@ainyc/canonry 1.33.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,281 @@
1
+ function P6(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z0={exports:{}},Zu={};var KO;function z6(){if(KO)return Zu;KO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return Zu.Fragment=t,Zu.jsx=n,Zu.jsxs=n,Zu}var HO;function M6(){return HO||(HO=1,z0.exports=z6()),z0.exports}var u=M6(),M0={exports:{}},$e={};var GO;function R6(){if(GO)return $e;GO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=y&&R[y]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function C(R,V,X){this.props=R,this.context=V,this.refs=N,this.updater=X||w}C.prototype.isReactComponent={},C.prototype.setState=function(R,V){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,V,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function A(){}A.prototype=C.prototype;function k(R,V,X){this.props=R,this.context=V,this.refs=N,this.updater=X||w}var _=k.prototype=new A;_.constructor=k,S(_,C.prototype),_.isPureReactComponent=!0;var T=Array.isArray;function P(){}var E={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function D(R,V,X){var q=X.ref;return{$$typeof:e,type:R,key:V,ref:q!==void 0?q:null,props:X}}function K(R,V){return D(R.type,V,R.props)}function U(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function I(R){var V={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(X){return V[X]})}var H=/\/+/g;function ge(R,V){return typeof R=="object"&&R!==null&&R.key!=null?I(""+R.key):V.toString(36)}function me(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(V){R.status==="pending"&&(R.status="fulfilled",R.value=V)},function(V){R.status==="pending"&&(R.status="rejected",R.reason=V)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function G(R,V,X,q,W){var ie=typeof R;(ie==="undefined"||ie==="boolean")&&(R=null);var ye=!1;if(R===null)ye=!0;else switch(ie){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(R.$$typeof){case e:case t:ye=!0;break;case m:return ye=R._init,G(ye(R._payload),V,X,q,W)}}if(ye)return W=W(R),ye=q===""?"."+ge(R,0):q,T(W)?(X="",ye!=null&&(X=ye.replace(H,"$&/")+"/"),G(W,V,X,"",function(ue){return ue})):W!=null&&(U(W)&&(W=K(W,X+(W.key==null||R&&R.key===W.key?"":(""+W.key).replace(H,"$&/")+"/")+ye)),V.push(W)),1;ye=0;var we=q===""?".":q+":";if(T(R))for(var te=0;te<R.length;te++)q=R[te],ie=we+ge(q,te),ye+=G(q,V,X,ie,W);else if(te=v(R),typeof te=="function")for(R=te.call(R),te=0;!(q=R.next()).done;)q=q.value,ie=we+ge(q,te++),ye+=G(q,V,X,ie,W);else if(ie==="object"){if(typeof R.then=="function")return G(me(R),V,X,q,W);throw V=String(R),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ye}function ae(R,V,X){if(R==null)return R;var q=[],W=0;return G(R,q,"","",function(ie){return V.call(X,ie,W++)}),q}function pe(R){if(R._status===-1){var V=R._result;V=V(),V.then(function(X){(R._status===0||R._status===-1)&&(R._status=1,R._result=X)},function(X){(R._status===0||R._status===-1)&&(R._status=2,R._result=X)}),R._status===-1&&(R._status=0,R._result=V)}if(R._status===1)return R._result.default;throw R._result}var xe=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=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(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},B={map:ae,forEach:function(R,V,X){ae(R,function(){V.apply(this,arguments)},X)},count:function(R){var V=0;return ae(R,function(){V++}),V},toArray:function(R){return ae(R,function(V){return V})||[]},only:function(R){if(!U(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return $e.Activity=g,$e.Children=B,$e.Component=C,$e.Fragment=n,$e.Profiler=i,$e.PureComponent=k,$e.StrictMode=r,$e.Suspense=f,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,$e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return E.H.useMemoCache(R)}},$e.cache=function(R){return function(){return R.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(R,V,X){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var q=S({},R.props),W=R.key;if(V!=null)for(ie in V.key!==void 0&&(W=""+V.key),V)!z.call(V,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&V.ref===void 0||(q[ie]=V[ie]);var ie=arguments.length-2;if(ie===1)q.children=X;else if(1<ie){for(var ye=Array(ie),we=0;we<ie;we++)ye[we]=arguments[we+2];q.children=ye}return D(R.type,W,q)},$e.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:s,_context:R},R},$e.createElement=function(R,V,X){var q,W={},ie=null;if(V!=null)for(q in V.key!==void 0&&(ie=""+V.key),V)z.call(V,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(W[q]=V[q]);var ye=arguments.length-2;if(ye===1)W.children=X;else if(1<ye){for(var we=Array(ye),te=0;te<ye;te++)we[te]=arguments[te+2];W.children=we}if(R&&R.defaultProps)for(q in ye=R.defaultProps,ye)W[q]===void 0&&(W[q]=ye[q]);return D(R,ie,W)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(R){return{$$typeof:c,render:R}},$e.isValidElement=U,$e.lazy=function(R){return{$$typeof:m,_payload:{_status:-1,_result:R},_init:pe}},$e.memo=function(R,V){return{$$typeof:h,type:R,compare:V===void 0?null:V}},$e.startTransition=function(R){var V=E.T,X={};E.T=X;try{var q=R(),W=E.S;W!==null&&W(X,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(P,xe)}catch(ie){xe(ie)}finally{V!==null&&X.types!==null&&(V.types=X.types),E.T=V}},$e.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},$e.use=function(R){return E.H.use(R)},$e.useActionState=function(R,V,X){return E.H.useActionState(R,V,X)},$e.useCallback=function(R,V){return E.H.useCallback(R,V)},$e.useContext=function(R){return E.H.useContext(R)},$e.useDebugValue=function(){},$e.useDeferredValue=function(R,V){return E.H.useDeferredValue(R,V)},$e.useEffect=function(R,V){return E.H.useEffect(R,V)},$e.useEffectEvent=function(R){return E.H.useEffectEvent(R)},$e.useId=function(){return E.H.useId()},$e.useImperativeHandle=function(R,V,X){return E.H.useImperativeHandle(R,V,X)},$e.useInsertionEffect=function(R,V){return E.H.useInsertionEffect(R,V)},$e.useLayoutEffect=function(R,V){return E.H.useLayoutEffect(R,V)},$e.useMemo=function(R,V){return E.H.useMemo(R,V)},$e.useOptimistic=function(R,V){return E.H.useOptimistic(R,V)},$e.useReducer=function(R,V,X){return E.H.useReducer(R,V,X)},$e.useRef=function(R){return E.H.useRef(R)},$e.useState=function(R){return E.H.useState(R)},$e.useSyncExternalStore=function(R,V,X){return E.H.useSyncExternalStore(R,V,X)},$e.useTransition=function(){return E.H.useTransition()},$e.version="19.2.4",$e}var VO;function Uc(){return VO||(VO=1,M0.exports=R6()),M0.exports}var x=Uc();const hi=Rs(x),rg=P6({__proto__:null,default:hi},[x]);var R0={exports:{}},Yu={},D0={exports:{}},L0={};var ZO;function D6(){return ZO||(ZO=1,(function(e){function t(G,ae){var pe=G.length;G.push(ae);e:for(;0<pe;){var xe=pe-1>>>1,B=G[xe];if(0<i(B,ae))G[xe]=ae,G[pe]=B,pe=xe;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var ae=G[0],pe=G.pop();if(pe!==ae){G[0]=pe;e:for(var xe=0,B=G.length,R=B>>>1;xe<R;){var V=2*(xe+1)-1,X=G[V],q=V+1,W=G[q];if(0>i(X,pe))q<B&&0>i(W,X)?(G[xe]=W,G[q]=pe,xe=q):(G[xe]=X,G[V]=pe,xe=V);else if(q<B&&0>i(W,pe))G[xe]=W,G[q]=pe,xe=q;else break e}}return ae}function i(G,ae){var pe=G.sortIndex-ae.sortIndex;return pe!==0?pe:G.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],m=1,g=null,y=3,v=!1,w=!1,S=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function _(G){for(var ae=n(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=G)r(h),ae.sortIndex=ae.expirationTime,t(f,ae);else break;ae=n(h)}}function T(G){if(S=!1,_(G),!w)if(n(f)!==null)w=!0,P||(P=!0,I());else{var ae=n(h);ae!==null&&me(T,ae.startTime-G)}}var P=!1,E=-1,z=5,D=-1;function K(){return N?!0:!(e.unstable_now()-D<z)}function U(){if(N=!1,P){var G=e.unstable_now();D=G;var ae=!0;try{e:{w=!1,S&&(S=!1,A(E),E=-1),v=!0;var pe=y;try{t:{for(_(G),g=n(f);g!==null&&!(g.expirationTime>G&&K());){var xe=g.callback;if(typeof xe=="function"){g.callback=null,y=g.priorityLevel;var B=xe(g.expirationTime<=G);if(G=e.unstable_now(),typeof B=="function"){g.callback=B,_(G),ae=!0;break t}g===n(f)&&r(f),_(G)}else r(f);g=n(f)}if(g!==null)ae=!0;else{var R=n(h);R!==null&&me(T,R.startTime-G),ae=!1}}break e}finally{g=null,y=pe,v=!1}ae=void 0}}finally{ae?I():P=!1}}}var I;if(typeof k=="function")I=function(){k(U)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,ge=H.port2;H.port1.onmessage=U,I=function(){ge.postMessage(null)}}else I=function(){C(U,0)};function me(G,ae){E=C(function(){G(e.unstable_now())},ae)}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(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(G){switch(y){case 1:case 2:case 3:var ae=3;break;default:ae=y}var pe=y;y=ae;try{return G()}finally{y=pe}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(G,ae){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var pe=y;y=G;try{return ae()}finally{y=pe}},e.unstable_scheduleCallback=function(G,ae,pe){var xe=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?xe+pe:xe):pe=xe,G){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=pe+B,G={id:m++,callback:ae,priorityLevel:G,startTime:pe,expirationTime:B,sortIndex:-1},pe>xe?(G.sortIndex=pe,t(h,G),n(f)===null&&G===n(h)&&(S?(A(E),E=-1):S=!0,me(T,pe-xe))):(G.sortIndex=B,t(f,G),w||v||(w=!0,P||(P=!0,I()))),G},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(G){var ae=y;return function(){var pe=y;y=ae;try{return G.apply(this,arguments)}finally{y=pe}}}})(L0)),L0}var YO;function L6(){return YO||(YO=1,D0.exports=D6()),D0.exports}var I0={exports:{}},Un={};var WO;function I6(){if(WO)return Un;WO=1;var e=Uc();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Un.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,m)},Un.flushSync=function(f){var h=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=m,r.d.f()}},Un.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Un.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Un.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Un.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Un.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=c(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Un.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Un.requestFormReset=function(f){r.d.r(f)},Un.unstable_batchedUpdates=function(f,h){return f(h)},Un.useFormState=function(f,h,m){return l.H.useFormState(f,h,m)},Un.useFormStatus=function(){return l.H.useHostTransitionStatus()},Un.version="19.2.4",Un}var QO;function Bz(){if(QO)return I0.exports;QO=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(),I0.exports=I6(),I0.exports}var XO;function $6(){if(XO)return Yu;XO=1;var e=L6(),t=Uc(),n=Bz();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(s(a)!==a)throw Error(r(188))}function h(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,p=o;;){var b=d.return;if(b===null)break;var j=b.alternate;if(j===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===d)return f(b),a;if(j===p)return f(b),o;j=j.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=j;else{for(var O=!1,M=b.child;M;){if(M===d){O=!0,d=b,p=j;break}if(M===p){O=!0,p=b,d=j;break}M=M.sibling}if(!O){for(M=j.child;M;){if(M===d){O=!0,d=j,p=b;break}if(M===p){O=!0,p=j,d=b;break}M=M.sibling}if(!O)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function m(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=m(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function I(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var H=Symbol.for("react.client.reference");function ge(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===H?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case T:return"Suspense";case P:return"SuspenseList";case D:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case k:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case _:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case E:return o=a.displayName||null,o!==null?o:ge(a.type)||"Memo";case z:o=a._payload,a=a._init;try{return ge(a(o))}catch{}}return null}var me=Array.isArray,G=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},xe=[],B=-1;function R(a){return{current:a}}function V(a){0>B||(a.current=xe[B],xe[B]=null,B--)}function X(a,o){B++,xe[B]=a.current,a.current=o}var q=R(null),W=R(null),ie=R(null),ye=R(null);function we(a,o){switch(X(ie,o),X(W,a),X(q,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?hO(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=hO(o),a=pO(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}V(q),X(q,a)}function te(){V(q),V(W),V(ie)}function ue(a){a.memoizedState!==null&&X(ye,a);var o=q.current,d=pO(o,a.type);o!==d&&(X(W,a),X(q,d))}function Se(a){W.current===a&&(V(q),V(W)),ye.current===a&&(V(ye),Ku._currentValue=pe)}var Z,Me;function Ee(a){if(Z===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);Z=o&&o[1]||"",Me=-1<d.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Z+a+Me}var it=!1;function rt(a,o){if(!a||it)return"";it=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(se){var ne=se}Reflect.construct(a,[],de)}else{try{de.call()}catch(se){ne=se}a.call(de.prototype)}}else{try{throw Error()}catch(se){ne=se}(de=a())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=p.DetermineComponentFrameRoot(),O=j[0],M=j[1];if(O&&M){var $=O.split(`
4
+ `),ee=M.split(`
5
+ `);for(b=p=0;p<$.length&&!$[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ee.length&&!ee[b].includes("DetermineComponentFrameRoot");)b++;if(p===$.length||b===ee.length)for(p=$.length-1,b=ee.length-1;1<=p&&0<=b&&$[p]!==ee[b];)b--;for(;1<=p&&0<=b;p--,b--)if($[p]!==ee[b]){if(p!==1||b!==1)do if(p--,b--,0>b||$[p]!==ee[b]){var oe=`
6
+ `+$[p].replace(" at new "," at ");return a.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",a.displayName)),oe}while(1<=p&&0<=b);break}}}finally{it=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ee(d):""}function an(a,o){switch(a.tag){case 26:case 27:case 5:return Ee(a.type);case 16:return Ee("Lazy");case 13:return a.child!==o&&o!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return rt(a.type,!1);case 11:return rt(a.type.render,!1);case 1:return rt(a.type,!0);case 31:return Ee("Activity");default:return""}}function fn(a){try{var o="",d=null;do o+=an(a,d),d=a,a=a.return;while(a);return o}catch(p){return`
7
+ Error generating stack: `+p.message+`
8
+ `+p.stack}}var Vt=Object.prototype.hasOwnProperty,fe=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,xt=e.unstable_shouldYield,wn=e.unstable_requestPaint,et=e.unstable_now,Ke=e.unstable_getCurrentPriorityLevel,at=e.unstable_ImmediatePriority,qt=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,ul=e.unstable_LowPriority,nr=e.unstable_IdlePriority,ft=e.log,au=e.unstable_setDisableYieldValue,ai=null,Ct=null;function rr(a){if(typeof ft=="function"&&au(a),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(ai,a)}catch{}}var ve=Math.clz32?Math.clz32:Cf,mr=Math.log,dl=Math.LN2;function Cf(a){return a>>>=0,a===0?32:31-(mr(a)/dl|0)|0}var Hs=256,fl=262144,Qi=4194304;function Ni(a){var o=a&42;if(o!==0)return o;switch(a&-a){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:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function hl(a,o,d){var p=a.pendingLanes;if(p===0)return 0;var b=0,j=a.suspendedLanes,O=a.pingedLanes;a=a.warmLanes;var M=p&134217727;return M!==0?(p=M&~j,p!==0?b=Ni(p):(O&=M,O!==0?b=Ni(O):d||(d=M&~a,d!==0&&(b=Ni(d))))):(M=p&~j,M!==0?b=Ni(M):O!==0?b=Ni(O):d||(d=p&~a,d!==0&&(b=Ni(d)))),b===0?0:o!==0&&o!==b&&(o&j)===0&&(j=b&-b,d=o&-o,j>=d||j===32&&(d&4194048)!==0)?o:b}function La(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Cy(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 _f(){var a=Qi;return Qi<<=1,(Qi&62914560)===0&&(Qi=4194304),a}function su(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function Gs(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Of(a,o,d,p,b,j){var O=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var M=a.entanglements,$=a.expirationTimes,ee=a.hiddenUpdates;for(d=O&~d;0<d;){var oe=31-ve(d),de=1<<oe;M[oe]=0,$[oe]=-1;var ne=ee[oe];if(ne!==null)for(ee[oe]=null,oe=0;oe<ne.length;oe++){var se=ne[oe];se!==null&&(se.lane&=-536870913)}d&=~de}p!==0&&Y(a,p,0),j!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=j&~(O&~o))}function Y(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var p=31-ve(o);a.entangledLanes|=o,a.entanglements[p]=a.entanglements[p]|1073741824|d&261930}function be(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var p=31-ve(d),b=1<<p;b&o|a[p]&o&&(a[p]|=o),d&=~b}}function Mt(a,o){var d=o&-o;return d=(d&42)!==0?1:hn(d),(d&(a.suspendedLanes|o))!==0?0:d}function hn(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Hn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function pl(){var a=ae.p;return a!==0?a:(a=window.event,a===void 0?32:LO(a.type))}function Ci(a,o){var d=ae.p;try{return ae.p=a,o()}finally{ae.p=d}}var Gn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Gn,$n="__reactProps$"+Gn,gr="__reactContainer$"+Gn,Xi="__reactEvents$"+Gn,ml="__reactListeners$"+Gn,kf="__reactHandles$"+Gn,Af="__reactResources$"+Gn,_i="__reactMarker$"+Gn;function Ia(a){delete a[ht],delete a[$n],delete a[Xi],delete a[ml],delete a[kf]}function $a(a){var o=a[ht];if(o)return o;for(var d=a.parentNode;d;){if(o=d[gr]||d[ht]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=wO(a);a!==null;){if(d=a[ht])return d;a=wO(a)}return o}a=d,d=a.parentNode}return null}function Ua(a){if(a=a[ht]||a[gr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function He(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function st(a){var o=a[Af];return o||(o=a[Af]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function pt(a){a[_i]=!0}var si=new Set,Vs={};function Oi(a,o){gl(a,o),gl(a+"Capture",o)}function gl(a,o){for(Vs[a]=o,a=0;a<o.length;a++)si.add(o[a])}var j4=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]*$"),rN={},iN={};function N4(a){return Vt.call(iN,a)?!0:Vt.call(rN,a)?!1:j4.test(a)?iN[a]=!0:(rN[a]=!0,!1)}function Ef(a,o,d){if(N4(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Tf(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function Ji(a,o,d,p){if(p===null)a.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+p)}}function Pr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function aN(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function C4(a,o,d){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,j=p.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(O){d=""+O,j.call(this,O)}}),Object.defineProperty(a,o,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(O){d=""+O},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function _y(a){if(!a._valueTracker){var o=aN(a)?"checked":"value";a._valueTracker=C4(a,o,""+a[o])}}function sN(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),p="";return a&&(p=aN(a)?a.checked?"true":"false":a.value),a=p,a!==d?(o.setValue(a),!0):!1}function Pf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var _4=/[\n"\\]/g;function zr(a){return a.replace(_4,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Oy(a,o,d,p,b,j,O,M){a.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?a.type=O:a.removeAttribute("type"),o!=null?O==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Pr(o)):a.value!==""+Pr(o)&&(a.value=""+Pr(o)):O!=="submit"&&O!=="reset"||a.removeAttribute("value"),o!=null?ky(a,O,Pr(o)):d!=null?ky(a,O,Pr(d)):p!=null&&a.removeAttribute("value"),b==null&&j!=null&&(a.defaultChecked=!!j),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+Pr(M):a.removeAttribute("name")}function oN(a,o,d,p,b,j,O,M){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.type=j),o!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||o!=null)){_y(a);return}d=d!=null?""+Pr(d):"",o=o!=null?""+Pr(o):d,M||o===a.value||(a.value=o),a.defaultValue=o}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=M?a.checked:!!p,a.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.name=O),_y(a)}function ky(a,o,d){o==="number"&&Pf(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function yl(a,o,d,p){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&p&&(a[d].defaultSelected=!0)}else{for(d=""+Pr(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,p&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function lN(a,o,d){if(o!=null&&(o=""+Pr(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Pr(d):""}function cN(a,o,d,p){if(o==null){if(p!=null){if(d!=null)throw Error(r(92));if(me(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),o=d}d=Pr(o),a.defaultValue=d,p=a.textContent,p===d&&p!==""&&p!==null&&(a.value=p),_y(a)}function vl(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var O4=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 uN(a,o,d){var p=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":p?a.setProperty(o,d):typeof d!="number"||d===0||O4.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function dN(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var b in o)p=o[b],o.hasOwnProperty(b)&&d[b]!==p&&uN(a,b,p)}else for(var j in o)o.hasOwnProperty(j)&&uN(a,j,o[j])}function Ay(a){if(a.indexOf("-")===-1)return!1;switch(a){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 k4=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"]]),A4=/^[\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 zf(a){return A4.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ea(){}var Ey=null;function Ty(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var bl=null,xl=null;function fN(a){var o=Ua(a);if(o&&(a=o.stateNode)){var d=a[$n]||null;e:switch(a=o.stateNode,o.type){case"input":if(Oy(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+zr(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var p=d[o];if(p!==a&&p.form===a.form){var b=p[$n]||null;if(!b)throw Error(r(90));Oy(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)p=d[o],p.form===a.form&&sN(p)}break e;case"textarea":lN(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&yl(a,!!d.multiple,o,!1)}}}var Py=!1;function hN(a,o,d){if(Py)return a(o,d);Py=!0;try{var p=a(o);return p}finally{if(Py=!1,(bl!==null||xl!==null)&&(xh(),bl&&(o=bl,a=xl,xl=bl=null,fN(o),a)))for(o=0;o<a.length;o++)fN(a[o])}}function ou(a,o){var d=a.stateNode;if(d===null)return null;var p=d[$n]||null;if(p===null)return null;d=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zy=!1;if(ta)try{var lu={};Object.defineProperty(lu,"passive",{get:function(){zy=!0}}),window.addEventListener("test",lu,lu),window.removeEventListener("test",lu,lu)}catch{zy=!1}var Ba=null,My=null,Mf=null;function pN(){if(Mf)return Mf;var a,o=My,d=o.length,p,b="value"in Ba?Ba.value:Ba.textContent,j=b.length;for(a=0;a<d&&o[a]===b[a];a++);var O=d-a;for(p=1;p<=O&&o[d-p]===b[j-p];p++);return Mf=b.slice(a,1<p?1-p:void 0)}function Rf(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Df(){return!0}function mN(){return!1}function ir(a){function o(d,p,b,j,O){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=j,this.target=O,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(d=a[M],this[M]=d?d(j):j[M]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Df:mN,this.isPropagationStopped=mN,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Df)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Df)},persist:function(){},isPersistent:Df}),o}var Zs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lf=ir(Zs),cu=g({},Zs,{view:0,detail:0}),E4=ir(cu),Ry,Dy,uu,If=g({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iy,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==uu&&(uu&&a.type==="mousemove"?(Ry=a.screenX-uu.screenX,Dy=a.screenY-uu.screenY):Dy=Ry=0,uu=a),Ry)},movementY:function(a){return"movementY"in a?a.movementY:Dy}}),gN=ir(If),T4=g({},If,{dataTransfer:0}),P4=ir(T4),z4=g({},cu,{relatedTarget:0}),Ly=ir(z4),M4=g({},Zs,{animationName:0,elapsedTime:0,pseudoElement:0}),R4=ir(M4),D4=g({},Zs,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),L4=ir(D4),I4=g({},Zs,{data:0}),yN=ir(I4),$4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U4={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"},B4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q4(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=B4[a])?!!o[a]:!1}function Iy(){return q4}var F4=g({},cu,{key:function(a){if(a.key){var o=$4[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Rf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?U4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iy,charCode:function(a){return a.type==="keypress"?Rf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Rf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),K4=ir(F4),H4=g({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vN=ir(H4),G4=g({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iy}),V4=ir(G4),Z4=g({},Zs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y4=ir(Z4),W4=g({},If,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Q4=ir(W4),X4=g({},Zs,{newState:0,oldState:0}),J4=ir(X4),eU=[9,13,27,32],$y=ta&&"CompositionEvent"in window,du=null;ta&&"documentMode"in document&&(du=document.documentMode);var tU=ta&&"TextEvent"in window&&!du,bN=ta&&(!$y||du&&8<du&&11>=du),xN=" ",wN=!1;function SN(a,o){switch(a){case"keyup":return eU.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jN(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var wl=!1;function nU(a,o){switch(a){case"compositionend":return jN(o);case"keypress":return o.which!==32?null:(wN=!0,xN);case"textInput":return a=o.data,a===xN&&wN?null:a;default:return null}}function rU(a,o){if(wl)return a==="compositionend"||!$y&&SN(a,o)?(a=pN(),Mf=My=Ba=null,wl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return bN&&o.locale!=="ko"?null:o.data;default:return null}}var iU={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 NN(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!iU[a.type]:o==="textarea"}function CN(a,o,d,p){bl?xl?xl.push(p):xl=[p]:bl=p,o=Oh(o,"onChange"),0<o.length&&(d=new Lf("onChange","change",null,d,p),a.push({event:d,listeners:o}))}var fu=null,hu=null;function aU(a){oO(a,0)}function $f(a){var o=He(a);if(sN(o))return a}function _N(a,o){if(a==="change")return o}var ON=!1;if(ta){var Uy;if(ta){var By="oninput"in document;if(!By){var kN=document.createElement("div");kN.setAttribute("oninput","return;"),By=typeof kN.oninput=="function"}Uy=By}else Uy=!1;ON=Uy&&(!document.documentMode||9<document.documentMode)}function AN(){fu&&(fu.detachEvent("onpropertychange",EN),hu=fu=null)}function EN(a){if(a.propertyName==="value"&&$f(hu)){var o=[];CN(o,hu,a,Ty(a)),hN(aU,o)}}function sU(a,o,d){a==="focusin"?(AN(),fu=o,hu=d,fu.attachEvent("onpropertychange",EN)):a==="focusout"&&AN()}function oU(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return $f(hu)}function lU(a,o){if(a==="click")return $f(o)}function cU(a,o){if(a==="input"||a==="change")return $f(o)}function uU(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var yr=typeof Object.is=="function"?Object.is:uU;function pu(a,o){if(yr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),p=Object.keys(o);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var b=d[p];if(!Vt.call(o,b)||!yr(a[b],o[b]))return!1}return!0}function TN(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function PN(a,o){var d=TN(a);a=0;for(var p;d;){if(d.nodeType===3){if(p=a+d.textContent.length,a<=o&&p>=o)return{node:d,offset:o-a};a=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=TN(d)}}function zN(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?zN(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function MN(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Pf(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Pf(a.document)}return o}function qy(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var dU=ta&&"documentMode"in document&&11>=document.documentMode,Sl=null,Fy=null,mu=null,Ky=!1;function RN(a,o,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Ky||Sl==null||Sl!==Pf(p)||(p=Sl,"selectionStart"in p&&qy(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),mu&&pu(mu,p)||(mu=p,p=Oh(Fy,"onSelect"),0<p.length&&(o=new Lf("onSelect","select",null,o,d),a.push({event:o,listeners:p}),o.target=Sl)))}function Ys(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var jl={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionrun:Ys("Transition","TransitionRun"),transitionstart:Ys("Transition","TransitionStart"),transitioncancel:Ys("Transition","TransitionCancel"),transitionend:Ys("Transition","TransitionEnd")},Hy={},DN={};ta&&(DN=document.createElement("div").style,"AnimationEvent"in window||(delete jl.animationend.animation,delete jl.animationiteration.animation,delete jl.animationstart.animation),"TransitionEvent"in window||delete jl.transitionend.transition);function Ws(a){if(Hy[a])return Hy[a];if(!jl[a])return a;var o=jl[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in DN)return Hy[a]=o[d];return a}var LN=Ws("animationend"),IN=Ws("animationiteration"),$N=Ws("animationstart"),fU=Ws("transitionrun"),hU=Ws("transitionstart"),pU=Ws("transitioncancel"),UN=Ws("transitionend"),BN=new Map,Gy="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(" ");Gy.push("scrollEnd");function oi(a,o){BN.set(a,o),Oi(o,[a])}var Uf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Mr=[],Nl=0,Vy=0;function Bf(){for(var a=Nl,o=Vy=Nl=0;o<a;){var d=Mr[o];Mr[o++]=null;var p=Mr[o];Mr[o++]=null;var b=Mr[o];Mr[o++]=null;var j=Mr[o];if(Mr[o++]=null,p!==null&&b!==null){var O=p.pending;O===null?b.next=b:(b.next=O.next,O.next=b),p.pending=b}j!==0&&qN(d,b,j)}}function qf(a,o,d,p){Mr[Nl++]=a,Mr[Nl++]=o,Mr[Nl++]=d,Mr[Nl++]=p,Vy|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Zy(a,o,d,p){return qf(a,o,d,p),Ff(a)}function Qs(a,o){return qf(a,null,null,o),Ff(a)}function qN(a,o,d){a.lanes|=d;var p=a.alternate;p!==null&&(p.lanes|=d);for(var b=!1,j=a.return;j!==null;)j.childLanes|=d,p=j.alternate,p!==null&&(p.childLanes|=d),j.tag===22&&(a=j.stateNode,a===null||a._visibility&1||(b=!0)),a=j,j=j.return;return a.tag===3?(j=a.stateNode,b&&o!==null&&(b=31-ve(d),a=j.hiddenUpdates,p=a[b],p===null?a[b]=[o]:p.push(o),o.lane=d|536870912),j):null}function Ff(a){if(50<Lu)throw Lu=0,r0=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Cl={};function mU(a,o,d,p){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(a,o,d,p){return new mU(a,o,d,p)}function Yy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function na(a,o){var d=a.alternate;return d===null?(d=vr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function FN(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Kf(a,o,d,p,b,j){var O=0;if(p=a,typeof a=="function")Yy(a)&&(O=1);else if(typeof a=="string")O=x6(a,d,q.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case D:return a=vr(31,d,o,b),a.elementType=D,a.lanes=j,a;case S:return Xs(d.children,b,j,o);case N:O=8,b|=24;break;case C:return a=vr(12,d,o,b|2),a.elementType=C,a.lanes=j,a;case T:return a=vr(13,d,o,b),a.elementType=T,a.lanes=j,a;case P:return a=vr(19,d,o,b),a.elementType=P,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:O=10;break e;case A:O=9;break e;case _:O=11;break e;case E:O=14;break e;case z:O=16,p=null;break e}O=29,d=Error(r(130,a===null?"null":typeof a,"")),p=null}return o=vr(O,d,o,b),o.elementType=a,o.type=p,o.lanes=j,o}function Xs(a,o,d,p){return a=vr(7,a,p,o),a.lanes=d,a}function Wy(a,o,d){return a=vr(6,a,null,o),a.lanes=d,a}function KN(a){var o=vr(18,null,null,0);return o.stateNode=a,o}function Qy(a,o,d){return o=vr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var HN=new WeakMap;function Rr(a,o){if(typeof a=="object"&&a!==null){var d=HN.get(a);return d!==void 0?d:(o={value:a,source:o,stack:fn(o)},HN.set(a,o),o)}return{value:a,source:o,stack:fn(o)}}var _l=[],Ol=0,Hf=null,gu=0,Dr=[],Lr=0,qa=null,ki=1,Ai="";function ra(a,o){_l[Ol++]=gu,_l[Ol++]=Hf,Hf=a,gu=o}function GN(a,o,d){Dr[Lr++]=ki,Dr[Lr++]=Ai,Dr[Lr++]=qa,qa=a;var p=ki;a=Ai;var b=32-ve(p)-1;p&=~(1<<b),d+=1;var j=32-ve(o)+b;if(30<j){var O=b-b%5;j=(p&(1<<O)-1).toString(32),p>>=O,b-=O,ki=1<<32-ve(o)+b|d<<b|p,Ai=j+a}else ki=1<<j|d<<b|p,Ai=a}function Xy(a){a.return!==null&&(ra(a,1),GN(a,1,0))}function Jy(a){for(;a===Hf;)Hf=_l[--Ol],_l[Ol]=null,gu=_l[--Ol],_l[Ol]=null;for(;a===qa;)qa=Dr[--Lr],Dr[Lr]=null,Ai=Dr[--Lr],Dr[Lr]=null,ki=Dr[--Lr],Dr[Lr]=null}function VN(a,o){Dr[Lr++]=ki,Dr[Lr++]=Ai,Dr[Lr++]=qa,ki=o.id,Ai=o.overflow,qa=a}var kn=null,Et=null,tt=!1,Fa=null,Ir=!1,ev=Error(r(519));function Ka(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yu(Rr(o,a)),ev}function ZN(a){var o=a.stateNode,d=a.type,p=a.memoizedProps;switch(o[ht]=a,o[$n]=p,d){case"dialog":Ze("cancel",o),Ze("close",o);break;case"iframe":case"object":case"embed":Ze("load",o);break;case"video":case"audio":for(d=0;d<$u.length;d++)Ze($u[d],o);break;case"source":Ze("error",o);break;case"img":case"image":case"link":Ze("error",o),Ze("load",o);break;case"details":Ze("toggle",o);break;case"input":Ze("invalid",o),oN(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ze("invalid",o);break;case"textarea":Ze("invalid",o),cN(o,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||p.suppressHydrationWarning===!0||dO(o.textContent,d)?(p.popover!=null&&(Ze("beforetoggle",o),Ze("toggle",o)),p.onScroll!=null&&Ze("scroll",o),p.onScrollEnd!=null&&Ze("scrollend",o),p.onClick!=null&&(o.onclick=ea),o=!0):o=!1,o||Ka(a,!0)}function YN(a){for(kn=a.return;kn;)switch(kn.tag){case 5:case 31:case 13:Ir=!1;return;case 27:case 3:Ir=!0;return;default:kn=kn.return}}function kl(a){if(a!==kn)return!1;if(!tt)return YN(a),tt=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||v0(a.type,a.memoizedProps)),d=!d),d&&Et&&Ka(a),YN(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Et=xO(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Et=xO(a)}else o===27?(o=Et,is(a.type)?(a=j0,j0=null,Et=a):Et=o):Et=kn?Ur(a.stateNode.nextSibling):null;return!0}function Js(){Et=kn=null,tt=!1}function tv(){var a=Fa;return a!==null&&(lr===null?lr=a:lr.push.apply(lr,a),Fa=null),a}function yu(a){Fa===null?Fa=[a]:Fa.push(a)}var nv=R(null),eo=null,ia=null;function Ha(a,o,d){X(nv,o._currentValue),o._currentValue=d}function aa(a){a._currentValue=nv.current,V(nv)}function rv(a,o,d){for(;a!==null;){var p=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),a===d)break;a=a.return}}function iv(a,o,d,p){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var j=b.dependencies;if(j!==null){var O=b.child;j=j.firstContext;e:for(;j!==null;){var M=j;j=b;for(var $=0;$<o.length;$++)if(M.context===o[$]){j.lanes|=d,M=j.alternate,M!==null&&(M.lanes|=d),rv(j.return,d,a),p||(O=null);break e}j=M.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(r(341));O.lanes|=d,j=O.alternate,j!==null&&(j.lanes|=d),rv(O,d,a),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===a){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function Al(a,o,d,p){a=null;for(var b=o,j=!1;b!==null;){if(!j){if((b.flags&524288)!==0)j=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var O=b.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var M=b.type;yr(b.pendingProps.value,O.value)||(a!==null?a.push(M):a=[M])}}else if(b===ye.current){if(O=b.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Ku):a=[Ku])}b=b.return}a!==null&&iv(o,a,d,p),o.flags|=262144}function Gf(a){for(a=a.firstContext;a!==null;){if(!yr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function to(a){eo=a,ia=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function An(a){return WN(eo,a)}function Vf(a,o){return eo===null&&to(a),WN(a,o)}function WN(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},ia===null){if(a===null)throw Error(r(308));ia=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else ia=ia.next=o;return d}var gU=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,p){a.push(p)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},yU=e.unstable_scheduleCallback,vU=e.unstable_NormalPriority,sn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function av(){return{controller:new gU,data:new Map,refCount:0}}function vu(a){a.refCount--,a.refCount===0&&yU(vU,function(){a.controller.abort()})}var bu=null,sv=0,El=0,Tl=null;function bU(a,o){if(bu===null){var d=bu=[];sv=0,El=c0(),Tl={status:"pending",value:void 0,then:function(p){d.push(p)}}}return sv++,o.then(QN,QN),o}function QN(){if(--sv===0&&bu!==null){Tl!==null&&(Tl.status="fulfilled");var a=bu;bu=null,El=0,Tl=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function xU(a,o){var d=[],p={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){p.status="fulfilled",p.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(p.status="rejected",p.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),p}var XN=G.S;G.S=function(a,o){R_=et(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&bU(a,o),XN!==null&&XN(a,o)};var no=R(null);function ov(){var a=no.current;return a!==null?a:_t.pooledCache}function Zf(a,o){o===null?X(no,no.current):X(no,o.pool)}function JN(){var a=ov();return a===null?null:{parent:sn._currentValue,pool:a}}var Pl=Error(r(460)),lv=Error(r(474)),Yf=Error(r(542)),Wf={then:function(){}};function eC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function tC(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(ea,ea),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,rC(a),a;default:if(typeof o.status=="string")o.then(ea,ea);else{if(a=_t,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(p){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=p}},function(p){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,rC(a),a}throw io=o,Pl}}function ro(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(io=d,Pl):d}}var io=null;function nC(){if(io===null)throw Error(r(459));var a=io;return io=null,a}function rC(a){if(a===Pl||a===Yf)throw Error(r(483))}var zl=null,xu=0;function Qf(a){var o=xu;return xu+=1,zl===null&&(zl=[]),tC(zl,a,o)}function wu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function Xf(a,o){throw o.$$typeof===y?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function iC(a){function o(Q,F){if(a){var J=Q.deletions;J===null?(Q.deletions=[F],Q.flags|=16):J.push(F)}}function d(Q,F){if(!a)return null;for(;F!==null;)o(Q,F),F=F.sibling;return null}function p(Q){for(var F=new Map;Q!==null;)Q.key!==null?F.set(Q.key,Q):F.set(Q.index,Q),Q=Q.sibling;return F}function b(Q,F){return Q=na(Q,F),Q.index=0,Q.sibling=null,Q}function j(Q,F,J){return Q.index=J,a?(J=Q.alternate,J!==null?(J=J.index,J<F?(Q.flags|=67108866,F):J):(Q.flags|=67108866,F)):(Q.flags|=1048576,F)}function O(Q){return a&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,F,J,le){return F===null||F.tag!==6?(F=Wy(J,Q.mode,le),F.return=Q,F):(F=b(F,J),F.return=Q,F)}function $(Q,F,J,le){var Re=J.type;return Re===S?oe(Q,F,J.props.children,le,J.key):F!==null&&(F.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===z&&ro(Re)===F.type)?(F=b(F,J.props),wu(F,J),F.return=Q,F):(F=Kf(J.type,J.key,J.props,null,Q.mode,le),wu(F,J),F.return=Q,F)}function ee(Q,F,J,le){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=Qy(J,Q.mode,le),F.return=Q,F):(F=b(F,J.children||[]),F.return=Q,F)}function oe(Q,F,J,le,Re){return F===null||F.tag!==7?(F=Xs(J,Q.mode,le,Re),F.return=Q,F):(F=b(F,J),F.return=Q,F)}function de(Q,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Wy(""+F,Q.mode,J),F.return=Q,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return J=Kf(F.type,F.key,F.props,null,Q.mode,J),wu(J,F),J.return=Q,J;case w:return F=Qy(F,Q.mode,J),F.return=Q,F;case z:return F=ro(F),de(Q,F,J)}if(me(F)||I(F))return F=Xs(F,Q.mode,J,null),F.return=Q,F;if(typeof F.then=="function")return de(Q,Qf(F),J);if(F.$$typeof===k)return de(Q,Vf(Q,F),J);Xf(Q,F)}return null}function ne(Q,F,J,le){var Re=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Re!==null?null:M(Q,F,""+J,le);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===Re?$(Q,F,J,le):null;case w:return J.key===Re?ee(Q,F,J,le):null;case z:return J=ro(J),ne(Q,F,J,le)}if(me(J)||I(J))return Re!==null?null:oe(Q,F,J,le,null);if(typeof J.then=="function")return ne(Q,F,Qf(J),le);if(J.$$typeof===k)return ne(Q,F,Vf(Q,J),le);Xf(Q,J)}return null}function se(Q,F,J,le,Re){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Q=Q.get(J)||null,M(F,Q,""+le,Re);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return Q=Q.get(le.key===null?J:le.key)||null,$(F,Q,le,Re);case w:return Q=Q.get(le.key===null?J:le.key)||null,ee(F,Q,le,Re);case z:return le=ro(le),se(Q,F,J,le,Re)}if(me(le)||I(le))return Q=Q.get(J)||null,oe(F,Q,le,Re,null);if(typeof le.then=="function")return se(Q,F,J,Qf(le),Re);if(le.$$typeof===k)return se(Q,F,J,Vf(F,le),Re);Xf(F,le)}return null}function Oe(Q,F,J,le){for(var Re=null,ot=null,Te=F,Fe=F=0,Qe=null;Te!==null&&Fe<J.length;Fe++){Te.index>Fe?(Qe=Te,Te=null):Qe=Te.sibling;var lt=ne(Q,Te,J[Fe],le);if(lt===null){Te===null&&(Te=Qe);break}a&&Te&&lt.alternate===null&&o(Q,Te),F=j(lt,F,Fe),ot===null?Re=lt:ot.sibling=lt,ot=lt,Te=Qe}if(Fe===J.length)return d(Q,Te),tt&&ra(Q,Fe),Re;if(Te===null){for(;Fe<J.length;Fe++)Te=de(Q,J[Fe],le),Te!==null&&(F=j(Te,F,Fe),ot===null?Re=Te:ot.sibling=Te,ot=Te);return tt&&ra(Q,Fe),Re}for(Te=p(Te);Fe<J.length;Fe++)Qe=se(Te,Q,Fe,J[Fe],le),Qe!==null&&(a&&Qe.alternate!==null&&Te.delete(Qe.key===null?Fe:Qe.key),F=j(Qe,F,Fe),ot===null?Re=Qe:ot.sibling=Qe,ot=Qe);return a&&Te.forEach(function(cs){return o(Q,cs)}),tt&&ra(Q,Fe),Re}function Ie(Q,F,J,le){if(J==null)throw Error(r(151));for(var Re=null,ot=null,Te=F,Fe=F=0,Qe=null,lt=J.next();Te!==null&&!lt.done;Fe++,lt=J.next()){Te.index>Fe?(Qe=Te,Te=null):Qe=Te.sibling;var cs=ne(Q,Te,lt.value,le);if(cs===null){Te===null&&(Te=Qe);break}a&&Te&&cs.alternate===null&&o(Q,Te),F=j(cs,F,Fe),ot===null?Re=cs:ot.sibling=cs,ot=cs,Te=Qe}if(lt.done)return d(Q,Te),tt&&ra(Q,Fe),Re;if(Te===null){for(;!lt.done;Fe++,lt=J.next())lt=de(Q,lt.value,le),lt!==null&&(F=j(lt,F,Fe),ot===null?Re=lt:ot.sibling=lt,ot=lt);return tt&&ra(Q,Fe),Re}for(Te=p(Te);!lt.done;Fe++,lt=J.next())lt=se(Te,Q,Fe,lt.value,le),lt!==null&&(a&&lt.alternate!==null&&Te.delete(lt.key===null?Fe:lt.key),F=j(lt,F,Fe),ot===null?Re=lt:ot.sibling=lt,ot=lt);return a&&Te.forEach(function(T6){return o(Q,T6)}),tt&&ra(Q,Fe),Re}function jt(Q,F,J,le){if(typeof J=="object"&&J!==null&&J.type===S&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case v:e:{for(var Re=J.key;F!==null;){if(F.key===Re){if(Re=J.type,Re===S){if(F.tag===7){d(Q,F.sibling),le=b(F,J.props.children),le.return=Q,Q=le;break e}}else if(F.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===z&&ro(Re)===F.type){d(Q,F.sibling),le=b(F,J.props),wu(le,J),le.return=Q,Q=le;break e}d(Q,F);break}else o(Q,F);F=F.sibling}J.type===S?(le=Xs(J.props.children,Q.mode,le,J.key),le.return=Q,Q=le):(le=Kf(J.type,J.key,J.props,null,Q.mode,le),wu(le,J),le.return=Q,Q=le)}return O(Q);case w:e:{for(Re=J.key;F!==null;){if(F.key===Re)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){d(Q,F.sibling),le=b(F,J.children||[]),le.return=Q,Q=le;break e}else{d(Q,F);break}else o(Q,F);F=F.sibling}le=Qy(J,Q.mode,le),le.return=Q,Q=le}return O(Q);case z:return J=ro(J),jt(Q,F,J,le)}if(me(J))return Oe(Q,F,J,le);if(I(J)){if(Re=I(J),typeof Re!="function")throw Error(r(150));return J=Re.call(J),Ie(Q,F,J,le)}if(typeof J.then=="function")return jt(Q,F,Qf(J),le);if(J.$$typeof===k)return jt(Q,F,Vf(Q,J),le);Xf(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(d(Q,F.sibling),le=b(F,J),le.return=Q,Q=le):(d(Q,F),le=Wy(J,Q.mode,le),le.return=Q,Q=le),O(Q)):d(Q,F)}return function(Q,F,J,le){try{xu=0;var Re=jt(Q,F,J,le);return zl=null,Re}catch(Te){if(Te===Pl||Te===Yf)throw Te;var ot=vr(29,Te,null,Q.mode);return ot.lanes=le,ot.return=Q,ot}}}var ao=iC(!0),aC=iC(!1),Ga=!1;function cv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uv(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Va(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Za(a,o,d){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(dt&2)!==0){var b=p.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),p.pending=o,o=Ff(a),qN(a,null,d),o}return qf(a,p,o,d),Ff(a)}function Su(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var p=o.lanes;p&=a.pendingLanes,d|=p,o.lanes=d,be(a,d)}}function dv(a,o){var d=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var O={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=O:j=j.next=O,d=d.next}while(d!==null);j===null?b=j=o:j=j.next=o}else b=j=o;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:p.shared,callbacks:p.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var fv=!1;function ju(){if(fv){var a=Tl;if(a!==null)throw a}}function Nu(a,o,d,p){fv=!1;var b=a.updateQueue;Ga=!1;var j=b.firstBaseUpdate,O=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var $=M,ee=$.next;$.next=null,O===null?j=ee:O.next=ee,O=$;var oe=a.alternate;oe!==null&&(oe=oe.updateQueue,M=oe.lastBaseUpdate,M!==O&&(M===null?oe.firstBaseUpdate=ee:M.next=ee,oe.lastBaseUpdate=$))}if(j!==null){var de=b.baseState;O=0,oe=ee=$=null,M=j;do{var ne=M.lane&-536870913,se=ne!==M.lane;if(se?(We&ne)===ne:(p&ne)===ne){ne!==0&&ne===El&&(fv=!0),oe!==null&&(oe=oe.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Oe=a,Ie=M;ne=o;var jt=d;switch(Ie.tag){case 1:if(Oe=Ie.payload,typeof Oe=="function"){de=Oe.call(jt,de,ne);break e}de=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ie.payload,ne=typeof Oe=="function"?Oe.call(jt,de,ne):Oe,ne==null)break e;de=g({},de,ne);break e;case 2:Ga=!0}}ne=M.callback,ne!==null&&(a.flags|=64,se&&(a.flags|=8192),se=b.callbacks,se===null?b.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:M.tag,payload:M.payload,callback:M.callback,next:null},oe===null?(ee=oe=se,$=de):oe=oe.next=se,O|=ne;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;se=M,M=se.next,se.next=null,b.lastBaseUpdate=se,b.shared.pending=null}}while(!0);oe===null&&($=de),b.baseState=$,b.firstBaseUpdate=ee,b.lastBaseUpdate=oe,j===null&&(b.shared.lanes=0),Ja|=O,a.lanes=O,a.memoizedState=de}}function sC(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function oC(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)sC(d[a],o)}var Ml=R(null),Jf=R(0);function lC(a,o){a=pa,X(Jf,a),X(Ml,o),pa=a|o.baseLanes}function hv(){X(Jf,pa),X(Ml,Ml.current)}function pv(){pa=Jf.current,V(Ml),V(Jf)}var br=R(null),$r=null;function Ya(a){var o=a.alternate;X(Jt,Jt.current&1),X(br,a),$r===null&&(o===null||Ml.current!==null||o.memoizedState!==null)&&($r=a)}function mv(a){X(Jt,Jt.current),X(br,a),$r===null&&($r=a)}function cC(a){a.tag===22?(X(Jt,Jt.current),X(br,a),$r===null&&($r=a)):Wa()}function Wa(){X(Jt,Jt.current),X(br,br.current)}function xr(a){V(br),$r===a&&($r=null),V(Jt)}var Jt=R(0);function eh(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||w0(d)||S0(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var sa=0,qe=null,wt=null,on=null,th=!1,Rl=!1,so=!1,nh=0,Cu=0,Dl=null,wU=0;function Zt(){throw Error(r(321))}function gv(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!yr(a[d],o[d]))return!1;return!0}function yv(a,o,d,p,b,j){return sa=j,qe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,G.H=a===null||a.memoizedState===null?GC:Pv,so=!1,j=d(p,b),so=!1,Rl&&(j=dC(o,d,p,b)),uC(a),j}function uC(a){G.H=ku;var o=wt!==null&&wt.next!==null;if(sa=0,on=wt=qe=null,th=!1,Cu=0,Dl=null,o)throw Error(r(300));a===null||ln||(a=a.dependencies,a!==null&&Gf(a)&&(ln=!0))}function dC(a,o,d,p){qe=a;var b=0;do{if(Rl&&(Dl=null),Cu=0,Rl=!1,25<=b)throw Error(r(301));if(b+=1,on=wt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}G.H=VC,j=o(d,p)}while(Rl);return j}function SU(){var a=G.H,o=a.useState()[0];return o=typeof o.then=="function"?_u(o):o,a=a.useState()[0],(wt!==null?wt.memoizedState:null)!==a&&(qe.flags|=1024),o}function vv(){var a=nh!==0;return nh=0,a}function bv(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function xv(a){if(th){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}th=!1}sa=0,on=wt=qe=null,Rl=!1,Cu=nh=0,Dl=null}function Vn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?qe.memoizedState=on=a:on=on.next=a,on}function en(){if(wt===null){var a=qe.alternate;a=a!==null?a.memoizedState:null}else a=wt.next;var o=on===null?qe.memoizedState:on.next;if(o!==null)on=o,wt=a;else{if(a===null)throw qe.alternate===null?Error(r(467)):Error(r(310));wt=a,a={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},on===null?qe.memoizedState=on=a:on=on.next=a}return on}function rh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _u(a){var o=Cu;return Cu+=1,Dl===null&&(Dl=[]),a=tC(Dl,a,o),o=qe,(on===null?o.memoizedState:on.next)===null&&(o=o.alternate,G.H=o===null||o.memoizedState===null?GC:Pv),a}function ih(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return _u(a);if(a.$$typeof===k)return An(a)}throw Error(r(438,String(a)))}function wv(a){var o=null,d=qe.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var p=qe.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=rh(),qe.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),p=0;p<a;p++)d[p]=K;return o.index++,d}function oa(a,o){return typeof o=="function"?o(a):o}function ah(a){var o=en();return Sv(o,wt,a)}function Sv(a,o,d){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=a.baseQueue,j=p.pending;if(j!==null){if(b!==null){var O=b.next;b.next=j.next,j.next=O}o.baseQueue=b=j,p.pending=null}if(j=a.baseState,b===null)a.memoizedState=j;else{o=b.next;var M=O=null,$=null,ee=o,oe=!1;do{var de=ee.lane&-536870913;if(de!==ee.lane?(We&de)===de:(sa&de)===de){var ne=ee.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),de===El&&(oe=!0);else if((sa&ne)===ne){ee=ee.next,ne===El&&(oe=!0);continue}else de={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=de,O=j):$=$.next=de,qe.lanes|=ne,Ja|=ne;de=ee.action,so&&d(j,de),j=ee.hasEagerState?ee.eagerState:d(j,de)}else ne={lane:de,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=ne,O=j):$=$.next=ne,qe.lanes|=de,Ja|=de;ee=ee.next}while(ee!==null&&ee!==o);if($===null?O=j:$.next=M,!yr(j,a.memoizedState)&&(ln=!0,oe&&(d=Tl,d!==null)))throw d;a.memoizedState=j,a.baseState=O,a.baseQueue=$,p.lastRenderedState=j}return b===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function jv(a){var o=en(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var p=d.dispatch,b=d.pending,j=o.memoizedState;if(b!==null){d.pending=null;var O=b=b.next;do j=a(j,O.action),O=O.next;while(O!==b);yr(j,o.memoizedState)||(ln=!0),o.memoizedState=j,o.baseQueue===null&&(o.baseState=j),d.lastRenderedState=j}return[j,p]}function fC(a,o,d){var p=qe,b=en(),j=tt;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=o();var O=!yr((wt||b).memoizedState,d);if(O&&(b.memoizedState=d,ln=!0),b=b.queue,_v(mC.bind(null,p,b,a),[a]),b.getSnapshot!==o||O||on!==null&&on.memoizedState.tag&1){if(p.flags|=2048,Ll(9,{destroy:void 0},pC.bind(null,p,b,d,o),null),_t===null)throw Error(r(349));j||(sa&127)!==0||hC(p,o,d)}return d}function hC(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=qe.updateQueue,o===null?(o=rh(),qe.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function pC(a,o,d,p){o.value=d,o.getSnapshot=p,gC(o)&&yC(a)}function mC(a,o,d){return d(function(){gC(o)&&yC(a)})}function gC(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!yr(a,d)}catch{return!0}}function yC(a){var o=Qs(a,2);o!==null&&cr(o,a,2)}function Nv(a){var o=Vn();if(typeof a=="function"){var d=a;if(a=d(),so){rr(!0);try{d()}finally{rr(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:a},o}function vC(a,o,d,p){return a.baseState=d,Sv(a,wt,typeof p=="function"?p:oa)}function jU(a,o,d,p,b){if(lh(a))throw Error(r(485));if(a=o.action,a!==null){var j={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){j.listeners.push(O)}};G.T!==null?d(!0):j.isTransition=!1,p(j),d=o.pending,d===null?(j.next=o.pending=j,bC(o,j)):(j.next=d.next,o.pending=d.next=j)}}function bC(a,o){var d=o.action,p=o.payload,b=a.state;if(o.isTransition){var j=G.T,O={};G.T=O;try{var M=d(b,p),$=G.S;$!==null&&$(O,M),xC(a,o,M)}catch(ee){Cv(a,o,ee)}finally{j!==null&&O.types!==null&&(j.types=O.types),G.T=j}}else try{j=d(b,p),xC(a,o,j)}catch(ee){Cv(a,o,ee)}}function xC(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){wC(a,o,p)},function(p){return Cv(a,o,p)}):wC(a,o,d)}function wC(a,o,d){o.status="fulfilled",o.value=d,SC(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,bC(a,d)))}function Cv(a,o,d){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=d,SC(o),o=o.next;while(o!==p)}a.action=null}function SC(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function jC(a,o){return o}function NC(a,o){if(tt){var d=_t.formState;if(d!==null){e:{var p=qe;if(tt){if(Et){t:{for(var b=Et,j=Ir;b.nodeType!==8;){if(!j){b=null;break t}if(b=Ur(b.nextSibling),b===null){b=null;break t}}j=b.data,b=j==="F!"||j==="F"?b:null}if(b){Et=Ur(b.nextSibling),p=b.data==="F!";break e}}Ka(p)}p=!1}p&&(o=d[0])}}return d=Vn(),d.memoizedState=d.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jC,lastRenderedState:o},d.queue=p,d=FC.bind(null,qe,p),p.dispatch=d,p=Nv(!1),j=Tv.bind(null,qe,!1,p.queue),p=Vn(),b={state:o,dispatch:null,action:a,pending:null},p.queue=b,d=jU.bind(null,qe,b,j,d),b.dispatch=d,p.memoizedState=a,[o,d,!1]}function CC(a){var o=en();return _C(o,wt,a)}function _C(a,o,d){if(o=Sv(a,o,jC)[0],a=ah(oa)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=_u(o)}catch(O){throw O===Pl?Yf:O}else p=o;o=en();var b=o.queue,j=b.dispatch;return d!==o.memoizedState&&(qe.flags|=2048,Ll(9,{destroy:void 0},NU.bind(null,b,d),null)),[p,j,a]}function NU(a,o){a.action=o}function OC(a){var o=en(),d=wt;if(d!==null)return _C(o,d,a);en(),o=o.memoizedState,d=en();var p=d.queue.dispatch;return d.memoizedState=a,[o,p,!1]}function Ll(a,o,d,p){return a={tag:a,create:d,deps:p,inst:o,next:null},o=qe.updateQueue,o===null&&(o=rh(),qe.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(p=d.next,d.next=a,a.next=p,o.lastEffect=a),a}function kC(){return en().memoizedState}function sh(a,o,d,p){var b=Vn();qe.flags|=a,b.memoizedState=Ll(1|o,{destroy:void 0},d,p===void 0?null:p)}function oh(a,o,d,p){var b=en();p=p===void 0?null:p;var j=b.memoizedState.inst;wt!==null&&p!==null&&gv(p,wt.memoizedState.deps)?b.memoizedState=Ll(o,j,d,p):(qe.flags|=a,b.memoizedState=Ll(1|o,j,d,p))}function AC(a,o){sh(8390656,8,a,o)}function _v(a,o){oh(2048,8,a,o)}function CU(a){qe.flags|=4;var o=qe.updateQueue;if(o===null)o=rh(),qe.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function EC(a){var o=en().memoizedState;return CU({ref:o,nextImpl:a}),function(){if((dt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function TC(a,o){return oh(4,2,a,o)}function PC(a,o){return oh(4,4,a,o)}function zC(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function MC(a,o,d){d=d!=null?d.concat([a]):null,oh(4,4,zC.bind(null,o,a),d)}function Ov(){}function RC(a,o){var d=en();o=o===void 0?null:o;var p=d.memoizedState;return o!==null&&gv(o,p[1])?p[0]:(d.memoizedState=[a,o],a)}function DC(a,o){var d=en();o=o===void 0?null:o;var p=d.memoizedState;if(o!==null&&gv(o,p[1]))return p[0];if(p=a(),so){rr(!0);try{a()}finally{rr(!1)}}return d.memoizedState=[p,o],p}function kv(a,o,d){return d===void 0||(sa&1073741824)!==0&&(We&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=L_(),qe.lanes|=a,Ja|=a,d)}function LC(a,o,d,p){return yr(d,o)?d:Ml.current!==null?(a=kv(a,d,p),yr(a,o)||(ln=!0),a):(sa&42)===0||(sa&1073741824)!==0&&(We&261930)===0?(ln=!0,a.memoizedState=d):(a=L_(),qe.lanes|=a,Ja|=a,o)}function IC(a,o,d,p,b){var j=ae.p;ae.p=j!==0&&8>j?j:8;var O=G.T,M={};G.T=M,Tv(a,!1,o,d);try{var $=b(),ee=G.S;if(ee!==null&&ee(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var oe=xU($,p);Ou(a,o,oe,jr(a))}else Ou(a,o,p,jr(a))}catch(de){Ou(a,o,{then:function(){},status:"rejected",reason:de},jr())}finally{ae.p=j,O!==null&&M.types!==null&&(O.types=M.types),G.T=O}}function _U(){}function Av(a,o,d,p){if(a.tag!==5)throw Error(r(476));var b=$C(a).queue;IC(a,b,o,pe,d===null?_U:function(){return UC(a),d(p)})}function $C(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:pe},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function UC(a){var o=$C(a);o.next===null&&(o=a.alternate.memoizedState),Ou(a,o.next.queue,{},jr())}function Ev(){return An(Ku)}function BC(){return en().memoizedState}function qC(){return en().memoizedState}function OU(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=jr();a=Va(d);var p=Za(o,a,d);p!==null&&(cr(p,o,d),Su(p,o,d)),o={cache:av()},a.payload=o;return}o=o.return}}function kU(a,o,d){var p=jr();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},lh(a)?KC(o,d):(d=Zy(a,o,d,p),d!==null&&(cr(d,a,p),HC(d,o,p)))}function FC(a,o,d){var p=jr();Ou(a,o,d,p)}function Ou(a,o,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(lh(a))KC(o,b);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=o.lastRenderedReducer,j!==null))try{var O=o.lastRenderedState,M=j(O,d);if(b.hasEagerState=!0,b.eagerState=M,yr(M,O))return qf(a,o,b,0),_t===null&&Bf(),!1}catch{}if(d=Zy(a,o,b,p),d!==null)return cr(d,a,p),HC(d,o,p),!0}return!1}function Tv(a,o,d,p){if(p={lane:2,revertLane:c0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},lh(a)){if(o)throw Error(r(479))}else o=Zy(a,d,p,2),o!==null&&cr(o,a,2)}function lh(a){var o=a.alternate;return a===qe||o!==null&&o===qe}function KC(a,o){Rl=th=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function HC(a,o,d){if((d&4194048)!==0){var p=o.lanes;p&=a.pendingLanes,d|=p,o.lanes=d,be(a,d)}}var ku={readContext:An,use:ih,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};ku.useEffectEvent=Zt;var GC={readContext:An,use:ih,useCallback:function(a,o){return Vn().memoizedState=[a,o===void 0?null:o],a},useContext:An,useEffect:AC,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,sh(4194308,4,zC.bind(null,o,a),d)},useLayoutEffect:function(a,o){return sh(4194308,4,a,o)},useInsertionEffect:function(a,o){sh(4,2,a,o)},useMemo:function(a,o){var d=Vn();o=o===void 0?null:o;var p=a();if(so){rr(!0);try{a()}finally{rr(!1)}}return d.memoizedState=[p,o],p},useReducer:function(a,o,d){var p=Vn();if(d!==void 0){var b=d(o);if(so){rr(!0);try{d(o)}finally{rr(!1)}}}else b=o;return p.memoizedState=p.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},p.queue=a,a=a.dispatch=kU.bind(null,qe,a),[p.memoizedState,a]},useRef:function(a){var o=Vn();return a={current:a},o.memoizedState=a},useState:function(a){a=Nv(a);var o=a.queue,d=FC.bind(null,qe,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:Ov,useDeferredValue:function(a,o){var d=Vn();return kv(d,a,o)},useTransition:function(){var a=Nv(!1);return a=IC.bind(null,qe,a.queue,!0,!1),Vn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var p=qe,b=Vn();if(tt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),_t===null)throw Error(r(349));(We&127)!==0||hC(p,o,d)}b.memoizedState=d;var j={value:d,getSnapshot:o};return b.queue=j,AC(mC.bind(null,p,j,a),[a]),p.flags|=2048,Ll(9,{destroy:void 0},pC.bind(null,p,j,d,o),null),d},useId:function(){var a=Vn(),o=_t.identifierPrefix;if(tt){var d=Ai,p=ki;d=(p&~(1<<32-ve(p)-1)).toString(32)+d,o="_"+o+"R_"+d,d=nh++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=wU++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Ev,useFormState:NC,useActionState:NC,useOptimistic:function(a){var o=Vn();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Tv.bind(null,qe,!0,d),d.dispatch=o,[a,o]},useMemoCache:wv,useCacheRefresh:function(){return Vn().memoizedState=OU.bind(null,qe)},useEffectEvent:function(a){var o=Vn(),d={impl:a};return o.memoizedState=d,function(){if((dt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Pv={readContext:An,use:ih,useCallback:RC,useContext:An,useEffect:_v,useImperativeHandle:MC,useInsertionEffect:TC,useLayoutEffect:PC,useMemo:DC,useReducer:ah,useRef:kC,useState:function(){return ah(oa)},useDebugValue:Ov,useDeferredValue:function(a,o){var d=en();return LC(d,wt.memoizedState,a,o)},useTransition:function(){var a=ah(oa)[0],o=en().memoizedState;return[typeof a=="boolean"?a:_u(a),o]},useSyncExternalStore:fC,useId:BC,useHostTransitionStatus:Ev,useFormState:CC,useActionState:CC,useOptimistic:function(a,o){var d=en();return vC(d,wt,a,o)},useMemoCache:wv,useCacheRefresh:qC};Pv.useEffectEvent=EC;var VC={readContext:An,use:ih,useCallback:RC,useContext:An,useEffect:_v,useImperativeHandle:MC,useInsertionEffect:TC,useLayoutEffect:PC,useMemo:DC,useReducer:jv,useRef:kC,useState:function(){return jv(oa)},useDebugValue:Ov,useDeferredValue:function(a,o){var d=en();return wt===null?kv(d,a,o):LC(d,wt.memoizedState,a,o)},useTransition:function(){var a=jv(oa)[0],o=en().memoizedState;return[typeof a=="boolean"?a:_u(a),o]},useSyncExternalStore:fC,useId:BC,useHostTransitionStatus:Ev,useFormState:OC,useActionState:OC,useOptimistic:function(a,o){var d=en();return wt!==null?vC(d,wt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:wv,useCacheRefresh:qC};VC.useEffectEvent=EC;function zv(a,o,d,p){o=a.memoizedState,d=d(p,o),d=d==null?o:g({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Mv={enqueueSetState:function(a,o,d){a=a._reactInternals;var p=jr(),b=Va(p);b.payload=o,d!=null&&(b.callback=d),o=Za(a,b,p),o!==null&&(cr(o,a,p),Su(o,a,p))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var p=jr(),b=Va(p);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=Za(a,b,p),o!==null&&(cr(o,a,p),Su(o,a,p))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=jr(),p=Va(d);p.tag=2,o!=null&&(p.callback=o),o=Za(a,p,d),o!==null&&(cr(o,a,d),Su(o,a,d))}};function ZC(a,o,d,p,b,j,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,j,O):o.prototype&&o.prototype.isPureReactComponent?!pu(d,p)||!pu(b,j):!0}function YC(a,o,d,p){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,p),o.state!==a&&Mv.enqueueReplaceState(o,o.state,null)}function oo(a,o){var d=o;if("ref"in o){d={};for(var p in o)p!=="ref"&&(d[p]=o[p])}if(a=a.defaultProps){d===o&&(d=g({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function WC(a){Uf(a)}function QC(a){console.error(a)}function XC(a){Uf(a)}function ch(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function JC(a,o,d){try{var p=a.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Rv(a,o,d){return d=Va(d),d.tag=3,d.payload={element:null},d.callback=function(){ch(a,o)},d}function e_(a){return a=Va(a),a.tag=3,a}function t_(a,o,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var j=p.value;a.payload=function(){return b(j)},a.callback=function(){JC(o,d,p)}}var O=d.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(a.callback=function(){JC(o,d,p),typeof b!="function"&&(es===null?es=new Set([this]):es.add(this));var M=p.stack;this.componentDidCatch(p.value,{componentStack:M!==null?M:""})})}function AU(a,o,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=d.alternate,o!==null&&Al(o,d,b,!0),d=br.current,d!==null){switch(d.tag){case 31:case 13:return $r===null?wh():d.alternate===null&&Yt===0&&(Yt=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===Wf?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([p]):o.add(p),s0(a,p,b)),!1;case 22:return d.flags|=65536,p===Wf?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([p]):d.add(p)),s0(a,p,b)),!1}throw Error(r(435,d.tag))}return s0(a,p,b),wh(),!1}if(tt)return o=br.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,p!==ev&&(a=Error(r(422),{cause:p}),yu(Rr(a,d)))):(p!==ev&&(o=Error(r(423),{cause:p}),yu(Rr(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,p=Rr(p,d),b=Rv(a.stateNode,p,b),dv(a,b),Yt!==4&&(Yt=2)),!1;var j=Error(r(520),{cause:p});if(j=Rr(j,d),Du===null?Du=[j]:Du.push(j),Yt!==4&&(Yt=2),o===null)return!0;p=Rr(p,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Rv(d.stateNode,p,a),dv(d,a),!1;case 1:if(o=d.type,j=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(es===null||!es.has(j))))return d.flags|=65536,b&=-b,d.lanes|=b,b=e_(b),t_(b,a,d,p),dv(d,b),!1}d=d.return}while(d!==null);return!1}var Dv=Error(r(461)),ln=!1;function En(a,o,d,p){o.child=a===null?aC(o,null,d,p):ao(o,a.child,d,p)}function n_(a,o,d,p,b){d=d.render;var j=o.ref;if("ref"in p){var O={};for(var M in p)M!=="ref"&&(O[M]=p[M])}else O=p;return to(o),p=yv(a,o,d,O,j,b),M=vv(),a!==null&&!ln?(bv(a,o,b),la(a,o,b)):(tt&&M&&Xy(o),o.flags|=1,En(a,o,p,b),o.child)}function r_(a,o,d,p,b){if(a===null){var j=d.type;return typeof j=="function"&&!Yy(j)&&j.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=j,i_(a,o,j,p,b)):(a=Kf(d.type,null,p,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(j=a.child,!Kv(a,b)){var O=j.memoizedProps;if(d=d.compare,d=d!==null?d:pu,d(O,p)&&a.ref===o.ref)return la(a,o,b)}return o.flags|=1,a=na(j,p),a.ref=o.ref,a.return=o,o.child=a}function i_(a,o,d,p,b){if(a!==null){var j=a.memoizedProps;if(pu(j,p)&&a.ref===o.ref)if(ln=!1,o.pendingProps=p=j,Kv(a,b))(a.flags&131072)!==0&&(ln=!0);else return o.lanes=a.lanes,la(a,o,b)}return Lv(a,o,d,p,b)}function a_(a,o,d,p){var b=p.children,j=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(j=j!==null?j.baseLanes|d:d,a!==null){for(p=o.child=a.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~j}else p=0,o.child=null;return s_(a,o,j,d,p)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Zf(o,j!==null?j.cachePool:null),j!==null?lC(o,j):hv(),cC(o);else return p=o.lanes=536870912,s_(a,o,j!==null?j.baseLanes|d:d,d,p)}else j!==null?(Zf(o,j.cachePool),lC(o,j),Wa(),o.memoizedState=null):(a!==null&&Zf(o,null),hv(),Wa());return En(a,o,b,d),o.child}function Au(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function s_(a,o,d,p,b){var j=ov();return j=j===null?null:{parent:sn._currentValue,pool:j},o.memoizedState={baseLanes:d,cachePool:j},a!==null&&Zf(o,null),hv(),cC(o),a!==null&&Al(a,o,p,!0),o.childLanes=b,null}function uh(a,o){return o=fh({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function o_(a,o,d){return ao(o,a.child,null,d),a=uh(o,o.pendingProps),a.flags|=2,xr(o),o.memoizedState=null,a}function EU(a,o,d){var p=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(tt){if(p.mode==="hidden")return a=uh(o,p),o.lanes=536870912,Au(null,a);if(mv(o),(a=Et)?(a=bO(a,Ir),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:qa!==null?{id:ki,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},d=KN(a),d.return=o,o.child=d,kn=o,Et=null)):a=null,a===null)throw Ka(o);return o.lanes=536870912,null}return uh(o,p)}var j=a.memoizedState;if(j!==null){var O=j.dehydrated;if(mv(o),b)if(o.flags&256)o.flags&=-257,o=o_(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(ln||Al(a,o,d,!1),b=(d&a.childLanes)!==0,ln||b){if(p=_t,p!==null&&(O=Mt(p,d),O!==0&&O!==j.retryLane))throw j.retryLane=O,Qs(a,O),cr(p,a,O),Dv;wh(),o=o_(a,o,d)}else a=j.treeContext,Et=Ur(O.nextSibling),kn=o,tt=!0,Fa=null,Ir=!1,a!==null&&VN(o,a),o=uh(o,p),o.flags|=4096;return o}return a=na(a.child,{mode:p.mode,children:p.children}),a.ref=o.ref,o.child=a,a.return=o,a}function dh(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function Lv(a,o,d,p,b){return to(o),d=yv(a,o,d,p,void 0,b),p=vv(),a!==null&&!ln?(bv(a,o,b),la(a,o,b)):(tt&&p&&Xy(o),o.flags|=1,En(a,o,d,b),o.child)}function l_(a,o,d,p,b,j){return to(o),o.updateQueue=null,d=dC(o,p,d,b),uC(a),p=vv(),a!==null&&!ln?(bv(a,o,j),la(a,o,j)):(tt&&p&&Xy(o),o.flags|=1,En(a,o,d,j),o.child)}function c_(a,o,d,p,b){if(to(o),o.stateNode===null){var j=Cl,O=d.contextType;typeof O=="object"&&O!==null&&(j=An(O)),j=new d(p,j),o.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Mv,o.stateNode=j,j._reactInternals=o,j=o.stateNode,j.props=p,j.state=o.memoizedState,j.refs={},cv(o),O=d.contextType,j.context=typeof O=="object"&&O!==null?An(O):Cl,j.state=o.memoizedState,O=d.getDerivedStateFromProps,typeof O=="function"&&(zv(o,d,O,p),j.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(O=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),O!==j.state&&Mv.enqueueReplaceState(j,j.state,null),Nu(o,p,j,b),ju(),j.state=o.memoizedState),typeof j.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(a===null){j=o.stateNode;var M=o.memoizedProps,$=oo(d,M);j.props=$;var ee=j.context,oe=d.contextType;O=Cl,typeof oe=="object"&&oe!==null&&(O=An(oe));var de=d.getDerivedStateFromProps;oe=typeof de=="function"||typeof j.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,oe||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(M||ee!==O)&&YC(o,j,p,O),Ga=!1;var ne=o.memoizedState;j.state=ne,Nu(o,p,j,b),ju(),ee=o.memoizedState,M||ne!==ee||Ga?(typeof de=="function"&&(zv(o,d,de,p),ee=o.memoizedState),($=Ga||ZC(o,d,$,p,ne,ee,O))?(oe||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(o.flags|=4194308)):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=ee),j.props=p,j.state=ee,j.context=O,p=$):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{j=o.stateNode,uv(a,o),O=o.memoizedProps,oe=oo(d,O),j.props=oe,de=o.pendingProps,ne=j.context,ee=d.contextType,$=Cl,typeof ee=="object"&&ee!==null&&($=An(ee)),M=d.getDerivedStateFromProps,(ee=typeof M=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(O!==de||ne!==$)&&YC(o,j,p,$),Ga=!1,ne=o.memoizedState,j.state=ne,Nu(o,p,j,b),ju();var se=o.memoizedState;O!==de||ne!==se||Ga||a!==null&&a.dependencies!==null&&Gf(a.dependencies)?(typeof M=="function"&&(zv(o,d,M,p),se=o.memoizedState),(oe=Ga||ZC(o,d,oe,p,ne,se,$)||a!==null&&a.dependencies!==null&&Gf(a.dependencies))?(ee||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(p,se,$),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(p,se,$)),typeof j.componentDidUpdate=="function"&&(o.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof j.componentDidUpdate!="function"||O===a.memoizedProps&&ne===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&ne===a.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=se),j.props=p,j.state=se,j.context=$,p=oe):(typeof j.componentDidUpdate!="function"||O===a.memoizedProps&&ne===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&ne===a.memoizedState||(o.flags|=1024),p=!1)}return j=p,dh(a,o),p=(o.flags&128)!==0,j||p?(j=o.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:j.render(),o.flags|=1,a!==null&&p?(o.child=ao(o,a.child,null,b),o.child=ao(o,null,d,b)):En(a,o,d,b),o.memoizedState=j.state,a=o.child):a=la(a,o,b),a}function u_(a,o,d,p){return Js(),o.flags|=256,En(a,o,d,p),o.child}var Iv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $v(a){return{baseLanes:a,cachePool:JN()}}function Uv(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=Sr),a}function d_(a,o,d){var p=o.pendingProps,b=!1,j=(o.flags&128)!==0,O;if((O=j)||(O=a!==null&&a.memoizedState===null?!1:(Jt.current&2)!==0),O&&(b=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,a===null){if(tt){if(b?Ya(o):Wa(),(a=Et)?(a=bO(a,Ir),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:qa!==null?{id:ki,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},d=KN(a),d.return=o,o.child=d,kn=o,Et=null)):a=null,a===null)throw Ka(o);return S0(a)?o.lanes=32:o.lanes=536870912,null}var M=p.children;return p=p.fallback,b?(Wa(),b=o.mode,M=fh({mode:"hidden",children:M},b),p=Xs(p,b,d,null),M.return=o,p.return=o,M.sibling=p,o.child=M,p=o.child,p.memoizedState=$v(d),p.childLanes=Uv(a,O,d),o.memoizedState=Iv,Au(null,p)):(Ya(o),Bv(o,M))}var $=a.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(j)o.flags&256?(Ya(o),o.flags&=-257,o=qv(a,o,d)):o.memoizedState!==null?(Wa(),o.child=a.child,o.flags|=128,o=null):(Wa(),M=p.fallback,b=o.mode,p=fh({mode:"visible",children:p.children},b),M=Xs(M,b,d,null),M.flags|=2,p.return=o,M.return=o,p.sibling=M,o.child=p,ao(o,a.child,null,d),p=o.child,p.memoizedState=$v(d),p.childLanes=Uv(a,O,d),o.memoizedState=Iv,o=Au(null,p));else if(Ya(o),S0(M)){if(O=M.nextSibling&&M.nextSibling.dataset,O)var ee=O.dgst;O=ee,p=Error(r(419)),p.stack="",p.digest=O,yu({value:p,source:null,stack:null}),o=qv(a,o,d)}else if(ln||Al(a,o,d,!1),O=(d&a.childLanes)!==0,ln||O){if(O=_t,O!==null&&(p=Mt(O,d),p!==0&&p!==$.retryLane))throw $.retryLane=p,Qs(a,p),cr(O,a,p),Dv;w0(M)||wh(),o=qv(a,o,d)}else w0(M)?(o.flags|=192,o.child=a.child,o=null):(a=$.treeContext,Et=Ur(M.nextSibling),kn=o,tt=!0,Fa=null,Ir=!1,a!==null&&VN(o,a),o=Bv(o,p.children),o.flags|=4096);return o}return b?(Wa(),M=p.fallback,b=o.mode,$=a.child,ee=$.sibling,p=na($,{mode:"hidden",children:p.children}),p.subtreeFlags=$.subtreeFlags&65011712,ee!==null?M=na(ee,M):(M=Xs(M,b,d,null),M.flags|=2),M.return=o,p.return=o,p.sibling=M,o.child=p,Au(null,p),p=o.child,M=a.child.memoizedState,M===null?M=$v(d):(b=M.cachePool,b!==null?($=sn._currentValue,b=b.parent!==$?{parent:$,pool:$}:b):b=JN(),M={baseLanes:M.baseLanes|d,cachePool:b}),p.memoizedState=M,p.childLanes=Uv(a,O,d),o.memoizedState=Iv,Au(a.child,p)):(Ya(o),d=a.child,a=d.sibling,d=na(d,{mode:"visible",children:p.children}),d.return=o,d.sibling=null,a!==null&&(O=o.deletions,O===null?(o.deletions=[a],o.flags|=16):O.push(a)),o.child=d,o.memoizedState=null,d)}function Bv(a,o){return o=fh({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function fh(a,o){return a=vr(22,a,null,o),a.lanes=0,a}function qv(a,o,d){return ao(o,a.child,null,d),a=Bv(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function f_(a,o,d){a.lanes|=o;var p=a.alternate;p!==null&&(p.lanes|=o),rv(a.return,o,d)}function Fv(a,o,d,p,b,j){var O=a.memoizedState;O===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:j}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=d,O.tailMode=b,O.treeForkCount=j)}function h_(a,o,d){var p=o.pendingProps,b=p.revealOrder,j=p.tail;p=p.children;var O=Jt.current,M=(O&2)!==0;if(M?(O=O&1|2,o.flags|=128):O&=1,X(Jt,O),En(a,o,p,d),p=tt?gu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&f_(a,d,o);else if(a.tag===19)f_(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&eh(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),Fv(o,!1,b,d,j,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&eh(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}Fv(o,!0,d,null,j,p);break;case"together":Fv(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function la(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),Ja|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(Al(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=na(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=na(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function Kv(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Gf(a)))}function TU(a,o,d){switch(o.tag){case 3:we(o,o.stateNode.containerInfo),Ha(o,sn,a.memoizedState.cache),Js();break;case 27:case 5:ue(o);break;case 4:we(o,o.stateNode.containerInfo);break;case 10:Ha(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,mv(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Ya(o),o.flags|=128,null):(d&o.child.childLanes)!==0?d_(a,o,d):(Ya(o),a=la(a,o,d),a!==null?a.sibling:null);Ya(o);break;case 19:var b=(a.flags&128)!==0;if(p=(d&o.childLanes)!==0,p||(Al(a,o,d,!1),p=(d&o.childLanes)!==0),b){if(p)return h_(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),X(Jt,Jt.current),p)break;return null;case 22:return o.lanes=0,a_(a,o,d,o.pendingProps);case 24:Ha(o,sn,a.memoizedState.cache)}return la(a,o,d)}function p_(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)ln=!0;else{if(!Kv(a,d)&&(o.flags&128)===0)return ln=!1,TU(a,o,d);ln=(a.flags&131072)!==0}else ln=!1,tt&&(o.flags&1048576)!==0&&GN(o,gu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(a=ro(o.elementType),o.type=a,typeof a=="function")Yy(a)?(p=oo(a,p),o.tag=1,o=c_(null,o,a,p,d)):(o.tag=0,o=Lv(null,o,a,p,d));else{if(a!=null){var b=a.$$typeof;if(b===_){o.tag=11,o=n_(null,o,a,p,d);break e}else if(b===E){o.tag=14,o=r_(null,o,a,p,d);break e}}throw o=ge(a)||a,Error(r(306,o,""))}}return o;case 0:return Lv(a,o,o.type,o.pendingProps,d);case 1:return p=o.type,b=oo(p,o.pendingProps),c_(a,o,p,b,d);case 3:e:{if(we(o,o.stateNode.containerInfo),a===null)throw Error(r(387));p=o.pendingProps;var j=o.memoizedState;b=j.element,uv(a,o),Nu(o,p,null,d);var O=o.memoizedState;if(p=O.cache,Ha(o,sn,p),p!==j.cache&&iv(o,[sn],d,!0),ju(),p=O.element,j.isDehydrated)if(j={element:p,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=j,o.memoizedState=j,o.flags&256){o=u_(a,o,p,d);break e}else if(p!==b){b=Rr(Error(r(424)),o),yu(b),o=u_(a,o,p,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Et=Ur(a.firstChild),kn=o,tt=!0,Fa=null,Ir=!0,d=aC(o,null,p,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Js(),p===b){o=la(a,o,d);break e}En(a,o,p,d)}o=o.child}return o;case 26:return dh(a,o),a===null?(d=CO(o.type,null,o.pendingProps,null))?o.memoizedState=d:tt||(d=o.type,a=o.pendingProps,p=kh(ie.current).createElement(d),p[ht]=o,p[$n]=a,Tn(p,d,a),pt(p),o.stateNode=p):o.memoizedState=CO(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ue(o),a===null&&tt&&(p=o.stateNode=SO(o.type,o.pendingProps,ie.current),kn=o,Ir=!0,b=Et,is(o.type)?(j0=b,Et=Ur(p.firstChild)):Et=b),En(a,o,o.pendingProps.children,d),dh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&tt&&((b=p=Et)&&(p=o6(p,o.type,o.pendingProps,Ir),p!==null?(o.stateNode=p,kn=o,Et=Ur(p.firstChild),Ir=!1,b=!0):b=!1),b||Ka(o)),ue(o),b=o.type,j=o.pendingProps,O=a!==null?a.memoizedProps:null,p=j.children,v0(b,j)?p=null:O!==null&&v0(b,O)&&(o.flags|=32),o.memoizedState!==null&&(b=yv(a,o,SU,null,null,d),Ku._currentValue=b),dh(a,o),En(a,o,p,d),o.child;case 6:return a===null&&tt&&((a=d=Et)&&(d=l6(d,o.pendingProps,Ir),d!==null?(o.stateNode=d,kn=o,Et=null,a=!0):a=!1),a||Ka(o)),null;case 13:return d_(a,o,d);case 4:return we(o,o.stateNode.containerInfo),p=o.pendingProps,a===null?o.child=ao(o,null,p,d):En(a,o,p,d),o.child;case 11:return n_(a,o,o.type,o.pendingProps,d);case 7:return En(a,o,o.pendingProps,d),o.child;case 8:return En(a,o,o.pendingProps.children,d),o.child;case 12:return En(a,o,o.pendingProps.children,d),o.child;case 10:return p=o.pendingProps,Ha(o,o.type,p.value),En(a,o,p.children,d),o.child;case 9:return b=o.type._context,p=o.pendingProps.children,to(o),b=An(b),p=p(b),o.flags|=1,En(a,o,p,d),o.child;case 14:return r_(a,o,o.type,o.pendingProps,d);case 15:return i_(a,o,o.type,o.pendingProps,d);case 19:return h_(a,o,d);case 31:return EU(a,o,d);case 22:return a_(a,o,d,o.pendingProps);case 24:return to(o),p=An(sn),a===null?(b=ov(),b===null&&(b=_t,j=av(),b.pooledCache=j,j.refCount++,j!==null&&(b.pooledCacheLanes|=d),b=j),o.memoizedState={parent:p,cache:b},cv(o),Ha(o,sn,b)):((a.lanes&d)!==0&&(uv(a,o),Nu(o,null,null,d),ju()),b=a.memoizedState,j=o.memoizedState,b.parent!==p?(b={parent:p,cache:p},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),Ha(o,sn,p)):(p=j.cache,Ha(o,sn,p),p!==b.cache&&iv(o,[sn],d,!0))),En(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ca(a){a.flags|=4}function Hv(a,o,d,p,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(B_())a.flags|=8192;else throw io=Wf,lv}else a.flags&=-16777217}function m_(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!EO(o))if(B_())a.flags|=8192;else throw io=Wf,lv}function hh(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?_f():536870912,a.lanes|=o,Bl|=o)}function Eu(a,o){if(!tt)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function Tt(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,p=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=p,a.childLanes=d,o}function PU(a,o,d){var p=o.pendingProps;switch(Jy(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(o),null;case 1:return Tt(o),null;case 3:return d=o.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),aa(sn),te(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(kl(o)?ca(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,tv())),Tt(o),null;case 26:var b=o.type,j=o.memoizedState;return a===null?(ca(o),j!==null?(Tt(o),m_(o,j)):(Tt(o),Hv(o,b,null,p,d))):j?j!==a.memoizedState?(ca(o),Tt(o),m_(o,j)):(Tt(o),o.flags&=-16777217):(a=a.memoizedProps,a!==p&&ca(o),Tt(o),Hv(o,b,a,p,d)),null;case 27:if(Se(o),d=ie.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&ca(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Tt(o),null}a=q.current,kl(o)?ZN(o):(a=SO(b,p,d),o.stateNode=a,ca(o))}return Tt(o),null;case 5:if(Se(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&ca(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Tt(o),null}if(j=q.current,kl(o))ZN(o);else{var O=kh(ie.current);switch(j){case 1:j=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:j=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":j=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":j=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":j=O.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?j.multiple=!0:p.size&&(j.size=p.size);break;default:j=typeof p.is=="string"?O.createElement(b,{is:p.is}):O.createElement(b)}}j[ht]=o,j[$n]=p;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)j.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=j;e:switch(Tn(j,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&ca(o)}}return Tt(o),Hv(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==p&&ca(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(a=ie.current,kl(o)){if(a=o.stateNode,d=o.memoizedProps,p=null,b=kn,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}a[ht]=o,a=!!(a.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||dO(a.nodeValue,d)),a||Ka(o,!0)}else a=kh(a).createTextNode(p),a[ht]=o,o.stateNode=a}return Tt(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(p=kl(o),d!==null){if(a===null){if(!p)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ht]=o}else Js(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Tt(o),a=!1}else d=tv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(xr(o),o):(xr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Tt(o),null;case 13:if(p=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=kl(o),p!==null&&p.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ht]=o}else Js(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Tt(o),b=!1}else b=tv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(xr(o),o):(xr(o),null)}return xr(o),(o.flags&128)!==0?(o.lanes=d,o):(d=p!==null,a=a!==null&&a.memoizedState!==null,d&&(p=o.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),j=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(j=p.memoizedState.cachePool.pool),j!==b&&(p.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),hh(o,o.updateQueue),Tt(o),null);case 4:return te(),a===null&&h0(o.stateNode.containerInfo),Tt(o),null;case 10:return aa(o.type),Tt(o),null;case 19:if(V(Jt),p=o.memoizedState,p===null)return Tt(o),null;if(b=(o.flags&128)!==0,j=p.rendering,j===null)if(b)Eu(p,!1);else{if(Yt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(j=eh(a),j!==null){for(o.flags|=128,Eu(p,!1),a=j.updateQueue,o.updateQueue=a,hh(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)FN(d,a),d=d.sibling;return X(Jt,Jt.current&1|2),tt&&ra(o,p.treeForkCount),o.child}a=a.sibling}p.tail!==null&&et()>vh&&(o.flags|=128,b=!0,Eu(p,!1),o.lanes=4194304)}else{if(!b)if(a=eh(j),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,hh(o,a),Eu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!j.alternate&&!tt)return Tt(o),null}else 2*et()-p.renderingStartTime>vh&&d!==536870912&&(o.flags|=128,b=!0,Eu(p,!1),o.lanes=4194304);p.isBackwards?(j.sibling=o.child,o.child=j):(a=p.last,a!==null?a.sibling=j:o.child=j,p.last=j)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=et(),a.sibling=null,d=Jt.current,X(Jt,b?d&1|2:d&1),tt&&ra(o,p.treeForkCount),a):(Tt(o),null);case 22:case 23:return xr(o),pv(),p=o.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(d&536870912)!==0&&(o.flags&128)===0&&(Tt(o),o.subtreeFlags&6&&(o.flags|=8192)):Tt(o),d=o.updateQueue,d!==null&&hh(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==d&&(o.flags|=2048),a!==null&&V(no),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),aa(sn),Tt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function zU(a,o){switch(Jy(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return aa(sn),te(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Se(o),null;case 31:if(o.memoizedState!==null){if(xr(o),o.alternate===null)throw Error(r(340));Js()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(xr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Js()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return V(Jt),null;case 4:return te(),null;case 10:return aa(o.type),null;case 22:case 23:return xr(o),pv(),a!==null&&V(no),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return aa(sn),null;case 25:return null;default:return null}}function g_(a,o){switch(Jy(o),o.tag){case 3:aa(sn),te();break;case 26:case 27:case 5:Se(o);break;case 4:te();break;case 31:o.memoizedState!==null&&xr(o);break;case 13:xr(o);break;case 19:V(Jt);break;case 10:aa(o.type);break;case 22:case 23:xr(o),pv(),a!==null&&V(no);break;case 24:aa(sn)}}function Tu(a,o){try{var d=o.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&a)===a){p=void 0;var j=d.create,O=d.inst;p=j(),O.destroy=p}d=d.next}while(d!==b)}}catch(M){gt(o,o.return,M)}}function Qa(a,o,d){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var j=b.next;p=j;do{if((p.tag&a)===a){var O=p.inst,M=O.destroy;if(M!==void 0){O.destroy=void 0,b=o;var $=d,ee=M;try{ee()}catch(oe){gt(b,$,oe)}}}p=p.next}while(p!==j)}}catch(oe){gt(o,o.return,oe)}}function y_(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{oC(o,d)}catch(p){gt(a,a.return,p)}}}function v_(a,o,d){d.props=oo(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(p){gt(a,o,p)}}function Pu(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof d=="function"?a.refCleanup=d(p):d.current=p}}catch(b){gt(a,o,b)}}function Ei(a,o){var d=a.ref,p=a.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){gt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){gt(a,o,b)}else d.current=null}function b_(a){var o=a.type,d=a.memoizedProps,p=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(b){gt(a,a.return,b)}}function Gv(a,o,d){try{var p=a.stateNode;t6(p,a.type,d,o),p[$n]=o}catch(b){gt(a,a.return,b)}}function x_(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&is(a.type)||a.tag===4}function Vv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||x_(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&is(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Zv(a,o,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=ea));else if(p!==4&&(p===27&&is(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(Zv(a,o,d),a=a.sibling;a!==null;)Zv(a,o,d),a=a.sibling}function ph(a,o,d){var p=a.tag;if(p===5||p===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(p!==4&&(p===27&&is(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(ph(a,o,d),a=a.sibling;a!==null;)ph(a,o,d),a=a.sibling}function w_(a){var o=a.stateNode,d=a.memoizedProps;try{for(var p=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Tn(o,p,d),o[ht]=a,o[$n]=d}catch(j){gt(a,a.return,j)}}var ua=!1,cn=!1,Yv=!1,S_=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function MU(a,o){if(a=a.containerInfo,g0=Rh,a=MN(a),qy(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,j=p.focusNode;p=p.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var O=0,M=-1,$=-1,ee=0,oe=0,de=a,ne=null;t:for(;;){for(var se;de!==d||b!==0&&de.nodeType!==3||(M=O+b),de!==j||p!==0&&de.nodeType!==3||($=O+p),de.nodeType===3&&(O+=de.nodeValue.length),(se=de.firstChild)!==null;)ne=de,de=se;for(;;){if(de===a)break t;if(ne===d&&++ee===b&&(M=O),ne===j&&++oe===p&&($=O),(se=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=se}d=M===-1||$===-1?null:{start:M,end:$}}else d=null}d=d||{start:0,end:0}}else d=null;for(y0={focusedElem:a,selectionRange:d},Rh=!1,Sn=o;Sn!==null;)if(o=Sn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Sn=a;else for(;Sn!==null;){switch(o=Sn,j=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&j!==null){a=void 0,d=o,b=j.memoizedProps,j=j.memoizedState,p=d.stateNode;try{var Oe=oo(d.type,b);a=p.getSnapshotBeforeUpdate(Oe,j),p.__reactInternalSnapshotBeforeUpdate=a}catch(Ie){gt(d,d.return,Ie)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)x0(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":x0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Sn=a;break}Sn=o.return}}function j_(a,o,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:fa(a,d),p&4&&Tu(5,d);break;case 1:if(fa(a,d),p&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(O){gt(d,d.return,O)}else{var b=oo(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(O){gt(d,d.return,O)}}p&64&&y_(d),p&512&&Pu(d,d.return);break;case 3:if(fa(a,d),p&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{oC(a,o)}catch(O){gt(d,d.return,O)}}break;case 27:o===null&&p&4&&w_(d);case 26:case 5:fa(a,d),o===null&&p&4&&b_(d),p&512&&Pu(d,d.return);break;case 12:fa(a,d);break;case 31:fa(a,d),p&4&&__(a,d);break;case 13:fa(a,d),p&4&&O_(a,d),p&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=FU.bind(null,d),c6(a,d))));break;case 22:if(p=d.memoizedState!==null||ua,!p){o=o!==null&&o.memoizedState!==null||cn,b=ua;var j=cn;ua=p,(cn=o)&&!j?ha(a,d,(d.subtreeFlags&8772)!==0):fa(a,d),ua=b,cn=j}break;case 30:break;default:fa(a,d)}}function N_(a){var o=a.alternate;o!==null&&(a.alternate=null,N_(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Ia(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Rt=null,ar=!1;function da(a,o,d){for(d=d.child;d!==null;)C_(a,o,d),d=d.sibling}function C_(a,o,d){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(ai,d)}catch{}switch(d.tag){case 26:cn||Ei(d,o),da(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:cn||Ei(d,o);var p=Rt,b=ar;is(d.type)&&(Rt=d.stateNode,ar=!1),da(a,o,d),Bu(d.stateNode),Rt=p,ar=b;break;case 5:cn||Ei(d,o);case 6:if(p=Rt,b=ar,Rt=null,da(a,o,d),Rt=p,ar=b,Rt!==null)if(ar)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(d.stateNode)}catch(j){gt(d,o,j)}else try{Rt.removeChild(d.stateNode)}catch(j){gt(d,o,j)}break;case 18:Rt!==null&&(ar?(a=Rt,yO(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),Yl(a)):yO(Rt,d.stateNode));break;case 4:p=Rt,b=ar,Rt=d.stateNode.containerInfo,ar=!0,da(a,o,d),Rt=p,ar=b;break;case 0:case 11:case 14:case 15:Qa(2,d,o),cn||Qa(4,d,o),da(a,o,d);break;case 1:cn||(Ei(d,o),p=d.stateNode,typeof p.componentWillUnmount=="function"&&v_(d,o,p)),da(a,o,d);break;case 21:da(a,o,d);break;case 22:cn=(p=cn)||d.memoizedState!==null,da(a,o,d),cn=p;break;default:da(a,o,d)}}function __(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Yl(a)}catch(d){gt(o,o.return,d)}}}function O_(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Yl(a)}catch(d){gt(o,o.return,d)}}function RU(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new S_),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new S_),o;default:throw Error(r(435,a.tag))}}function mh(a,o){var d=RU(a);o.forEach(function(p){if(!d.has(p)){d.add(p);var b=KU.bind(null,a,p);p.then(b,b)}})}function sr(a,o){var d=o.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],j=a,O=o,M=O;e:for(;M!==null;){switch(M.tag){case 27:if(is(M.type)){Rt=M.stateNode,ar=!1;break e}break;case 5:Rt=M.stateNode,ar=!1;break e;case 3:case 4:Rt=M.stateNode.containerInfo,ar=!0;break e}M=M.return}if(Rt===null)throw Error(r(160));C_(j,O,b),Rt=null,ar=!1,j=b.alternate,j!==null&&(j.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)k_(o,a),o=o.sibling}var li=null;function k_(a,o){var d=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:sr(o,a),or(a),p&4&&(Qa(3,a,a.return),Tu(3,a),Qa(5,a,a.return));break;case 1:sr(o,a),or(a),p&512&&(cn||d===null||Ei(d,d.return)),p&64&&ua&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var b=li;if(sr(o,a),or(a),p&512&&(cn||d===null||Ei(d,d.return)),p&4){var j=d!==null?d.memoizedState:null;if(p=a.memoizedState,d===null)if(p===null)if(a.stateNode===null){e:{p=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":j=b.getElementsByTagName("title")[0],(!j||j[_i]||j[ht]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=b.createElement(p),b.head.insertBefore(j,b.querySelector("head > title"))),Tn(j,p,d),j[ht]=a,pt(j),p=j;break e;case"link":var O=kO("link","href",b).get(p+(d.href||""));if(O){for(var M=0;M<O.length;M++)if(j=O[M],j.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&j.getAttribute("rel")===(d.rel==null?null:d.rel)&&j.getAttribute("title")===(d.title==null?null:d.title)&&j.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){O.splice(M,1);break t}}j=b.createElement(p),Tn(j,p,d),b.head.appendChild(j);break;case"meta":if(O=kO("meta","content",b).get(p+(d.content||""))){for(M=0;M<O.length;M++)if(j=O[M],j.getAttribute("content")===(d.content==null?null:""+d.content)&&j.getAttribute("name")===(d.name==null?null:d.name)&&j.getAttribute("property")===(d.property==null?null:d.property)&&j.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&j.getAttribute("charset")===(d.charSet==null?null:d.charSet)){O.splice(M,1);break t}}j=b.createElement(p),Tn(j,p,d),b.head.appendChild(j);break;default:throw Error(r(468,p))}j[ht]=a,pt(j),p=j}a.stateNode=p}else AO(b,a.type,a.stateNode);else a.stateNode=OO(b,p,a.memoizedProps);else j!==p?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,p===null?AO(b,a.type,a.stateNode):OO(b,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Gv(a,a.memoizedProps,d.memoizedProps)}break;case 27:sr(o,a),or(a),p&512&&(cn||d===null||Ei(d,d.return)),d!==null&&p&4&&Gv(a,a.memoizedProps,d.memoizedProps);break;case 5:if(sr(o,a),or(a),p&512&&(cn||d===null||Ei(d,d.return)),a.flags&32){b=a.stateNode;try{vl(b,"")}catch(Oe){gt(a,a.return,Oe)}}p&4&&a.stateNode!=null&&(b=a.memoizedProps,Gv(a,b,d!==null?d.memoizedProps:b)),p&1024&&(Yv=!0);break;case 6:if(sr(o,a),or(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,d=a.stateNode;try{d.nodeValue=p}catch(Oe){gt(a,a.return,Oe)}}break;case 3:if(Th=null,b=li,li=Ah(o.containerInfo),sr(o,a),li=b,or(a),p&4&&d!==null&&d.memoizedState.isDehydrated)try{Yl(o.containerInfo)}catch(Oe){gt(a,a.return,Oe)}Yv&&(Yv=!1,A_(a));break;case 4:p=li,li=Ah(a.stateNode.containerInfo),sr(o,a),or(a),li=p;break;case 12:sr(o,a),or(a);break;case 31:sr(o,a),or(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 13:sr(o,a),or(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(yh=et()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 22:b=a.memoizedState!==null;var $=d!==null&&d.memoizedState!==null,ee=ua,oe=cn;if(ua=ee||b,cn=oe||$,sr(o,a),cn=oe,ua=ee,or(a),p&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||$||ua||cn||lo(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){$=d=o;try{if(j=$.stateNode,b)O=j.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{M=$.stateNode;var de=$.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;M.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Oe){gt($,$.return,Oe)}}}else if(o.tag===6){if(d===null){$=o;try{$.stateNode.nodeValue=b?"":$.memoizedProps}catch(Oe){gt($,$.return,Oe)}}}else if(o.tag===18){if(d===null){$=o;try{var se=$.stateNode;b?vO(se,!0):vO($.stateNode,!1)}catch(Oe){gt($,$.return,Oe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=a.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,mh(a,d))));break;case 19:sr(o,a),or(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,mh(a,p)));break;case 30:break;case 21:break;default:sr(o,a),or(a)}}function or(a){var o=a.flags;if(o&2){try{for(var d,p=a.return;p!==null;){if(x_(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,j=Vv(a);ph(a,j,b);break;case 5:var O=d.stateNode;d.flags&32&&(vl(O,""),d.flags&=-33);var M=Vv(a);ph(a,M,O);break;case 3:case 4:var $=d.stateNode.containerInfo,ee=Vv(a);Zv(a,ee,$);break;default:throw Error(r(161))}}catch(oe){gt(a,a.return,oe)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function A_(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;A_(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function fa(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)j_(a,o.alternate,o),o=o.sibling}function lo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:Qa(4,o,o.return),lo(o);break;case 1:Ei(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&v_(o,o.return,d),lo(o);break;case 27:Bu(o.stateNode);case 26:case 5:Ei(o,o.return),lo(o);break;case 22:o.memoizedState===null&&lo(o);break;case 30:lo(o);break;default:lo(o)}a=a.sibling}}function ha(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,b=a,j=o,O=j.flags;switch(j.tag){case 0:case 11:case 15:ha(b,j,d),Tu(4,j);break;case 1:if(ha(b,j,d),p=j,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ee){gt(p,p.return,ee)}if(p=j,b=p.updateQueue,b!==null){var M=p.stateNode;try{var $=b.shared.hiddenCallbacks;if($!==null)for(b.shared.hiddenCallbacks=null,b=0;b<$.length;b++)sC($[b],M)}catch(ee){gt(p,p.return,ee)}}d&&O&64&&y_(j),Pu(j,j.return);break;case 27:w_(j);case 26:case 5:ha(b,j,d),d&&p===null&&O&4&&b_(j),Pu(j,j.return);break;case 12:ha(b,j,d);break;case 31:ha(b,j,d),d&&O&4&&__(b,j);break;case 13:ha(b,j,d),d&&O&4&&O_(b,j);break;case 22:j.memoizedState===null&&ha(b,j,d),Pu(j,j.return);break;case 30:break;default:ha(b,j,d)}o=o.sibling}}function Wv(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&vu(d))}function Qv(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&vu(a))}function ci(a,o,d,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)E_(a,o,d,p),o=o.sibling}function E_(a,o,d,p){var b=o.flags;switch(o.tag){case 0:case 11:case 15:ci(a,o,d,p),b&2048&&Tu(9,o);break;case 1:ci(a,o,d,p);break;case 3:ci(a,o,d,p),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&vu(a)));break;case 12:if(b&2048){ci(a,o,d,p),a=o.stateNode;try{var j=o.memoizedProps,O=j.id,M=j.onPostCommit;typeof M=="function"&&M(O,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch($){gt(o,o.return,$)}}else ci(a,o,d,p);break;case 31:ci(a,o,d,p);break;case 13:ci(a,o,d,p);break;case 23:break;case 22:j=o.stateNode,O=o.alternate,o.memoizedState!==null?j._visibility&2?ci(a,o,d,p):zu(a,o):j._visibility&2?ci(a,o,d,p):(j._visibility|=2,Il(a,o,d,p,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Wv(O,o);break;case 24:ci(a,o,d,p),b&2048&&Qv(o.alternate,o);break;default:ci(a,o,d,p)}}function Il(a,o,d,p,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var j=a,O=o,M=d,$=p,ee=O.flags;switch(O.tag){case 0:case 11:case 15:Il(j,O,M,$,b),Tu(8,O);break;case 23:break;case 22:var oe=O.stateNode;O.memoizedState!==null?oe._visibility&2?Il(j,O,M,$,b):zu(j,O):(oe._visibility|=2,Il(j,O,M,$,b)),b&&ee&2048&&Wv(O.alternate,O);break;case 24:Il(j,O,M,$,b),b&&ee&2048&&Qv(O.alternate,O);break;default:Il(j,O,M,$,b)}o=o.sibling}}function zu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,p=o,b=p.flags;switch(p.tag){case 22:zu(d,p),b&2048&&Wv(p.alternate,p);break;case 24:zu(d,p),b&2048&&Qv(p.alternate,p);break;default:zu(d,p)}o=o.sibling}}var Mu=8192;function $l(a,o,d){if(a.subtreeFlags&Mu)for(a=a.child;a!==null;)T_(a,o,d),a=a.sibling}function T_(a,o,d){switch(a.tag){case 26:$l(a,o,d),a.flags&Mu&&a.memoizedState!==null&&w6(d,li,a.memoizedState,a.memoizedProps);break;case 5:$l(a,o,d);break;case 3:case 4:var p=li;li=Ah(a.stateNode.containerInfo),$l(a,o,d),li=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=Mu,Mu=16777216,$l(a,o,d),Mu=p):$l(a,o,d));break;default:$l(a,o,d)}}function P_(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Ru(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var p=o[d];Sn=p,M_(p,a)}P_(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)z_(a),a=a.sibling}function z_(a){switch(a.tag){case 0:case 11:case 15:Ru(a),a.flags&2048&&Qa(9,a,a.return);break;case 3:Ru(a);break;case 12:Ru(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,gh(a)):Ru(a);break;default:Ru(a)}}function gh(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var p=o[d];Sn=p,M_(p,a)}P_(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:Qa(8,o,o.return),gh(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,gh(o));break;default:gh(o)}a=a.sibling}}function M_(a,o){for(;Sn!==null;){var d=Sn;switch(d.tag){case 0:case 11:case 15:Qa(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:vu(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Sn=p;else e:for(d=a;Sn!==null;){p=Sn;var b=p.sibling,j=p.return;if(N_(p),p===d){Sn=null;break e}if(b!==null){b.return=j,Sn=b;break e}Sn=j}}}var DU={getCacheForType:function(a){var o=An(sn),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return An(sn).controller.signal}},LU=typeof WeakMap=="function"?WeakMap:Map,dt=0,_t=null,Ve=null,We=0,mt=0,wr=null,Xa=!1,Ul=!1,Xv=!1,pa=0,Yt=0,Ja=0,co=0,Jv=0,Sr=0,Bl=0,Du=null,lr=null,e0=!1,yh=0,R_=0,vh=1/0,bh=null,es=null,pn=0,ts=null,ql=null,ma=0,t0=0,n0=null,D_=null,Lu=0,r0=null;function jr(){return(dt&2)!==0&&We!==0?We&-We:G.T!==null?c0():pl()}function L_(){if(Sr===0)if((We&536870912)===0||tt){var a=fl;fl<<=1,(fl&3932160)===0&&(fl=262144),Sr=a}else Sr=536870912;return a=br.current,a!==null&&(a.flags|=32),Sr}function cr(a,o,d){(a===_t&&(mt===2||mt===9)||a.cancelPendingCommit!==null)&&(Fl(a,0),ns(a,We,Sr,!1)),Gs(a,d),((dt&2)===0||a!==_t)&&(a===_t&&((dt&2)===0&&(co|=d),Yt===4&&ns(a,We,Sr,!1)),Ti(a))}function I_(a,o,d){if((dt&6)!==0)throw Error(r(327));var p=!d&&(o&127)===0&&(o&a.expiredLanes)===0||La(a,o),b=p?UU(a,o):a0(a,o,!0),j=p;do{if(b===0){Ul&&!p&&ns(a,o,0,!1);break}else{if(d=a.current.alternate,j&&!IU(d)){b=a0(a,o,!1),j=!1;continue}if(b===2){if(j=o,a.errorRecoveryDisabledLanes&j)var O=0;else O=a.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var M=a;b=Du;var $=M.current.memoizedState.isDehydrated;if($&&(Fl(M,O).flags|=256),O=a0(M,O,!1),O!==2){if(Xv&&!$){M.errorRecoveryDisabledLanes|=j,co|=j,b=4;break e}j=lr,lr=b,j!==null&&(lr===null?lr=j:lr.push.apply(lr,j))}b=O}if(j=!1,b!==2)continue}}if(b===1){Fl(a,0),ns(a,o,0,!0);break}e:{switch(p=a,j=b,j){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ns(p,o,Sr,!Xa);break e;case 2:lr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=yh+300-et(),10<b)){if(ns(p,o,Sr,!Xa),hl(p,0,!0)!==0)break e;ma=o,p.timeoutHandle=mO($_.bind(null,p,d,lr,bh,e0,o,Sr,co,Bl,Xa,j,"Throttled",-0,0),b);break e}$_(p,d,lr,bh,e0,o,Sr,co,Bl,Xa,j,null,-0,0)}}break}while(!0);Ti(a)}function $_(a,o,d,p,b,j,O,M,$,ee,oe,de,ne,se){if(a.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},T_(o,j,de);var Oe=(j&62914560)===j?yh-et():(j&4194048)===j?R_-et():0;if(Oe=S6(de,Oe),Oe!==null){ma=j,a.cancelPendingCommit=Oe(V_.bind(null,a,o,j,d,p,b,O,M,$,oe,de,null,ne,se)),ns(a,j,O,!ee);return}}V_(a,o,j,d,p,b,O,M,$)}function IU(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var b=d[p],j=b.getSnapshot;b=b.value;try{if(!yr(j(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ns(a,o,d,p){o&=~Jv,o&=~co,a.suspendedLanes|=o,a.pingedLanes&=~o,p&&(a.warmLanes|=o),p=a.expirationTimes;for(var b=o;0<b;){var j=31-ve(b),O=1<<j;p[j]=-1,b&=~O}d!==0&&Y(a,d,o)}function xh(){return(dt&6)===0?(Iu(0),!1):!0}function i0(){if(Ve!==null){if(mt===0)var a=Ve.return;else a=Ve,ia=eo=null,xv(a),zl=null,xu=0,a=Ve;for(;a!==null;)g_(a.alternate,a),a=a.return;Ve=null}}function Fl(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,i6(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),ma=0,i0(),_t=a,Ve=d=na(a.current,null),We=o,mt=0,wr=null,Xa=!1,Ul=La(a,o),Xv=!1,Bl=Sr=Jv=co=Ja=Yt=0,lr=Du=null,e0=!1,(o&8)!==0&&(o|=o&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=o;0<p;){var b=31-ve(p),j=1<<b;o|=a[b],p&=~j}return pa=o,Bf(),d}function U_(a,o){qe=null,G.H=ku,o===Pl||o===Yf?(o=nC(),mt=3):o===lv?(o=nC(),mt=4):mt=o===Dv?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,wr=o,Ve===null&&(Yt=1,ch(a,Rr(o,a.current)))}function B_(){var a=br.current;return a===null?!0:(We&4194048)===We?$r===null:(We&62914560)===We||(We&536870912)!==0?a===$r:!1}function q_(){var a=G.H;return G.H=ku,a===null?ku:a}function F_(){var a=G.A;return G.A=DU,a}function wh(){Yt=4,Xa||(We&4194048)!==We&&br.current!==null||(Ul=!0),(Ja&134217727)===0&&(co&134217727)===0||_t===null||ns(_t,We,Sr,!1)}function a0(a,o,d){var p=dt;dt|=2;var b=q_(),j=F_();(_t!==a||We!==o)&&(bh=null,Fl(a,o)),o=!1;var O=Yt;e:do try{if(mt!==0&&Ve!==null){var M=Ve,$=wr;switch(mt){case 8:i0(),O=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(o=!0);var ee=mt;if(mt=0,wr=null,Kl(a,M,$,ee),d&&Ul){O=0;break e}break;default:ee=mt,mt=0,wr=null,Kl(a,M,$,ee)}}$U(),O=Yt;break}catch(oe){U_(a,oe)}while(!0);return o&&a.shellSuspendCounter++,ia=eo=null,dt=p,G.H=b,G.A=j,Ve===null&&(_t=null,We=0,Bf()),O}function $U(){for(;Ve!==null;)K_(Ve)}function UU(a,o){var d=dt;dt|=2;var p=q_(),b=F_();_t!==a||We!==o?(bh=null,vh=et()+500,Fl(a,o)):Ul=La(a,o);e:do try{if(mt!==0&&Ve!==null){o=Ve;var j=wr;t:switch(mt){case 1:mt=0,wr=null,Kl(a,o,j,1);break;case 2:case 9:if(eC(j)){mt=0,wr=null,H_(o);break}o=function(){mt!==2&&mt!==9||_t!==a||(mt=7),Ti(a)},j.then(o,o);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:eC(j)?(mt=0,wr=null,H_(o)):(mt=0,wr=null,Kl(a,o,j,7));break;case 5:var O=null;switch(Ve.tag){case 26:O=Ve.memoizedState;case 5:case 27:var M=Ve;if(O?EO(O):M.stateNode.complete){mt=0,wr=null;var $=M.sibling;if($!==null)Ve=$;else{var ee=M.return;ee!==null?(Ve=ee,Sh(ee)):Ve=null}break t}}mt=0,wr=null,Kl(a,o,j,5);break;case 6:mt=0,wr=null,Kl(a,o,j,6);break;case 8:i0(),Yt=6;break e;default:throw Error(r(462))}}BU();break}catch(oe){U_(a,oe)}while(!0);return ia=eo=null,G.H=p,G.A=b,dt=d,Ve!==null?0:(_t=null,We=0,Bf(),Yt)}function BU(){for(;Ve!==null&&!xt();)K_(Ve)}function K_(a){var o=p_(a.alternate,a,pa);a.memoizedProps=a.pendingProps,o===null?Sh(a):Ve=o}function H_(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=l_(d,o,o.pendingProps,o.type,void 0,We);break;case 11:o=l_(d,o,o.pendingProps,o.type.render,o.ref,We);break;case 5:xv(o);default:g_(d,o),o=Ve=FN(o,pa),o=p_(d,o,pa)}a.memoizedProps=a.pendingProps,o===null?Sh(a):Ve=o}function Kl(a,o,d,p){ia=eo=null,xv(o),zl=null,xu=0;var b=o.return;try{if(AU(a,b,o,d,We)){Yt=1,ch(a,Rr(d,a.current)),Ve=null;return}}catch(j){if(b!==null)throw Ve=b,j;Yt=1,ch(a,Rr(d,a.current)),Ve=null;return}o.flags&32768?(tt||p===1?a=!0:Ul||(We&536870912)!==0?a=!1:(Xa=a=!0,(p===2||p===9||p===3||p===6)&&(p=br.current,p!==null&&p.tag===13&&(p.flags|=16384))),G_(o,a)):Sh(o)}function Sh(a){var o=a;do{if((o.flags&32768)!==0){G_(o,Xa);return}a=o.return;var d=PU(o.alternate,o,pa);if(d!==null){Ve=d;return}if(o=o.sibling,o!==null){Ve=o;return}Ve=o=a}while(o!==null);Yt===0&&(Yt=5)}function G_(a,o){do{var d=zU(a.alternate,a);if(d!==null){d.flags&=32767,Ve=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){Ve=a;return}Ve=a=d}while(a!==null);Yt=6,Ve=null}function V_(a,o,d,p,b,j,O,M,$){a.cancelPendingCommit=null;do jh();while(pn!==0);if((dt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(j=o.lanes|o.childLanes,j|=Vy,Of(a,d,j,O,M,$),a===_t&&(Ve=_t=null,We=0),ql=o,ts=a,ma=d,t0=j,n0=b,D_=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,HU(Ye,function(){return X_(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=G.T,G.T=null,b=ae.p,ae.p=2,O=dt,dt|=4;try{MU(a,o,d)}finally{dt=O,ae.p=b,G.T=p}}pn=1,Z_(),Y_(),W_()}}function Z_(){if(pn===1){pn=0;var a=ts,o=ql,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=G.T,G.T=null;var p=ae.p;ae.p=2;var b=dt;dt|=4;try{k_(o,a);var j=y0,O=MN(a.containerInfo),M=j.focusedElem,$=j.selectionRange;if(O!==M&&M&&M.ownerDocument&&zN(M.ownerDocument.documentElement,M)){if($!==null&&qy(M)){var ee=$.start,oe=$.end;if(oe===void 0&&(oe=ee),"selectionStart"in M)M.selectionStart=ee,M.selectionEnd=Math.min(oe,M.value.length);else{var de=M.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Oe=M.textContent.length,Ie=Math.min($.start,Oe),jt=$.end===void 0?Ie:Math.min($.end,Oe);!se.extend&&Ie>jt&&(O=jt,jt=Ie,Ie=O);var Q=PN(M,Ie),F=PN(M,jt);if(Q&&F&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==F.node||se.focusOffset!==F.offset)){var J=de.createRange();J.setStart(Q.node,Q.offset),se.removeAllRanges(),Ie>jt?(se.addRange(J),se.extend(F.node,F.offset)):(J.setEnd(F.node,F.offset),se.addRange(J))}}}}for(de=[],se=M;se=se.parentNode;)se.nodeType===1&&de.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<de.length;M++){var le=de[M];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Rh=!!g0,y0=g0=null}finally{dt=b,ae.p=p,G.T=d}}a.current=o,pn=2}}function Y_(){if(pn===2){pn=0;var a=ts,o=ql,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=G.T,G.T=null;var p=ae.p;ae.p=2;var b=dt;dt|=4;try{j_(a,o.alternate,o)}finally{dt=b,ae.p=p,G.T=d}}pn=3}}function W_(){if(pn===4||pn===3){pn=0,wn();var a=ts,o=ql,d=ma,p=D_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?pn=5:(pn=0,ql=ts=null,Q_(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(es=null),Hn(d),o=o.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(ai,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=G.T,b=ae.p,ae.p=2,G.T=null;try{for(var j=a.onRecoverableError,O=0;O<p.length;O++){var M=p[O];j(M.value,{componentStack:M.stack})}}finally{G.T=o,ae.p=b}}(ma&3)!==0&&jh(),Ti(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===r0?Lu++:(Lu=0,r0=a):Lu=0,Iu(0)}}function Q_(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,vu(o)))}function jh(){return Z_(),Y_(),W_(),X_()}function X_(){if(pn!==5)return!1;var a=ts,o=t0;t0=0;var d=Hn(ma),p=G.T,b=ae.p;try{ae.p=32>d?32:d,G.T=null,d=n0,n0=null;var j=ts,O=ma;if(pn=0,ql=ts=null,ma=0,(dt&6)!==0)throw Error(r(331));var M=dt;if(dt|=4,z_(j.current),E_(j,j.current,O,d),dt=M,Iu(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(ai,j)}catch{}return!0}finally{ae.p=b,G.T=p,Q_(a,o)}}function J_(a,o,d){o=Rr(d,o),o=Rv(a.stateNode,o,2),a=Za(a,o,2),a!==null&&(Gs(a,2),Ti(a))}function gt(a,o,d){if(a.tag===3)J_(a,a,d);else for(;o!==null;){if(o.tag===3){J_(o,a,d);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(es===null||!es.has(p))){a=Rr(d,a),d=e_(2),p=Za(o,d,2),p!==null&&(t_(d,p,o,a),Gs(p,2),Ti(p));break}}o=o.return}}function s0(a,o,d){var p=a.pingCache;if(p===null){p=a.pingCache=new LU;var b=new Set;p.set(o,b)}else b=p.get(o),b===void 0&&(b=new Set,p.set(o,b));b.has(d)||(Xv=!0,b.add(d),a=qU.bind(null,a,o,d),o.then(a,a))}function qU(a,o,d){var p=a.pingCache;p!==null&&p.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,_t===a&&(We&d)===d&&(Yt===4||Yt===3&&(We&62914560)===We&&300>et()-yh?(dt&2)===0&&Fl(a,0):Jv|=d,Bl===We&&(Bl=0)),Ti(a)}function eO(a,o){o===0&&(o=_f()),a=Qs(a,o),a!==null&&(Gs(a,o),Ti(a))}function FU(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),eO(a,d)}function KU(a,o){var d=0;switch(a.tag){case 31:case 13:var p=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),eO(a,d)}function HU(a,o){return fe(a,o)}var Nh=null,Hl=null,o0=!1,Ch=!1,l0=!1,rs=0;function Ti(a){a!==Hl&&a.next===null&&(Hl===null?Nh=Hl=a:Hl=Hl.next=a),Ch=!0,o0||(o0=!0,VU())}function Iu(a,o){if(!l0&&Ch){l0=!0;do for(var d=!1,p=Nh;p!==null;){if(a!==0){var b=p.pendingLanes;if(b===0)var j=0;else{var O=p.suspendedLanes,M=p.pingedLanes;j=(1<<31-ve(42|a)+1)-1,j&=b&~(O&~M),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,iO(p,j))}else j=We,j=hl(p,p===_t?j:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(j&3)===0||La(p,j)||(d=!0,iO(p,j));p=p.next}while(d);l0=!1}}function GU(){tO()}function tO(){Ch=o0=!1;var a=0;rs!==0&&r6()&&(a=rs);for(var o=et(),d=null,p=Nh;p!==null;){var b=p.next,j=nO(p,o);j===0?(p.next=null,d===null?Nh=b:d.next=b,b===null&&(Hl=d)):(d=p,(a!==0||(j&3)!==0)&&(Ch=!0)),p=b}pn!==0&&pn!==5||Iu(a),rs!==0&&(rs=0)}function nO(a,o){for(var d=a.suspendedLanes,p=a.pingedLanes,b=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var O=31-ve(j),M=1<<O,$=b[O];$===-1?((M&d)===0||(M&p)!==0)&&(b[O]=Cy(M,o)):$<=o&&(a.expiredLanes|=M),j&=~M}if(o=_t,d=We,d=hl(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,d===0||a===o&&(mt===2||mt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Je(p),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||La(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(p!==null&&Je(p),Hn(d)){case 2:case 8:d=qt;break;case 32:d=Ye;break;case 268435456:d=nr;break;default:d=Ye}return p=rO.bind(null,a),d=fe(d,p),a.callbackPriority=o,a.callbackNode=d,o}return p!==null&&p!==null&&Je(p),a.callbackPriority=2,a.callbackNode=null,2}function rO(a,o){if(pn!==0&&pn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(jh()&&a.callbackNode!==d)return null;var p=We;return p=hl(a,a===_t?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(I_(a,p,o),nO(a,et()),a.callbackNode!=null&&a.callbackNode===d?rO.bind(null,a):null)}function iO(a,o){if(jh())return null;I_(a,o,!0)}function VU(){a6(function(){(dt&6)!==0?fe(at,GU):tO()})}function c0(){if(rs===0){var a=El;a===0&&(a=Hs,Hs<<=1,(Hs&261888)===0&&(Hs=256)),rs=a}return rs}function aO(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:zf(""+a)}function sO(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function ZU(a,o,d,p,b){if(o==="submit"&&d&&d.stateNode===b){var j=aO((b[$n]||null).action),O=p.submitter;O&&(o=(o=O[$n]||null)?aO(o.formAction):O.getAttribute("formAction"),o!==null&&(j=o,O=null));var M=new Lf("action","action",null,p,b);a.push({event:M,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(rs!==0){var $=O?sO(b,O):new FormData(b);Av(d,{pending:!0,data:$,method:b.method,action:j},null,$)}}else typeof j=="function"&&(M.preventDefault(),$=O?sO(b,O):new FormData(b),Av(d,{pending:!0,data:$,method:b.method,action:j},j,$))},currentTarget:b}]})}}for(var u0=0;u0<Gy.length;u0++){var d0=Gy[u0],YU=d0.toLowerCase(),WU=d0[0].toUpperCase()+d0.slice(1);oi(YU,"on"+WU)}oi(LN,"onAnimationEnd"),oi(IN,"onAnimationIteration"),oi($N,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(fU,"onTransitionRun"),oi(hU,"onTransitionStart"),oi(pU,"onTransitionCancel"),oi(UN,"onTransitionEnd"),gl("onMouseEnter",["mouseout","mouseover"]),gl("onMouseLeave",["mouseout","mouseover"]),gl("onPointerEnter",["pointerout","pointerover"]),gl("onPointerLeave",["pointerout","pointerover"]),Oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $u="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(" "),QU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($u));function oO(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var p=a[d],b=p.event;p=p.listeners;e:{var j=void 0;if(o)for(var O=p.length-1;0<=O;O--){var M=p[O],$=M.instance,ee=M.currentTarget;if(M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(oe){Uf(oe)}b.currentTarget=null,j=$}else for(O=0;O<p.length;O++){if(M=p[O],$=M.instance,ee=M.currentTarget,M=M.listener,$!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=ee;try{j(b)}catch(oe){Uf(oe)}b.currentTarget=null,j=$}}}}function Ze(a,o){var d=o[Xi];d===void 0&&(d=o[Xi]=new Set);var p=a+"__bubble";d.has(p)||(lO(o,a,2,!1),d.add(p))}function f0(a,o,d){var p=0;o&&(p|=4),lO(d,a,p,o)}var _h="_reactListening"+Math.random().toString(36).slice(2);function h0(a){if(!a[_h]){a[_h]=!0,si.forEach(function(d){d!=="selectionchange"&&(QU.has(d)||f0(d,!1,a),f0(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[_h]||(o[_h]=!0,f0("selectionchange",!1,o))}}function lO(a,o,d,p){switch(LO(o)){case 2:var b=C6;break;case 8:b=_6;break;default:b=k0}d=b.bind(null,o,d,a),b=void 0,!zy||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),p?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function p0(a,o,d,p,b){var j=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var M=p.stateNode.containerInfo;if(M===b)break;if(O===4)for(O=p.return;O!==null;){var $=O.tag;if(($===3||$===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;M!==null;){if(O=$a(M),O===null)return;if($=O.tag,$===5||$===6||$===26||$===27){p=j=O;continue e}M=M.parentNode}}p=p.return}hN(function(){var ee=j,oe=Ty(d),de=[];e:{var ne=BN.get(a);if(ne!==void 0){var se=Lf,Oe=a;switch(a){case"keypress":if(Rf(d)===0)break e;case"keydown":case"keyup":se=K4;break;case"focusin":Oe="focus",se=Ly;break;case"focusout":Oe="blur",se=Ly;break;case"beforeblur":case"afterblur":se=Ly;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=gN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=P4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=V4;break;case LN:case IN:case $N:se=R4;break;case UN:se=Y4;break;case"scroll":case"scrollend":se=E4;break;case"wheel":se=Q4;break;case"copy":case"cut":case"paste":se=L4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=vN;break;case"toggle":case"beforetoggle":se=J4}var Ie=(o&4)!==0,jt=!Ie&&(a==="scroll"||a==="scrollend"),Q=Ie?ne!==null?ne+"Capture":null:ne;Ie=[];for(var F=ee,J;F!==null;){var le=F;if(J=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||J===null||Q===null||(le=ou(F,Q),le!=null&&Ie.push(Uu(F,le,J))),jt)break;F=F.return}0<Ie.length&&(ne=new se(ne,Oe,null,d,oe),de.push({event:ne,listeners:Ie}))}}if((o&7)===0){e:{if(ne=a==="mouseover"||a==="pointerover",se=a==="mouseout"||a==="pointerout",ne&&d!==Ey&&(Oe=d.relatedTarget||d.fromElement)&&($a(Oe)||Oe[gr]))break e;if((se||ne)&&(ne=oe.window===oe?oe:(ne=oe.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Oe=d.relatedTarget||d.toElement,se=ee,Oe=Oe?$a(Oe):null,Oe!==null&&(jt=s(Oe),Ie=Oe.tag,Oe!==jt||Ie!==5&&Ie!==27&&Ie!==6)&&(Oe=null)):(se=null,Oe=ee),se!==Oe)){if(Ie=gN,le="onMouseLeave",Q="onMouseEnter",F="mouse",(a==="pointerout"||a==="pointerover")&&(Ie=vN,le="onPointerLeave",Q="onPointerEnter",F="pointer"),jt=se==null?ne:He(se),J=Oe==null?ne:He(Oe),ne=new Ie(le,F+"leave",se,d,oe),ne.target=jt,ne.relatedTarget=J,le=null,$a(oe)===ee&&(Ie=new Ie(Q,F+"enter",Oe,d,oe),Ie.target=J,Ie.relatedTarget=jt,le=Ie),jt=le,se&&Oe)t:{for(Ie=XU,Q=se,F=Oe,J=0,le=Q;le;le=Ie(le))J++;le=0;for(var Re=F;Re;Re=Ie(Re))le++;for(;0<J-le;)Q=Ie(Q),J--;for(;0<le-J;)F=Ie(F),le--;for(;J--;){if(Q===F||F!==null&&Q===F.alternate){Ie=Q;break t}Q=Ie(Q),F=Ie(F)}Ie=null}else Ie=null;se!==null&&cO(de,ne,se,Ie,!1),Oe!==null&&jt!==null&&cO(de,jt,Oe,Ie,!0)}}e:{if(ne=ee?He(ee):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var ot=_N;else if(NN(ne))if(ON)ot=cU;else{ot=oU;var Te=sU}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Ay(ee.elementType)&&(ot=_N):ot=lU;if(ot&&(ot=ot(a,ee))){CN(de,ot,d,oe);break e}Te&&Te(a,ne,ee),a==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&ky(ne,"number",ne.value)}switch(Te=ee?He(ee):window,a){case"focusin":(NN(Te)||Te.contentEditable==="true")&&(Sl=Te,Fy=ee,mu=null);break;case"focusout":mu=Fy=Sl=null;break;case"mousedown":Ky=!0;break;case"contextmenu":case"mouseup":case"dragend":Ky=!1,RN(de,d,oe);break;case"selectionchange":if(dU)break;case"keydown":case"keyup":RN(de,d,oe)}var Fe;if($y)e:{switch(a){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else wl?SN(a,d)&&(Qe="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Qe="onCompositionStart");Qe&&(bN&&d.locale!=="ko"&&(wl||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&wl&&(Fe=pN()):(Ba=oe,My="value"in Ba?Ba.value:Ba.textContent,wl=!0)),Te=Oh(ee,Qe),0<Te.length&&(Qe=new yN(Qe,a,null,d,oe),de.push({event:Qe,listeners:Te}),Fe?Qe.data=Fe:(Fe=jN(d),Fe!==null&&(Qe.data=Fe)))),(Fe=tU?nU(a,d):rU(a,d))&&(Qe=Oh(ee,"onBeforeInput"),0<Qe.length&&(Te=new yN("onBeforeInput","beforeinput",null,d,oe),de.push({event:Te,listeners:Qe}),Te.data=Fe)),ZU(de,a,ee,d,oe)}oO(de,o)})}function Uu(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Oh(a,o){for(var d=o+"Capture",p=[];a!==null;){var b=a,j=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||j===null||(b=ou(a,d),b!=null&&p.unshift(Uu(a,b,j)),b=ou(a,o),b!=null&&p.push(Uu(a,b,j))),a.tag===3)return p;a=a.return}return[]}function XU(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function cO(a,o,d,p,b){for(var j=o._reactName,O=[];d!==null&&d!==p;){var M=d,$=M.alternate,ee=M.stateNode;if(M=M.tag,$!==null&&$===p)break;M!==5&&M!==26&&M!==27||ee===null||($=ee,b?(ee=ou(d,j),ee!=null&&O.unshift(Uu(d,ee,$))):b||(ee=ou(d,j),ee!=null&&O.push(Uu(d,ee,$)))),d=d.return}O.length!==0&&a.push({event:o,listeners:O})}var JU=/\r\n?/g,e6=/\u0000|\uFFFD/g;function uO(a){return(typeof a=="string"?a:""+a).replace(JU,`
9
+ `).replace(e6,"")}function dO(a,o){return o=uO(o),uO(a)===o}function St(a,o,d,p,b,j){switch(d){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||vl(a,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&vl(a,""+p);break;case"className":Tf(a,"class",p);break;case"tabIndex":Tf(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Tf(a,d,p);break;case"style":dN(a,p,j);break;case"data":if(o!=="object"){Tf(a,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=zf(""+p),a.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(d,"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 j=="function"&&(d==="formAction"?(o!=="input"&&St(a,o,"name",b.name,b,null),St(a,o,"formEncType",b.formEncType,b,null),St(a,o,"formMethod",b.formMethod,b,null),St(a,o,"formTarget",b.formTarget,b,null)):(St(a,o,"encType",b.encType,b,null),St(a,o,"method",b.method,b,null),St(a,o,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(d);break}p=zf(""+p),a.setAttribute(d,p);break;case"onClick":p!=null&&(a.onclick=ea);break;case"onScroll":p!=null&&Ze("scroll",a);break;case"onScrollEnd":p!=null&&Ze("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}d=zf(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""+p):a.removeAttribute(d);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":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":p===!0?a.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(d,p):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(d,p):a.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(d):a.setAttribute(d,p);break;case"popover":Ze("beforetoggle",a),Ze("toggle",a),Ef(a,"popover",p);break;case"xlinkActuate":Ji(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Ji(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Ji(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Ji(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Ji(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Ji(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Ji(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Ji(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Ji(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ef(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=k4.get(d)||d,Ef(a,d,p))}}function m0(a,o,d,p,b,j){switch(d){case"style":dN(a,p,j);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof p=="string"?vl(a,p):(typeof p=="number"||typeof p=="bigint")&&vl(a,""+p);break;case"onScroll":p!=null&&Ze("scroll",a);break;case"onScrollEnd":p!=null&&Ze("scrollend",a);break;case"onClick":p!=null&&(a.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vs.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),j=a[$n]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(o,j,b),typeof p=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,p,b);break e}d in a?a[d]=p:p===!0?a.setAttribute(d,""):Ef(a,d,p)}}}function Tn(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",a),Ze("load",a);var p=!1,b=!1,j;for(j in d)if(d.hasOwnProperty(j)){var O=d[j];if(O!=null)switch(j){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:St(a,o,j,O,d,null)}}b&&St(a,o,"srcSet",d.srcSet,d,null),p&&St(a,o,"src",d.src,d,null);return;case"input":Ze("invalid",a);var M=j=O=b=null,$=null,ee=null;for(p in d)if(d.hasOwnProperty(p)){var oe=d[p];if(oe!=null)switch(p){case"name":b=oe;break;case"type":O=oe;break;case"checked":$=oe;break;case"defaultChecked":ee=oe;break;case"value":j=oe;break;case"defaultValue":M=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,o));break;default:St(a,o,p,oe,d,null)}}oN(a,j,M,$,ee,O,b,!1);return;case"select":Ze("invalid",a),p=O=j=null;for(b in d)if(d.hasOwnProperty(b)&&(M=d[b],M!=null))switch(b){case"value":j=M;break;case"defaultValue":O=M;break;case"multiple":p=M;default:St(a,o,b,M,d,null)}o=j,d=O,a.multiple=!!p,o!=null?yl(a,!!p,o,!1):d!=null&&yl(a,!!p,d,!0);return;case"textarea":Ze("invalid",a),j=b=p=null;for(O in d)if(d.hasOwnProperty(O)&&(M=d[O],M!=null))switch(O){case"value":p=M;break;case"defaultValue":b=M;break;case"children":j=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:St(a,o,O,M,d,null)}cN(a,p,b,j);return;case"option":for($ in d)d.hasOwnProperty($)&&(p=d[$],p!=null)&&($==="selected"?a.selected=p&&typeof p!="function"&&typeof p!="symbol":St(a,o,$,p,d,null));return;case"dialog":Ze("beforetoggle",a),Ze("toggle",a),Ze("cancel",a),Ze("close",a);break;case"iframe":case"object":Ze("load",a);break;case"video":case"audio":for(p=0;p<$u.length;p++)Ze($u[p],a);break;case"image":Ze("error",a),Ze("load",a);break;case"details":Ze("toggle",a);break;case"embed":case"source":case"link":Ze("error",a),Ze("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in d)if(d.hasOwnProperty(ee)&&(p=d[ee],p!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:St(a,o,ee,p,d,null)}return;default:if(Ay(o)){for(oe in d)d.hasOwnProperty(oe)&&(p=d[oe],p!==void 0&&m0(a,o,oe,p,d,void 0));return}}for(M in d)d.hasOwnProperty(M)&&(p=d[M],p!=null&&St(a,o,M,p,d,null))}function t6(a,o,d,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,j=null,O=null,M=null,$=null,ee=null,oe=null;for(se in d){var de=d[se];if(d.hasOwnProperty(se)&&de!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":$=de;default:p.hasOwnProperty(se)||St(a,o,se,null,p,de)}}for(var ne in p){var se=p[ne];if(de=d[ne],p.hasOwnProperty(ne)&&(se!=null||de!=null))switch(ne){case"type":j=se;break;case"name":b=se;break;case"checked":ee=se;break;case"defaultChecked":oe=se;break;case"value":O=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:se!==de&&St(a,o,ne,se,p,de)}}Oy(a,O,M,$,ee,oe,j,b);return;case"select":se=O=M=ne=null;for(j in d)if($=d[j],d.hasOwnProperty(j)&&$!=null)switch(j){case"value":break;case"multiple":se=$;default:p.hasOwnProperty(j)||St(a,o,j,null,p,$)}for(b in p)if(j=p[b],$=d[b],p.hasOwnProperty(b)&&(j!=null||$!=null))switch(b){case"value":ne=j;break;case"defaultValue":M=j;break;case"multiple":O=j;default:j!==$&&St(a,o,b,j,p,$)}o=M,d=O,p=se,ne!=null?yl(a,!!d,ne,!1):!!p!=!!d&&(o!=null?yl(a,!!d,o,!0):yl(a,!!d,d?[]:"",!1));return;case"textarea":se=ne=null;for(M in d)if(b=d[M],d.hasOwnProperty(M)&&b!=null&&!p.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:St(a,o,M,null,p,b)}for(O in p)if(b=p[O],j=d[O],p.hasOwnProperty(O)&&(b!=null||j!=null))switch(O){case"value":ne=b;break;case"defaultValue":se=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==j&&St(a,o,O,b,p,j)}lN(a,ne,se);return;case"option":for(var Oe in d)ne=d[Oe],d.hasOwnProperty(Oe)&&ne!=null&&!p.hasOwnProperty(Oe)&&(Oe==="selected"?a.selected=!1:St(a,o,Oe,null,p,ne));for($ in p)ne=p[$],se=d[$],p.hasOwnProperty($)&&ne!==se&&(ne!=null||se!=null)&&($==="selected"?a.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":St(a,o,$,ne,p,se));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 Ie in d)ne=d[Ie],d.hasOwnProperty(Ie)&&ne!=null&&!p.hasOwnProperty(Ie)&&St(a,o,Ie,null,p,ne);for(ee in p)if(ne=p[ee],se=d[ee],p.hasOwnProperty(ee)&&ne!==se&&(ne!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,o));break;default:St(a,o,ee,ne,p,se)}return;default:if(Ay(o)){for(var jt in d)ne=d[jt],d.hasOwnProperty(jt)&&ne!==void 0&&!p.hasOwnProperty(jt)&&m0(a,o,jt,void 0,p,ne);for(oe in p)ne=p[oe],se=d[oe],!p.hasOwnProperty(oe)||ne===se||ne===void 0&&se===void 0||m0(a,o,oe,ne,p,se);return}}for(var Q in d)ne=d[Q],d.hasOwnProperty(Q)&&ne!=null&&!p.hasOwnProperty(Q)&&St(a,o,Q,null,p,ne);for(de in p)ne=p[de],se=d[de],!p.hasOwnProperty(de)||ne===se||ne==null&&se==null||St(a,o,de,ne,p,se)}function fO(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],j=b.transferSize,O=b.initiatorType,M=b.duration;if(j&&M&&fO(O)){for(O=0,M=b.responseEnd,p+=1;p<d.length;p++){var $=d[p],ee=$.startTime;if(ee>M)break;var oe=$.transferSize,de=$.initiatorType;oe&&fO(de)&&($=$.responseEnd,O+=oe*($<M?1:(M-ee)/($-ee)))}if(--p,o+=8*(j+O)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var g0=null,y0=null;function kh(a){return a.nodeType===9?a:a.ownerDocument}function hO(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function pO(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function v0(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var b0=null;function r6(){var a=window.event;return a&&a.type==="popstate"?a===b0?!1:(b0=a,!0):(b0=null,!1)}var mO=typeof setTimeout=="function"?setTimeout:void 0,i6=typeof clearTimeout=="function"?clearTimeout:void 0,gO=typeof Promise=="function"?Promise:void 0,a6=typeof queueMicrotask=="function"?queueMicrotask:typeof gO<"u"?function(a){return gO.resolve(null).then(a).catch(s6)}:mO;function s6(a){setTimeout(function(){throw a})}function is(a){return a==="head"}function yO(a,o){var d=o,p=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(p===0){a.removeChild(b),Yl(o);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")Bu(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Bu(d);for(var j=d.firstChild;j;){var O=j.nextSibling,M=j.nodeName;j[_i]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&j.rel.toLowerCase()==="stylesheet"||d.removeChild(j),j=O}}else d==="body"&&Bu(a.ownerDocument.body);d=b}while(d);Yl(o)}function vO(a,o){var d=a;a=0;do{var p=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=p}while(d)}function x0(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":x0(d),Ia(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function o6(a,o,d,p){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[_i])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(j=a.getAttribute("rel"),j==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(j!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(j=a.getAttribute("src"),(j!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&j&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var j=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===j)return a}else return a;if(a=Ur(a.nextSibling),a===null)break}return null}function l6(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Ur(a.nextSibling),a===null))return null;return a}function bO(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Ur(a.nextSibling),a===null))return null;return a}function w0(a){return a.data==="$?"||a.data==="$~"}function S0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function c6(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var p=function(){o(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Ur(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var j0=null;function xO(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return Ur(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function wO(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function SO(a,o,d){switch(o=kh(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Bu(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Ia(a)}var Br=new Map,jO=new Set;function Ah(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ga=ae.d;ae.d={f:u6,r:d6,D:f6,C:h6,L:p6,m:m6,X:y6,S:g6,M:v6};function u6(){var a=ga.f(),o=xh();return a||o}function d6(a){var o=Ua(a);o!==null&&o.tag===5&&o.type==="form"?UC(o):ga.r(a)}var Gl=typeof document>"u"?null:document;function NO(a,o,d){var p=Gl;if(p&&typeof o=="string"&&o){var b=zr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),jO.has(b)||(jO.add(b),a={rel:a,crossOrigin:d,href:o},p.querySelector(b)===null&&(o=p.createElement("link"),Tn(o,"link",a),pt(o),p.head.appendChild(o)))}}function f6(a){ga.D(a),NO("dns-prefetch",a,null)}function h6(a,o){ga.C(a,o),NO("preconnect",a,o)}function p6(a,o,d){ga.L(a,o,d);var p=Gl;if(p&&a&&o){var b='link[rel="preload"][as="'+zr(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+zr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+zr(d.imageSizes)+'"]')):b+='[href="'+zr(a)+'"]';var j=b;switch(o){case"style":j=Vl(a);break;case"script":j=Zl(a)}Br.has(j)||(a=g({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),Br.set(j,a),p.querySelector(b)!==null||o==="style"&&p.querySelector(qu(j))||o==="script"&&p.querySelector(Fu(j))||(o=p.createElement("link"),Tn(o,"link",a),pt(o),p.head.appendChild(o)))}}function m6(a,o){ga.m(a,o);var d=Gl;if(d&&a){var p=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+zr(p)+'"][href="'+zr(a)+'"]',j=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=Zl(a)}if(!Br.has(j)&&(a=g({rel:"modulepreload",href:a},o),Br.set(j,a),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Fu(j)))return}p=d.createElement("link"),Tn(p,"link",a),pt(p),d.head.appendChild(p)}}}function g6(a,o,d){ga.S(a,o,d);var p=Gl;if(p&&a){var b=st(p).hoistableStyles,j=Vl(a);o=o||"default";var O=b.get(j);if(!O){var M={loading:0,preload:null};if(O=p.querySelector(qu(j)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},d),(d=Br.get(j))&&N0(a,d);var $=O=p.createElement("link");pt($),Tn($,"link",a),$._p=new Promise(function(ee,oe){$.onload=ee,$.onerror=oe}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Eh(O,o,p)}O={type:"stylesheet",instance:O,count:1,state:M},b.set(j,O)}}}function y6(a,o){ga.X(a,o);var d=Gl;if(d&&a){var p=st(d).hoistableScripts,b=Zl(a),j=p.get(b);j||(j=d.querySelector(Fu(b)),j||(a=g({src:a,async:!0},o),(o=Br.get(b))&&C0(a,o),j=d.createElement("script"),pt(j),Tn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(b,j))}}function v6(a,o){ga.M(a,o);var d=Gl;if(d&&a){var p=st(d).hoistableScripts,b=Zl(a),j=p.get(b);j||(j=d.querySelector(Fu(b)),j||(a=g({src:a,async:!0,type:"module"},o),(o=Br.get(b))&&C0(a,o),j=d.createElement("script"),pt(j),Tn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},p.set(b,j))}}function CO(a,o,d,p){var b=(b=ie.current)?Ah(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=Vl(d.href),d=st(b).hoistableStyles,p=d.get(o),p||(p={type:"style",instance:null,count:0,state:null},d.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Vl(d.href);var j=st(b).hoistableStyles,O=j.get(a);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,O),(j=b.querySelector(qu(a)))&&!j._p&&(O.instance=j,O.state.loading=5),Br.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Br.set(a,d),j||b6(b,a,d,O.state))),o&&p===null)throw Error(r(528,""));return O}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Zl(d),d=st(b).hoistableScripts,p=d.get(o),p||(p={type:"script",instance:null,count:0,state:null},d.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Vl(a){return'href="'+zr(a)+'"'}function qu(a){return'link[rel="stylesheet"]['+a+"]"}function _O(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function b6(a,o,d,p){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=a.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Tn(o,"link",d),pt(o),a.head.appendChild(o))}function Zl(a){return'[src="'+zr(a)+'"]'}function Fu(a){return"script[async]"+a}function OO(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var p=a.querySelector('style[data-href~="'+zr(d.href)+'"]');if(p)return o.instance=p,pt(p),p;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),pt(p),Tn(p,"style",b),Eh(p,d.precedence,a),o.instance=p;case"stylesheet":b=Vl(d.href);var j=a.querySelector(qu(b));if(j)return o.state.loading|=4,o.instance=j,pt(j),j;p=_O(d),(b=Br.get(b))&&N0(p,b),j=(a.ownerDocument||a).createElement("link"),pt(j);var O=j;return O._p=new Promise(function(M,$){O.onload=M,O.onerror=$}),Tn(j,"link",p),o.state.loading|=4,Eh(j,d.precedence,a),o.instance=j;case"script":return j=Zl(d.src),(b=a.querySelector(Fu(j)))?(o.instance=b,pt(b),b):(p=d,(b=Br.get(j))&&(p=g({},d),C0(p,b)),a=a.ownerDocument||a,b=a.createElement("script"),pt(b),Tn(b,"link",p),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,Eh(p,d.precedence,a));return o.instance}function Eh(a,o,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,j=b,O=0;O<p.length;O++){var M=p[O];if(M.dataset.precedence===o)j=M;else if(j!==b)break}j?j.parentNode.insertBefore(a,j.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function N0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function C0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Th=null;function kO(a,o,d){if(Th===null){var p=new Map,b=Th=new Map;b.set(d,p)}else b=Th,p=b.get(d),p||(p=new Map,b.set(d,p));if(p.has(a))return p;for(p.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var j=d[b];if(!(j[_i]||j[ht]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var O=j.getAttribute(o)||"";O=a+O;var M=p.get(O);M?M.push(j):p.set(O,[j])}}return p}function AO(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function x6(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function EO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function w6(a,o,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Vl(p.href),j=o.querySelector(qu(b));if(j){o=j._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Ph.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=j,pt(j);return}j=o.ownerDocument||o,p=_O(p),(b=Br.get(b))&&N0(p,b),j=j.createElement("link"),pt(j);var O=j;O._p=new Promise(function(M,$){O.onload=M,O.onerror=$}),Tn(j,"link",p),d.instance=j}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Ph.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var _0=0;function S6(a,o){return a.stylesheets&&a.count===0&&Mh(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var p=setTimeout(function(){if(a.stylesheets&&Mh(a,a.stylesheets),a.unsuspend){var j=a.unsuspend;a.unsuspend=null,j()}},6e4+o);0<a.imgBytes&&_0===0&&(_0=62500*n6());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Mh(a,a.stylesheets),a.unsuspend)){var j=a.unsuspend;a.unsuspend=null,j()}},(a.imgBytes>_0?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function Ph(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var zh=null;function Mh(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,zh=new Map,o.forEach(j6,a),zh=null,Ph.call(a))}function j6(a,o){if(!(o.state.loading&4)){var d=zh.get(a);if(d)var p=d.get(null);else{d=new Map,zh.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<b.length;j++){var O=b[j];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(d.set(O.dataset.precedence,O),p=O)}p&&d.set(null,p)}b=o.instance,O=b.getAttribute("data-precedence"),j=d.get(O)||p,j===p&&d.set(null,b),d.set(O,b),this.count++,p=Ph.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),j?j.parentNode.insertBefore(b,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Ku={$$typeof:k,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function N6(a,o,d,p,b,j,O,M,$){this.tag=1,this.containerInfo=a,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=su(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.hiddenUpdates=su(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=j,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function TO(a,o,d,p,b,j,O,M,$,ee,oe,de){return a=new N6(a,o,d,O,$,ee,oe,de,M),o=1,j===!0&&(o|=24),j=vr(3,null,null,o),a.current=j,j.stateNode=a,o=av(),o.refCount++,a.pooledCache=o,o.refCount++,j.memoizedState={element:p,isDehydrated:d,cache:o},cv(j),a}function PO(a){return a?(a=Cl,a):Cl}function zO(a,o,d,p,b,j){b=PO(b),p.context===null?p.context=b:p.pendingContext=b,p=Va(o),p.payload={element:d},j=j===void 0?null:j,j!==null&&(p.callback=j),d=Za(a,p,o),d!==null&&(cr(d,a,o),Su(d,a,o))}function MO(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function O0(a,o){MO(a,o),(a=a.alternate)&&MO(a,o)}function RO(a){if(a.tag===13||a.tag===31){var o=Qs(a,67108864);o!==null&&cr(o,a,67108864),O0(a,67108864)}}function DO(a){if(a.tag===13||a.tag===31){var o=jr();o=hn(o);var d=Qs(a,o);d!==null&&cr(d,a,o),O0(a,o)}}var Rh=!0;function C6(a,o,d,p){var b=G.T;G.T=null;var j=ae.p;try{ae.p=2,k0(a,o,d,p)}finally{ae.p=j,G.T=b}}function _6(a,o,d,p){var b=G.T;G.T=null;var j=ae.p;try{ae.p=8,k0(a,o,d,p)}finally{ae.p=j,G.T=b}}function k0(a,o,d,p){if(Rh){var b=A0(p);if(b===null)p0(a,o,p,Dh,d),IO(a,p);else if(k6(b,a,o,d,p))p.stopPropagation();else if(IO(a,p),o&4&&-1<O6.indexOf(a)){for(;b!==null;){var j=Ua(b);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var O=Ni(j.pendingLanes);if(O!==0){var M=j;for(M.pendingLanes|=2,M.entangledLanes|=2;O;){var $=1<<31-ve(O);M.entanglements[1]|=$,O&=~$}Ti(j),(dt&6)===0&&(vh=et()+500,Iu(0))}}break;case 31:case 13:M=Qs(j,2),M!==null&&cr(M,j,2),xh(),O0(j,2)}if(j=A0(p),j===null&&p0(a,o,p,Dh,d),j===b)break;b=j}b!==null&&p.stopPropagation()}else p0(a,o,p,null,d)}}function A0(a){return a=Ty(a),E0(a)}var Dh=null;function E0(a){if(Dh=null,a=$a(a),a!==null){var o=s(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=l(o),a!==null)return a;a=null}else if(d===31){if(a=c(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Dh=a,null}function LO(a){switch(a){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(Ke()){case at:return 2;case qt:return 8;case Ye:case ul:return 32;case nr:return 268435456;default:return 32}default:return 32}}var T0=!1,as=null,ss=null,os=null,Hu=new Map,Gu=new Map,ls=[],O6="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 IO(a,o){switch(a){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":os=null;break;case"pointerover":case"pointerout":Hu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gu.delete(o.pointerId)}}function Vu(a,o,d,p,b,j){return a===null||a.nativeEvent!==j?(a={blockedOn:o,domEventName:d,eventSystemFlags:p,nativeEvent:j,targetContainers:[b]},o!==null&&(o=Ua(o),o!==null&&RO(o)),a):(a.eventSystemFlags|=p,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function k6(a,o,d,p,b){switch(o){case"focusin":return as=Vu(as,a,o,d,p,b),!0;case"dragenter":return ss=Vu(ss,a,o,d,p,b),!0;case"mouseover":return os=Vu(os,a,o,d,p,b),!0;case"pointerover":var j=b.pointerId;return Hu.set(j,Vu(Hu.get(j)||null,a,o,d,p,b)),!0;case"gotpointercapture":return j=b.pointerId,Gu.set(j,Vu(Gu.get(j)||null,a,o,d,p,b)),!0}return!1}function $O(a){var o=$a(a.target);if(o!==null){var d=s(o);if(d!==null){if(o=d.tag,o===13){if(o=l(d),o!==null){a.blockedOn=o,Ci(a.priority,function(){DO(d)});return}}else if(o===31){if(o=c(d),o!==null){a.blockedOn=o,Ci(a.priority,function(){DO(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Lh(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=A0(a.nativeEvent);if(d===null){d=a.nativeEvent;var p=new d.constructor(d.type,d);Ey=p,d.target.dispatchEvent(p),Ey=null}else return o=Ua(d),o!==null&&RO(o),a.blockedOn=d,!1;o.shift()}return!0}function UO(a,o,d){Lh(a)&&d.delete(o)}function A6(){T0=!1,as!==null&&Lh(as)&&(as=null),ss!==null&&Lh(ss)&&(ss=null),os!==null&&Lh(os)&&(os=null),Hu.forEach(UO),Gu.forEach(UO)}function Ih(a,o){a.blockedOn===o&&(a.blockedOn=null,T0||(T0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,A6)))}var $h=null;function BO(a){$h!==a&&($h=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$h===a&&($h=null);for(var o=0;o<a.length;o+=3){var d=a[o],p=a[o+1],b=a[o+2];if(typeof p!="function"){if(E0(p||d)===null)continue;break}var j=Ua(d);j!==null&&(a.splice(o,3),o-=3,Av(j,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function Yl(a){function o($){return Ih($,a)}as!==null&&Ih(as,a),ss!==null&&Ih(ss,a),os!==null&&Ih(os,a),Hu.forEach(o),Gu.forEach(o);for(var d=0;d<ls.length;d++){var p=ls[d];p.blockedOn===a&&(p.blockedOn=null)}for(;0<ls.length&&(d=ls[0],d.blockedOn===null);)$O(d),d.blockedOn===null&&ls.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],j=d[p+1],O=b[$n]||null;if(typeof j=="function")O||BO(d);else if(O){var M=null;if(j&&j.hasAttribute("formAction")){if(b=j,O=j[$n]||null)M=O.formAction;else if(E0(b)!==null)continue}else M=O.action;typeof M=="function"?d[p+1]=M:(d.splice(p,3),p-=3),BO(d)}}}function qO(){function a(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var j=navigation.currentEntry;j&&j.url!=null&&navigation.navigate(j.url,{state:j.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function P0(a){this._internalRoot=a}Uh.prototype.render=P0.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,p=jr();zO(d,p,a,o,null,null)},Uh.prototype.unmount=P0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;zO(a.current,2,null,a,null,null),xh(),o[gr]=null}};function Uh(a){this._internalRoot=a}Uh.prototype.unstable_scheduleHydration=function(a){if(a){var o=pl();a={blockedOn:null,target:a,priority:o};for(var d=0;d<ls.length&&o!==0&&o<ls[d].priority;d++);ls.splice(d,0,a),d===0&&$O(a)}};var FO=t.version;if(FO!=="19.2.4")throw Error(r(527,FO,"19.2.4"));ae.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(o),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var E6={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bh.isDisabled&&Bh.supportsFiber)try{ai=Bh.inject(E6),Ct=Bh}catch{}}return Yu.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,p="",b=WC,j=QC,O=XC;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=TO(a,1,!1,null,null,d,p,null,b,j,O,qO),a[gr]=o.current,h0(a),new P0(o)},Yu.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var p=!1,b="",j=WC,O=QC,M=XC,$=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(O=d.onCaughtError),d.onRecoverableError!==void 0&&(M=d.onRecoverableError),d.formState!==void 0&&($=d.formState)),o=TO(a,1,!0,o,d??null,p,b,$,j,O,M,qO),o.context=PO(null),d=o.current,p=jr(),p=hn(p),b=Va(p),b.callback=null,Za(d,b,p),d=p,o.current.lanes=d,Gs(o,d),Ti(o),a[gr]=o.current,h0(a),new Uh(o)},Yu.version="19.2.4",Yu}var JO;function U6(){if(JO)return R0.exports;JO=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(),R0.exports=$6(),R0.exports}var B6=U6(),el=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(){}},q6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},F6=class{#t=q6;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},So=new F6;function K6(e){setTimeout(e,0)}var Bo=typeof window>"u"||"Deno"in globalThis;function qn(){}function H6(e,t){return typeof e=="function"?e(t):e}function Hx(e){return typeof e=="number"&&e>=0&&e!==1/0}function qz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function js(e,t){return typeof e=="function"?e(t):e}function Gr(e,t){return typeof e=="function"?e(t):e}function ek(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==NS(l,t.options))return!1}else if(!Nd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function tk(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(qo(t.options.mutationKey)!==qo(s))return!1}else if(!Nd(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function NS(e,t){return(t?.queryKeyHashFn||qo)(e)}function qo(e){return JSON.stringify(e,(t,n)=>Gx(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Nd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nd(e[n],t[n])):!1}var G6=Object.prototype.hasOwnProperty;function CS(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=nk(e)&&nk(t);if(!r&&!(Gx(e)&&Gx(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let h=0;for(let m=0;m<c;m++){const g=r?m:l[m],y=e[g],v=t[g];if(y===v){f[g]=y,(r?m<s:G6.call(e,g))&&h++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){f[g]=v;continue}const w=CS(y,v,n+1);f[g]=w,w===y&&h++}return s===c&&h===s?e:f}function Cd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gx(e){if(!rk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!rk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rk(e){return Object.prototype.toString.call(e)==="[object Object]"}function V6(e){return new Promise(t=>{So.setTimeout(t,e)})}function Vx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?CS(e,t):t}function Z6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Y6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _S=Symbol();function Fz(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_S?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function OS(e,t){return typeof e=="function"?e(...t):!!e}function W6(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Q6=class extends el{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Bo&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},kS=new Q6;function Zx(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var X6=K6;function J6(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=X6;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Qt=J6(),eB=class extends el{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Bo&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},Fp=new eB;function tB(e){return Math.min(1e3*2**e,3e4)}function Kz(e){return(e??"online")==="online"?Fp.isOnline():!0}var Yx=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Hz(e){let t=!1,n=0,r;const i=Zx(),s=()=>i.status!=="pending",l=S=>{if(!s()){const N=new Yx(S);y(N),e.onCancel?.(N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>kS.isFocused()&&(e.networkMode==="always"||Fp.isOnline())&&e.canRun(),m=()=>Kz(e.networkMode)&&e.canRun(),g=S=>{s()||(r?.(),i.resolve(S))},y=S=>{s()||(r?.(),i.reject(S))},v=()=>new Promise(S=>{r=N=>{(s()||h())&&S(N)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),w=()=>{if(s())return;let S;const N=n===0?e.initialPromise:void 0;try{S=N??e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(g).catch(C=>{if(s())return;const A=e.retry??(Bo?0:3),k=e.retryDelay??tB,_=typeof k=="function"?k(n,C):k,T=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!T){y(C);return}n++,e.onFail?.(n,C),V6(_).then(()=>h()?void 0:v()).then(()=>{t?y(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():v().then(w),i)}}var Gz=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hx(this.gcTime)&&(this.#t=So.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bo?1/0:300*1e3))}clearGcTimeout(){this.#t&&(So.clearTimeout(this.#t),this.#t=void 0)}},nB=class extends Gz{#t;#e;#n;#i;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ak(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ak(this.options);t.data!==void 0&&(this.setState(ik(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Vx(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(qn).catch(qn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Gr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_S||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>js(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:!qz(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.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.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=Fz(this.options,t),h=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#o=!1,this.options.persister?this.options.persister(c,h,this):c(h)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=Hz({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof Yx&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Yx){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Vz(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...ik(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Qt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Vz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Kz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ik(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ak(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var AS=class extends el{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Zx(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#r;#a;#o;#s;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),sk(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wx(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wx(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Gr(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!Cd(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&ok(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Gr(this.options.enabled,this.#e)!==Gr(t.enabled,this.#e)||js(this.options.staleTime,this.#e)!==js(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Gr(this.options.enabled,this.#e)!==Gr(t.enabled,this.#e)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return iB(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="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(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(qn)),t}#g(){this.#x();const e=js(this.options.staleTime,this.#e);if(Bo||this.#i.isStale||!Hx(e))return;const n=qz(this.#i.dataUpdatedAt,e)+1;this.#c=So.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Bo||Gr(this.options.enabled,this.#e)===!1||!Hx(this.#l)||this.#l===0)&&(this.#u=So.setInterval(()=>{(this.options.refetchIntervalInBackground||kS.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(So.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(So.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,s=this.#r,l=this.#a,f=e!==n?e.state:this.#n,{state:h}=e;let m={...h},g=!1,y;if(t._optimisticResults){const z=this.hasListeners(),D=!z&&sk(e,t),K=z&&ok(e,n,t,r);(D||K)&&(m={...m,...Vz(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=m;y=m.data;let N=!1;if(t.placeholderData!==void 0&&y===void 0&&S==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(z=i.data,N=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,z!==void 0&&(S="success",y=Vx(i?.data,z,t),g=!0)}if(t.select&&y!==void 0&&!N)if(i&&y===s?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=Vx(i?.data,y,t),this.#d=y,this.#s=null}catch(z){this.#s=z}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),S="error");const C=m.fetchStatus==="fetching",A=S==="pending",k=S==="error",_=A&&C,T=y!==void 0,E={status:S,fetchStatus:m.fetchStatus,isPending:A,isSuccess:S==="success",isError:k,isInitialLoading:_,isLoading:_,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!A,isLoadingError:k&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&T,isStale:ES(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Gr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=E.data!==void 0,D=E.status==="error"&&!z,K=H=>{D?H.reject(E.error):z&&H.resolve(E.data)},U=()=>{const H=this.#o=E.promise=Zx();K(H)},I=this.#o;switch(I.status){case"pending":e.queryHash===n.queryHash&&K(I);break;case"fulfilled":(D||E.data!==I.value)&&U();break;case"rejected":(!D||E.error!==I.reason)&&U();break}}return E}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),Cd(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const s=new Set(i??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(l=>{const c=l;return this.#i[c]!==e[c]&&s.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){Qt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function rB(e,t){return Gr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sk(e,t){return rB(e,t)||e.state.data!==void 0&&Wx(e,t,t.refetchOnMount)}function Wx(e,t,n){if(Gr(t.enabled,e)!==!1&&js(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ES(e,t)}return!1}function ok(e,t,n,r){return(e!==t||Gr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ES(e,n)}function ES(e,t){return Gr(t.enabled,e)!==!1&&e.isStaleByTime(js(t.staleTime,e))}function iB(e,t){return!Cd(e.getCurrentResult(),t)}function lk(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let m=!1;const g=w=>{W6(w,()=>t.signal,()=>m=!0)},y=Fz(t.options,t.fetchOptions),v=async(w,S,N)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:N?"backward":"forward",meta:t.options.meta};return g(P),P})(),k=await y(A),{maxPages:_}=t.options,T=N?Y6:Z6;return{pages:T(w.pages,k,_),pageParams:T(w.pageParams,S,_)}};if(i&&s.length){const w=i==="backward",S=w?aB:ck,N={pages:s,pageParams:l},C=S(r,N);c=await v(N,C,w)}else{const w=e??s.length;do{const S=f===0?l[0]??r.initialPageParam:ck(r,c);if(f>0&&S==null)break;c=await v(c,S),f++}while(f<w)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function ck(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function aB(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sB=class extends Gz{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Zz(),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.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Hz({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,l)=>{this.#r({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Qt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Zz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yz=class extends el{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const r=new sB({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=qh(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=qh(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=qh(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=qh(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Qt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>tk(t,n))}findAll(e={}){return this.getAll().filter(t=>tk(e,t))}notify(e){Qt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Qt.batch(()=>Promise.all(e.map(t=>t.continue().catch(qn))))}};function qh(e){return e.options.scope?.id}var oB=class extends el{#t;#e=void 0;#n;#i;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),Cd(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&qo(n.mutationKey)!==qo(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Zz();this.#e={...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){Qt.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function uk(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function lB(e,t,n){const r=e.slice(0);return r[t]=n,r}var cB=class extends el{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Qt.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const i=r.map(m=>m.observer),s=i.map(m=>m.getCurrentResult()),l=n.length!==i.length,c=i.some((m,g)=>m!==n[g]),f=l||c,h=f?!0:s.some((m,g)=>{const y=this.#e[g];return!y||!Cd(m,y)});!f&&!h||(f&&(this.#d=r,this.#r=i),this.#e=s,this.hasListeners()&&(f&&(uk(n,i).forEach(m=>{m.destroy()}),uk(i,n).forEach(m=>{m.subscribe(g=>{this.#l(m,g)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),i=n.map(s=>s.defaultedQueryOptions.queryHash);return[r,s=>this.#c(s??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,s=>{t.forEach(l=>{l.observer.trackProp(s)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((s,l)=>s!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=CS(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const s=t.get(i);s?s.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new AS(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=lB(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&Qt.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},uB=class extends el{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??NS(r,t);let s=this.get(i);return s||(s=new nB({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ek(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ek(e,n)):t}notify(e){Qt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dB=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new uB,this.#e=e.mutationCache||new Yz,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=kS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Fp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(js(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,l=H6(t,s);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qt.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Qt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Qt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(qn).catch(qn)}invalidateQueries(e,t={}){return Qt.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qt.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(qn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(qn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(js(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e.behavior=lk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e.behavior=lk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fp.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(qo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Nd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(qo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Nd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=NS(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===_S&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},Wz=x.createContext(void 0),Ds=e=>{const t=x.useContext(Wz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fB=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Wz.Provider,{value:e,children:t})),Qz=x.createContext(!1),Xz=()=>x.useContext(Qz);Qz.Provider;function hB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pB=x.createContext(hB()),Jz=()=>x.useContext(pB),eM=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?OS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},tM=e=>{x.useEffect(()=>{e.clearReset()},[e])},nM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||OS(n,[e.error,r])),rM=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},mB=(e,t)=>e.isLoading&&e.isFetching&&!t,Qx=(e,t)=>e?.suspense&&t.isPending,Xx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gB({queries:e,...t},n){const r=Ds(),i=Xz(),s=Jz(),l=x.useMemo(()=>e.map(S=>{const N=r.defaultQueryOptions(S);return N._optimisticResults=i?"isRestoring":"optimistic",N}),[e,r,i]);l.forEach(S=>{rM(S);const N=r.getQueryCache().get(S.queryHash);eM(S,s,N)}),tM(s);const[c]=x.useState(()=>new cB(r,l,t)),[f,h,m]=c.getOptimisticResult(l,t.combine),g=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(S=>g?c.subscribe(Qt.batchCalls(S)):qn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=f.some((S,N)=>Qx(l[N],S))?f.flatMap((S,N)=>{const C=l[N];if(C&&Qx(C,S)){const A=new AS(r,C);return Xx(C,A,s)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=f.find((S,N)=>{const C=l[N];return C&&nM({result:S,errorResetBoundary:s,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(w?.error)throw w.error;return h(m())}function yB(e,t,n){const r=Xz(),i=Jz(),s=Ds(),l=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",rM(l),eM(l,i,c),tM(i);const f=!s.getQueryCache().get(l.queryHash),[h]=x.useState(()=>new t(s,l)),m=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=g?h.subscribe(Qt.batchCalls(y)):qn;return h.updateResult(),v},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(l)},[l,h]),Qx(l,m))throw Xx(l,h,i);if(nM({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(l,m),l.experimental_prefetchInRender&&!Bo&&mB(m,r)&&(f?Xx(l,h,i):c?.promise)?.catch(qn).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?m:h.trackResult(m)}function To(e,t){return yB(e,AS)}function Xd(e,t){const n=Ds(),[r]=x.useState(()=>new oB(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Qt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((l,c)=>{r.mutate(l,c).catch(qn)},[r]);if(i.error&&OS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Fh=typeof window<"u"?x.useLayoutEffect:x.useEffect;function $0(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function vB(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{t(s)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function bB(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var xB=!1;function _d(e){return e[e.length-1]}function wB(e){return typeof e=="function"}function xs(e,t){return wB(e)?e(t):e}var SB=Object.prototype.hasOwnProperty,dk=Object.prototype.propertyIsEnumerable,jB=()=>Object.create(null),uo=(e,t)=>jo(e,t,jB);function jo(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=pk(e)&&pk(i);if(!s&&!(Kp(e)&&Kp(i)))return i;const l=s?e:fk(e);if(!l)return i;const c=s?i:fk(i);if(!c)return i;const f=l.length,h=c.length,m=s?new Array(h):n();let g=0;for(let y=0;y<h;y++){const v=s?y:c[y],w=e[v],S=i[v];if(w===S){m[v]=w,(s?y<f:SB.call(e,v))&&g++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[v]=S;continue}const N=jo(w,S,n,r+1);m[v]=N,N===w&&g++}return f===h&&g===f?e:m}function fk(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!dk.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!dk.call(e,i))return!1;r.push(i)}return r}function Kp(e){if(!hk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!hk(n)||!n.hasOwnProperty("isPrototypeOf"))}function hk(e){return Object.prototype.toString.call(e)==="[object Object]"}function pk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Po(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Po(e[r],t[r],n))return!1;return!0}if(Kp(e)&&Kp(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Po(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let s=0;for(const l in t)if((!r||t[l]!==void 0)&&(s++,s>i||!Po(e[l],t[l],n)))return!1;return i===s}return!1}function _c(e){let t,n;const r=new Promise((i,s)=>{t=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Od(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function NB(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function mk(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return NB(t)}var CB=["http:","https:","mailto:","tel:"];function Hp(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wu(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=mk(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+mk(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function _B(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Gp(e){const t=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const l=t.get(s);if(l)return i(l),l.value},set(s,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(s);if(c)c.value=l,i(c);else{const f={key:s,value:l,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(s,f)}},clear(){t.clear(),n=void 0,r=void 0}}}var OB="Invariant failed";function Es(e,t){if(!e)throw new Error(OB)}var No=4,iM=5;function kB(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function TS(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,s=e.substring(t,i);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=kB(s);if(l){const[c,f]=l,h=s.charCodeAt(c+1);if(h===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){const m=c+3,g=f;if(m<g)return n[0]=3,n[1]=t+c,n[2]=t+m,n[3]=t+g,n[4]=t+f+1,n[5]=i,n}}else if(h===36){const m=c+1,g=c+2;return g===f?(n[0]=2,n[1]=t+c,n[2]=t+m,n[3]=t+g,n[4]=t+f+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+g,n[3]=t+f,n[4]=t+f+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ig(e,t,n,r,i,s,l){l?.(n);let c=r;{const f=n.fullPath??n.from,h=f.length,m=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<h;){const v=TS(f,c,t);let w;const S=c,N=v[5];switch(c=N+1,s++,v[0]){case 0:{const C=f.substring(v[2],v[3]);if(m){const A=i.static?.get(C);if(A)w=A;else{i.static??=new Map;const k=Co(n.fullPath??n.from);k.parent=i,k.depth=s,w=k,i.static.set(C,k)}}else{const A=C.toLowerCase(),k=i.staticInsensitive?.get(A);if(k)w=k;else{i.staticInsensitive??=new Map;const _=Co(n.fullPath??n.from);_.parent=i,_.depth=s,w=_,i.staticInsensitive.set(A,_)}}break}case 1:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=!g&&i.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===k&&E.prefix===_&&E.suffix===T);if(P)w=P;else{const E=B0(1,n.fullPath??n.from,k,_,T);w=E,E.depth=s,E.parent=i,i.dynamic??=[],i.dynamic.push(E)}break}case 3:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=!g&&i.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===k&&E.prefix===_&&E.suffix===T);if(P)w=P;else{const E=B0(3,n.fullPath??n.from,k,_,T);w=E,E.parent=i,E.depth=s,i.optional??=[],i.optional.push(E)}break}case 2:{const C=f.substring(S,v[1]),A=f.substring(v[4],N),k=m&&!!(C||A),_=C?k?C:C.toLowerCase():void 0,T=A?k?A:A.toLowerCase():void 0,P=B0(2,n.fullPath??n.from,k,_,T);w=P,P.parent=i,P.depth=s,i.wildcard??=[],i.wildcard.push(P)}}i=w}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Co(n.fullPath??n.from);v.kind=iM,v.parent=i,s++,v.depth=s,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&f.endsWith("/")){const v=Co(n.fullPath??n.from);v.kind=No,v.parent=i,s++,v.depth=s,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)ig(e,t,f,c,i,s,l)}function U0(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ms(e){if(e.pathless)for(const t of e.pathless)ms(t);if(e.static)for(const t of e.static.values())ms(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ms(t);if(e.dynamic?.length){e.dynamic.sort(U0);for(const t of e.dynamic)ms(t)}if(e.optional?.length){e.optional.sort(U0);for(const t of e.optional)ms(t)}if(e.wildcard?.length){e.wildcard.sort(U0);for(const t of e.wildcard)ms(t)}}function Co(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function B0(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function AB(e,t){const n=Co("/"),r=new Uint16Array(6);for(const i of e)ig(!1,r,i,1,n,0);ms(n),t.masksTree=n,t.flatCache=Gp(1e3)}function EB(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=PS(e,t.masksTree);return t.flatCache.set(e,r),r}function TB(e,t,n,r,i){e||="/",r||="/";const s=t?`case\0${e}`:e;let l=i.singleCache.get(s);return l||(l=Co("/"),ig(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(s,l)),PS(r,l,n)}function PB(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let s;try{s=PS(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)s=null;else throw l}return s&&(s.branch=RB(s.route)),t.matchCache.set(r,s),s}function zB(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function MB(e,t=!1,n){const r=Co(e.fullPath),i=new Uint16Array(6),s={},l={};let c=0;return ig(t,i,e,1,r,0,f=>{if(n?.(f,c),Es(!(f.id in s),`Duplicate routes found with id: ${String(f.id)}`),s[f.id]=f,c!==0&&f.path){const h=zB(f.fullPath);(!l[h]||f.fullPath.endsWith("/"))&&(l[h]=f)}c++}),ms(r),{processedTree:{segmentTree:r,singleCache:Gp(1e3),matchCache:Gp(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:l}}function PS(e,t,n=!1){const r=e.split("/"),i=LB(e,r,t,n);if(!i)return null;const[s]=aM(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function aM(e,t,n){const r=DB(n.node);let i=null;const s=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,f=n.extract?.path??0,h=n.extract?.segment??0;for(;c<r.length;l++,c++,f++,h++){const m=r[c];if(m.kind===No)break;if(m.kind===iM){h--,l--,f--;continue}const g=t[l],y=f;if(g&&(f+=g.length),m.kind===1){i??=n.node.fullPath.split("/");const v=i[h],w=m.prefix?.length??0;if(v.charCodeAt(w)===123){const S=m.suffix?.length??0,N=v.substring(w+2,v.length-S-1),C=g.substring(w,g.length-S);s[N]=decodeURIComponent(C)}else{const S=v.substring(1);s[S]=decodeURIComponent(g)}}else if(m.kind===3){if(n.skipped&1<<c){l--,f=y-1;continue}i??=n.node.fullPath.split("/");const v=i[h],w=m.prefix?.length??0,S=m.suffix?.length??0,N=v.substring(w+3,v.length-S-1),C=m.suffix||m.prefix?g.substring(w,g.length-S):g;C&&(s[N]=decodeURIComponent(C))}else if(m.kind===2){const v=m,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);s["*"]=S,s._splat=S;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:l,node:c,path:f,segment:h}]}function RB(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function DB(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function LB(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!_d(t),s=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,h=null,m=null;for(;c.length;){const g=c.pop(),{node:y,index:v,skipped:w,depth:S,statics:N,dynamics:C,optionals:A}=g;let{extract:k,rawParams:_,parsedParams:T}=g;if(y.skipOnParamError){if(!q0(e,t,g))continue;_=g.rawParams,k=g.extract,T=g.parsedParams}r&&y.route&&y.kind!==No&&Qu(h,g)&&(h=g);const P=v===l;if(P&&(y.route&&!s&&Qu(m,g)&&(m=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const E=P?void 0:t[v];let z;if(P&&y.index){const D={node:y.index,index:v,skipped:w,depth:S+1,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T};let K=!0;if(y.index.skipOnParamError&&(q0(e,t,D)||(K=!1)),K){if(N===l&&!C&&!A&&!w)return D;Qu(m,D)&&(m=D)}}if(y.wildcard&&Qu(f,g))for(const D of y.wildcard){const{prefix:K,suffix:U}=D;if(K&&(P||!(D.caseSensitive?E:z??=E.toLowerCase()).startsWith(K)))continue;if(U){if(P)continue;const H=t.slice(v).join("/").slice(-U.length);if((D.caseSensitive?H:H.toLowerCase())!==U)continue}const I={node:D,index:l,skipped:w,depth:S,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T};if(!(D.skipOnParamError&&!q0(e,t,I))){f=I;break}}if(y.optional){const D=w|1<<S,K=S+1;for(let U=y.optional.length-1;U>=0;U--){const I=y.optional[U];c.push({node:I,index:v,skipped:D,depth:K,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P)for(let U=y.optional.length-1;U>=0;U--){const I=y.optional[U],{prefix:H,suffix:ge}=I;if(H||ge){const me=I.caseSensitive?E:z??=E.toLowerCase();if(H&&!me.startsWith(H)||ge&&!me.endsWith(ge))continue}c.push({node:I,index:v+1,skipped:w,depth:K,statics:N,dynamics:C,optionals:A+1,extract:k,rawParams:_,parsedParams:T})}}if(!P&&y.dynamic&&E)for(let D=y.dynamic.length-1;D>=0;D--){const K=y.dynamic[D],{prefix:U,suffix:I}=K;if(U||I){const H=K.caseSensitive?E:z??=E.toLowerCase();if(U&&!H.startsWith(U)||I&&!H.endsWith(I))continue}c.push({node:K,index:v+1,skipped:w,depth:S+1,statics:N,dynamics:C+1,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P&&y.staticInsensitive){const D=y.staticInsensitive.get(z??=E.toLowerCase());D&&c.push({node:D,index:v+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(!P&&y.static){const D=y.static.get(E);D&&c.push({node:D,index:v+1,skipped:w,depth:S+1,statics:N+1,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}if(y.pathless){const D=S+1;for(let K=y.pathless.length-1;K>=0;K--){const U=y.pathless[K];c.push({node:U,index:v,skipped:w,depth:D,statics:N,dynamics:C,optionals:A,extract:k,rawParams:_,parsedParams:T})}}}if(m&&f)return Qu(f,m)?m:f;if(m)return m;if(f)return f;if(r&&h){let g=h.index;for(let v=0;v<h.index;v++)g+=t[v].length;const y=g===e.length?"/":e.slice(g);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(y),h}return null}function q0(e,t,n){try{const[r,i]=aM(e,t,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,s),!0}catch{return null}}function Qu(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===No)>(e.node.kind===No)||t.node.kind===No==(e.node.kind===No)&&t.depth>e.depth))):!0}function Op(e){return zS(e.filter(t=>t!==void 0).join("/"))}function zS(e){return e.replace(/\/{2,}/g,"/")}function sM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ns(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function oM(e){return Ns(sM(e))}function Vp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function IB(e,t,n){return Vp(e,n)===Vp(t,n)}function $B({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),s=!i&&t===".";let l;if(r){l=i?t:s?e:e+"\0"+t;const g=r.get(l);if(g)return g}let c;if(s)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&_d(c)==="";)c.pop();const g=t.split("/");for(let y=0,v=g.length;y<v;y++){const w=g[y];w===""?y?y===v-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(_d(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let g=0;g<c.length;g++){g>0&&(h+="/");const y=c[g];if(!y)continue;f=TS(y,0,f);const v=f[0];if(v===0){h+=y;continue}const w=f[5],S=y.substring(0,f[1]),N=y.substring(f[4],w),C=y.substring(f[2],f[3]);v===1?h+=S||N?`${S}{$${C}}${N}`:`$${C}`:v===2?h+=S||N?`${S}{$}${N}`:"$":h+=`${S}{-$${C}}${N}`}h=zS(h);const m=h||"/";return l&&r&&r.set(l,m),m}function UB(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>t.get(s)??s)}function F0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>yk(i,n)).join("/"):yk(r,n)}function gk({path:e,params:t,decoder:n,...r}){let i=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let c=0,f,h="";for(;c<l;){const m=c;f=TS(e,m,f);const g=f[5];if(c=g+1,m===g)continue;const y=f[0];if(y===0){h+="/"+e.substring(m,g);continue}if(y===2){const v=t._splat;s._splat=v,s["*"]=v;const w=e.substring(m,f[1]),S=e.substring(f[4],g);if(!v){i=!0,(w||S)&&(h+="/"+w+S);continue}const N=F0("_splat",t,n);h+="/"+w+N+S;continue}if(y===1){const v=e.substring(f[2],f[3]);!i&&!(v in t)&&(i=!0),s[v]=t[v];const w=e.substring(m,f[1]),S=e.substring(f[4],g),N=F0(v,t,n)??"undefined";h+="/"+w+N+S;continue}if(y===3){const v=e.substring(f[2],f[3]),w=t[v];if(w==null)continue;s[v]=w;const S=e.substring(m,f[1]),N=e.substring(f[4],g),C=F0(v,t,n)??"";h+="/"+S+C+N;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:i}}function yk(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Xn(e){return!!e?.isNotFound}function BB(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Jx="tsr-scroll-restoration-v1_3",qB=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function FB(){const e=BB();if(!e)return null;const t=e.getItem(Jx);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=xs(r,n)||n;try{e.setItem(Jx,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Kh=FB(),KB=e=>e.state.__TSR_key||e.href;function HB(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var Zp=!1;function GB({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:s}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=l[c];Zp=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const g in f){const y=f[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const v=document.querySelector(g);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const h=(s??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(h);y&&y.scrollIntoView(g)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const g of i){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(m)}}Zp=!1}function VB(e,t){if(!Kh||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Kh))return;e.isScrollRestorationSetup=!0,Zp=!1;const n=e.options.getScrollRestorationKey||KB;window.history.scrollRestoration="manual";const r=i=>{if(Zp||!e.isScrollRestoring)return;let s="";if(i.target===document||i.target===window)s="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?s=`[data-scroll-restoration-id="${c}"]`:s=HB(i.target)}const l=n(e.state.location);Kh.set(c=>{const f=c[l]||={},h=f[s]||={};if(s==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(s){const m=document.querySelector(s);m&&(h.scrollX=m.scrollLeft||0,h.scrollY=m.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",qB(r,100),!0),e.subscribe("onRendered",i=>{const s=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(GB({storageKey:Jx,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Kh.set(l=>(l[s]||={},l)))})}function ZB(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function YB(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function K0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function WB(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const s=n[r];s==null?n[r]=K0(i):Array.isArray(s)?s.push(K0(i)):n[r]=[s,K0(i)]}return n}var QB=JB(JSON.parse),XB=e8(JSON.stringify,JSON.parse);function JB(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=WB(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function e8(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const s=YB(i,r);return s?`?${s}`:""}}var zo="__root__";function MS(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ur(e){return e instanceof Response&&!!e.options}function t8(e){return{input:({url:t})=>{for(const n of e)t=ew(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=lM(e[n],t);return t}}}function n8(e){const t=oM(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(s)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Op(["/",t,l.pathname]),l)}}function ew(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function lM(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}var Lt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Lt||{});function cM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:l,shallowPropagate:c};function r(h,m,g){const y=m.depsTail;if(y!==void 0&&y.dep===h)return;const v=y!==void 0?y.nextDep:m.deps;if(v!==void 0&&v.dep===h){v.version=g,m.depsTail=v;return}const w=h.subsTail;if(w!==void 0&&w.version===g&&w.sub===m)return;const S=m.depsTail=h.subsTail={version:g,dep:h,sub:m,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:m.deps=S,w!==void 0?w.nextSub=S:h.subs=S}function i(h,m=h.sub){const g=h.dep,y=h.prevDep,v=h.nextDep,w=h.nextSub,S=h.prevSub;return v!==void 0?v.prevDep=y:m.depsTail=y,y!==void 0?y.nextDep=v:m.deps=v,w!==void 0?w.prevSub=S:g.subsTail=S,S!==void 0?S.nextSub=w:(g.subs=w)===void 0&&n(g),v}function s(h){let m=h.nextSub,g;e:do{const y=h.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&f(h,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const S=(h=w).nextSub;S!==void 0&&(g={value:m,prev:g},m=S);continue}}if((h=m)!==void 0){m=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){m=h.nextSub;continue e}break}while(!0)}function l(h,m){let g,y=0,v=!1;e:do{const w=h.dep,S=w.flags;if(m.flags&16)v=!0;else if((S&17)===17){if(e(w)){const N=w.subs;N.nextSub!==void 0&&c(N),v=!0}}else if((S&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=w.deps,m=w,++y;continue}if(!v){const N=h.nextDep;if(N!==void 0){h=N;continue}}for(;y--;){const N=m.subs,C=N.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=N,v){if(e(m)){C&&c(N),m=h.sub;continue}v=!1}else m.flags&=-33;m=h.sub;const A=h.nextDep;if(A!==void 0){h=A;continue e}}return v}while(!0)}function c(h){do{const m=h.sub,g=m.flags;(g&48)===32&&(m.flags=g|16,(g&6)===2&&t(m))}while((h=h.nextSub)!==void 0)}function f(h,m){let g=m.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let RS=0,fo=0,vd=0;const ba=[],{link:pye,unlink:uM,propagate:mye,checkDirty:r8,shallowPropagate:gye}=cM({update(e){return e.depsTail!==void 0?o8(e):l8(e)},notify(e){let t=vd,n=t;do if(ba[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(vd=t;n<--t;){const r=ba[n];ba[n++]=ba[t],ba[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ag(e)):d8.call(e)}});function i8(){return RS}function a8(){++RS}function s8(){--RS||u8()}function o8(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ag(e)}}function l8(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function c8(e){const t=e.flags;if(t&16||t&32&&r8(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ag(e)}}else e.flags=2}function u8(){try{for(;fo<vd;){const e=ba[fo];ba[fo++]=void 0,c8(e)}}finally{for(;fo<vd;){const e=ba[fo];ba[fo++]=void 0,e.flags|=10}fo=0,vd=0}}function d8(){this.depsTail=void 0,this.flags=0,ag(this);const e=this.subs;e!==void 0&&uM(e)}function ag(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=uM(n,e)}function DS(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const tw=[];let kp=0;const{link:vk,unlink:f8,propagate:h8,checkDirty:dM,shallowPropagate:bk}=cM({update(e){return e._update()},notify(e){tw[nw++]=e,e.flags&=~Lt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Lt.Mutable|Lt.Dirty,Yp(e))}});let Hh=0,nw=0,Ri;function Yp(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=f8(n,e)}function fM(){if(!(i8()>0)){for(;Hh<nw;){const e=tw[Hh];tw[Hh++]=void 0,e.notify()}Hh=0,nw=0}}function hM(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Lt.None:Lt.Mutable,get(){return Ri!==void 0&&vk(i,Ri,kp),i._snapshot},subscribe(s){const l=DS(s),c={current:!1},f=p8(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(s){const l=Ri,c=Object.is;if(n)Ri=i,++kp,i.depsTail=void 0;else if(s===void 0)return!1;n&&(i.flags=Lt.Mutable|Lt.RecursedCheck);try{const f=i._snapshot,h=typeof s=="function"?s(f):s===void 0&&n?r(f):s;return f===void 0||!c(f,h)?(i._snapshot=h,!0):!1}finally{Ri=l,n&&(i.flags&=~Lt.RecursedCheck),Yp(i)}}};return n?(i.flags=Lt.Mutable|Lt.Dirty,i.get=function(){const s=i.flags;if(s&Lt.Dirty||s&Lt.Pending&&dM(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&bk(l)}}else s&Lt.Pending&&(i.flags=s&~Lt.Pending);return Ri!==void 0&&vk(i,Ri,kp),i._snapshot}):i.set=function(s){if(i._update(s)){const l=i.subs;l!==void 0&&(h8(l),bk(l),fM())}},i}function p8(e){const t=()=>{const r=Ri;Ri=n,++kp,n.depsTail=void 0,n.flags=Lt.Watching|Lt.RecursedCheck;try{return e()}finally{Ri=r,n.flags&=~Lt.RecursedCheck,Yp(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Lt.Watching|Lt.RecursedCheck,notify(){const r=this.flags;r&Lt.Dirty||r&Lt.Pending&&dM(this.deps,this)?t():this.flags=Lt.Watching},stop(){this.flags=Lt.None,this.depsTail=void 0,Yp(this)}};return t(),n}class m8{constructor(t){this.atom=hM(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(DS(t))}}class g8{constructor(t){this.atom=hM(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(DS(t))}}function y8(e){return typeof e=="function"?new g8(e):new m8(e)}function v8(e){try{a8(),e()}finally{s8(),fM()}}function bd(e){let t;return v8(()=>{t=e()}),t}var rw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},sg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Mo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let s=0;s<=i;s++){const l=e.matches[s];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},xk=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let s=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=i);for(let l=s;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?s:i},ws=(e,t,n)=>{if(!(!ur(n)&&!Xn(n)))throw ur(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:ur(n)?"redirected":r.status==="pending"?"success":r.status,context:Mo(e,t.index),isFetching:!1,error:n})),Xn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ur(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},pM=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},wk=(e,t,n)=>{const r=Mo(e,n);e.updateMatch(t,i=>({...i,context:r}))},Xu=(e,t,n,r)=>{const{id:i,routeId:s}=e.matches[t],l=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,ws(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,ws(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ur(n)&&!Xn(n)&&(e.serialError??=n)},mM=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!sg(e,t)&&(n.options.loader||n.options.beforeLoad||yM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{rw(e)},i);r._nonReactive.pendingTimeout=s}},b8=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;mM(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&ws(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},x8=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=_c(()=>{s?.resolve(),s=void 0});const{paramsError:l,searchError:c}=i;l&&Xu(e,n,l,"PARSE_PARAMS"),c&&Xu(e,n,c,"VALIDATE_SEARCH"),mM(e,t,r,i);const f=new AbortController;let h=!1;const m=()=>{h||(h=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:f})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){bd(()=>{m(),g()});return}i._nonReactive.beforeLoadPromise=_c();const y={...Mo(e,n,!1),...i.__routeContext},{search:v,params:w,cause:S}=i,N=sg(e,t),C={search:v,abortController:f,params:w,preload:N,context:y,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=_=>{if(_===void 0){bd(()=>{m(),g()});return}(ur(_)||Xn(_))&&(m(),Xu(e,n,_,"BEFORE_LOAD")),bd(()=>{m(),e.updateMatch(t,T=>({...T,__beforeLoadContext:_})),g()})};let k;try{if(k=r.options.beforeLoad(C),Od(k))return m(),k.catch(_=>{Xu(e,n,_,"BEFORE_LOAD")}).then(A)}catch(_){m(),Xu(e,n,_,"BEFORE_LOAD")}A(k)},w8=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>c(),l=()=>x8(e,n,t,i),c=()=>{if(pM(e,n))return;const f=b8(e,n,i);return Od(f)?f.then(l):l()};return s()},S8=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([s,l,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:l,styles:s?.styles}))},gM=(e,t,n,r,i)=>{const s=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:h}=e.router.getMatch(n),m=Mo(e,r),g=sg(e,n);return{params:l,deps:c,preload:!!g,parentMatchPromise:s,abortController:f,context:m,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":h,route:i,...e.router.options.additionalContext}},Sk=async(e,t,n,r,i)=>{try{const s=e.router.getMatch(n);try{(!(xB??e.router.isServer)||s.ssr===!0)&&kd(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(gM(e,t,n,r,i)),h=!!c&&Od(f);if((h||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),c){const g=h?await f:f;ws(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,y=>({...y,loaderData:g}))}i._lazyPromise&&await i._lazyPromise;const m=s._nonReactive.minPendingPromise;m&&await m,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Mo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Mo(e,r)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,Xn(l)&&await i.options.notFoundComponent?.preload?.(),ws(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(h){c=h,ws(e,e.router.getMatch(n),h)}!ur(c)&&!Xn(c)&&await kd(i,["errorComponent"]),e.updateMatch(n,h=>({...h,error:c,context:Mo(e,r),status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),ws(e,l,s)}},j8=async(e,t,n)=>{async function r(v,w,S,N,C){const A=Date.now()-w.updatedAt,k=v?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,_=C.options.shouldReload,T=typeof _=="function"?_(gM(e,t,i,n,C)):_,{status:P,invalid:E}=N,z=A>k&&(!!e.forceStaleReload||N.cause==="enter"||S!==void 0&&S!==N.id);l=P==="success"&&(E||(T??z)),v&&C.options.preload===!1||(l&&!e.sync&&m?(c=!0,(async()=>{try{await Sk(e,t,i,n,C);const D=e.router.getMatch(i);D._nonReactive.loaderPromise?.resolve(),D._nonReactive.loadPromise?.resolve(),D._nonReactive.loaderPromise=void 0,D._nonReactive.loadPromise=void 0}catch(D){ur(D)&&await e.router.navigate(D.options)}})()):P!=="success"||l?await Sk(e,t,i,n,C):wk(e,i,n))}const{id:i,routeId:s}=e.matches[n];let l=!1,c=!1;const f=e.router.looseRoutesById[s],h=f.options.loader,m=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(pM(e,i)){if(!e.router.getMatch(i))return e.matches[n];wk(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===s?e.router.state.matches[n].id:e.router.state.matches.find(N=>N.routeId===s)?.id,S=sg(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&m)return v;await v._nonReactive.loaderPromise;const N=e.router.getMatch(i),C=N._nonReactive.error||N.error;C&&ws(e,N,C),N.status==="pending"&&await r(S,v,w,N,f)}else{const N=S&&!e.router.state.matches.some(A=>A.id===i),C=e.router.getMatch(i);C._nonReactive.loaderPromise=_c(),N!==C.preload&&e.updateMatch(i,A=>({...A,preload:N})),await r(S,v,w,C,f)}}const g=e.router.getMatch(i);c||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,c||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const y=c?g.isFetching:!1;return y!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):g};async function jk(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&rw(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=w8(t,y);Od(v)&&await v}catch(v){if(ur(v))throw v;if(Xn(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?xk(t,r):void 0,l=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let c,f;for(let y=0;y<l;y++)n.push(j8(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(ur(w))throw w;Xn(w)?c??=w:f??=w}if(f!==void 0)throw f}const h=c??(r&&!t.preload?r:void 0);let m=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const y=xk(t,h);Es(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),h.routeId=v.routeId;const N=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,C=>({...C,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),m=y,await kd(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await kd(y,["errorComponent"])}for(let y=0;y<=m;y++){const{id:v,routeId:w}=t.matches[y],S=t.router.looseRoutesById[w];try{const N=S8(t,v,S);if(N){const C=await N;t.updateMatch(v,A=>({...A,...C}))}}catch(N){console.error(`Error executing head for route ${w}:`,N)}}const g=rw(t);if(Od(g)&&await g,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Nk(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function kd(e,t=Ap){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Ap?(()=>{if(e._componentsPromise===void 0){const r=Nk(e,Ap);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Nk(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function yM(e){for(const t of Ap)if(e.options[t]?.preload)return!0;return!1}var Ap=["component","errorComponent","pendingComponent","notFoundComponent"],Cs="__TSR_index",Ck="popstate",_k="beforeunload";function N8(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},s=async({task:l,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],m=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&h.length&&m)for(const g of h){const y=Wp(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:f.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,f)=>{const h=t.state[Cs];c=Ok(h+1,c),s({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:c})},replace:(l,c,f)=>{const h=t.state[Cs];c=Ok(h,c),s({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:c})},go:(l,c)=>{s({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{s({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{s({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Cs]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ok(e,t){t||(t={});const n=LS();return{...t,key:n,__TSR_key:n,[Cs]:e}}function C8(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const s=()=>i,l=z=>i=z,c=(z=>z),f=(()=>Wp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=LS();t.history.replaceState({[Cs]:0,key:z,__TSR_key:z},"")}let h=f(),m,g=!1,y=!1,v=!1,w=!1;const S=()=>h;let N,C;const A=()=>{N&&(E._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),E._ignoreSubscribers=!1,N=void 0,C=void 0,m=void 0)},k=(z,D,K)=>{const U=c(D);C||(m=h),h=Wp(D,K),N={href:U,state:K,isPush:N?.isPush||z==="push"},C||(C=Promise.resolve().then(()=>A()))},_=z=>{h=f(),E.notify({type:z})},T=async()=>{if(y){y=!1;return}const z=f(),D=z.state[Cs]-h.state[Cs],K=D===1,U=D===-1,I=!K&&!U||g;g=!1;const H=I?"GO":U?"BACK":"FORWARD",ge=I?{type:"GO",index:D}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const me=s();if(typeof document<"u"&&me.length){for(const G of me)if(await G.blockerFn({currentLocation:h,nextLocation:z,action:H})){y=!0,t.history.go(1),E.notify(ge);return}}}h=f(),E.notify(ge)},P=z=>{if(w){w=!1;return}let D=!1;const K=s();if(typeof document<"u"&&K.length)for(const U of K){const I=U.enableBeforeUnload??!0;if(I===!0){D=!0;break}if(typeof I=="function"&&I()===!0){D=!0;break}}if(D)return z.preventDefault(),z.returnValue=""},E=N8({getLocation:S,getLength:()=>t.history.length,pushState:(z,D)=>k("push",z,D),replaceState:(z,D)=>k("replace",z,D),back:z=>(z&&(v=!0),w=!0,t.history.back()),forward:z=>{z&&(v=!0),w=!0,t.history.forward()},go:z=>{g=!0,t.history.go(z)},createHref:z=>c(z),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(_k,P,{capture:!0}),t.removeEventListener(Ck,T)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:s,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(_k,P,{capture:!0}),t.addEventListener(Ck,T),t.history.pushState=function(...z){const D=n.apply(t.history,z);return E._ignoreSubscribers||_("PUSH"),D},t.history.replaceState=function(...z){const D=r.apply(t.history,z);return E._ignoreSubscribers||_("REPLACE"),D},E}function _8(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Wp(e,t){const n=_8(e),r=n.indexOf("#"),i=n.indexOf("?"),s=LS();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[Cs]:0,key:s,__TSR_key:s}}}function LS(){return(Math.random()+1).toString(36).substring(7)}function Ro(e){const t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function O8(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var k8=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,s=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=UB(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=C8()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=Gp(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=y8(E8(this.latestLocation)),VB(this));let l=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(i||r!==c||s!==f){this.basepath=c;const h=[],m=oM(c);m&&m!=="/"&&h.push(n8({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:t8(h),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=MB(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&AB(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:f,hash:h,href:m,state:g})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const N=this.options.parseSearch(f),C=this.options.stringifySearch(N);return{href:c+C+h,publicHref:m,pathname:Wu(c).path,external:!1,searchStr:C,search:uo(n?.search,N),hash:Wu(h.slice(1)).path,state:jo(n?.state,g)}}const y=new URL(m,this.origin),v=ew(this.rewrite,y),w=this.options.parseSearch(v.search),S=this.options.stringifySearch(w);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:m,pathname:Wu(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:S,search:uo(n?.search,w),hash:Wu(v.hash.slice(1)).path,state:jo(n?.state,g)}},i=r(t),{__tempLocation:s,__tempKey:l}=i.state;if(s&&(!l||l===this.tempLocationKey)){const c=r(s);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>$B({base:t,to:zS(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,n,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:n},r):this.matchRoutesInternal(t,n),this.getMatchedRoutes=t=>T8({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const s=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(s);i.from;const c=i.unsafeRelative==="path"?s.pathname:i.from??l.fullPath,f=this.resolvePathWithBase(c,"."),h=l.search,m=Object.assign(Object.create(null),l.params),g=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?m:Object.assign(m,xs(i.params,m)),v=this.getMatchedRoutes(g);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const D of w){const K=D.options.params?.stringify??D.options.stringifyParams;if(K)try{Object.assign(y,K(y))}catch{}}const S=t.leaveParams?g:Wu(gk({path:g,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=h;if(t._includeValidateSearch&&this.options.search?.strict){const D={};w.forEach(K=>{if(K.options.validateSearch)try{Object.assign(D,Ep(K.options.validateSearch,{...D,...N}))}catch{}}),N=D}N=P8({search:N,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),N=uo(h,N);const C=this.options.stringifySearch(N),A=i.hash===!0?s.hash:i.hash?xs(i.hash,s.hash):void 0,k=A?`#${A}`:"";let _=i.state===!0?s.state:i.state?xs(i.state,s.state):{};_=jo(s.state,_);const T=`${S}${C}${k}`;let P,E,z=!1;if(this.rewrite){const D=new URL(T,this.origin),K=lM(this.rewrite,D);P=D.href.replace(D.origin,""),K.origin!==this.origin?(E=K.href,z=!0):E=K.pathname+K.search+K.hash}else P=_B(T),E=P;return{publicHref:E,href:P,pathname:S,search:N,searchStr:C,state:_,hash:A??"",external:z,unmaskOnReload:i.unmaskOnReload}},r=(i={},s)=>{const l=n(i);let c=s?n(s):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=EB(l.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:m,params:g,...y}=h.route,v=g===!1||g===null?Object.create(null):(g??!0)===!0?f:Object.assign(f,xs(g,f));s={from:t.from,...y,params:v},c=n(s)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(h=>{r.state[h]=this.latestLocation.state[h]});const f=Po(r.state,this.latestLocation.state);return c.forEach(h=>{delete r.state[h]}),f},s=Ns(this.latestLocation.href)===Ns(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=_c(()=>{l?.resolve(),l=void 0}),s&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:f,...h}=r;c&&(h={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:s,href:l,...c}={})=>{if(l){const m=this.history.location.state.__TSR_index,g=Wp(l,{__TSR_index:t?m:m+1}),y=new URL(g.pathname,this.origin);c.to=ew(this.rewrite,y).pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...s})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const f=this.buildLocation({to:t,...s});r=r??f.publicHref,i=i??f.publicHref}const c=!l&&i?i:r;if(Hp(c,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...s,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const s=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ro({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...Ro({resolvedLocation:h,location:f})}),await jk({router:this,sync:t?.sync,forceStaleReload:s.href===f.href,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],g=[],y=[],v=[];bd(()=>{this.__store.setState(w=>{const S=w.matches,N=w.pendingMatches||w.matches;return m=S.filter(C=>!N.some(A=>A.id===C.id)),g=S.filter(C=>!N.some(A=>A.routeId===C.routeId)),y=N.filter(C=>!S.some(A=>A.routeId===C.routeId)),v=N.filter(C=>S.some(A=>A.routeId===C.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:N,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...m.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,S])=>{w.forEach(N=>{this.looseRoutesById[N.routeId].options[S]?.(N)})})})})}})}catch(f){ur(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Xn(f)&&(r=f),this.__store.setState(h=>({...h,statusCode:n?n.status:r?404:h.matches.some(m=>m.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,s=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Ro({resolvedLocation:s,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:O8(i.cachedMatches.map(s=>s.id===t?n(s):s))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(s=>s.id===t?n(s):s)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&Hp(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const n=t?.filter;n!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=kd,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),s=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);bd(()=>{r.forEach(l=>{s.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await jk({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(f=>f.id===l?c(f):f):this.updateMatch(l,c)}}),r}catch(l){if(ur(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Xn(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const s=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=TB(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,s.pathname,this.processedTree);return!l||t.params&&!Po(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Po(s.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??XB,parseSearch:e.parseSearch??QB,protocolAllowlist:e.protocolAllowlist??CB}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:s}=n;let{matchedRoutes:l}=n,c=!1;(r?r.path!=="/"&&i["**"]:Ns(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const f=c?M8(this.options.notFoundMode,l):void 0,h=new Array(l.length),m=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<l.length;g++){const y=l[g],v=h[g-1];let w,S,N;{const H=v?.search??e.search,ge=v?._strictSearch??void 0;try{const me=Ep(y.options.validateSearch,{...H})??void 0;w={...H,...me},S={...ge,...me},N=void 0}catch(me){let G=me;if(me instanceof Qp||(G=new Qp(me.message,{cause:me})),t?.throwOnError)throw G;w=H,S={},N=G}}const C=y.options.loaderDeps?.({search:w})??"",A=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:_}=gk({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=y.id+k+A,P=this.getMatch(T),E=m.get(y.id),z=P?._strictParams??_;let D;if(!P)try{kk(y,_,s,z)}catch(H){if(Xn(H)||ur(H)?D=H:D=new A8(H.message,{cause:H}),t?.throwOnError)throw D}Object.assign(i,z);const K=E?"stay":"enter";let U;if(P)U={...P,cause:K,params:E?.params??i,_strictParams:z,search:uo(E?E.search:P.search,w),_strictSearch:S};else{const H=y.options.loader||y.options.beforeLoad||y.lazyFn||yM(y)?"pending":"success";U={id:T,ssr:y.options.ssr,index:g,routeId:y.id,params:E?.params??i,_strictParams:z,pathname:k,updatedAt:Date.now(),search:E?uo(E.search,w):w,_strictSearch:S,searchError:void 0,status:H,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:_c()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:K,loaderDeps:E?jo(E.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(U.globalNotFound=f===y.id),U.searchError=N;const I=this.getParentContext(v);U.context={...I,...U.__routeContext,...U.__beforeLoadContext},h[g]=U}for(let g=0;g<h.length;g++){const y=h[g],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),S=m.get(y.routeId);if(y.params=S?uo(S.params,i):i,!w){const N=h[g-1],C=this.getParentContext(N);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:C??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:h,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=_d(t),s={...e.search};for(const h of t)try{Object.assign(s,Ep(h.options.validateSearch,s))}catch{}const l=_d(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let f;if(c)f=l.params;else{const h=Object.assign(Object.create(null),n);for(const m of t)try{kk(m,n,r??{},h)}catch{}f=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:f}}},Qp=class extends Error{},A8=class extends Error{};function E8(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ep(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Qp("Async validation not supported");if(n.issues)throw new Qp(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function T8({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Ns(e);let s,l;const c=PB(i,n,!0);return c&&(s=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:s,parsedParams:l}}function P8({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return z8(n)(e,t,r??!1)}function z8(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const s=({search:l,next:c})=>{let f=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(f=i.options.preSearchFilters.reduce((m,g)=>g(m),l));const h=c(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((m,g)=>g(m),h):h};t.middlewares.push(s)}if(i.options.validateSearch){const s=({search:l,next:c})=>{const f=c(l);if(!t._includeValidateSearch)return f;try{return{...f,...Ep(i.options.validateSearch,f)??void 0}}catch{return f}};t.middlewares.push(s)}}const n=({search:i})=>{const s=t.dest;return s.search?s.search===!0?i:xs(s.search,i):{}};t.middlewares.push(n);const r=(i,s,l)=>{if(i>=l.length)return s;const c=l[i];return c({search:s,next:h=>r(i+1,h,l)})};return function(s,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,s,t.middlewares)}}function M8(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return zo}function kk(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=i(r);Object.assign(r,s)}}var R8="Error preloading route! ☝️",vM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=zo:this.parentRoute||Es(!1);let i=r?zo:n?.path;i&&i!=="/"&&(i=sM(i));const s=n?.id||i;let l=r?zo:Op([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Op(["/",l]));const c=l==="__root__"?"/":Op([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Ns(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>MS({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},D8=class extends vM{constructor(e){super(e)}};function IS(e){const t=e.errorComponent??$S;return u.jsx(L8,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var L8=class extends x.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function $S({error:e}){const[t,n]=x.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function I8({children:e,fallback:t=null}){return bM()?u.jsx(hi.Fragment,{children:e}):u.jsx(hi.Fragment,{children:t})}function bM(){return hi.useSyncExternalStore($8,()=>!0,()=>!1)}function $8(){return()=>{}}var xM=x.createContext(null);function ei(e){const t=x.useContext(xM);return e?.warn,t}var H0={exports:{}},G0={},V0={exports:{}},Z0={};var Ak;function U8(){if(Ak)return Z0;Ak=1;var e=Uc();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),S=w[0].inst,N=w[1];return s(function(){S.value=v,S.getSnapshot=y,f(S)&&N({inst:S})},[g,v,y]),i(function(){return f(S)&&N({inst:S}),g(function(){f(S)&&N({inst:S})})},[g]),l(v),v}function f(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Z0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Z0}var Ek;function B8(){return Ek||(Ek=1,V0.exports=U8()),V0.exports}var Tk;function q8(){if(Tk)return G0;Tk=1;var e=Uc(),t=B8();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return G0.useSyncExternalStoreWithSelector=function(h,m,g,y,v){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=c(function(){function C(P){if(!A){if(A=!0,k=P,P=y(P),v!==void 0&&S.hasValue){var E=S.value;if(v(E,P))return _=E}return _=P}if(E=_,r(k,P))return E;var z=y(P);return v!==void 0&&v(E,z)?(k=P,E):(k=P,_=z)}var A=!1,k,_,T=g===void 0?null:g;return[function(){return C(m())},T===null?void 0:function(){return C(T())}]},[m,g,y,v]);var N=i(h,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=N},[N]),f(N),N},G0}var Pk;function F8(){return Pk||(Pk=1,H0.exports=q8()),H0.exports}var wM=F8();function K8(e,t){return e===t}function H8(e,t,n=K8){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return wM.useSyncExternalStoreWithSelector(r,i,i,t,n)}function hr(e){const t=ei({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return H8(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=jo(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}var og=x.createContext(void 0),G8=x.createContext(void 0);function Ls(e){const t=x.useContext(e.from?G8:og);return hr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Es(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function US(e){return Ls({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function BS(e){const{select:t,...n}=e;return Ls({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function lg(e){return Ls({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function cg(e){return Ls({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Is(e){const t=ei();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qS(e){return Ls({...e,select:t=>e.select?e.select(t.context):t.context})}var tl=Bz();const V8=Rs(tl);function Z8(e,t){const n=ei(),r=bB(t),{activeProps:i,inactiveProps:s,activeOptions:l,to:c,preload:f,preloadDelay:h,hashScrollIntoView:m,replace:g,startTransition:y,resetScroll:v,viewTransition:w,children:S,target:N,disabled:C,style:A,className:k,onClick:_,onBlur:T,onFocus:P,onMouseEnter:E,onMouseLeave:z,onTouchStart:D,ignoreBlocker:K,params:U,search:I,hash:H,state:ge,mask:me,reloadDocument:G,unsafeRelative:ae,from:pe,_fromLocation:xe,...B}=e,R=bM(),V=hr({select:Ke=>{const at=Ke.matches[Ke.matches.length-1];return{search:at?.search,hash:Ke.location.hash,path:at?.pathname}},structuralSharing:!0}),X=e.from,q=x.useMemo(()=>({...e,from:X}),[n,V,X,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),W=x.useMemo(()=>n.buildLocation({...q}),[n,q]),ie=W.maskedLocation?W.maskedLocation.publicHref:W.publicHref,ye=W.maskedLocation?W.maskedLocation.external:W.external,we=x.useMemo(()=>eq(ie,ye,n.history,C),[C,ye,ie,n.history]),te=x.useMemo(()=>{if(we?.external)return Hp(we.href,n.protocolAllowlist)?void 0:we.href;if(!tq(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Hp(c,n.protocolAllowlist)?void 0:c}catch{}},[c,we,n.protocolAllowlist]),ue=hr({select:Ke=>{if(te)return!1;if(l?.exact){if(!IB(Ke.location.pathname,W.pathname,n.basepath))return!1}else{const at=Vp(Ke.location.pathname,n.basepath),qt=Vp(W.pathname,n.basepath);if(!(at.startsWith(qt)&&(at.length===qt.length||at[qt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Po(Ke.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?R&&Ke.location.hash===W.hash:!0}}),Se=ue?xs(i,{})??Y8:Y0,Z=ue?Y0:xs(s,{})??Y0,Me=[k,Se.className,Z.className].filter(Boolean).join(" "),Ee=(A||Se.style||Z.style)&&{...A,...Se.style,...Z.style},[it,rt]=x.useState(!1),an=x.useRef(!1),fn=e.reloadDocument||te?!1:f??n.options.defaultPreload,Vt=h??n.options.defaultPreloadDelay??0,fe=x.useCallback(()=>{n.preloadRoute({...q,_builtLocation:W}).catch(Ke=>{console.warn(Ke),console.warn(R8)})},[n,q,W]);vB(r,x.useCallback(Ke=>{Ke?.isIntersecting&&fe()},[fe]),J8,{disabled:!!C||fn!=="viewport"}),x.useEffect(()=>{an.current||!C&&fn==="render"&&(fe(),an.current=!0)},[C,fe,fn]);const Je=Ke=>{const at=Ke.currentTarget.getAttribute("target"),qt=N!==void 0?N:at;if(!C&&!nq(Ke)&&!Ke.defaultPrevented&&(!qt||qt==="_self")&&Ke.button===0){Ke.preventDefault(),tl.flushSync(()=>{rt(!0)});const Ye=n.subscribe("onResolved",()=>{Ye(),rt(!1)});n.navigate({...q,replace:g,resetScroll:v,hashScrollIntoView:m,startTransition:y,viewTransition:w,ignoreBlocker:K})}};if(te)return{...B,ref:r,href:te,...S&&{children:S},...N&&{target:N},...C&&{disabled:C},...A&&{style:A},...k&&{className:k},..._&&{onClick:_},...T&&{onBlur:T},...P&&{onFocus:P},...E&&{onMouseEnter:E},...z&&{onMouseLeave:z},...D&&{onTouchStart:D}};const xt=Ke=>{if(C||fn!=="intent")return;if(!Vt){fe();return}const at=Ke.currentTarget;if(Ju.has(at))return;const qt=setTimeout(()=>{Ju.delete(at),fe()},Vt);Ju.set(at,qt)},wn=Ke=>{C||fn!=="intent"||fe()},et=Ke=>{if(C||!fn||!Vt)return;const at=Ke.currentTarget,qt=Ju.get(at);qt&&(clearTimeout(qt),Ju.delete(at))};return{...B,...Se,...Z,href:we?.href,ref:r,onClick:Wl([_,Je]),onBlur:Wl([T,et]),onFocus:Wl([P,xt]),onMouseEnter:Wl([E,xt]),onMouseLeave:Wl([z,et]),onTouchStart:Wl([D,wn]),disabled:!!C,target:N,...Ee&&{style:Ee},...Me&&{className:Me},...C&&W8,...ue&&Q8,...R&&it&&X8}}var Y0={},Y8={className:"active"},W8={role:"link","aria-disabled":!0},Q8={"data-status":"active","aria-current":"page"},X8={"data-transitioning":"transitioning"},Ju=new WeakMap,J8={rootMargin:"100px"},Wl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function eq(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function tq(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Dt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...s}=Z8(r,t),l=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...f}=s;return x.createElement("a",f,l)}return x.createElement(n,s,l)});function nq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var rq=class extends vM{constructor(e){super(e),this.useMatch=t=>Ls({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qS({...t,from:this.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>BS({...t,from:this.id}),this.useLoaderData=t=>US({...t,from:this.id}),this.useNavigate=()=>Is({from:this.fullPath}),this.Link=hi.forwardRef((t,n)=>u.jsx(Dt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ti(e){return new rq(e)}function iq(){return e=>sq(e)}var aq=class extends D8{constructor(e){super(e),this.useMatch=t=>Ls({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qS({...t,from:this.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>BS({...t,from:this.id}),this.useLoaderData=t=>US({...t,from:this.id}),this.useNavigate=()=>Is({from:this.fullPath}),this.Link=hi.forwardRef((t,n)=>u.jsx(Dt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function sq(e){return new aq(e)}function zk(e){return typeof e=="object"?new Mk(e,{silent:!0}).createRoute(e):new Mk(e,{silent:!0}).createRoute}var Mk=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ti(n);return r.isRoot=!1,r},this.silent=t?.silent}},Rk=class{constructor(e){this.useMatch=t=>Ls({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>qS({...t,from:this.options.id}),this.useSearch=t=>cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>lg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>BS({...t,from:this.options.id}),this.useLoaderData=t=>US({...t,from:this.options.id}),this.useNavigate=()=>Is({from:ei().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Dk(e){return typeof e=="object"?new Rk(e):t=>new Rk({id:e,...t})}function oq(e){const t=hr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(IS,{getResetKey:()=>t,onCatch:(n,r)=>{if(Xn(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Xn(n))return e.fallback?.(n);throw n},children:e.children})}function lq(){return u.jsx("p",{children:"Not Found"})}function cc(e){return u.jsx(u.Fragment,{children:e.children})}function SM(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(lq,{})}function cq(){return ei().isScrollRestoring,null}var jM=x.memo(function({matchId:t}){const n=ei(),r=hr({select:w=>{const S=w.matches.findIndex(C=>C.id===t),N=w.matches[S];return Es(N),{routeId:N.routeId,ssr:N.ssr,_displayPending:N._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],s=i.options.pendingComponent??n.options.defaultPendingComponent,l=s?u.jsx(s,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,f=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??s??(i.options.errorComponent?.preload||m))?x.Suspense:cc,y=c?IS:cc,v=h?oq:cc;return u.jsxs(i.isRoot?i.options.shellComponent??cc:cc,{children:[u.jsx(og.Provider,{value:t,children:u.jsx(g,{fallback:l,children:u.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||$S,onCatch:(w,S)=>{if(Xn(w))throw w;f?.(w,S)},children:u.jsx(v,{fallback:w=>{if(!h||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(h,w)},children:m||r._displayPending?u.jsx(I8,{fallback:l,children:u.jsx(Lk,{matchId:t})}):u.jsx(Lk,{matchId:t})})})})}),r.parentRouteId===zo&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(uq,{}),u.jsx(cq,{})]}):null]})});function uq(){const e=ei(),t=x.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ro(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Lk=x.memo(function({matchId:t}){const n=ei(),{match:r,key:i,routeId:s}=hr({select:f=>{const h=f.matches.find(y=>y.id===t),m=h.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[s],c=x.useMemo(()=>{const f=l.options.component??n.options.defaultComponent;return f?u.jsx(f,{},i):u.jsx(FS,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const f=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise){const m=_c();h._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Es(Xn(r.error)),SM(n,l,r.error);if(r.status==="redirected")throw Es(ur(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),FS=x.memo(function(){const t=ei(),n=x.useContext(og),r=hr({select:h=>h.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[r],s=hr({select:h=>{const m=h.matches.find(g=>g.id===n);return Es(m),m.globalNotFound}}),l=hr({select:h=>{const m=h.matches;return m[m.findIndex(g=>g.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(s)return SM(t,i,void 0);if(!l)return null;const f=u.jsx(jM,{matchId:l});return r===zo?u.jsx(x.Suspense,{fallback:c,children:f}):f});function dq(){const e=ei(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:s}=hr({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),l=$0(s),c=s||n||i,f=$0(c),h=s||i,m=$0(h);return e.startTransition=g=>{r(!0),x.startTransition(()=>{g(),r(!1)})},x.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ns(e.latestLocation.publicHref)!==Ns(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),Fh(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Fh(()=>{l&&!s&&e.emit({type:"onLoad",...Ro(e.state)})},[l,e,s]),Fh(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...Ro(e.state)})},[h,m,e]),Fh(()=>{if(f&&!c){const g=Ro(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&ZB(e)}},[c,f,e]),null}function fq(){const e=ei(),t=e.routesById[zo].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?cc:x.Suspense,{fallback:n,children:[u.jsx(dq,{}),u.jsx(hq,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function hq(){const e=ei(),t=hr({select:i=>i.matches[0]?.id}),n=hr({select:i=>i.loadedAt}),r=t?u.jsx(jM,{matchId:t}):null;return u.jsx(og.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(IS,{getResetKey:()=>n,errorComponent:$S,onCatch:void 0,children:r})})}var pq=e=>new mq(e),mq=class extends k8{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=zk,globalThis.createLazyFileRoute=Dk):typeof window<"u"&&(window.createFileRoute=zk,window.createLazyFileRoute=Dk);function gq({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=u.jsx(xM.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function yq({router:e,...t}){return u.jsx(gq,{router:e,...t,children:u.jsx(fq,{})})}function vq(e){return hr({select:t=>t.location})}class Xp extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function bq(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const xq=bq();function wq(){return""}function Ik(){return!!wq()}async function je(e,t){const n=await fetch(`${xq}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,s;if(r)try{const l=JSON.parse(r);typeof l.error=="string"?i=l.error:l.error?.message?(i=l.error.message,s=l.error.code):l.message&&(i=l.message)}catch{i=r}throw new Xp(i,n.status,s)}if(n.status!==204)return n.json()}function NM(){return je("/projects")}function CM(e){return je(`/projects/${encodeURIComponent(e)}`)}function _M(){return je("/runs")}function Oc(e){return je(`/runs/${encodeURIComponent(e)}`)}function Sq(e){return je(`/projects/${encodeURIComponent(e)}/keywords`)}function OM(e){return je(`/projects/${encodeURIComponent(e)}/competitors`)}function kM(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return je(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function ug(e,t){return je(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function jq(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Nq(e,t){return je(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function AM(e,t){return je(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function $k(e,t){const n=await CM(e);return ug(e,{displayName:n.displayName,canonicalDomain:n.canonicalDomain,ownedDomains:t,country:n.country,language:n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:n.locations,defaultLocation:n.defaultLocation})}async function Cq(e,t){const n=await CM(e);return ug(e,{displayName:t.displayName??n.displayName,canonicalDomain:t.canonicalDomain??n.canonicalDomain,ownedDomains:t.ownedDomains??n.ownedDomains,country:t.country??n.country,language:t.language??n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:t.locations??n.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:n.defaultLocation})}function _q(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),je(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function Oq(e,t){return je(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function kq(e,t){await je(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Aq(e,t){return je(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Eq(e){await je(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Tq(e){return je(`/projects/${encodeURIComponent(e)}/export`)}function KS(){return je("/settings")}function Pq(){return je("/session")}function zq(e){return je("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function Mq(e){return je("/session",{method:"POST",body:JSON.stringify({password:e})})}function Rq(e,t){return je(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Dq(e){return je("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Lq(e){try{return await je(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Uk(e,t){return je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Iq(e){await je(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function $q(e){return je(`/projects/${encodeURIComponent(e)}/notifications`)}function Uq(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Bq(e,t){await je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function qq(e,t){return je(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Fq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function Kq(e){return je("/apply",{method:"POST",body:JSON.stringify(e)})}function Hq(e){return je("/runs",{method:"POST",body:JSON.stringify(e??{})})}function EM(e){return je(`/projects/${encodeURIComponent(e)}/google/connections`)}function Gq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Vq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Zq(e){return je(`/projects/${encodeURIComponent(e)}/google/properties`)}function Yq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function Wq(e,t,n){return je(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function TM(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Qq(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function Xq(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Jq(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function e9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function HS(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function t9(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function n9(e,t){return je(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function r9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function i9(e){return je(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Bk(){return je("/cdp/status")}function a9(e,t){return je("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function qk(e,t){return je(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function PM(e){return je(`/projects/${encodeURIComponent(e)}/bing/status`)}function s9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function o9(e){return je(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function l9(e){return je(`/projects/${encodeURIComponent(e)}/bing/sites`)}function c9(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function GS(e){return je(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function zM(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return je(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function MM(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Fk(e,t){return je(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function u9(e){return je(`/projects/${encodeURIComponent(e)}/bing/performance`)}function d9(e){return je("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function f9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function h9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function p9(e,t){const n=t?`?window=${t}`:"";return je(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function Kk(e){return je(`/projects/${encodeURIComponent(e)}/ga/status`)}function Hk(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function RM(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function m9(e,t){return je(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function Gk(e){return je(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history`)}function g9(e){return je(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function y9(e,t){try{const n=await fetch(e);if(!n.ok)return{label:t,state:"error",detail:`HTTP ${n.status}`};const r=await n.json(),i=typeof r.version=="string"?r.version:"unknown",s=typeof r.databaseUrlConfigured=="boolean"?r.databaseUrlConfigured:void 0,l=typeof r.lastHeartbeatAt=="string"?r.lastHeartbeatAt:void 0,c=[i,s===!1?"database not configured":"database configured",l?`heartbeat ${l}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:c,version:i,databaseConfigured:s,lastHeartbeatAt:l}}catch(n){return{label:t,state:"error",detail:n instanceof Error?n.message:"unreachable"}}}const v9=6e3,b9=5,x9=180;let Fn=[],w9=0;const iw=new Set,aw=new Map,sw=new Map;function Jp(){const e=[...Fn];for(const t of iw)t(e)}function VS(e){const t=aw.get(e);t&&(clearTimeout(t),aw.delete(e));const n=sw.get(e);n&&(clearTimeout(n),sw.delete(e))}function DM(e){VS(e);const t=Fn.length;Fn=Fn.filter(n=>n.id!==e),Fn.length!==t&&Jp()}function Vk(e){VS(e.id),aw.set(e.id,setTimeout(()=>{ow(e.id)},e.durationMs))}function S9(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function Xe(e,t="negative",n=v9){const r=S9(e,t,n),i={id:String(++w9),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const s=Fn.find(l=>l.dedupeKey===r.dedupeKey);if(s){if((r.dedupeMode??"drop")==="drop")return s.id;const l={...s,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Fn=Fn.map(c=>c.id===s.id?l:c),Jp(),Vk(l),s.id}}return Fn.length>=b9&&DM(Fn[0].id),Fn=[...Fn,i],Jp(),Vk(i),i.id}function ow(e){const t=Fn.find(n=>n.id===e);!t||t.state==="closing"||(VS(e),Fn=Fn.map(n=>n.id===e?{...n,state:"closing"}:n),Jp(),sw.set(e,setTimeout(()=>{DM(e)},x9)))}function j9(e){return iw.add(e),()=>{iw.delete(e)}}function Zk(){return Fn}function N9(){return new dB({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Yz({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||Xe({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const C9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Yk=e=>{const t=_9(e);return t.charAt(0).toUpperCase()+t.slice(1)},LM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),O9=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var k9={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 A9=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>x.createElement("svg",{ref:f,...k9,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:LM("lucide",i),...!s&&!O9(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,m])=>x.createElement(h,m)),...Array.isArray(s)?s:[s]]));const Ln=(e,t)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(A9,{ref:s,iconNode:t,className:LM(`lucide-${C9(Yk(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Yk(e),n};const E9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dg=Ln("chevron-right",E9);const T9=[["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"}]],P9=Ln("download",T9);const z9=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],M9=Ln("github",z9);const R9=[["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"}]],D9=Ln("globe",R9);const L9=[["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"}]],I9=Ln("layout-dashboard",L9);const $9=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],U9=Ln("menu",$9);const B9=[["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"}]],q9=Ln("play",B9);const F9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wk=Ln("plus",F9);const K9=[["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"}]],Qk=Ln("refresh-cw",K9);const H9=[["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"}]],G9=Ln("rocket",H9);const V9=[["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"}]],Z9=Ln("rotate-ccw",V9);const Y9=[["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"}]],W9=Ln("settings",Y9);const Q9=[["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"}]],X9=Ln("trash-2",Q9);const J9=[["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"}]],eF=Ln("triangle-alert",J9);const tF=[["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"}]],nF=Ln("unplug",tF);const rF=[["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"}]],iF=Ln("upload",rF);const aF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fg=Ln("x",aF);function sF(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const s=r.slice(0,i).trim(),l=r.slice(i);try{const c=JSON.parse(l);return`${n} ${s}
10
+
11
+ ${JSON.stringify(c,null,2)}`}catch{}}return`${n}
12
+ ${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function hg(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function fi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Xk(e){return e===null?"Unknown":e?"Pass":"Fail"}function lw(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function oF(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function lF(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:"daily",hour:n[1]?parseInt(n[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function W0(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${lw(l)} · ${r}`}const s=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(s){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=s[2]?parseInt(s[2]):6;return`Every ${l[s[1]]} at ${lw(c)} · ${r}`}return`${e} · ${r}`}const IM="canonry.run-tracker",cw=new Set;let Jk=!1,cF=0,pg={runs:{},batches:{}};function uF(){const e=Fo();for(const t of cw)t(e)}function dF(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function fF(){typeof window>"u"||window.sessionStorage.setItem(IM,JSON.stringify(pg))}function $M(){Jk||(Jk=!0,!(typeof window>"u")&&(pg=dF(window.sessionStorage.getItem(IM))))}function mg(e){pg=e,fF(),uF()}function Fo(){return $M(),pg}function hF(e){return $M(),cw.add(e),()=>{cw.delete(e)}}function UM(e){const t=Fo();mg({...t,runs:{...t.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function eA(e){const t=Fo();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;mg({...t,runs:r})}function pF(e){const t=Fo(),n=`batch_${Date.now()}_${++cF}`;return mg({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function mF(e){const t=Fo();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;mg({...t,batches:r})}function gF(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function yF(e,t){let n=0,r=0,i=0,s=0,l=0;for(const c of e){const f=t[c]?.status;f==="completed"?n+=1:f==="partial"?r+=1:f==="failed"?i+=1:f==="cancelled"?s+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:s,pending:l,finished:l===0}}function tA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ZS(...e){return t=>{let n=!1;const r=e.map(i=>{const s=tA(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():tA(e[i],null)}}}}function nl(...e){return x.useCallback(ZS(...e),e)}var vF=Symbol.for("react.lazy"),em=rg[" use ".trim().toString()];function bF(e){return typeof e=="object"&&e!==null&&"then"in e}function BM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vF&&"_payload"in e&&bF(e._payload)}function xF(e){const t=SF(e),n=x.forwardRef((r,i)=>{let{children:s,...l}=r;BM(s)&&typeof em=="function"&&(s=em(s._payload));const c=x.Children.toArray(s),f=c.find(NF);if(f){const h=f.props.children,m=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,m):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var wF=xF("Slot");function SF(e){const t=x.forwardRef((n,r)=>{let{children:i,...s}=n;if(BM(i)&&typeof em=="function"&&(i=em(i._payload)),x.isValidElement(i)){const l=_F(i),c=CF(s,i.props);return i.type!==x.Fragment&&(c.ref=r?ZS(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jF=Symbol("radix.slottable");function NF(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jF}function CF(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function _F(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function qM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=qM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qM(e))&&(r&&(r+=" "),r+=t);return r}const nA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rA=bt,FM=(e,t)=>n=>{var r;if(t?.variants==null)return rA(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,l=Object.keys(i).map(h=>{const m=n?.[h],g=s?.[h];if(m===null)return null;const y=nA(m)||nA(g);return i[h][y]}),c=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:g,className:y,...v}=m;return Object.entries(v).every(w=>{let[S,N]=w;return Array.isArray(N)?N.includes({...s,...c}[S]):{...s,...c}[S]===N})?[...h,g,y]:h},[]);return rA(e,l,f,n?.class,n?.className)},OF=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kF=(e,t)=>({classGroupId:e,validator:t}),KM=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tm="-",iA=[],AF="arbitrary..",EF=e=>{const t=PF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return TF(l);const c=l.split(tm),f=c[0]===""&&c.length>1?1:0;return HM(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],h=n[l];return f?h?OF(h,f):f:h||iA}return n[l]||iA}}},HM=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const h=HM(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(tm):e.slice(t).join(tm),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},TF=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?AF+r:void 0})(),PF=e=>{const{theme:t,classGroups:n}=e;return zF(n,t)},zF=(e,t)=>{const n=KM();for(const r in e){const i=e[r];YS(i,n,r,t)}return n},YS=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];MF(l,t,n,r)}},MF=(e,t,n,r)=>{if(typeof e=="string"){RF(e,t,n);return}if(typeof e=="function"){DF(e,t,n,r);return}LF(e,t,n,r)},RF=(e,t,n)=>{const r=e===""?t:GM(t,e);r.classGroupId=n},DF=(e,t,n,r)=>{if(IF(e)){YS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kF(n,e))},LF=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[c,f]=i[l];YS(f,GM(t,c),n,r)}},GM=(e,t)=>{let n=e;const r=t.split(tm),i=r.length;for(let s=0;s<i;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=KM(),n.nextPart.set(l,c)),n=c}return n},IF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},uw="!",aA=":",UF=[],sA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),BF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let l=0,c=0,f=0,h;const m=i.length;for(let S=0;S<m;S++){const N=i[S];if(l===0&&c===0){if(N===aA){s.push(i.slice(f,S)),f=S+1;continue}if(N==="/"){h=S;continue}}N==="["?l++:N==="]"?l--:N==="("?c++:N===")"&&c--}const g=s.length===0?i:i.slice(f);let y=g,v=!1;g.endsWith(uw)?(y=g.slice(0,-1),v=!0):g.startsWith(uw)&&(y=g.slice(1),v=!0);const w=h&&h>f?h-f:void 0;return sA(s,v,y,w)};if(t){const i=t+aA,s=r;r=l=>l.startsWith(i)?s(l.slice(i.length)):sA(UF,!1,l,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},qF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",f=t.has(l);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},FF=e=>({cache:$F(e.cacheSize),parseClassName:BF(e),sortModifiers:qF(e),...EF(e)}),KF=/\s+/,HF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,l=[],c=e.trim().split(KF);let f="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:g,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let N=!!S,C=r(N?w.substring(0,S):w);if(!C){if(!N){f=m+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=m+(f.length>0?" "+f:f);continue}N=!1}const A=y.length===0?"":y.length===1?y[0]:s(y).join(":"),k=v?A+uw:A,_=k+C;if(l.indexOf(_)>-1)continue;l.push(_);const T=i(C,N);for(let P=0;P<T.length;++P){const E=T[P];l.push(k+E)}f=m+(f.length>0?" "+f:f)}return f},GF=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=VM(n))&&(i&&(i+=" "),i+=r);return i},VM=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=VM(e[r]))&&(n&&(n+=" "),n+=t);return n},VF=(e,...t)=>{let n,r,i,s;const l=f=>{const h=t.reduce((m,g)=>g(m),e());return n=FF(h),r=n.cache.get,i=n.cache.set,s=c,c(f)},c=f=>{const h=r(f);if(h)return h;const m=HF(f,n);return i(f,m),m};return s=l,(...f)=>s(GF(...f))},ZF=[],mn=e=>{const t=n=>n[e]||ZF;return t.isThemeGetter=!0,t},ZM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YF=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QF=/\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$/,XF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,us=e=>YF.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),ds=e=>!!e&&Number.isInteger(Number(e)),Q0=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),ya=e=>WF.test(e),WM=()=>!0,tK=e=>QF.test(e)&&!XF.test(e),WS=()=>!1,nK=e=>JF.test(e),rK=e=>eK.test(e),iK=e=>!ke(e)&&!Ae(e),aK=e=>$s(e,JM,WS),ke=e=>ZM.test(e),ho=e=>$s(e,eR,tK),oA=e=>$s(e,hK,Ge),sK=e=>$s(e,nR,WM),oK=e=>$s(e,tR,WS),lA=e=>$s(e,QM,WS),lK=e=>$s(e,XM,rK),Gh=e=>$s(e,rR,nK),Ae=e=>YM.test(e),ed=e=>rl(e,eR),cK=e=>rl(e,tR),cA=e=>rl(e,QM),uK=e=>rl(e,JM),dK=e=>rl(e,XM),Vh=e=>rl(e,rR,!0),fK=e=>rl(e,nR,!0),$s=(e,t,n)=>{const r=ZM.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rl=(e,t,n=!1)=>{const r=YM.exec(e);return r?r[1]?t(r[1]):n:!1},QM=e=>e==="position"||e==="percentage",XM=e=>e==="image"||e==="url",JM=e=>e==="length"||e==="size"||e==="bg-size",eR=e=>e==="length",hK=e=>e==="number",tR=e=>e==="family-name",nR=e=>e==="number"||e==="weight",rR=e=>e==="shadow",pK=()=>{const e=mn("color"),t=mn("font"),n=mn("text"),r=mn("font-weight"),i=mn("tracking"),s=mn("leading"),l=mn("breakpoint"),c=mn("container"),f=mn("spacing"),h=mn("radius"),m=mn("shadow"),g=mn("inset-shadow"),y=mn("text-shadow"),v=mn("drop-shadow"),w=mn("blur"),S=mn("perspective"),N=mn("aspect"),C=mn("ease"),A=mn("animate"),k=()=>["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"],T=()=>[..._(),Ae,ke],P=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],z=()=>[Ae,ke,f],D=()=>[us,"full","auto",...z()],K=()=>[ds,"none","subgrid",Ae,ke],U=()=>["auto",{span:["full",ds,Ae,ke]},ds,Ae,ke],I=()=>[ds,"auto",Ae,ke],H=()=>["auto","min","max","fr",Ae,ke],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...z()],ae=()=>[us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],pe=()=>[us,"screen","full","dvw","lvw","svw","min","max","fit",...z()],xe=()=>[us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],B=()=>[e,Ae,ke],R=()=>[..._(),cA,lA,{position:[Ae,ke]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",uK,aK,{size:[Ae,ke]}],q=()=>[Q0,ed,ho],W=()=>["","none","full",h,Ae,ke],ie=()=>["",Ge,ed,ho],ye=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Ge,Q0,cA,lA],ue=()=>["","none",w,Ae,ke],Se=()=>["none",Ge,Ae,ke],Z=()=>["none",Ge,Ae,ke],Me=()=>[Ge,Ae,ke],Ee=()=>[us,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ya],breakpoint:[ya],color:[WM],container:[ya],"drop-shadow":[ya],ease:["in","out","in-out"],font:[iK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ya],shadow:[ya],spacing:["px",Ge],text:[ya],"text-shadow":[ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",us,ke,Ae,N]}],container:["container"],columns:[{columns:[Ge,ke,Ae,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:T()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],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:[ds,"auto",Ae,ke]}],basis:[{basis:[us,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,us,"auto","initial","none",ke]}],grow:[{grow:["",Ge,Ae,ke]}],shrink:[{shrink:["",Ge,Ae,ke]}],order:[{order:[ds,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...xe()]}],"min-block-size":[{"min-block":["auto",...xe()]}],"max-block-size":[{"max-block":["none",...xe()]}],w:[{w:[c,"screen",...ae()]}],"min-w":[{"min-w":[c,"screen","none",...ae()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,ed,ho]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,fK,sK]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Q0,ke]}],"font-family":[{font:[cK,oK,t]}],"font-features":[{"font-features":[ke]}],"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:[i,Ae,ke]}],"line-clamp":[{"line-clamp":[Ge,"none",Ae,oA]}],leading:[{leading:[s,...z()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ae,ho]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],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",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ds,Ae,ke],radial:["",Ae,ke],conic:[ds,Ae,ke]},dK,lK]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ae,ke]}],"outline-w":[{outline:["",Ge,ed,ho]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",m,Vh,Gh]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",g,Vh,Gh]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ge,ho]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",y,Vh,Gh]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ge,Ae,ke]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:ue()}],brightness:[{brightness:[Ge,Ae,ke]}],contrast:[{contrast:[Ge,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Vh,Gh]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ge,Ae,ke]}],"hue-rotate":[{"hue-rotate":[Ge,Ae,ke]}],invert:[{invert:["",Ge,Ae,ke]}],saturate:[{saturate:[Ge,Ae,ke]}],sepia:[{sepia:["",Ge,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ae,ke]}],ease:[{ease:["linear","initial",C,Ae,ke]}],delay:[{delay:[Ge,Ae,ke]}],animate:[{animate:["none",A,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ae,ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",Ae,ke]}],"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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Ae,ke]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ge,ed,ho,oA]}],stroke:[{stroke:["none",...B()]}],"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"]}},mK=VF(pK);function ni(...e){return mK(bt(e))}const gK=FM("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-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),he=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const l=r?wF:"button";return u.jsx(l,{ref:s,className:ni(gK({variant:t,size:n,className:e})),...i})});he.displayName="Button";const yK=FM("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function iR({className:e,variant:t,...n}){return u.jsx("div",{className:ni(yK({variant:t}),e),...n})}function uA({compact:e=!1}){return u.jsxs(Dt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[u.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),u.jsxs("span",{className:"brand-copy",children:[u.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:u.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Ad({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return u.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function nm(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function aR(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function vK(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function bK(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function yt({tone:e,children:t}){const n=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(iR,{variant:n,children:t})}function gg({status:e}){return u.jsx(yt,{tone:aR(e),children:hg(e)})}function _s(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function xK(e,t){const n=x.createContext(t),r=s=>{const{children:l,...c}=s,f=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(s){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function wK(e,t=[]){let n=[];function r(s,l){const c=x.createContext(l),f=n.length;n=[...n,l];const h=g=>{const{scope:y,children:v,...w}=g,S=y?.[e]?.[f]||c,N=x.useMemo(()=>w,Object.values(w));return u.jsx(S.Provider,{value:N,children:v})};h.displayName=s+"Provider";function m(g,y){const v=y?.[e]?.[f]||c,w=x.useContext(v);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}const i=()=>{const s=n.map(l=>x.createContext(l));return function(c){const f=c?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[r,SK(i,...t)]}function SK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const l=r.reduce((c,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...c,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ed=globalThis?.document?x.useLayoutEffect:()=>{},jK=rg[" useId ".trim().toString()]||(()=>{}),NK=0;function X0(e){const[t,n]=x.useState(jK());return Ed(()=>{n(r=>r??String(NK++))},[e]),e||(t?`radix-${t}`:"")}var CK=rg[" useInsertionEffect ".trim().toString()]||Ed;function _K({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,l]=OK({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:i;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const g=m.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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.`),m.current=c},[c,r])}const h=x.useCallback(m=>{if(c){const g=kK(m)?m(e):m;g!==e&&l.current?.(g)}else s(m)},[c,e,s,l]);return[f,h]}function OK({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return CK(()=>{s.current=t},[t]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function kK(e){return typeof e=="function"}function sR(e){const t=AK(e),n=x.forwardRef((r,i)=>{const{children:s,...l}=r,c=x.Children.toArray(s),f=c.find(TK);if(f){const h=f.props.children,m=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,m):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function AK(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const l=zK(i),c=PK(s,i.props);return i.type!==x.Fragment&&(c.ref=r?ZS(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EK=Symbol("radix.slottable");function TK(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EK}function PK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function zK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ea=MK.reduce((e,t)=>{const n=sR(`Primitive.${t}`),r=x.forwardRef((i,s)=>{const{asChild:l,...c}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function RK(e,t){e&&tl.flushSync(()=>e.dispatchEvent(t))}function Td(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function DK(e,t=globalThis?.document){const n=Td(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var LK="DismissableLayer",dw="dismissableLayer.update",IK="dismissableLayer.pointerDownOutside",$K="dismissableLayer.focusOutside",dA,oR=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lR=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...f}=e,h=x.useContext(oR),[m,g]=x.useState(null),y=m?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=nl(t,E=>g(E)),S=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(N),A=m?S.indexOf(m):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,_=A>=C,T=qK(E=>{const z=E.target,D=[...h.branches].some(K=>K.contains(z));!_||D||(i?.(E),l?.(E),E.defaultPrevented||c?.())},y),P=FK(E=>{const z=E.target;[...h.branches].some(K=>K.contains(z))||(s?.(E),l?.(E),E.defaultPrevented||c?.())},y);return DK(E=>{A===h.layers.size-1&&(r?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},y),x.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(dA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),fA(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=dA)}},[m,y,n,h]),x.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),fA())},[m,h]),x.useEffect(()=>{const E=()=>v({});return document.addEventListener(dw,E),()=>document.removeEventListener(dw,E)},[]),u.jsx(Ea.div,{...f,ref:w,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:_s(e.onFocusCapture,P.onFocusCapture),onBlurCapture:_s(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:_s(e.onPointerDownCapture,T.onPointerDownCapture)})});lR.displayName=LK;var UK="DismissableLayerBranch",BK=x.forwardRef((e,t)=>{const n=x.useContext(oR),r=x.useRef(null),i=nl(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Ea.div,{...e,ref:i})});BK.displayName=UK;function qK(e,t=globalThis?.document){const n=Td(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){cR(IK,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function FK(e,t=globalThis?.document){const n=Td(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&cR($K,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fA(){const e=new CustomEvent(dw);document.dispatchEvent(e)}function cR(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?RK(i,s):i.dispatchEvent(s)}var J0="focusScope.autoFocusOnMount",eb="focusScope.autoFocusOnUnmount",hA={bubbles:!1,cancelable:!0},KK="FocusScope",uR=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,f]=x.useState(null),h=Td(i),m=Td(s),g=x.useRef(null),y=nl(t,S=>f(S)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(k){if(v.paused||!c)return;const _=k.target;c.contains(_)?g.current=_:ps(g.current,{select:!0})},N=function(k){if(v.paused||!c)return;const _=k.relatedTarget;_!==null&&(c.contains(_)||ps(g.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&ps(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const A=new MutationObserver(C);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),A.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){mA.add(v);const S=document.activeElement;if(!c.contains(S)){const C=new CustomEvent(J0,hA);c.addEventListener(J0,h),c.dispatchEvent(C),C.defaultPrevented||(HK(WK(dR(c)),{select:!0}),document.activeElement===S&&ps(c))}return()=>{c.removeEventListener(J0,h),setTimeout(()=>{const C=new CustomEvent(eb,hA);c.addEventListener(eb,m),c.dispatchEvent(C),C.defaultPrevented||ps(S??document.body,{select:!0}),c.removeEventListener(eb,m),mA.remove(v)},0)}}},[c,h,m,v]);const w=x.useCallback(S=>{if(!n&&!r||v.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(N&&C){const A=S.currentTarget,[k,_]=GK(A);k&&_?!S.shiftKey&&C===_?(S.preventDefault(),n&&ps(k,{select:!0})):S.shiftKey&&C===k&&(S.preventDefault(),n&&ps(_,{select:!0})):C===A&&S.preventDefault()}},[n,r,v.paused]);return u.jsx(Ea.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});uR.displayName=KK;function HK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function GK(e){const t=dR(e),n=pA(t,e),r=pA(t.reverse(),e);return[n,r]}function dR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pA(e,t){for(const n of e)if(!VK(n,{upTo:t}))return n}function VK(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 ZK(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZK(e)&&t&&e.select()}}var mA=YK();function YK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=gA(e,t),e.unshift(t)},remove(t){e=gA(e,t),e[0]?.resume()}}}function gA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WK(e){return e.filter(t=>t.tagName!=="A")}var QK="Portal",fR=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=x.useState(!1);Ed(()=>s(!0),[]);const l=n||i&&globalThis?.document?.body;return l?V8.createPortal(u.jsx(Ea.div,{...r,ref:t}),l):null});fR.displayName=QK;function XK(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var yg=e=>{const{present:t,children:n}=e,r=JK(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=nl(r.ref,eH(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};yg.displayName="Presence";function JK(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),l=e?"mounted":"unmounted",[c,f]=XK(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Zh(r.current);s.current=c==="mounted"?h:"none"},[c]),Ed(()=>{const h=r.current,m=i.current;if(m!==e){const y=s.current,v=Zh(h);e?f("MOUNT"):v==="none"||h?.display==="none"?f("UNMOUNT"):f(m&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Ed(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=v=>{const S=Zh(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},y=v=>{v.target===t&&(s.current=Zh(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Zh(e){return e?.animationName||"none"}function eH(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tb=0;function tH(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yA()),document.body.insertAdjacentElement("beforeend",e[1]??yA()),tb++,()=>{tb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),tb--}},[])}function yA(){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 Li=function(){return Li=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Li.apply(this,arguments)};function hR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function nH(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Tp="right-scroll-bar-position",Pp="width-before-scroll-bar",rH="with-scroll-bars-hidden",iH="--removed-body-scroll-bar-size";function nb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aH(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var sH=typeof window<"u"?x.useLayoutEffect:x.useEffect,vA=new WeakMap;function oH(e,t){var n=aH(null,function(r){return e.forEach(function(i){return nb(i,r)})});return sH(function(){var r=vA.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(c){s.has(c)||nb(c,null)}),s.forEach(function(c){i.has(c)||nb(c,l)})}vA.set(n,e)},[e]),n}function lH(e){return e}function cH(e,t){t===void 0&&(t=lH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var f=function(){var m=l;l=[],m.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return i}function uH(e){e===void 0&&(e={});var t=cH(null);return t.options=Li({async:!0,ssr:!1},e),t}var pR=function(e){var t=e.sideCar,n=hR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Li({},n))};pR.isSideCarExport=!0;function dH(e,t){return e.useMedium(t),pR}var mR=uH(),rb=function(){},vg=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:rb,onWheelCapture:rb,onTouchMoveCapture:rb}),i=r[0],s=r[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,S=e.inert,N=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,k=e.gapMode,_=hR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=y,P=oH([n,t]),E=Li(Li({},_),i);return x.createElement(x.Fragment,null,m&&x.createElement(T,{sideCar:mR,removeScrollBar:h,shards:g,noRelative:v,noIsolation:w,inert:S,setCallbacks:s,allowPinchZoom:!!N,lockRef:n,gapMode:k}),l?x.cloneElement(x.Children.only(c),Li(Li({},E),{ref:P})):x.createElement(A,Li({},E,{className:f,ref:P}),c))});vg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vg.classNames={fullWidth:Pp,zeroRight:Tp};var fH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fH();return t&&e.setAttribute("nonce",t),e}function pH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hH())&&(pH(t,n),mH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yH=function(){var e=gH();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gR=function(){var e=yH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},vH={left:0,top:0,right:0,gap:0},ib=function(e){return parseInt(e||"",10)||0},bH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ib(n),ib(r),ib(i)]},xH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vH;var t=bH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wH=gR(),bc="data-scroll-locked",SH=function(e,t,n,r){var i=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
13
+ .`.concat(rH,` {
14
+ overflow: hidden `).concat(r,`;
15
+ padding-right: `).concat(c,"px ").concat(r,`;
16
+ }
17
+ body[`).concat(bc,`] {
18
+ overflow: hidden `).concat(r,`;
19
+ overscroll-behavior: contain;
20
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
21
+ padding-left: `.concat(i,`px;
22
+ padding-top: `).concat(s,`px;
23
+ padding-right: `).concat(l,`px;
24
+ margin-left:0;
25
+ margin-top:0;
26
+ margin-right: `).concat(c,"px ").concat(r,`;
27
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
28
+ }
29
+
30
+ .`).concat(Tp,` {
31
+ right: `).concat(c,"px ").concat(r,`;
32
+ }
33
+
34
+ .`).concat(Pp,` {
35
+ margin-right: `).concat(c,"px ").concat(r,`;
36
+ }
37
+
38
+ .`).concat(Tp," .").concat(Tp,` {
39
+ right: 0 `).concat(r,`;
40
+ }
41
+
42
+ .`).concat(Pp," .").concat(Pp,` {
43
+ margin-right: 0 `).concat(r,`;
44
+ }
45
+
46
+ body[`).concat(bc,`] {
47
+ `).concat(iH,": ").concat(c,`px;
48
+ }
49
+ `)},bA=function(){var e=parseInt(document.body.getAttribute(bc)||"0",10);return isFinite(e)?e:0},jH=function(){x.useEffect(function(){return document.body.setAttribute(bc,(bA()+1).toString()),function(){var e=bA()-1;e<=0?document.body.removeAttribute(bc):document.body.setAttribute(bc,e.toString())}},[])},NH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;jH();var s=x.useMemo(function(){return xH(i)},[i]);return x.createElement(wH,{styles:SH(s,!t,i,n?"":"!important")})},fw=!1;if(typeof window<"u")try{var Yh=Object.defineProperty({},"passive",{get:function(){return fw=!0,!0}});window.addEventListener("test",Yh,Yh),window.removeEventListener("test",Yh,Yh)}catch{fw=!1}var Ql=fw?{passive:!1}:!1,CH=function(e){return e.tagName==="TEXTAREA"},yR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CH(e)&&n[t]==="visible")},_H=function(e){return yR(e,"overflowY")},OH=function(e){return yR(e,"overflowX")},xA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=vR(e,r);if(i){var s=bR(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},AH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},vR=function(e,t){return e==="v"?_H(t):OH(t)},bR=function(e,t){return e==="v"?kH(t):AH(t)},EH=function(e,t){return e==="h"&&t==="rtl"?-1:1},TH=function(e,t,n,r,i){var s=EH(e,window.getComputedStyle(t).direction),l=s*r,c=n.target,f=t.contains(c),h=!1,m=l>0,g=0,y=0;do{if(!c)break;var v=bR(e,c),w=v[0],S=v[1],N=v[2],C=S-N-s*w;(w||C)&&vR(e,c)&&(g+=C,y+=w);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Wh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wA=function(e){return[e.deltaX,e.deltaY]},SA=function(e){return e&&"current"in e?e.current:e},PH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zH=function(e){return`
50
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
51
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
+ `)},MH=0,Xl=[];function RH(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(MH++)[0],s=x.useState(gR)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=nH([e.lockRef.current],(e.shards||[]).map(SA),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var C=Wh(S),A=n.current,k="deltaX"in S?S.deltaX:A[0]-C[0],_="deltaY"in S?S.deltaY:A[1]-C[1],T,P=S.target,E=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in S&&E==="h"&&P.type==="range")return!1;var z=window.getSelection(),D=z&&z.anchorNode,K=D?D===P||D.contains(P):!1;if(K)return!1;var U=xA(E,P);if(!U)return!0;if(U?T=E:(T=E==="v"?"h":"v",U=xA(E,P)),!U)return!1;if(!r.current&&"changedTouches"in S&&(k||_)&&(r.current=T),!T)return!0;var I=r.current||T;return TH(I,N,S,I==="h"?k:_)},[]),f=x.useCallback(function(S){var N=S;if(!(!Xl.length||Xl[Xl.length-1]!==s)){var C="deltaY"in N?wA(N):Wh(N),A=t.current.filter(function(T){return T.name===N.type&&(T.target===N.target||N.target===T.shadowParent)&&PH(T.delta,C)})[0];if(A&&A.should){N.cancelable&&N.preventDefault();return}if(!A){var k=(l.current.shards||[]).map(SA).filter(Boolean).filter(function(T){return T.contains(N.target)}),_=k.length>0?c(N,k[0]):!l.current.noIsolation;_&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(S,N,C,A){var k={name:S,delta:N,target:C,should:A,shadowParent:DH(C)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),m=x.useCallback(function(S){n.current=Wh(S),r.current=void 0},[]),g=x.useCallback(function(S){h(S.type,wA(S),S.target,c(S,e.lockRef.current))},[]),y=x.useCallback(function(S){h(S.type,Wh(S),S.target,c(S,e.lockRef.current))},[]);x.useEffect(function(){return Xl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Ql),document.addEventListener("touchmove",f,Ql),document.addEventListener("touchstart",m,Ql),function(){Xl=Xl.filter(function(S){return S!==s}),document.removeEventListener("wheel",f,Ql),document.removeEventListener("touchmove",f,Ql),document.removeEventListener("touchstart",m,Ql)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(s,{styles:zH(i)}):null,v?x.createElement(NH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LH=dH(mR,RH);var xR=x.forwardRef(function(e,t){return x.createElement(vg,Li({},e,{ref:t,sideCar:LH}))});xR.classNames=vg.classNames;var IH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jl=new WeakMap,Qh=new WeakMap,Xh={},ab=0,wR=function(e){return e&&(e.host||wR(e.parentNode))},$H=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wR(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},UH=function(e,t,n,r){var i=$H(t,Array.isArray(e)?e:[e]);Xh[n]||(Xh[n]=new WeakMap);var s=Xh[n],l=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(c.has(y))m(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",S=(Jl.get(y)||0)+1,N=(s.get(y)||0)+1;Jl.set(y,S),s.set(y,N),l.push(y),S===1&&w&&Qh.set(y,!0),N===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",y,C)}})};return m(t),c.clear(),ab++,function(){l.forEach(function(g){var y=Jl.get(g)-1,v=s.get(g)-1;Jl.set(g,y),s.set(g,v),y||(Qh.has(g)||g.removeAttribute(r),Qh.delete(g)),v||g.removeAttribute(n)}),ab--,ab||(Jl=new WeakMap,Jl=new WeakMap,Qh=new WeakMap,Xh={})}},BH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=IH(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),UH(r,i,n,"aria-hidden")):function(){return null}},bg="Dialog",[SR]=wK(bg),[qH,xi]=SR(bg),jR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=x.useRef(null),f=x.useRef(null),[h,m]=_K({prop:r,defaultProp:i??!1,onChange:s,caller:bg});return u.jsx(qH,{scope:t,triggerRef:c,contentRef:f,contentId:X0(),titleId:X0(),descriptionId:X0(),open:h,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),modal:l,children:n})};jR.displayName=bg;var NR="DialogTrigger",FH=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=xi(NR,n),s=nl(t,i.triggerRef);return u.jsx(Ea.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":JS(i.open),...r,ref:s,onClick:_s(e.onClick,i.onOpenToggle)})});FH.displayName=NR;var QS="DialogPortal",[KH,CR]=SR(QS,{forceMount:void 0}),_R=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=xi(QS,t);return u.jsx(KH,{scope:t,forceMount:n,children:x.Children.map(r,l=>u.jsx(yg,{present:n||s.open,children:u.jsx(fR,{asChild:!0,container:i,children:l})}))})};_R.displayName=QS;var rm="DialogOverlay",OR=x.forwardRef((e,t)=>{const n=CR(rm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=xi(rm,e.__scopeDialog);return s.modal?u.jsx(yg,{present:r||s.open,children:u.jsx(GH,{...i,ref:t})}):null});OR.displayName=rm;var HH=sR("DialogOverlay.RemoveScroll"),GH=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=xi(rm,n);return u.jsx(xR,{as:HH,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ea.div,{"data-state":JS(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ko="DialogContent",kR=x.forwardRef((e,t)=>{const n=CR(Ko,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=xi(Ko,e.__scopeDialog);return u.jsx(yg,{present:r||s.open,children:s.modal?u.jsx(VH,{...i,ref:t}):u.jsx(ZH,{...i,ref:t})})});kR.displayName=Ko;var VH=x.forwardRef((e,t)=>{const n=xi(Ko,e.__scopeDialog),r=x.useRef(null),i=nl(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return BH(s)},[]),u.jsx(AR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_s(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_s(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&s.preventDefault()}),onFocusOutside:_s(e.onFocusOutside,s=>s.preventDefault())})}),ZH=x.forwardRef((e,t)=>{const n=xi(Ko,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(AR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),AR=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=xi(Ko,n),f=x.useRef(null),h=nl(t,f);return tH(),u.jsxs(u.Fragment,{children:[u.jsx(uR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(lR,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":JS(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(YH,{titleId:c.titleId}),u.jsx(QH,{contentRef:f,descriptionId:c.descriptionId})]})]})}),XS="DialogTitle",ER=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=xi(XS,n);return u.jsx(Ea.h2,{id:i.titleId,...r,ref:t})});ER.displayName=XS;var TR="DialogDescription",PR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=xi(TR,n);return u.jsx(Ea.p,{id:i.descriptionId,...r,ref:t})});PR.displayName=TR;var zR="DialogClose",MR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=xi(zR,n);return u.jsx(Ea.button,{type:"button",...r,ref:t,onClick:_s(e.onClick,()=>i.onOpenChange(!1))})});MR.displayName=zR;function JS(e){return e?"open":"closed"}var RR="DialogTitleWarning",[yye,DR]=xK(RR,{contentName:Ko,titleName:XS,docsSlug:"dialog"}),YH=({titleId:e})=>{const t=DR(RR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
+
54
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
+
56
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},WH="DialogDescriptionWarning",QH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DR(WH).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},LR=jR,IR=_R,e1=OR,t1=kR,n1=ER,$R=PR,UR=MR;const XH=LR,JH=IR,BR=x.forwardRef(({className:e,...t},n)=>u.jsx(e1,{ref:n,className:ni("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));BR.displayName=e1.displayName;const e7=400,t7=1200,n7=720,qR=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,s]=x.useState(n7),l=x.useRef(!1),c=x.useRef(0),f=x.useRef(0),h=x.useCallback(y=>{l.current=!0,c.current=y.clientX,f.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),m=x.useCallback(y=>{if(!l.current)return;const v=c.current-y.clientX,w=Math.min(t7,Math.max(e7,f.current+v));s(w)},[]),g=x.useCallback(()=>{l.current=!1},[]);return u.jsxs(JH,{children:[u.jsx(BR,{}),u.jsxs(t1,{ref:r,className:ni("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[u.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:h,onPointerMove:m,onPointerUp:g}),t,u.jsxs(UR,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[u.jsx(fg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});qR.displayName=t1.displayName;const r7=({className:e,...t})=>u.jsx("div",{className:ni("flex flex-col gap-1.5 pr-10",e),...t}),FR=x.forwardRef(({className:e,...t},n)=>u.jsx(n1,{ref:n,className:ni("text-lg font-medium text-zinc-50",e),...t}));FR.displayName=n1.displayName;const KR=x.forwardRef(({className:e,...t},n)=>u.jsx($R,{ref:n,className:ni("text-sm text-zinc-500",e),...t}));KR.displayName=$R.displayName;function i7({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(XH,{open:r,onOpenChange:s=>s?void 0:i(),children:u.jsxs(qR,{children:[u.jsxs(r7,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(FR,{id:"drawer-title",children:e}),u.jsx(KR,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function ce(e,t,n){function r(c,f){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:f,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,f);const h=l.prototype,m=Object.keys(h);for(let g=0;g<m.length;g++){const y=m[g];y in c||(c[y]=h[y].bind(c))}}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function l(c){var f;const h=n?.Parent?new s:this;r(h,c),(f=h._zod).deferred??(f.deferred=[]);for(const m of h._zod.deferred)m();return h}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class xc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class HR extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const GR={};function Ts(e){return GR}function VR(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function hw(e,t){return typeof t=="bigint"?t.toString():t}function r1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function i1(e){return e==null}function a1(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function a7(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const f=r.match(/\d?e-(\d?)/);f?.[1]&&(i=Number.parseInt(f[1]))}const s=n>i?n:i,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}const jA=Symbol("evaluating");function vt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==jA)return r===void 0&&(r=jA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function il(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Us(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function NA(e){return JSON.stringify(e)}function s7(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ZR="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function im(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const o7=r1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function kc(e){if(im(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(im(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function YR(e){return kc(e)?{...e}:Array.isArray(e)?[...e]:e}const l7=new Set(["string","number","symbol"]);function Ac(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function c7(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const u7={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function d7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Us(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return il(this,"shape",l),l},checks:[]});return Bs(e,s)}function f7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Us(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return il(this,"shape",l),l},checks:[]});return Bs(e,s)}function h7(e,t){if(!kc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(s,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Us(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return il(this,"shape",s),s}});return Bs(e,i)}function p7(e,t){if(!kc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Us(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return il(this,"shape",r),r}});return Bs(e,n)}function m7(e,t){const n=Us(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return il(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Bs(e,n)}function g7(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Us(t._zod.def,{get shape(){const c=t._zod.def.shape,f={...c};if(n)for(const h in n){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(f[h]=e?new e({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)f[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return il(this,"shape",f),f},checks:[]});return Bs(t,l)}function y7(e,t,n){const r=Us(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(s[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)s[l]=new e({type:"nonoptional",innerType:i[l]});return il(this,"shape",s),s}});return Bs(t,r)}function dc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function fc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Jh(e){return typeof e=="string"?e:e?.message}function Ps(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Jh(e.inst?._zod.def?.error?.(e))??Jh(t?.error?.(e))??Jh(n.customError?.(e))??Jh(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function s1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const WR=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,hw,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},QR=ce("$ZodError",WR),XR=ce("$ZodError",WR,{Parent:Error});function v7(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function b7(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<s.path.length;){const f=s.path[c];c===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(t(s))):l[f]=l[f]||{_errors:[]},l=l[f],c++}}};return r(e),n}const o1=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise)throw new xc;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Ps(f,s,Ts())));throw ZR(c,i?.callee),c}return l.value},l1=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Ps(f,s,Ts())));throw ZR(c,i?.callee),c}return l.value},xg=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new xc;return s.issues.length?{success:!1,error:new(e??QR)(s.issues.map(l=>Ps(l,i,Ts())))}:{success:!0,data:s.value}},x7=xg(XR),wg=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(l=>Ps(l,i,Ts())))}:{success:!0,data:s.value}},w7=wg(XR),S7=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return o1(e)(t,n,i)},j7=e=>(t,n,r)=>o1(e)(t,n,r),N7=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return l1(e)(t,n,i)},C7=e=>async(t,n,r)=>l1(e)(t,n,r),_7=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xg(e)(t,n,i)},O7=e=>(t,n,r)=>xg(e)(t,n,r),k7=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wg(e)(t,n,i)},A7=e=>async(t,n,r)=>wg(e)(t,n,r),E7=/^[cC][^\s-]{8,}$/,T7=/^[0-9a-z]+$/,P7=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z7=/^[0-9a-vA-V]{20}$/,M7=/^[A-Za-z0-9]{27}$/,R7=/^[a-zA-Z0-9_-]{21}$/,D7=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,L7=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,CA=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,I7=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U7(){return new RegExp($7,"u")}const B7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q7=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F7=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,K7=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H7=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JR=/^[A-Za-z0-9_-]*$/,G7=/^\+[1-9]\d{6,14}$/,eD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",V7=new RegExp(`^${eD}$`);function tD(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Z7(e){return new RegExp(`^${tD(e)}$`)}function Y7(e){const t=tD({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${eD}T(?:${r})$`)}const W7=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Q7=/^-?\d+$/,nD=/^-?\d+(?:\.\d+)?$/,X7=/^(?:true|false)$/i,J7=/^[^A-Z]*$/,eG=/^[^a-z]*$/,pr=ce("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rD={number:"number",bigint:"bigint",object:"date"},iD=ce("$ZodCheckLessThan",(e,t)=>{pr.init(e,t);const n=rD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aD=ce("$ZodCheckGreaterThan",(e,t)=>{pr.init(e,t);const n=rD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tG=ce("$ZodCheckMultipleOf",(e,t)=>{pr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):a7(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nG=ce("$ZodCheckNumberFormat",(e,t)=>{pr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=u7[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,n&&(c.pattern=Q7)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),rG=ce("$ZodCheckMaxLength",(e,t)=>{var n;pr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!i1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const l=s1(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),iG=ce("$ZodCheckMinLength",(e,t)=>{var n;pr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!i1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=s1(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),aG=ce("$ZodCheckLengthEquals",(e,t)=>{var n;pr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!i1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const l=s1(i),c=s>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Sg=ce("$ZodCheckStringFormat",(e,t)=>{var n,r;pr.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),sG=ce("$ZodCheckRegex",(e,t)=>{Sg.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),oG=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=J7),Sg.init(e,t)}),lG=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eG),Sg.init(e,t)}),cG=ce("$ZodCheckIncludes",(e,t)=>{pr.init(e,t);const n=Ac(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),uG=ce("$ZodCheckStartsWith",(e,t)=>{pr.init(e,t);const n=new RegExp(`^${Ac(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),dG=ce("$ZodCheckEndsWith",(e,t)=>{pr.init(e,t);const n=new RegExp(`.*${Ac(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),fG=ce("$ZodCheckOverwrite",(e,t)=>{pr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class hG{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
57
+ `).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),s=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of s)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
58
+ `))}}const pG={major:4,minor:3,patch:6},Kt=ce("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pG;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,c,f)=>{let h=dc(l),m;for(const g of c){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const y=l.issues.length,v=g._zod.check(l);if(v instanceof Promise&&f?.async===!1)throw new xc;if(m||v instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await v,l.issues.length!==y&&(h||(h=dc(l,y)))});else{if(l.issues.length===y)continue;h||(h=dc(l,y))}}return m?m.then(()=>l):l},s=(l,c,f)=>{if(dc(l))return l.aborted=!0,l;const h=i(c,r,f);if(h instanceof Promise){if(f.async===!1)throw new xc;return h.then(m=>e._zod.parse(m,f))}return e._zod.parse(h,f)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(m=>s(m,l,c)):s(h,l,c)}const f=e._zod.parse(l,c);if(f instanceof Promise){if(c.async===!1)throw new xc;return f.then(h=>i(h,r,c))}return i(f,r,c)}}vt(e,"~standard",()=>({validate:i=>{try{const s=x7(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return w7(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),c1=ce("$ZodString",(e,t)=>{Kt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??W7(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ut=ce("$ZodStringFormat",(e,t)=>{Sg.init(e,t),c1.init(e,t)}),mG=ce("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=L7),Ut.init(e,t)}),gG=ce("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=CA(r))}else t.pattern??(t.pattern=CA());Ut.init(e,t)}),yG=ce("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=I7),Ut.init(e,t)}),vG=ce("$ZodURL",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),bG=ce("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=U7()),Ut.init(e,t)}),xG=ce("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=R7),Ut.init(e,t)}),wG=ce("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=E7),Ut.init(e,t)}),SG=ce("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=T7),Ut.init(e,t)}),jG=ce("$ZodULID",(e,t)=>{t.pattern??(t.pattern=P7),Ut.init(e,t)}),NG=ce("$ZodXID",(e,t)=>{t.pattern??(t.pattern=z7),Ut.init(e,t)}),CG=ce("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=M7),Ut.init(e,t)}),_G=ce("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Y7(t)),Ut.init(e,t)}),OG=ce("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=V7),Ut.init(e,t)}),kG=ce("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Z7(t)),Ut.init(e,t)}),AG=ce("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=D7),Ut.init(e,t)}),EG=ce("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=B7),Ut.init(e,t),e._zod.bag.format="ipv4"}),TG=ce("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=q7),Ut.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),PG=ce("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=F7),Ut.init(e,t)}),zG=ce("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=K7),Ut.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const l=Number(s);if(`${l}`!==s)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function sD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const MG=ce("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=H7),Ut.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{sD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function RG(e){if(!JR.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return sD(n)}const DG=ce("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=JR),Ut.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{RG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),LG=ce("$ZodE164",(e,t)=>{t.pattern??(t.pattern=G7),Ut.init(e,t)});function IG(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const $G=ce("$ZodJWT",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{IG(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),oD=ce("$ZodNumber",(e,t)=>{Kt.init(e,t),e._zod.pattern=e._zod.bag.pattern??nD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),UG=ce("$ZodNumberFormat",(e,t)=>{nG.init(e,t),oD.init(e,t)}),BG=ce("$ZodBoolean",(e,t)=>{Kt.init(e,t),e._zod.pattern=X7,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),qG=ce("$ZodUnknown",(e,t)=>{Kt.init(e,t),e._zod.parse=n=>n}),FG=ce("$ZodNever",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _A(e,t,n){e.issues.length&&t.issues.push(...fc(n,e.issues)),t.value[n]=e.value}const KG=ce("$ZodArray",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let l=0;l<i.length;l++){const c=i[l],f=t.element._zod.run({value:c,issues:[]},r);f instanceof Promise?s.push(f.then(h=>_A(h,n,l))):_A(f,n,l)}return s.length?Promise.all(s).then(()=>n):n}});function am(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...fc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function lD(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=c7(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cD(e,t,n,r,i,s){const l=[],c=i.keySet,f=i.catchall._zod,h=f.def.type,m=f.optout==="optional";for(const g in t){if(c.has(g))continue;if(h==="never"){l.push(g);continue}const y=f.run({value:t[g],issues:[]},r);y instanceof Promise?e.push(y.then(v=>am(v,n,g,t,m))):am(y,n,g,t,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const HG=ce("$ZodObject",(e,t)=>{if(Kt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...c};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=r1(()=>lD(t));vt(e._zod,"propValues",()=>{const c=t.shape,f={};for(const h in c){const m=c[h]._zod;if(m.values){f[h]??(f[h]=new Set);for(const g of m.values)f[h].add(g)}}return f});const i=im,s=t.catchall;let l;e._zod.parse=(c,f)=>{l??(l=r.value);const h=c.value;if(!i(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};const m=[],g=l.shape;for(const y of l.keys){const v=g[y],w=v._zod.optout==="optional",S=v._zod.run({value:h[y],issues:[]},f);S instanceof Promise?m.push(S.then(N=>am(N,c,y,h,w))):am(S,c,y,h,w)}return s?cD(m,h,c,f,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),GG=ce("$ZodObjectJIT",(e,t)=>{HG.init(e,t);const n=e._zod.parse,r=r1(()=>lD(t)),i=y=>{const v=new hG(["shape","payload","ctx"]),w=r.value,S=k=>{const _=NA(k);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};v.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const k of w.keys)N[k]=`key_${C++}`;v.write("const newResult = {};");for(const k of w.keys){const _=N[k],T=NA(k),E=y[k]?._zod?.optout==="optional";v.write(`const ${_} = ${S(k)};`),E?v.write(`
59
+ if (${_}.issues.length) {
60
+ if (${T} in input) {
61
+ payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
62
+ ...iss,
63
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
64
+ })));
65
+ }
66
+ }
67
+
68
+ if (${_}.value === undefined) {
69
+ if (${T} in input) {
70
+ newResult[${T}] = undefined;
71
+ }
72
+ } else {
73
+ newResult[${T}] = ${_}.value;
74
+ }
75
+
76
+ `):v.write(`
77
+ if (${_}.issues.length) {
78
+ payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
79
+ ...iss,
80
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
81
+ })));
82
+ }
83
+
84
+ if (${_}.value === undefined) {
85
+ if (${T} in input) {
86
+ newResult[${T}] = undefined;
87
+ }
88
+ } else {
89
+ newResult[${T}] = ${_}.value;
90
+ }
91
+
92
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(k,_)=>A(y,k,_)};let s;const l=im,c=!GR.jitless,h=c&&o7.value,m=t.catchall;let g;e._zod.parse=(y,v)=>{g??(g=r.value);const w=y.value;return l(w)?c&&h&&v?.async===!1&&v.jitless!==!0?(s||(s=i(t.shape)),y=s(y,v),m?cD([],w,y,v,g,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function OA(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!dc(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>Ps(l,r,Ts())))}),t)}const VG=ce("$ZodUnion",(e,t)=>{Kt.init(e,t),vt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),vt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),vt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),vt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>a1(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let l=!1;const c=[];for(const f of t.options){const h=f._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)c.push(h),l=!0;else{if(h.issues.length===0)return h;c.push(h)}}return l?Promise.all(c).then(f=>OA(f,i,e,s)):OA(c,i,e,s)}}),ZG=ce("$ZodIntersection",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([f,h])=>kA(n,f,h)):kA(n,s,l)}});function pw(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(kc(e)&&kc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const l=pw(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};i[s]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],l=pw(i,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kA(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&i&&e.issues.push({...i,keys:s}),dc(e))return e;const l=pw(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const YG=ce("$ZodRecord",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!kc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const m=t.valueType._zod.run({value:i[h],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&n.issues.push(...fc(h,g.issues)),n.value[h]=g.value})):(m.issues.length&&n.issues.push(...fc(h,m.issues)),n.value[h]=m.value)}let f;for(const h in i)c.has(h)||(f=f??[],f.push(h));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let f=t.keyType._zod.run({value:c,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&nD.test(c)&&f.issues.length){const g=t.keyType._zod.run({value:Number(c),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>Ps(g,r,Ts())),input:c,path:[c],inst:e});continue}const m=t.valueType._zod.run({value:i[c],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&n.issues.push(...fc(c,g.issues)),n.value[f.value]=g.value})):(m.issues.length&&n.issues.push(...fc(c,m.issues)),n.value[f.value]=m.value)}}return s.length?Promise.all(s).then(()=>n):n}}),WG=ce("$ZodEnum",(e,t)=>{Kt.init(e,t);const n=VR(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>l7.has(typeof i)).map(i=>typeof i=="string"?Ac(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),QG=ce("$ZodLiteral",(e,t)=>{if(Kt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ac(r):r?Ac(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),XG=ce("$ZodTransform",(e,t)=>{Kt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HR(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new xc;return n.value=i,n}});function AA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const uD=ce("$ZodOptional",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${a1(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>AA(s,n.value)):AA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),JG=ce("$ZodExactOptional",(e,t)=>{uD.init(e,t),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),eV=ce("$ZodNullable",(e,t)=>{Kt.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${a1(n.source)}|null)$`):void 0}),vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),tV=ce("$ZodDefault",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>EA(s,t)):EA(i,t)}});function EA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const nV=ce("$ZodPrefault",(e,t)=>{Kt.init(e,t),e._zod.optin="optional",vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),rV=ce("$ZodNonOptional",(e,t)=>{Kt.init(e,t),vt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>TA(s,e)):TA(i,e)}});function TA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const iV=ce("$ZodCatch",(e,t)=>{Kt.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>Ps(l,r,Ts()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ps(s,r,Ts()))},input:n.value}),n.issues=[]),n)}}),aV=ce("$ZodPipe",(e,t)=>{Kt.init(e,t),vt(e._zod,"values",()=>t.in._zod.values),vt(e._zod,"optin",()=>t.in._zod.optin),vt(e._zod,"optout",()=>t.out._zod.optout),vt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>ep(l,t.in,r)):ep(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>ep(s,t.out,r)):ep(i,t.out,r)}});function ep(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const sV=ce("$ZodReadonly",(e,t)=>{Kt.init(e,t),vt(e._zod,"propValues",()=>t.innerType._zod.propValues),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"optin",()=>t.innerType?._zod?.optin),vt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(PA):PA(i)}});function PA(e){return e.value=Object.freeze(e.value),e}const oV=ce("$ZodCustom",(e,t)=>{pr.init(e,t),Kt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>zA(s,n,r,e));zA(i,n,r,e)}});function zA(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Pd(i))}}var MA;class lV{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function cV(){return new lV}(MA=globalThis).__zod_globalRegistry??(MA.__zod_globalRegistry=cV());const hd=globalThis.__zod_globalRegistry;function uV(e,t){return new e({type:"string",...ze(t)})}function dV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function RA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function fV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function hV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function pV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function mV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function gV(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function yV(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function vV(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function bV(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function xV(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function wV(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function SV(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function jV(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function NV(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function CV(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function _V(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function OV(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function kV(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function AV(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function EV(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function TV(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function PV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function zV(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function MV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function RV(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function DV(e,t){return new e({type:"number",checks:[],...ze(t)})}function LV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function IV(e,t){return new e({type:"boolean",...ze(t)})}function $V(e){return new e({type:"unknown"})}function UV(e,t){return new e({type:"never",...ze(t)})}function DA(e,t){return new iD({check:"less_than",...ze(t),value:e,inclusive:!1})}function sb(e,t){return new iD({check:"less_than",...ze(t),value:e,inclusive:!0})}function LA(e,t){return new aD({check:"greater_than",...ze(t),value:e,inclusive:!1})}function ob(e,t){return new aD({check:"greater_than",...ze(t),value:e,inclusive:!0})}function IA(e,t){return new tG({check:"multiple_of",...ze(t),value:e})}function dD(e,t){return new rG({check:"max_length",...ze(t),maximum:e})}function sm(e,t){return new iG({check:"min_length",...ze(t),minimum:e})}function fD(e,t){return new aG({check:"length_equals",...ze(t),length:e})}function BV(e,t){return new sG({check:"string_format",format:"regex",...ze(t),pattern:e})}function qV(e){return new oG({check:"string_format",format:"lowercase",...ze(e)})}function FV(e){return new lG({check:"string_format",format:"uppercase",...ze(e)})}function KV(e,t){return new cG({check:"string_format",format:"includes",...ze(t),includes:e})}function HV(e,t){return new uG({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function GV(e,t){return new dG({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function Bc(e){return new fG({check:"overwrite",tx:e})}function VV(e){return Bc(t=>t.normalize(e))}function ZV(){return Bc(e=>e.trim())}function YV(){return Bc(e=>e.toLowerCase())}function WV(){return Bc(e=>e.toUpperCase())}function QV(){return Bc(e=>s7(e))}function XV(e,t,n){return new e({type:"array",element:t,...ze(n)})}function JV(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function eZ(e){const t=tZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Pd(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Pd(i))}},e(n.value,n)));return t}function tZ(e,t){const n=new pr({check:"custom",...ze(t)});return n._zod.check=e,n}function hD(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??hd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function un(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,m);else{const y=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,m)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),un(g,t,m),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(l.schema,f),t.io==="input"&&Zn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function pD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const f=r.get(c);if(f&&f!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,y=e.external.uri??(w=>w);if(g)return{ref:y(g)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const h=`#/${c}/`,m=l[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:h+m}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:f,defId:h}=i(l);c.def={...c.schema},h&&(c.defId=h);const m=c.schema;for(const g in m)delete m[g];m.$ref=f};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
93
+
94
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function mD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const f=c.def??c.schema,h={...f},m=c.ref;if(c.ref=null,m){r(m);const y=e.seen.get(m),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(v)):Object.assign(f,v),Object.assign(f,h),l._zod.parent===m)for(const S in f)S==="$ref"||S==="allOf"||S in h||delete f[S];if(v.$ref&&y.def)for(const S in f)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(f[S])===JSON.stringify(y.def[S])&&delete f[S]}const g=l._zod.parent;if(g&&g!==m){r(g);const y=e.seen.get(g);if(y?.schema.$ref&&(f.$ref=y.schema.$ref,y.def))for(const v in f)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(f[v])===JSON.stringify(y.def[v])&&delete f[v]}e.override({zodSchema:l,jsonSchema:f,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:om(t,"input",e.processors),output:om(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Zn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Zn(r.element,n);if(r.type==="set")return Zn(r.valueType,n);if(r.type==="lazy")return Zn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Zn(r.innerType,n);if(r.type==="intersection")return Zn(r.left,n)||Zn(r.right,n);if(r.type==="record"||r.type==="map")return Zn(r.keyType,n)||Zn(r.valueType,n);if(r.type==="pipe")return Zn(r.in,n)||Zn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Zn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Zn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Zn(i,n))return!0;return!!(r.rest&&Zn(r.rest,n))}return!1}const nZ=(e,t={})=>n=>{const r=hD({...n,processors:t});return un(e,r),pD(r,e),mD(r,e)},om=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},l=hD({...i??{},target:s,io:t,processors:n});return un(e,l),pD(l,e),mD(l,e)},rZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:l,format:c,patterns:f,contentEncoding:h}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof l=="number"&&(i.maxLength=l),c&&(i.format=rZ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),h&&(i.contentEncoding=h),f&&f.size>0){const m=[...f];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},aZ=(e,t,n,r)=>{const i=n,{minimum:s,maximum:l,format:c,multipleOf:f,exclusiveMaximum:h,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m),typeof s=="number"&&(i.minimum=s,typeof m=="number"&&t.target!=="draft-04"&&(m>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof f=="number"&&(i.multipleOf=f)},sZ=(e,t,n,r)=>{n.type="boolean"},oZ=(e,t,n,r)=>{n.not={}},lZ=(e,t,n,r)=>{},cZ=(e,t,n,r)=>{const i=e._zod.def,s=VR(i.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},uZ=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},dZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hZ=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=un(s.element,t,{...r,path:[...r.path,"items"]})},pZ=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const l=s.shape;for(const h in l)i.properties[h]=un(l[h],t,{...r,path:[...r.path,"properties",h]});const c=new Set(Object.keys(l)),f=new Set([...c].filter(h=>{const m=s.shape[h]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));f.size>0&&(i.required=Array.from(f)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=un(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},mZ=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,l=i.options.map((c,f)=>un(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",f]}));s?n.oneOf=l:n.anyOf=l},gZ=(e,t,n,r)=>{const i=e._zod.def,s=un(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=un(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,f=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=f},yZ=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const l=s.keyType,f=l._zod.bag?.patterns;if(s.mode==="loose"&&f&&f.size>0){const m=un(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of f)i.patternProperties[g.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=un(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=un(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const h=l._zod.values;if(h){const m=[...h].filter(g=>typeof g=="string"||typeof g=="number");m.length>0&&(i.required=m)}},vZ=(e,t,n,r)=>{const i=e._zod.def,s=un(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},bZ=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},xZ=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},wZ=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},SZ=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},jZ=(e,t,n,r)=>{const i=e._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;un(s,t,r);const l=t.seen.get(e);l.ref=s},NZ=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},gD=(e,t,n,r)=>{const i=e._zod.def;un(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},CZ=ce("ZodISODateTime",(e,t)=>{_G.init(e,t),Gt.init(e,t)});function _Z(e){return PV(CZ,e)}const OZ=ce("ZodISODate",(e,t)=>{OG.init(e,t),Gt.init(e,t)});function kZ(e){return zV(OZ,e)}const AZ=ce("ZodISOTime",(e,t)=>{kG.init(e,t),Gt.init(e,t)});function EZ(e){return MV(AZ,e)}const TZ=ce("ZodISODuration",(e,t)=>{AG.init(e,t),Gt.init(e,t)});function PZ(e){return RV(TZ,e)}const zZ=(e,t)=>{QR.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>b7(e,n)},flatten:{value:n=>v7(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hw,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hw,2)}},isEmpty:{get(){return e.issues.length===0}}})},ri=ce("ZodError",zZ,{Parent:Error}),MZ=o1(ri),RZ=l1(ri),DZ=xg(ri),LZ=wg(ri),IZ=S7(ri),$Z=j7(ri),UZ=N7(ri),BZ=C7(ri),qZ=_7(ri),FZ=O7(ri),KZ=k7(ri),HZ=A7(ri),Ht=ce("ZodType",(e,t)=>(Kt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:om(e,"input"),output:om(e,"output")}}),e.toJSONSchema=nZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Us(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Bs(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>MZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>DZ(e,n,r),e.parseAsync=async(n,r)=>RZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>LZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>IZ(e,n,r),e.decode=(n,r)=>$Z(e,n,r),e.encodeAsync=async(n,r)=>UZ(e,n,r),e.decodeAsync=async(n,r)=>BZ(e,n,r),e.safeEncode=(n,r)=>qZ(e,n,r),e.safeDecode=(n,r)=>FZ(e,n,r),e.safeEncodeAsync=async(n,r)=>KZ(e,n,r),e.safeDecodeAsync=async(n,r)=>HZ(e,n,r),e.refine=(n,r)=>e.check($Y(n,r)),e.superRefine=n=>e.check(UY(n)),e.overwrite=n=>e.check(Bc(n)),e.optional=()=>BA(e),e.exactOptional=()=>_Y(e),e.nullable=()=>qA(e),e.nullish=()=>BA(qA(e)),e.nonoptional=n=>PY(e,n),e.array=()=>Ce(e),e.or=n=>vY([e,n]),e.and=n=>xY(e,n),e.transform=n=>FA(e,NY(n)),e.default=n=>AY(e,n),e.prefault=n=>TY(e,n),e.catch=n=>MY(e,n),e.pipe=n=>FA(e,n),e.readonly=()=>LY(e),e.describe=n=>{const r=e.clone();return hd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return hd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return hd.get(e);const r=e.clone();return hd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),yD=ce("_ZodString",(e,t)=>{c1.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(r,i,s)=>iZ(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(BV(...r)),e.includes=(...r)=>e.check(KV(...r)),e.startsWith=(...r)=>e.check(HV(...r)),e.endsWith=(...r)=>e.check(GV(...r)),e.min=(...r)=>e.check(sm(...r)),e.max=(...r)=>e.check(dD(...r)),e.length=(...r)=>e.check(fD(...r)),e.nonempty=(...r)=>e.check(sm(1,...r)),e.lowercase=r=>e.check(qV(r)),e.uppercase=r=>e.check(FV(r)),e.trim=()=>e.check(ZV()),e.normalize=(...r)=>e.check(VV(...r)),e.toLowerCase=()=>e.check(YV()),e.toUpperCase=()=>e.check(WV()),e.slugify=()=>e.check(QV())}),GZ=ce("ZodString",(e,t)=>{c1.init(e,t),yD.init(e,t),e.email=n=>e.check(dV(VZ,n)),e.url=n=>e.check(gV(ZZ,n)),e.jwt=n=>e.check(TV(cY,n)),e.emoji=n=>e.check(yV(YZ,n)),e.guid=n=>e.check(RA($A,n)),e.uuid=n=>e.check(fV(tp,n)),e.uuidv4=n=>e.check(hV(tp,n)),e.uuidv6=n=>e.check(pV(tp,n)),e.uuidv7=n=>e.check(mV(tp,n)),e.nanoid=n=>e.check(vV(WZ,n)),e.guid=n=>e.check(RA($A,n)),e.cuid=n=>e.check(bV(QZ,n)),e.cuid2=n=>e.check(xV(XZ,n)),e.ulid=n=>e.check(wV(JZ,n)),e.base64=n=>e.check(kV(sY,n)),e.base64url=n=>e.check(AV(oY,n)),e.xid=n=>e.check(SV(eY,n)),e.ksuid=n=>e.check(jV(tY,n)),e.ipv4=n=>e.check(NV(nY,n)),e.ipv6=n=>e.check(CV(rY,n)),e.cidrv4=n=>e.check(_V(iY,n)),e.cidrv6=n=>e.check(OV(aY,n)),e.e164=n=>e.check(EV(lY,n)),e.datetime=n=>e.check(_Z(n)),e.date=n=>e.check(kZ(n)),e.time=n=>e.check(EZ(n)),e.duration=n=>e.check(PZ(n))});function L(e){return uV(GZ,e)}const Gt=ce("ZodStringFormat",(e,t)=>{Ut.init(e,t),yD.init(e,t)}),VZ=ce("ZodEmail",(e,t)=>{yG.init(e,t),Gt.init(e,t)}),$A=ce("ZodGUID",(e,t)=>{mG.init(e,t),Gt.init(e,t)}),tp=ce("ZodUUID",(e,t)=>{gG.init(e,t),Gt.init(e,t)}),ZZ=ce("ZodURL",(e,t)=>{vG.init(e,t),Gt.init(e,t)}),YZ=ce("ZodEmoji",(e,t)=>{bG.init(e,t),Gt.init(e,t)}),WZ=ce("ZodNanoID",(e,t)=>{xG.init(e,t),Gt.init(e,t)}),QZ=ce("ZodCUID",(e,t)=>{wG.init(e,t),Gt.init(e,t)}),XZ=ce("ZodCUID2",(e,t)=>{SG.init(e,t),Gt.init(e,t)}),JZ=ce("ZodULID",(e,t)=>{jG.init(e,t),Gt.init(e,t)}),eY=ce("ZodXID",(e,t)=>{NG.init(e,t),Gt.init(e,t)}),tY=ce("ZodKSUID",(e,t)=>{CG.init(e,t),Gt.init(e,t)}),nY=ce("ZodIPv4",(e,t)=>{EG.init(e,t),Gt.init(e,t)}),rY=ce("ZodIPv6",(e,t)=>{TG.init(e,t),Gt.init(e,t)}),iY=ce("ZodCIDRv4",(e,t)=>{PG.init(e,t),Gt.init(e,t)}),aY=ce("ZodCIDRv6",(e,t)=>{zG.init(e,t),Gt.init(e,t)}),sY=ce("ZodBase64",(e,t)=>{MG.init(e,t),Gt.init(e,t)}),oY=ce("ZodBase64URL",(e,t)=>{DG.init(e,t),Gt.init(e,t)}),lY=ce("ZodE164",(e,t)=>{LG.init(e,t),Gt.init(e,t)}),cY=ce("ZodJWT",(e,t)=>{$G.init(e,t),Gt.init(e,t)}),vD=ce("ZodNumber",(e,t)=>{oD.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(r,i,s)=>aZ(e,r,i),e.gt=(r,i)=>e.check(LA(r,i)),e.gte=(r,i)=>e.check(ob(r,i)),e.min=(r,i)=>e.check(ob(r,i)),e.lt=(r,i)=>e.check(DA(r,i)),e.lte=(r,i)=>e.check(sb(r,i)),e.max=(r,i)=>e.check(sb(r,i)),e.int=r=>e.check(UA(r)),e.safe=r=>e.check(UA(r)),e.positive=r=>e.check(LA(0,r)),e.nonnegative=r=>e.check(ob(0,r)),e.negative=r=>e.check(DA(0,r)),e.nonpositive=r=>e.check(sb(0,r)),e.multipleOf=(r,i)=>e.check(IA(r,i)),e.step=(r,i)=>e.check(IA(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function De(e){return DV(vD,e)}const uY=ce("ZodNumberFormat",(e,t)=>{UG.init(e,t),vD.init(e,t)});function UA(e){return LV(uY,e)}const dY=ce("ZodBoolean",(e,t)=>{BG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sZ(e,n,r)});function Ft(e){return IV(dY,e)}const fY=ce("ZodUnknown",(e,t)=>{qG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lZ()});function lm(){return $V(fY)}const hY=ce("ZodNever",(e,t)=>{FG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oZ(e,n,r)});function pY(e){return UV(hY,e)}const mY=ce("ZodArray",(e,t)=>{KG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hZ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sm(n,r)),e.nonempty=n=>e.check(sm(1,n)),e.max=(n,r)=>e.check(dD(n,r)),e.length=(n,r)=>e.check(fD(n,r)),e.unwrap=()=>e.element});function Ce(e,t){return XV(mY,e,t)}const gY=ce("ZodObject",(e,t)=>{GG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pZ(e,n,r,i),vt(e,"shape",()=>t.shape),e.keyof=()=>$t(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:lm()}),e.loose=()=>e.clone({...e._zod.def,catchall:lm()}),e.strict=()=>e.clone({...e._zod.def,catchall:pY()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>h7(e,n),e.safeExtend=n=>p7(e,n),e.merge=n=>m7(e,n),e.pick=n=>d7(e,n),e.omit=n=>f7(e,n),e.partial=(...n)=>g7(bD,e,n[0]),e.required=(...n)=>y7(xD,e,n[0])});function Ne(e,t){const n={type:"object",shape:e??{},...ze(t)};return new gY(n)}const yY=ce("ZodUnion",(e,t)=>{VG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mZ(e,n,r,i),e.options=t.options});function vY(e,t){return new yY({type:"union",options:e,...ze(t)})}const bY=ce("ZodIntersection",(e,t)=>{ZG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gZ(e,n,r,i)});function xY(e,t){return new bY({type:"intersection",left:e,right:t})}const wY=ce("ZodRecord",(e,t)=>{YG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yZ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Jd(e,t,n){return new wY({type:"record",keyType:e,valueType:t,...ze(n)})}const mw=ce("ZodEnum",(e,t)=>{WG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(r,i,s)=>cZ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new mw({...t,checks:[],...ze(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new mw({...t,checks:[],...ze(i),entries:s})}});function $t(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new mw({type:"enum",entries:n,...ze(t)})}const SY=ce("ZodLiteral",(e,t)=>{QG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uZ(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zd(e,t){return new SY({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const jY=ce("ZodTransform",(e,t)=>{XG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HR(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Pd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Pd(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function NY(e){return new jY({type:"transform",transform:e})}const bD=ce("ZodOptional",(e,t)=>{uD.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function BA(e){return new bD({type:"optional",innerType:e})}const CY=ce("ZodExactOptional",(e,t)=>{JG.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _Y(e){return new CY({type:"optional",innerType:e})}const OY=ce("ZodNullable",(e,t)=>{eV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qA(e){return new OY({type:"nullable",innerType:e})}const kY=ce("ZodDefault",(e,t)=>{tV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AY(e,t){return new kY({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():YR(t)}})}const EY=ce("ZodPrefault",(e,t)=>{nV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function TY(e,t){return new EY({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():YR(t)}})}const xD=ce("ZodNonOptional",(e,t)=>{rV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function PY(e,t){return new xD({type:"nonoptional",innerType:e,...ze(t)})}const zY=ce("ZodCatch",(e,t)=>{iV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function MY(e,t){return new zY({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const RY=ce("ZodPipe",(e,t)=>{aV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jZ(e,n,r,i),e.in=t.in,e.out=t.out});function FA(e,t){return new RY({type:"pipe",in:e,out:t})}const DY=ce("ZodReadonly",(e,t)=>{sV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NZ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LY(e){return new DY({type:"readonly",innerType:e})}const IY=ce("ZodCustom",(e,t)=>{oV.init(e,t),Ht.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dZ(e,n)});function $Y(e,t={}){return JV(IY,e,t)}function UY(e){return eZ(e)}Ne({maxConcurrency:De().int().positive(),maxRequestsPerMinute:De().int().positive(),maxRequestsPerDay:De().int().positive()});const qc=L().min(1);L().min(1);const u1=Ne({label:L().min(1),city:L().min(1),region:L().min(1),country:L().length(2),timezone:L().optional()}),wD=$t(["citation.lost","citation.gained","run.completed","run.failed"]);Ne({id:L(),projectId:L(),channel:zd("webhook"),url:L().url(),urlDisplay:L(),urlHost:L(),events:Ce(wD),enabled:Ft().default(!0),webhookSecret:L().optional(),createdAt:L(),updatedAt:L()});const SD=$t(["cli","api","config-file"]);function BY(e){const t=new Set,n=new Set;for(const r of e){if(t.has(r.label)){n.add(r.label);continue}t.add(r.label)}return[...n]}function qY(e,t){return t?e.some(n=>n.label===t):!0}Ne({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:Ce(L().min(1)).optional(),country:L().length(2),language:L().min(2),tags:Ce(L()).optional(),labels:Jd(L(),L()).optional(),providers:Ce(qc).optional(),locations:Ce(u1).optional(),defaultLocation:L().nullable().optional(),configSource:SD.optional()});Ne({id:L(),name:L(),displayName:L().optional(),canonicalDomain:L(),ownedDomains:Ce(L()).default([]),country:L().length(2),language:L().min(2),tags:Ce(L()).default([]),labels:Jd(L(),L()).default({}),locations:Ce(u1).default([]),defaultLocation:L().nullable().optional(),configSource:SD.default("cli"),configRevision:De().int().positive().default(1),createdAt:L().optional(),updatedAt:L().optional()});function gw(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function FY(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const s=i.trim();if(!s)continue;const l=gw(s);n.has(l)||(n.add(l),r.push(s))}return r}const KY=Ne({name:L().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:Jd(L(),L()).optional().default({})}),HY=Ne({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),providers:Ce(qc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),GY=Ne({channel:zd("webhook"),url:L().url(),events:Ce(wD).min(1)}),VY=Ne({gsc:Ne({propertyUrl:L()}).optional(),syncSchedule:Ne({preset:L().optional(),cron:L().optional()}).optional()}).optional(),ZY=Ne({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:Ce(L().min(1)).optional().default([]),country:L().length(2),language:L().min(2),keywords:Ce(L().min(1)).optional().default([]),competitors:Ce(L().min(1)).optional().default([]),providers:Ce(qc).optional().default([]),locations:Ce(u1).optional().default([]),defaultLocation:L().optional(),schedule:HY,notifications:Ce(GY).optional().default([]),google:VY}).superRefine((e,t)=>{const n=BY(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),qY(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ne({apiVersion:zd("canonry/v1"),kind:zd("Project"),metadata:KY,spec:ZY});const YY=$t(["gsc","ga4"]);Ne({id:L(),domain:L(),connectionType:YY,propertyId:L().nullable().optional(),sitemapUrl:L().nullable().optional(),scopes:Ce(L()).default([]),createdAt:L(),updatedAt:L()});Ne({date:L(),query:L(),page:L(),country:L().nullable().optional(),device:L().nullable().optional(),clicks:De(),impressions:De(),ctr:De(),position:De()});const yw=Ne({id:L(),url:L(),indexingState:L().nullable().optional(),verdict:L().nullable().optional(),coverageState:L().nullable().optional(),pageFetchState:L().nullable().optional(),robotsTxtState:L().nullable().optional(),crawlTime:L().nullable().optional(),lastCrawlResult:L().nullable().optional(),isMobileFriendly:Ft().nullable().optional(),richResults:Ce(L()).default([]),inspectedAt:L()});$t(["stable","reindexed","deindexed","still-missing","new"]);const WY=Ne({url:L(),previousState:L().nullable(),currentState:L().nullable(),transitionDate:L()}),QY=Ne({reason:L(),count:De(),urls:Ce(yw).default([])});Ne({summary:Ne({total:De(),indexed:De(),notIndexed:De(),deindexed:De(),percentage:De()}),lastInspectedAt:L().nullable(),indexed:Ce(yw).default([]),notIndexed:Ce(yw).default([]),deindexed:Ce(WY).default([]),reasonGroups:Ce(QY).default([])});Ne({url:L(),type:$t(["URL_UPDATED","URL_DELETED"]),notifiedAt:L()});Ne({url:L(),type:$t(["URL_UPDATED","URL_DELETED"]),notifiedAt:L(),status:$t(["success","error"]),error:L().optional()});Ne({date:L(),indexed:De(),notIndexed:De(),reasonBreakdown:Jd(L(),De()).default({})});Ne({id:L(),domain:L(),siteUrl:L().nullable().optional(),createdAt:L(),updatedAt:L()});const lb=Ne({id:L(),url:L(),httpCode:De().nullable().optional(),inIndex:Ft().nullable().optional(),lastCrawledDate:L().nullable().optional(),inIndexDate:L().nullable().optional(),inspectedAt:L(),documentSize:De().nullable().optional(),anchorCount:De().nullable().optional(),discoveryDate:L().nullable().optional()});Ne({summary:Ne({total:De(),indexed:De(),notIndexed:De(),unknown:De().optional(),percentage:De()}),lastInspectedAt:L().nullable(),indexed:Ce(lb).default([]),notIndexed:Ce(lb).default([]),unknown:Ce(lb).default([]).optional()});Ne({query:L(),impressions:De(),clicks:De(),ctr:De(),averagePosition:De()});Ne({url:L(),status:$t(["success","error"]),submittedAt:L(),error:L().optional()});const Fc=$t(["live","staging"]);Ne({projectName:L(),url:L(),stagingUrl:L().optional(),username:L(),defaultEnv:Fc,createdAt:L(),updatedAt:L()});const KA=Ne({url:L(),reachable:Ft(),pageCount:De().nullable().optional(),version:L().nullable().optional(),error:L().nullable().optional(),plugins:Ce(L()).optional(),authenticatedUser:Ne({id:De(),slug:L()}).nullable().optional()});Ne({connected:Ft(),projectName:L(),defaultEnv:Fc,live:KA.nullable(),staging:KA.nullable(),adminUrl:L().nullable().optional()});const XY=Ne({id:De(),slug:L(),title:L(),status:L(),modifiedAt:L().nullable().optional(),link:L().nullable().optional()}),jD=Ne({title:L().nullable(),description:L().nullable(),noindex:Ft().nullable(),writable:Ft().default(!1),writeTargets:Ce(L()).default([])}),JY=Ne({type:L(),json:Jd(L(),lm())}),eW=XY.extend({env:Fc,content:L(),seo:jD,schemaBlocks:Ce(JY).default([])}),HA=eW.extend({contentHash:L(),contentSnippet:L()}),ND=Ne({manualRequired:zd(!0),targetUrl:L(),adminUrl:L().nullable().optional(),content:L(),nextSteps:Ce(L()).default([])}),tW=Ne({slug:L(),severity:$t(["high","medium","low"]),code:$t(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:L()});Ne({slug:L(),title:L(),status:L(),wordCount:De(),seo:jD,schemaPresent:Ft(),issues:Ce(tW).default([])});const nW=Ne({slug:L(),status:$t(["applied","skipped","manual"]),error:L().optional(),manualAssist:ND.optional()});Ne({env:Fc,strategy:$t(["plugin","manual"]),results:Ce(nW)});const rW=Ne({slug:L(),status:$t(["deployed","stripped","skipped","failed"]),schemasInjected:Ce(L()).optional(),manualAssist:ND.optional(),error:L().optional()});Ne({env:Fc,results:Ce(rW)});const iW=Ne({slug:L(),title:L(),canonrySchemas:Ce(L()),thirdPartySchemas:Ce(L()),hasCanonrySchema:Ft()});Ne({env:Fc,pages:Ce(iW)});const aW=Ne({name:L(),status:$t(["completed","skipped","failed"]),summary:L().optional(),error:L().optional()});Ne({projectName:L(),steps:Ce(aW)});Ne({slug:L(),live:HA,staging:HA,hasDifferences:Ft(),differences:Ne({title:Ft(),slug:Ft(),content:Ft(),seoTitle:Ft(),seoDescription:Ft(),noindex:Ft(),schema:Ft()})});const sW=$t(["queued","running","completed","partial","failed","cancelled"]),oW=$t(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),lW=$t(["manual","scheduled","config-apply"]),cW=$t(["cited","not-cited"]),uW=$t(["visible","not-visible"]),dW=$t(["new","cited","lost","emerging","not-cited"]);Ne({id:L(),projectId:L(),kind:oW,status:sW,trigger:lW.default("manual"),location:L().nullable().optional(),startedAt:L().nullable().optional(),finishedAt:L().nullable().optional(),error:L().nullable().optional(),createdAt:L()});const CD=Ne({uri:L(),title:L()});Ne({id:L(),runId:L(),keywordId:L(),keyword:L().optional(),provider:qc,citationState:cW,answerMentioned:Ft().optional(),visibilityState:uW.optional(),transition:dW.optional(),answerText:L().nullable().optional(),citedDomains:Ce(L()).default([]),competitorOverlap:Ce(L()).default([]),recommendedCompetitors:Ce(L()).default([]),matchedTerms:Ce(L()).default([]),groundingSources:Ce(CD).default([]),searchQueries:Ce(L()).default([]),model:L().nullable().optional(),location:L().nullable().optional(),createdAt:L()});Ne({id:L(),projectId:L().nullable().optional(),actor:L(),action:L(),entityType:L(),entityId:L().nullable().optional(),diff:lm().optional(),createdAt:L()});const fW=$t(["yes","no","unknown","not-mentioned"]);Ne({companyName:L().min(1),domain:L().min(1),phrases:Ce(L().min(1)).optional().default([]),competitors:Ce(L().min(1)).optional().default([])});const hW=Ne({name:L(),count:De().int().nonnegative()}),pW=Ne({id:L(),name:L(),weight:De(),score:De(),grade:L(),status:$t(["pass","partial","fail"]),findings:Ce(Ne({type:L(),message:L()})).default([]),recommendations:Ce(L()).default([])}),mW=Ne({url:L(),finalUrl:L(),auditedAt:L(),overallScore:De(),overallGrade:L(),summary:L(),factors:Ce(pW).default([])}),gW=Ne({industry:L(),summary:L(),services:Ce(L()).default([]),categoryTerms:Ce(L()).default([])}),yW=Ne({provider:L(),displayName:L(),model:L().nullable().optional(),mentioned:Ft(),cited:Ft(),describedAccurately:fW,accuracyNotes:L().nullable().optional(),incorrectClaims:Ce(L()).default([]),recommendedCompetitors:Ce(L()).default([]),citedDomains:Ce(L()).default([]),groundingSources:Ce(CD).default([]),searchQueries:Ce(L()).default([]),answerText:L(),error:L().nullable().optional()}),vW=Ne({phrase:L(),providerResults:Ce(yW).default([])}),bW=Ne({totalQueries:De().int().nonnegative(),totalProviders:De().int().nonnegative(),totalComparisons:De().int().nonnegative(),mentionCount:De().int().nonnegative(),citationCount:De().int().nonnegative(),topCompetitors:Ce(hW).default([]),visibilityGap:L(),whatThisMeans:Ce(L()).default([]),recommendedActions:Ce(L()).default([])});Ne({companyName:L(),domain:L(),homepageUrl:L(),generatedAt:L(),phrases:Ce(L()).default([]),competitors:Ce(L()).default([]),profile:gW,audit:mW,queryResults:Ce(vW).default([]),summary:bW});Ne({id:L(),projectId:L(),cronExpr:L(),preset:L().nullable().optional(),timezone:L().default("UTC"),enabled:Ft().default(!0),providers:Ce(qc).default([]),lastRunAt:L().nullable().optional(),nextRunAt:L().nullable().optional(),createdAt:L(),updatedAt:L()});Ne({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),enabled:Ft().optional().default(!0),providers:Ce(qc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Ne({id:L(),projectId:L(),propertyId:L(),clientEmail:L(),connected:Ft(),createdAt:L(),updatedAt:L()});Ne({date:L(),landingPage:L(),sessions:De(),organicSessions:De(),users:De()});const xW=Ne({source:L(),medium:L(),sessions:De(),users:De()});Ne({totalSessions:De(),totalOrganicSessions:De(),totalUsers:De(),topPages:Ce(Ne({landingPage:L(),sessions:De(),organicSessions:De(),users:De()})),aiReferrals:Ce(xW),lastSyncedAt:L().nullable()});Ne({date:L(),source:L(),medium:L(),sessions:De(),users:De()});function GA(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Wn({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top+window.scrollY,left:l.left+l.width/2+window.scrollX})},[]),s=x.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:s,onFocus:i,onBlur:s,children:[u.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&tl.createPortal(u.jsx("span",{role:"tooltip",className:"info-tooltip-bubble info-tooltip-bubble--fixed",style:{top:t.top,left:t.left},children:e}),document.body)]})}function VA(e,t){const n=wW(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(h=>h.startsWith("**")&&h.endsWith("**")?{type:"bold",value:h.slice(2,-2)}:{type:"text",value:h}),i=n.flatMap(h=>h.terms).filter(h=>h.trim().length>1);if(i.length===0)return r.map((h,m)=>h.type==="bold"?hi.createElement("strong",{key:`b-${m}`,className:"text-zinc-200 font-semibold"},h.value):h.value).filter(Boolean);const l=[...i].sort((h,m)=>m.length-h.length).map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${l.join("|")})`,"gi"),f=new Map;for(const h of n)for(const m of h.terms){const g=m.toLowerCase();f.has(g)||f.set(g,h.className)}return r.flatMap((h,m)=>h.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const S=f.get(y.toLowerCase())??"answer-highlight";return h.type==="bold"?hi.createElement("mark",{key:`hl-${m}-${v}`,className:S},hi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):hi.createElement("mark",{key:`hl-${m}-${v}`,className:S},y)}return h.type==="bold"?hi.createElement("strong",{key:`b-${m}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function wW(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function cb(e,t){switch(e){case"new":return"First observation";case"emerging":return"First visibility";case"lost":return"Lost since last run";default:return t==="visible"?"Visible in latest run":t==="pending"?"Awaiting first run":"Not visible in latest run"}}function SW({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[s,l]=x.useState("mentions"),[c,f]=x.useState(-1),[h,m]=x.useState(null),[g,y]=x.useState(!1),[v,w]=x.useState({}),S=FY(t.project),N=new Set(S.map(gw)),C=e.runHistory,A=C.length>1,[k,_]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const q=C.at(-1);q&&(T.current=!0,Oc(q.runId).then(W=>{const ie=W.snapshots.find(ye=>ye.keyword===e.keyword&&ye.provider===e.provider);ie&&_({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:q.visibilityTransition,provider:ie.provider,model:ie.model??e.model,answerSnippet:ie.answerText??e.answerSnippet,citedDomains:ie.citedDomains??e.citedDomains,competitorDomains:ie.competitorOverlap??e.competitorDomains,recommendedCompetitors:ie.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ie.matchedTerms??e.matchedTerms??[],groundingSources:ie.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,C]);const P=c>=0&&h!==null,E=P?h:k||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:C.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},z=E.visibilityState==="pending"||E.citationState==="pending",D=z?!1:E.visibilityState!=null?E.visibilityState==="visible":E.answerMentioned!=null?E.answerMentioned:E.citationState==="cited"||E.citationState==="emerging",K=E.answerMentioned!=null||E.visibilityState!=null||E.recommendedCompetitors.length>0,U=E.citedDomains.length>0||E.groundingSources.length>0||E.evidenceUrls.length>0,I=t.project.displayName||t.project.name,H=[...S.map(gw),I,I.split(" ").slice(0,2).join(" "),...E.matchedTerms].filter(q=>q.trim().length>2),ge=[...E.competitorDomains.flatMap(q=>{const W=q.split(".")[0];return W&&W.length>=4?[W]:[]}),...E.recommendedCompetitors].filter(q=>q.trim().length>2),me=[{terms:H,className:"answer-highlight-brand"},...ge.length>0?[{terms:ge,className:"answer-highlight-competitor"}]:[]],G=z?"pending":E.visibilityTransition==="lost"?"lost":D?"cited":"not-cited",ae=x.useRef(0),pe=x.useCallback(async q=>{const W=++ae.current;if(q===-1||q===C.length-1){f(-1),m(null),i(!1);return}f(q),i(!1);const ie=C[q],ye=`${ie.runId}::${e.keyword}::${e.provider}`;if(v[ye]){m(v[ye]);return}y(!0);try{const we=await Oc(ie.runId);if(W!==ae.current)return;const te=we.snapshots.find(Se=>Se.keyword===e.keyword&&Se.provider===e.provider)??we.snapshots.find(Se=>Se.keyword===e.keyword),ue=te?{citationState:te.citationState,answerMentioned:te.answerMentioned,visibilityState:te.visibilityState,visibilityTransition:ie.visibilityTransition,provider:te.provider,model:te.model??null,answerSnippet:te.answerText??"",citedDomains:te.citedDomains,competitorDomains:te.competitorOverlap,recommendedCompetitors:te.recommendedCompetitors??[],matchedTerms:te.matchedTerms??[],groundingSources:te.groundingSources,evidenceUrls:[],changeLabel:cb(ie.visibilityTransition,ie.visibilityState),summary:""}:{citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:cb(ie.visibilityTransition,ie.visibilityState),summary:"Snapshot data not available for this run."};w(Se=>({...Se,[ye]:ue})),m(ue)}catch{if(W!==ae.current)return;m({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:cb(ie.visibilityTransition,ie.visibilityState),summary:"Failed to load historical run data."})}finally{W===ae.current&&y(!1)}},[C,e.keyword,e.provider,v]),B=(P||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,R=!P&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",V=D?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:B}:E.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:B}:z?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:B},X=()=>{if(!E.answerSnippet)return null;const q=E.answerSnippet.split(`
95
+ `),W=[];let ie=[],ye=0;const we=()=>{if(ie.length===0)return;const te=ie.join(" ").trim();te&&W.push(u.jsx("p",{className:W.length>0?"mt-2.5":"",children:VA(te,me)},ye++)),ie=[]};for(const te of q){const ue=te.trim();if(/^[-\u2013\u2014]{3,}$/.test(ue)){we(),W.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},ye++));continue}const Se=ue.match(/^(#{1,3})\s+(.+)$/);if(Se){we();const Z=Se[1].length,Me=Se[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Se[2],Ee=Z===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Z===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";W.push(u.jsx("p",{className:Ee,children:VA(Me,me)},ye++));continue}if(ue===""){we();continue}ie.push(ue)}return we(),W};return u.jsx(LR,{open:!0,onOpenChange:q=>{q||n()},children:u.jsxs(IR,{children:[u.jsx(e1,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(t1,{className:"evidence-modal","aria-describedby":void 0,children:[u.jsxs("div",{className:"evidence-modal-header",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",E.provider||"All providers"]}),u.jsx(n1,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(UR,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[u.jsx(fg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),A&&u.jsxs("div",{className:"evidence-modal-timeline",children:[u.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:C.map((q,W)=>{const ie=c===-1&&W===C.length-1||c===W,ye=q.visibilityState??(q.answerMentioned?"visible":"not-visible"),we=q.visibilityTransition??ye,te=ye==="visible"?"bg-emerald-400":we==="emerging"?"bg-amber-400":we==="lost"?"bg-rose-400":"bg-zinc-600",Se=new Date(q.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Z=!!(q.model&&W>0&&C[W-1]?.model&&C[W-1].model!==q.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${ie?"evidence-run-dot--selected":""}`,onClick:()=>pe(W===C.length-1?-1:W),"aria-label":[`Run ${Se}: ${ye}`,q.model?`model ${q.model}`:null,Z?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ie,children:[u.jsx("span",{className:`size-2 rounded-full ${te} ${Z?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),u.jsx("span",{className:"text-[10px] text-zinc-500",children:Se})]},W)})}),c>=0&&c<C.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(C[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:C[c].visibilityState??(C[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>pe(-1),children:["←"," Back to latest"]})]}),!P&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(q=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${q.fromModel??"unknown"} -> ${q.toModel??"unknown"} on ${new Date(q.createdAt).toLocaleDateString()}`},`${q.runId}:${q.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[g&&u.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!g&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${G}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${G}`,children:V.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${G}`,children:V.title}),u.jsx("p",{className:"evidence-position-meta",children:V.meta}),R&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:R})]}),E.answerSnippet&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),u.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:X()}),E.answerSnippet.length>280&&u.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!g&&u.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!P&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:D?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((q,W)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${D?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:D?u.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),u.jsx("span",{className:"action-item-text",children:q})]},W))})]}),E.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(K||U)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${s==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),u.jsx("button",{className:`sidebar-tab ${s==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),s==="mentions"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Answer visibility"}),u.jsx(Wn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),u.jsxs("div",{className:`mention-status mention-status--${D?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:z?"…":D?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:z?"Pending":D?"Visible":"Not visible"})]}),E.matchedTerms.length>0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.matchedTerms.map(q=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:q},q))})]}),!z&&!D&&E.matchedTerms.length===0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:H.map(q=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:q},q))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(E.recommendedCompetitors.length>0||E.competitorDomains.length>0)&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Competitors in answer"}),u.jsx(Wn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const q=E.competitorDomains.map(ye=>ye.replace(/^www\./,"")),W=new Set(q.map(ye=>GA(ye.replace(/\.[^.]+$/,""))));return[...E.recommendedCompetitors.filter(ye=>!W.has(GA(ye))),...q].map(ye=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:ye},ye))})()})]})]}),s==="sources"&&u.jsxs(u.Fragment,{children:[E.citedDomains.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Domains from source links"}),u.jsx(Wn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),u.jsx("div",{className:"citation-leaderboard",children:E.citedDomains.map((q,W)=>{const ie=q.toLowerCase().replace(/^www\./,""),ye=N.has(ie),we=!ye&&E.competitorDomains.some(ue=>ue.toLowerCase().replace(/^www\./,"")===ie),te=ye?"you":we?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${te}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",W+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:q}),ye&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),we&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},q)})})]}),E.groundingSources.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsxs("span",{children:["Grounding source links (",E.groundingSources.length,")"]}),u.jsx(Wn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),u.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((q,W)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:q.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:q.title||q.uri})},W))})]}),E.evidenceUrls.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),u.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(q=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:q,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:q})},q))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",P?"for this run":"yet"]})]}),!K&&!U&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",P?"for this run":"yet"]})]})]})]})]})]})})}function di(e){const t=new Date("2026-02-20");return e.map((n,r)=>({runId:`run_mock_${r+1}`,citationState:n,createdAt:new Date(t.getTime()+r*2*24*60*60*1e3).toISOString()}))}const ub=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function jg(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const jW=jg({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),NW=jg({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),CW=jg({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),_W=jg({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),OW=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:di(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:di(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:di(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:di(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:di(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:di(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:di(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:di(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:di(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];ub[0],ub[1],di(["cited","cited","cited","cited","cited"]),ub[2],2/7,di(["not-cited","not-cited","not-cited","cited"]);function kW(e,t){return e.projects.find(n=>n.project.id===t)}function AW(e,t){return e.runs.find(n=>n.id===t)}function EW(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}function _D(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function ZA(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function TW(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),s=r%60;return`${i}m ${s}s`}function OD(e){return e==="answer-visibility"?"Answer visibility sweep":e}function PW(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function d1(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:OD(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?ZA(e.startedAt):ZA(e.createdAt),duration:TW(e.startedAt,e.finishedAt),statusDetail:e.error?kD(e.error):zW(e),summary:MW(e),triggerLabel:PW(e.trigger)}}function kD(e){try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){const r=n.message??n.error?.message??n[0]?.error?.message;if(typeof r=="string"&&r.length>0)return r.length>200?r.slice(0,200)+"…":r}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const n=t[1];return n.length>200?n.slice(0,200)+"…":n}return e.length>200?e.slice(0,200)+"…":e}function zW(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?kD(e.error):"Run failed.";default:return""}}function MW(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function AD(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const s of e){const l=s.keyword??s.id;t.has(l)||t.set(l,!1),s.citationState==="cited"&&t.set(l,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function RW(e){return e>=70?"positive":e>=40?"caution":"negative"}function DW(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function LW(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function IW(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const s of e){const l=s.keywordId,c=t.get(l)??{cited:!1,competitorOverlap:new Set};s.citationState==="cited"&&(c.cited=!0);for(const f of s.competitorOverlap)c.competitorOverlap.add(f);t.set(l,c)}const n=t.size,r=[...t.values()].filter(s=>!s.cited&&s.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:LW(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function $W(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function UW(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function BW(e,t){const n=$W(e,t);if(!n||n.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const r=n.notIndexed===1?"URL is":"URLs are",i=n.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(n.percentage)}`,delta:`${n.provider} · ${n.indexed} of ${n.total} indexed`,tone:UW(n),description:n.provider==="Google"&&n.deindexed>0?`${n.deindexed} deindexed ${i} detected in the latest Google Search Console inspection.`:`${n.notIndexed} ${r} not indexed in ${n.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function ED(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const s of e)s.competitorOverlap.some(l=>n.has(l))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function qW(e,t,n,r){const i=[];let s=0;const l=new Set;if(n){const c=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;c.set(v,y)}const f=new Set(n.snapshots.map(y=>y.provider)),h=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),m=[...new Set([...f,...h])].sort(),g=m.length>0?m:["gemini"];for(const y of t){if(y.runs.length===0)continue;l.add(y.keyword);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const S of g){const N=c.get(`${y.keyword}::${S}`),C=(y.providerRuns?.[S]?.length??0)>0;if(!N&&!C)continue;const A=N?.model??null,k=A?`${S}:${A}`:null,_=k?y.modelRuns?.[k]:void 0,T=y.providerRuns?.[S],P=(T?.length?T:null)??(_?.length?_:null),E=T?.length?"provider":_?.length?"model":"keyword",z=P?P.at(-1).transition:w,D=P?P.at(-1).visibilityTransition??(P.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),K=P?.at(-1)?.citationState,U=P?.at(-1)?.visibilityState,I=N?z==="lost"?"lost":z==="emerging"?"emerging":N.citationState==="cited"?"cited":"not-cited":K==="cited"?"cited":"not-cited",H=N?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),ge=vw(P||y.runs),me=YA(P||y.runs),G=FW(y,S),ae=(P??y.runs).map(R=>({runId:R.runId,citationState:R.citationState,createdAt:R.createdAt,model:G.get(R.runId)??null,answerMentioned:R.answerMentioned,visibilityState:R.visibilityState,visibilityTransition:R.visibilityTransition})),pe=KW(ae),xe=E==="provider"&&pe.length<=1?"model":E,B=HW(ae);i.push({id:`evidence_${e}_${s++}`,keyword:y.keyword,provider:N?.provider??S,model:N?.model??null,location:N?.location??null,citationState:I,answerMentioned:N?.answerMentioned,visibilityState:H,visibilityChangeLabel:WA(D,me,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:WA(z,ge),answerSnippet:N?.answerText??"",citedDomains:N?.citedDomains??[],evidenceUrls:[],competitorDomains:N?.competitorOverlap??[],recommendedCompetitors:N?.recommendedCompetitors??[],matchedTerms:N?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:N?.groundingSources??[],summary:GW(H,D,y.keyword),runHistory:ae,historyScope:xe,modelsSeen:pe,modelTransitions:B})}}}for(const c of r)l.has(c.keyword)||i.push({id:`evidence_${e}_${s++}`,keyword:c.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function FW(e,t){const n=new Map,r=`${t}:`;for(const[i,s]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),c=l==="unknown"?null:l;for(const f of s)n.set(f.runId,c)}return n}function KW(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function HW(e){const t=[];let n=null;for(const r of e){const i=r.model??null;i!==n&&n!==null&&t.push({runId:r.runId,createdAt:r.createdAt,fromModel:n,toModel:i}),n=i}return t}function vw(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let n=0;for(let r=e.length-1;r>=0&&e[r].citationState===t;r--)n++;return n}function YA(e){if(e.length===0)return 0;const t=e[e.length-1].visibilityState??"not-visible";let n=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===t;r--)n++;return n}function WA(e,t,n){const r={positive:n?.positive??"cited",negative:n?.negative??"not cited",first:n?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return t<=1?`${td(r.positive)} in latest run`:`${td(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return td(r.first);case"not-cited":case"not-visible":return t<=1?`${td(r.negative)} in latest run`:`${td(r.negative)} across ${t} runs`;default:return e}}function td(e){return e.charAt(0).toUpperCase()+e.slice(1)}function GW(e,t,n){switch(t){case"lost":return`Visibility was lost for "${n}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${n}".`}switch(e){case"visible":return`Your brand or domain is visible in AI answers for "${n}".`;case"pending":return`"${n}" has been added but no visibility run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${n}".`}}function QA(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const s of i.competitorOverlap){if(!n.has(s))continue;const l=r.get(s)??new Set;l.add(i.keyword),r.set(s,l)}return r}const db=3;function VW(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:s}=e,l=[],c=[],f=new Set;for(const C of t)C.citationState==="lost"&&(f.has(C.keyword)||(f.add(C.keyword),c.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"lost"})));c.length>0&&l.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} key phrase${c.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const h=QA(r,s),m=QA(i,s);for(const C of s){const A=h.get(C)??new Set,k=m.get(C)??new Set,_=[...A].filter(T=>!k.has(T));_.length>0&&l.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:_.map(T=>{const P=t.find(E=>E.keyword===T);return{keyword:T,evidenceId:P?.id??"",citationState:"cited"}})})}const g=new Map;for(const C of n){const A=C.runs.at(-1);A&&g.set(C.keyword,{transition:A.transition,citationState:A.citationState})}const y=[],v=[],w=new Set;for(const[C,{transition:A,citationState:k}]of g){if(!(A==="emerging"||A==="new"&&k==="cited"))continue;w.add(C);const T=t.find(P=>P.keyword===C&&(P.citationState==="emerging"||P.citationState==="cited"));y.push({keyword:C,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(w.has(C.keyword)||v.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(v.length>0){const C=new Set(v.map(A=>A.keyword)).size;l.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${C} key phrase${C>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&l.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const S=new Set(t.map(C=>C.keyword)),N=[];for(const C of n){if(!S.has(C.keyword)||C.runs.length<db||C.runs.at(-1)?.citationState!=="not-cited")continue;if(vw(C.runs)>=db){const _=t.find(T=>T.keyword===C.keyword);N.push({keyword:C.keyword,evidenceId:_?.id??"",citationState:"not-cited"})}}N.length>0&&l.push({id:"insight_persistent_gap",tone:"caution",title:`${N.length} key phrase${N.length>1?"s":""} uncited for ${db}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:N});for(const C of s){const A=h.get(C)??new Set,_=[...m.get(C)??new Set].filter(T=>!A.has(T));_.length>0&&l.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:_.map(T=>{const P=t.find(E=>E.keyword===T);return{keyword:T,evidenceId:P?.id??"",citationState:"not-cited"}})})}return l.length===0&&l.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),l}function ZW(e,t){if(t.length===0){const f=new Set(e.filter(h=>h.citationState==="cited").map(h=>h.keyword)).size;return{gained:f,lost:0,tone:f>0?"positive":"neutral",hasPreviousRun:!1}}const n=f=>{const h=new Set;for(const m of f)m.citationState==="cited"&&m.keyword&&h.add(m.keyword);return h},r=n(e),i=n(t);let s=0,l=0;for(const f of r)i.has(f)||s++;for(const f of i)r.has(f)||l++;const c=l>s?"negative":s>l?"positive":"neutral";return{gained:s,lost:l,tone:c,hasPreviousRun:!0}}function YW(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const n=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",r=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:n,delta:`${e.length} total runs`,tone:r,description:`Latest: ${OD(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function WW(e){const t=_D(e.project),n=qW(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.latestRunDetail?.snapshots??[],i=AD(r),s=IW(r),l=BW(e.gscCoverage,e.bingCoverage),c=ED(r,e.competitors.map(v=>v.domain)),f=VW({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(v=>v.domain)}),h=[...e.runs].sort((v,w)=>w.createdAt.localeCompare(v.createdAt)),m=h.map(v=>d1(v,e.project.displayName||e.project.name)),g=new Map;for(const v of r){const w=v.provider||"gemini",S=v.model??null,N=`${w}::${S??"unknown"}`,C=g.get(N)??{provider:w,model:S,cited:0,total:0};C.total++,v.citationState==="cited"&&C.cited++,g.set(N,C)}const y=[...g.values()].sort((v,w)=>v.provider.localeCompare(w.provider)||(v.model??"").localeCompare(w.model??"")).map(({provider:v,model:w,cited:S,total:N})=>({provider:v,model:w,score:N>0?Math.round(S/N*100):0,cited:S,total:N}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:r.length>0?`${i.score}`:"No data",delta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible`:"Run a sweep first",tone:r.length>0?RW(i.score):"neutral",description:r.length>0?`${i.citedCount} of ${i.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},keywordCounts:{cited:i.citedCount,total:i.totalCount},gapKeyPhrases:s,indexCoverage:l,providerScores:y,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:DW(c.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:YW(h),movementSummary:ZW(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:f,visibilityEvidence:n,competitors:e.competitors.map((v,w)=>{const S=new Set;for(const _ of r)(_.competitorOverlap.includes(v.domain)||_.citedDomains.includes(v.domain))&&_.keyword&&S.add(_.keyword);const N=[...S],C=new Set(r.map(_=>_.keyword).filter(Boolean)),A=C.size>0?N.length/C.size:0,k=A>=.5?"High":A>=.2?"Moderate":N.length>0?"Low":"None";return{id:v.id||`comp_${w}`,domain:v.domain,citationCount:N.length,totalKeywords:C.size,pressureLabel:k,citedKeywords:N,movement:"",notes:""}}),recentRuns:m.slice(0,5)}}function QW(e){const t=_D(e.project),n=e.latestRunDetail?.snapshots??[],r=AD(n),i=ED(n,e.competitors.map(f=>f.domain)),l=[...e.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt))[0],c=l?d1(l,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:r.score,visibilityDelta:n.length>0?`${r.citedCount} of ${r.totalCount} key phrases`:"No data",lastRun:c,insight:n.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible across ${new Set(n.map(f=>f.provider)).size} provider${new Set(n.map(f=>f.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:i.label}}function XW(e,t){const n=[],r=[],i=[];for(const l of e){r.push(WW(l)),i.push(QW(l));const c=[...l.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt));for(const f of c)n.push(d1(f,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const s=e.length>0;return{portfolioOverview:{projects:i,attentionItems:s?JW(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...s?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:s,ctaLabel:s?"Trigger run":"Create a project first",summary:s?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function JW(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(s=>s.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(s=>s.status==="running"||s.status==="queued");i.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${i.length} run${i.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Zr={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},TD=x.createContext(null);TD.Provider;function ef(){return x.useContext(TD)}function al(e){const n=ef()?.dashboard??null,r=To({queryKey:Zr.projects.all,queryFn:NM,enabled:!n}),i=To({queryKey:Zr.runs.all,queryFn:_M,enabled:!n,refetchInterval:w=>w.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),s=To({queryKey:Zr.settings,queryFn:()=>KS().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],f=gB({queries:l.map(w=>{const S=c.filter(C=>C.projectId===w.id),N=S.filter(C=>(C.status==="completed"||C.status==="partial")&&C.kind==="answer-visibility").sort((C,A)=>A.createdAt.localeCompare(C.createdAt));return{queryKey:Zr.projects.detail(w.id,N[0]?.id),queryFn:async()=>{const[C,A,k,_,T,P,E]=await Promise.all([Sq(w.name).catch(()=>[]),OM(w.name).catch(()=>[]),kM(w.name).catch(()=>[]),N[0]?Oc(N[0].id).catch(()=>null):Promise.resolve(null),N[1]?Oc(N[1].id).catch(()=>null):Promise.resolve(null),HS(w.name).catch(()=>null),GS(w.name).catch(()=>null)]);return{project:w,runs:S,keywords:C,competitors:A,timeline:k,latestRunDetail:_,previousRunDetail:T,gscCoverage:P,bingCoverage:E}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),h=f.every(w=>w.isSuccess),m=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!h)return null;const w=f.map(S=>S.data).filter(S=>S!=null);return XW(w,s.data??null)},[n,r.data,i.data,s.data,h,f,l.length]),g=!n&&(r.isError||i.isError),y=!n&&!m&&!g,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),s.refetch()])},[r.refetch,i.refetch,s.refetch]);return{dashboard:m,isLoading:y,isError:g,refetch:v}}function eQ(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const XA=eQ(),bw=XA==="/"?"":XA.replace(/\/$/,"");async function tQ(){const e=bw?`${bw}/health`:"/health",t=await y9(e,"API"),n=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:n}}function Ng(e,t){return To({queryKey:Zr.health,queryFn:tQ,enabled:e,refetchInterval:15e3,initialData:t})}function nQ(e){return To({queryKey:Zr.runs.detail(e??""),queryFn:()=>Oc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Kc(){const e=Is(),t=cg({strict:!1}),n=hr({select:f=>f.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:f=>e({to:n,from:vi.to,search:h=>({...h,runId:f,evidenceId:void 0})}),openEvidence:f=>e({to:n,from:vi.to,search:h=>({...h,evidenceId:f,runId:void 0})}),closeDrawer:()=>e({to:n,from:vi.to,search:f=>({...f,runId:void 0,evidenceId:void 0})})}}const rQ={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function iQ(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function aQ(){const e=x.useSyncExternalStore(j9,Zk,Zk),t=Is(),{openRun:n}=Kc(),r=x.useCallback(s=>{ow(s)},[]),i=x.useCallback(s=>{s.cta&&(s.cta.intent==="open-run-drawer"?n(s.cta.runId):t({to:"/runs"}),ow(s.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(s=>u.jsxs("section",{role:s.tone==="negative"?"alert":"status","aria-live":s.tone==="negative"?"assertive":"polite","data-state":s.state,className:`toast-card ${rQ[s.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:s.title}),s.detail?u.jsx("p",{className:"toast-detail",children:s.detail}):null,s.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(s),"aria-label":iQ(s),children:s.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(s.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(fg,{className:"size-3.5"})})]},s.id))})}const JA=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],eE=e=>({label:e,state:"checking",detail:"Checking service health"}),sQ={apiStatus:eE("API"),workerStatus:eE("Worker")};function oQ(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function lQ(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function cQ(e){const t=oQ(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function uQ(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function dQ(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function fQ(e,t){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,t>0?`${t} skipped at queue time`:null].filter(Boolean).join(", ")}function hQ(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function pQ(){const e=x.useSyncExternalStore(hF,Fo,Fo),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=To({queryKey:Zr.runs.all,queryFn:_M,enabled:t}),r=To({queryKey:Zr.projects.all,queryFn:NM,enabled:t}),i=x.useRef({}),s=x.useCallback(()=>{n.refetch()},[n.refetch]);return x.useEffect(()=>{t&&s()},[t,s]),x.useEffect(()=>{if(!t||typeof window>"u")return;const l=()=>{document.visibilityState==="visible"&&s()};return window.addEventListener("focus",s),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",l)}},[t,s]),x.useEffect(()=>{const l=n.data??[],c=r.data??[],f=Object.fromEntries(l.map(m=>[m.id,m])),h=Object.fromEntries(l.map(m=>[m.id,m.status]));for(const m of Object.values(e.runs)){const g=f[m.runId];if(!g||!gF(g.status)||(i.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;if(m.sourceAction==="run-all"){eA(g.id);continue}const v=dQ(g.projectId,m.projectLabel,c);Xe({title:cQ(g),detail:uQ(g,v),tone:lQ(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),eA(g.id)}for(const m of Object.values(e.batches)){const g=yF(m.runIds,f);g.finished&&(Xe({title:"Run-all batch finished",detail:fQ(g,m.skippedCount),tone:hQ(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),mF(m.batchId))}i.current=h},[r.data,n.data,e]),null}function mQ(){const e=ef(),{dashboard:t,isLoading:n,refetch:r}=al(),l=Ng(!e,e?.health).data??e?.health??sQ,c=vq(),{runId:f,evidenceId:h,closeDrawer:m}=Kc(),[g,y]=x.useState(!1),v=nQ(f),w=v.data??null,S=v.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{y(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!f&&!h)return;const _=T=>{T.key==="Escape"&&m()};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[f,h,m]);const N=t??e?.dashboard??null,C=f&&N?AW(N,f):void 0,A=h&&N?EW(N,h):void 0,k=(()=>{const _=c.pathname;if(_==="/")return"Portfolio";if(_==="/projects")return"Projects";if(_==="/runs")return"Runs";if(_==="/settings")return"Settings";if(_==="/setup")return"Setup";if(_.startsWith("/projects/")){const P=_.split("/").filter(Boolean)[1];if(P&&N){const E=N.projects.find(z=>z.project.id===P);if(E)return E.project.name}return"Project"}return"Not found"})();return u.jsxs("div",{className:"app-shell",children:[u.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),u.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[u.jsx("div",{className:"sidebar-brand",children:u.jsx(uA,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Dt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(I9,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Dt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(D9,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Dt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(q9,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Dt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(W9,{className:"sidebar-icon"}),u.jsx("span",{children:"Settings"})]}),n?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(_=>u.jsxs("div",{className:"sidebar-skeleton-item",children:[u.jsx("span",{className:"skeleton-circle size-2"}),u.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+_*15}%`}})]},_))]}):N&&N.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),N.projects.map(_=>{const T=_.visibilitySummary.tone;return u.jsxs(Dt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[u.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),u.jsx("span",{children:_.project.name})]},_.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Dt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(G9,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:JA.map(_=>u.jsx("a",{className:"sidebar-footer-link",href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]}),u.jsxs("div",{className:"main-area",children:[u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-left",children:[u.jsx("div",{className:"topbar-brand-mobile",children:u.jsx(uA,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Dt,{to:"/",children:"Home"}),u.jsx(dg,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:k})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),u.jsxs(he,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":g,"aria-controls":"mobile-nav",onClick:()=>y(_=>!_),children:[u.jsx(U9,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${g?"mobile-nav-open":""}`,children:[u.jsxs(he,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[u.jsx(fg,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Dt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Dt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Dt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Dt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),N&&N.projects.length>0?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),N.projects.map(_=>u.jsx(Dt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"mobile-nav-link",children:_.project.name},_.project.id))]}):null]}),u.jsx("main",{id:"content",className:"page-shell",children:n&&!e?u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-40"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(_=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text w-full"}),u.jsx("div",{className:"skeleton-text-sm w-3/4"})]},_))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(_=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-20"}),u.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>u.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},_))})]}):u.jsx(FS,{})}),u.jsxs("footer",{className:"footer",children:[u.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[u.jsx(M9,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:JA.map(_=>u.jsx("a",{href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]})]}),C?u.jsxs(i7,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:m,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(gg,{status:C.status}),u.jsx("span",{className:"text-zinc-400",children:C.startedAt}),u.jsx("span",{className:"text-zinc-500",children:C.duration}),u.jsx("span",{className:"text-zinc-600",children:C.triggerLabel})]}),C.status==="failed"&&C.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:C.statusDetail}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(_=>u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:_.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ad,{provider:_.provider}),u.jsx(iR,{variant:_.citationState==="cited"?"success":"neutral",children:_.citationState})]})]}),_.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:_.model}),_.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",_.citedDomains.join(", ")]}),_.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",_.competitorOverlap.join(", ")]}),_.groundingSources&&_.groundingSources.length>0&&u.jsxs("details",{className:"mt-2",children:[u.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[_.groundingSources.length," grounding source",_.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:_.groundingSources.map((T,P)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:T.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},P))})]}),_.answerText&&u.jsxs("details",{className:"mt-1",children:[u.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),u.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:_.answerText})]})]},_.id)),w.status==="running"&&u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?u.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[u.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),u.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:sF(w.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?u.jsx(SW,{evidence:A.evidence,project:A.project,onClose:m}):null,u.jsx(pQ,{}),u.jsx(aQ,{})]})}class gQ extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?u.jsx("div",{className:"page-container",children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[u.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:u.jsx(eF,{className:"size-6 text-rose-400"})}),u.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),u.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),u.jsxs("div",{className:"flex gap-3 mt-2",children:[u.jsxs(he,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(Z9,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(he,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Ue=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ni("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));Ue.displayName="Card";const xw=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ni("flex flex-col gap-1.5 p-5",e),...t}));xw.displayName="CardHeader";const ww=x.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ni("font-medium tracking-tight text-zinc-50",e),...t}));ww.displayName="CardTitle";const Sw=x.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ni("text-sm text-zinc-500",e),...t}));Sw.displayName="CardDescription";const zp=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ni("p-5 pt-0",e),...t}));zp.displayName="CardContent";function yQ({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,s=5,l=Math.min(...e),f=Math.max(...e)-l||1,h=i-s*2,m=r-s*2,g=e.map((y,v)=>{const w=s+v/Math.max(e.length-1,1)*h,S=s+(1-(y-l)/f)*m;return`${w},${S}`}).join(" ");return u.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[u.jsx("defs",{children:u.jsx("clipPath",{id:n,children:u.jsx("rect",{x:s,y:s,width:h,height:m,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:s,x2:i-s,y1:r-s,y2:r-s}),u.jsx("polyline",{clipPath:`url(#${n})`,points:g,vectorEffect:"non-scaling-stroke"})]})}function vQ(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function bQ(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:nm(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:nm(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(f=>f.state==="ready").length,s=n.providerStatuses.length,l=i>0,c=n.providerStatuses.filter(f=>f.state==="ready").map(f=>vQ(f)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${s} configured`,meta:c||"None configured"}})}function xQ(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(n=>n.state==="ready"))return"Launch is blocked until at least one provider is configured."}function wQ(e,t,n){const r=xQ(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(s=>{if(s.id==="api")return{...s,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(s.id==="worker")return{...s,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(c=>c.state==="ready");return{...s,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}function SQ({project:e}){return u.jsxs(Dt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[u.jsxs("div",{className:"project-row-primary",children:[u.jsxs("div",{children:[u.jsx("p",{className:"project-name",children:e.project.name}),u.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),u.jsx("p",{className:"project-insight",children:e.insight})]}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),u.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),u.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),u.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),u.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",hg(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(yQ,{points:e.trend,tone:aR(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(dg,{className:"h-4 w-4 text-zinc-500"})})]})}function jQ(){const e=ef(),{dashboard:t,isLoading:n}=al(),r=t??e?.dashboard;if(!r||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-32"}),u.jsx("div",{className:"skeleton-text-sm w-64"})]}),u.jsx("div",{className:"space-y-3",children:[1,2,3].map(m=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("div",{className:"skeleton-text w-36"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},m))})]});const i=r.portfolioOverview,c=Ng(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},f=bQ(i.systemHealth,c,r.settings),{openRun:h}=Kc();return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Portfolio"}),u.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),u.jsx("div",{className:"page-header-right",children:u.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?u.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(m=>u.jsx(SQ,{project:m},m.project.id))}):u.jsxs(Ue,{className:"surface-card empty-card",children:[u.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),u.jsx(he,{size:"sm",asChild:!0,children:u.jsx(Dt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),u.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),u.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),u.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(m=>u.jsxs(Dt,{to:m.href,className:`attention-item attention-item-${m.tone}`,children:[u.jsxs("div",{children:[u.jsx("p",{className:"attention-title",children:m.title}),u.jsx("p",{className:"attention-detail",children:m.detail})]}),u.jsx("span",{className:"attention-action",children:m.actionLabel})]},m.id))})]}),u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),u.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),u.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(m=>u.jsxs("button",{className:"compact-run",type:"button",onClick:()=>h(m.id),children:[u.jsxs("div",{children:[u.jsx("p",{className:"compact-run-title",children:m.projectName}),u.jsx("p",{className:"compact-run-detail",children:m.summary})]}),u.jsx(gg,{status:m.status})]},m.id)):u.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),u.jsxs("section",{className:"page-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),u.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),u.jsx("div",{className:"health-grid",children:f.map(m=>u.jsxs(Ue,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:m.label}),u.jsx("h3",{children:m.detail})]}),u.jsx(yt,{tone:m.tone,children:m.label})]}),u.jsx("p",{className:"supporting-copy",children:m.meta})]},m.id))})]})]})}const f1=Symbol.for("yaml.alias"),jw=Symbol.for("yaml.document"),Os=Symbol.for("yaml.map"),PD=Symbol.for("yaml.pair"),Fi=Symbol.for("yaml.scalar"),Hc=Symbol.for("yaml.seq"),Xr=Symbol.for("yaml.node.type"),sl=e=>!!e&&typeof e=="object"&&e[Xr]===f1,Cg=e=>!!e&&typeof e=="object"&&e[Xr]===jw,tf=e=>!!e&&typeof e=="object"&&e[Xr]===Os,rn=e=>!!e&&typeof e=="object"&&e[Xr]===PD,At=e=>!!e&&typeof e=="object"&&e[Xr]===Fi,nf=e=>!!e&&typeof e=="object"&&e[Xr]===Hc;function tn(e){if(e&&typeof e=="object")switch(e[Xr]){case Os:case Hc:return!0}return!1}function nn(e){if(e&&typeof e=="object")switch(e[Xr]){case f1:case Os:case Fi:case Hc:return!0}return!1}const zD=e=>(At(e)||tn(e))&&!!e.anchor,vo=Symbol("break visit"),NQ=Symbol("skip children"),xd=Symbol("remove node");function Gc(e,t){const n=CQ(t);Cg(e)?hc(null,e.contents,n,Object.freeze([e]))===xd&&(e.contents=null):hc(null,e,n,Object.freeze([]))}Gc.BREAK=vo;Gc.SKIP=NQ;Gc.REMOVE=xd;function hc(e,t,n,r){const i=_Q(e,t,n,r);if(nn(i)||rn(i))return OQ(e,r,i),hc(e,i,n,r);if(typeof i!="symbol"){if(tn(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){const l=hc(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===vo)return vo;l===xd&&(t.items.splice(s,1),s-=1)}}}else if(rn(t)){r=Object.freeze(r.concat(t));const s=hc("key",t.key,n,r);if(s===vo)return vo;s===xd&&(t.key=null);const l=hc("value",t.value,n,r);if(l===vo)return vo;l===xd&&(t.value=null)}}return i}function CQ(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function _Q(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(tf(t))return n.Map?.(e,t,r);if(nf(t))return n.Seq?.(e,t,r);if(rn(t))return n.Pair?.(e,t,r);if(At(t))return n.Scalar?.(e,t,r);if(sl(t))return n.Alias?.(e,t,r)}function OQ(e,t,n){const r=t[t.length-1];if(tn(r))r.items[e]=n;else if(rn(r))e==="key"?r.key=n:r.value=n;else if(Cg(r))r.contents=n;else{const i=sl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const kQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},AQ=e=>e.replace(/[!,[\]{}]/g,t=>kQ[t]);class Yn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Yn.defaultYaml,t),this.tags=Object.assign({},Yn.defaultTags,n)}clone(){const t=new Yn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Yn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Yn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Yn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Yn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Yn.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,l]=r;return this.tags[s]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const l=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+AQ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&nn(t.contents)){const s={};Gc(t.contents,(l,c)=>{nn(c)&&c.tag&&(s[c.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,l]of r)s==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${s} ${l}`);return n.join(`
96
+ `)}}Yn.defaultYaml={explicit:!1,version:"1.2"};Yn.defaultTags={"!!":"tag:yaml.org,2002:"};function MD(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function RD(e){const t=new Set;return Gc(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function DD(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function EQ(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=RD(e));const l=DD(t,i);return i.add(l),l},setAnchors:()=>{for(const s of n){const l=r.get(s);if(typeof l=="object"&&l.anchor&&(At(l.node)||tn(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=s,c}}},sourceObjects:r}}function pc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const l=r[i],c=pc(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),l=pc(e,r,i,s);l===void 0?r.delete(i):l!==s&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const s=pc(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const l=pc(e,r,i,s);l===void 0?delete r[i]:l!==s&&(r[i]=l)}return e.call(t,n,r)}function Qr(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Qr(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!zD(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class h1{constructor(t){Object.defineProperty(this,Xr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Cg(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Qr(this,"",l);if(typeof i=="function")for(const{count:f,res:h}of l.anchors.values())i(h,f);return typeof s=="function"?pc(s,{"":c},"",c):c}}class p1 extends h1{constructor(t){super(f1),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Gc(t,{Node:(s,l)=>{(sl(l)||zD(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,l=this.resolve(i,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=r.get(l);if(c||(Qr(l,null,n),c=r.get(l)),c?.res===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Mp(i,l,r)),c.count*c.aliasCount>s)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(MD(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Mp(e,t,n){if(sl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(tn(t)){let r=0;for(const i of t.items){const s=Mp(e,i,n);s>r&&(r=s)}return r}else if(rn(t)){const r=Mp(e,t.key,n),i=Mp(e,t.value,n);return Math.max(r,i)}return 1}const LD=e=>!e||typeof e!="function"&&typeof e!="object";class Be extends h1{constructor(t){super(Fi),this.value=t}toJSON(t,n){return n?.keep?this.value:Qr(this.value,t,n)}toString(){return String(this.value)}}Be.BLOCK_FOLDED="BLOCK_FOLDED";Be.BLOCK_LITERAL="BLOCK_LITERAL";Be.PLAIN="PLAIN";Be.QUOTE_DOUBLE="QUOTE_DOUBLE";Be.QUOTE_SINGLE="QUOTE_SINGLE";const TQ="tag:yaml.org,2002:";function PQ(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Md(e,t,n){if(Cg(e)&&(e=e.contents),nn(e))return e;if(rn(e)){const g=n.schema[Os].createNode?.(n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:l,sourceObjects:c}=n;let f;if(r&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=i(e)),new p1(f.anchor);f={anchor:null,node:null},c.set(e,f)}t?.startsWith("!!")&&(t=TQ+t.slice(2));let h=PQ(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Be(e);return f&&(f.node=g),g}h=e instanceof Map?l[Os]:Symbol.iterator in Object(e)?l[Hc]:l[Os]}s&&(s(h),delete n.onTagObj);const m=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new Be(e);return t?m.tag=t:h.default||(m.tag=h.tag),f&&(f.node=m),m}function cm(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const l=[];l[s]=r,r=l}else r=new Map([[s,r]])}return Md(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const pd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class ID extends h1{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>nn(r)||rn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(pd(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(tn(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,cm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(tn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&At(s)?s.value:s:tn(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!rn(n))return!1;const r=n.value;return r==null||t&&At(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return tn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(tn(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,cm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const zQ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function wa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const _o=(e,t,n)=>e.endsWith(`
97
+ `)?wa(n,t):n.includes(`
98
+ `)?`
99
+ `+wa(n,t):(e.endsWith(" ")?"":" ")+n,$D="flow",Nw="block",Rp="quoted";function _g(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:l,onOverflow:c}={}){if(!i||i<0)return e;i<s&&(s=0);const f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;const h=[],m={};let g=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?h.push(0):g=i-r);let y,v,w=!1,S=-1,N=-1,C=-1;n===Nw&&(S=tE(e,S,t.length),S!==-1&&(g=S+f));for(let k;k=e[S+=1];){if(n===Rp&&k==="\\"){switch(N=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}C=S}if(k===`
100
+ `)n===Nw&&(S=tE(e,S,t.length)),g=S+t.length+f,y=void 0;else{if(k===" "&&v&&v!==" "&&v!==`
101
+ `&&v!==" "){const _=e[S+1];_&&_!==" "&&_!==`
102
+ `&&_!==" "&&(y=S)}if(S>=g)if(y)h.push(y),g=y+f,y=void 0;else if(n===Rp){for(;v===" "||v===" ";)v=k,k=e[S+=1],w=!0;const _=S>C+1?S-2:N-1;if(m[_])return e;h.push(_),m[_]=!0,g=_+f,y=void 0}else w=!0}v=k}if(w&&c&&c(),h.length===0)return e;l&&l();let A=e.slice(0,h[0]);for(let k=0;k<h.length;++k){const _=h[k],T=h[k+1]||e.length;_===0?A=`
103
+ ${t}${e.slice(0,T)}`:(n===Rp&&m[_]&&(A+=`${e[_]}\\`),A+=`
104
+ ${t}${e.slice(_+1,T)}`)}return A}function tE(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
105
+ `);r=t,i=t+1,s=e[i]}return r}const Og=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),kg=e=>/^(%|---|\.\.\.)/m.test(e);function MQ(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,l=0;s<i;++s)if(e[s]===`
106
+ `){if(s-l>r)return!0;if(l=s+1,i-l<=r)return!1}return!0}function wd(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(kg(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const m=n.substr(f+2,4);switch(m){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:m.substr(0,2)==="00"?l+="\\x"+m.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(r||n[f+2]==='"'||n.length<i)f+=1;else{for(l+=n.slice(c,f)+`
107
+
108
+ `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
109
+ `,f+=2;l+=s,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,r?l:_g(l,s,Rp,Og(t,!1))}function Cw(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
+ `)||/[ \t]\n|\n[ \t]/.test(e))return wd(e,t);const n=t.indent||(kg(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
+ ${n}`)+"'";return t.implicitKey?r:_g(r,n,$D,Og(t,!1))}function mc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=wd;else{const i=e.includes('"'),s=e.includes("'");i&&!s?r=Cw:s&&!i?r=wd:r=n?Cw:wd}return r(e,t)}let _w;try{_w=new RegExp(`(^|(?<!
112
+ ))
113
+ +(?!
114
+ |$)`,"g")}catch{_w=/\n+(?!\n|$)/g}function Dp({comment:e,type:t,value:n},r,i,s){const{blockQuote:l,commentString:c,lineWidth:f}=r.options;if(!l||/\n[\t ]+$/.test(n))return mc(n,r);const h=r.indent||(r.forceBlockIndent||kg(n)?" ":""),m=l==="literal"?!0:l==="folded"||t===Be.BLOCK_FOLDED?!1:t===Be.BLOCK_LITERAL?!0:!MQ(n,f,h.length);if(!n)return m?`|
115
+ `:`>
116
+ `;let g,y;for(y=n.length;y>0;--y){const T=n[y-1];if(T!==`
117
+ `&&T!==" "&&T!==" ")break}let v=n.substring(y);const w=v.indexOf(`
118
+ `);w===-1?g="-":n===v||w!==v.length-1?(g="+",s&&s()):g="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
119
+ `&&(v=v.slice(0,-1)),v=v.replace(_w,`$&${h}`));let S=!1,N,C=-1;for(N=0;N<n.length;++N){const T=n[N];if(T===" ")S=!0;else if(T===`
120
+ `)C=N;else break}let A=n.substring(0,C<N?C+1:N);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${h}`));let _=(S?h?"2":"1":"")+g;if(e&&(_+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){const T=n.replace(/\n+/g,`
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let P=!1;const E=Og(r,!0);l!=="folded"&&t!==Be.BLOCK_FOLDED&&(E.onOverflow=()=>{P=!0});const z=_g(`${A}${T}${v}`,h,Nw,E);if(!P)return`>${_}
122
+ ${h}${z}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
123
+ ${h}${A}${n}${v}`}function RQ(e,t,n,r){const{type:i,value:s}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:m}=t;if(c&&s.includes(`
124
+ `)||m&&/[[\]{},]/.test(s))return mc(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||m||!s.includes(`
125
+ `)?mc(s,t):Dp(e,t,n,r);if(!c&&!m&&i!==Be.PLAIN&&s.includes(`
126
+ `))return Dp(e,t,n,r);if(kg(s)){if(f==="")return t.forceBlockIndent=!0,Dp(e,t,n,r);if(c&&f===h)return mc(s,t)}const g=s.replace(/\n+/g,`$&
127
+ ${f}`);if(l){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(g),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return mc(s,t)}return c?g:_g(g,f,$D,Og(t,!1))}function m1(e,t,n,r){const{implicitKey:i,inFlow:s}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Be.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Be.QUOTE_DOUBLE);const f=m=>{switch(m){case Be.BLOCK_FOLDED:case Be.BLOCK_LITERAL:return i||s?mc(l.value,t):Dp(l,t,n,r);case Be.QUOTE_DOUBLE:return wd(l.value,t);case Be.QUOTE_SINGLE:return Cw(l.value,t);case Be.PLAIN:return RQ(l,t,n,r);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:m,defaultStringType:g}=t.options,y=i&&m||g;if(h=f(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function UD(e,t){const n=Object.assign({blockQuote:!0,commentString:zQ,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function DQ(e,t){if(t.tag){const i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(At(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){const s=i.filter(l=>l.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function LQ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(At(e)||tn(e))&&e.anchor;s&&MD(s)&&(n.add(s),i.push(`&${s}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function Ec(e,t,n,r){if(rn(e))return e.toString(t,n,r);if(sl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const s=nn(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=DQ(t.doc.schema.tags,s));const l=LQ(s,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(s,t,n,r):At(s)?m1(s,t,n,r):s.toString(t,n,r);return l?At(s)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
128
+ ${t.indent}${c}`:c}function IQ({key:e,value:t},n,r,i){const{allNullValues:s,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:m,simpleKeys:g}}=n;let y=nn(e)&&e.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(tn(e)||!nn(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let v=!g&&(!e||y&&t==null&&!n.inFlow||tn(e)||(At(e)?e.type===Be.BLOCK_FOLDED||e.type===Be.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(g||!s),indent:c+f});let w=!1,S=!1,N=Ec(e,n,()=>w=!0,()=>S=!0);if(!v&&!n.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(s||t==null)return w&&r&&r(),N===""?"?":v?`? ${N}`:N}else if(s&&!g||t==null&&v)return N=`? ${N}`,y&&!w?N+=_o(N,n.indent,h(y)):S&&i&&i(),N;w&&(y=null),v?(y&&(N+=_o(N,n.indent,h(y))),N=`? ${N}
129
+ ${c}:`):(N=`${N}:`,y&&(N+=_o(N,n.indent,h(y))));let C,A,k;nn(t)?(C=!!t.spaceBefore,A=t.commentBefore,k=t.comment):(C=!1,A=null,k=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!y&&At(t)&&(n.indentAtStart=N.length+1),S=!1,!m&&f.length>=2&&!n.inFlow&&!v&&nf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const T=Ec(t,n,()=>_=!0,()=>S=!0);let P=" ";if(y||C||A){if(P=C?`
130
+ `:"",A){const E=h(A);P+=`
131
+ ${wa(E,n.indent)}`}T===""&&!n.inFlow?P===`
132
+ `&&k&&(P=`
133
+
134
+ `):P+=`
135
+ ${n.indent}`}else if(!v&&tn(t)){const E=T[0],z=T.indexOf(`
136
+ `),D=z!==-1,K=n.inFlow??t.flow??t.items.length===0;if(D||!K){let U=!1;if(D&&(E==="&"||E==="!")){let I=T.indexOf(" ");E==="&"&&I!==-1&&I<z&&T[I+1]==="!"&&(I=T.indexOf(" ",I+1)),(I===-1||z<I)&&(U=!0)}U||(P=`
137
+ ${n.indent}`)}}else(T===""||T[0]===`
138
+ `)&&(P="");return N+=P+T,n.inFlow?_&&r&&r():k&&!_?N+=_o(N,n.indent,h(k)):S&&i&&i(),N}function $Q(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const np="<<",Na={identify:e=>e===np||typeof e=="symbol"&&e.description===np,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Be(Symbol(np)),{addToJSMap:BD}),stringify:()=>np},UQ=(e,t)=>(Na.identify(t)||At(t)&&(!t.type||t.type===Be.PLAIN)&&Na.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Na.tag&&n.default);function BD(e,t,n){if(n=e&&sl(n)?n.resolve(e.doc):n,nf(n))for(const r of n.items)fb(e,t,r);else if(Array.isArray(n))for(const r of n)fb(e,t,r);else fb(e,t,n)}function fb(e,t,n){const r=e&&sl(n)?n.resolve(e.doc):n;if(!tf(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,l]of i)t instanceof Map?t.has(s)||t.set(s,l):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function qD(e,t,{key:n,value:r}){if(nn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(UQ(e,n))BD(e,t,r);else{const i=Qr(n,"",e);if(t instanceof Map)t.set(i,Qr(r,i,e));else if(t instanceof Set)t.add(i);else{const s=BQ(n,i,e),l=Qr(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function BQ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(nn(e)&&n?.doc){const r=UD(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),$Q(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function g1(e,t,n){const r=Md(e,void 0,n),i=Md(t,void 0,n);return new Jn(r,i)}class Jn{constructor(t,n=null){Object.defineProperty(this,Xr,{value:PD}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return nn(n)&&(n=n.clone(t)),nn(r)&&(r=r.clone(t)),new Jn(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return qD(n,r,this)}toString(t,n,r){return t?.doc?IQ(this,t,n,r):JSON.stringify(this)}}function FD(e,t,n){return(t.inFlow??e.flow?FQ:qQ)(e,t,n)}function qQ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,m=Object.assign({},n,{indent:s,type:null});let g=!1;const y=[];for(let w=0;w<t.length;++w){const S=t[w];let N=null;if(nn(S))!g&&S.spaceBefore&&y.push(""),um(n,y,S.commentBefore,g),S.comment&&(N=S.comment);else if(rn(S)){const A=nn(S.key)?S.key:null;A&&(!g&&A.spaceBefore&&y.push(""),um(n,y,A.commentBefore,g))}g=!1;let C=Ec(S,m,()=>N=null,()=>g=!0);N&&(C+=_o(C,s,h(N))),g&&N&&(g=!1),y.push(r+C)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const S=y[w];v+=S?`
139
+ ${f}${S}`:`
140
+ `}}return e?(v+=`
141
+ `+wa(h(e),f),c&&c()):g&&l&&l(),v}function FQ({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:l,options:{commentString:c}}=t;r+=s;const f=Object.assign({},t,{indent:r,inFlow:!0,type:null});let h=!1,m=0;const g=[];for(let w=0;w<e.length;++w){const S=e[w];let N=null;if(nn(S))S.spaceBefore&&g.push(""),um(t,g,S.commentBefore,!1),S.comment&&(N=S.comment);else if(rn(S)){const A=nn(S.key)?S.key:null;A&&(A.spaceBefore&&g.push(""),um(t,g,A.commentBefore,!1),A.comment&&(h=!0));const k=nn(S.value)?S.value:null;k?(k.comment&&(N=k.comment),k.commentBefore&&(h=!0)):S.value==null&&A?.comment&&(N=A.comment)}N&&(h=!0);let C=Ec(S,f,()=>N=null);w<e.length-1&&(C+=","),N&&(C+=_o(C,r,c(N))),!h&&(g.length>m||C.includes(`
142
+ `))&&(h=!0),g.push(C),m=g.length}const{start:y,end:v}=n;if(g.length===0)return y+v;if(!h){const w=g.reduce((S,N)=>S+N.length+2,2);h=t.options.lineWidth>0&&w>t.options.lineWidth}if(h){let w=y;for(const S of g)w+=S?`
143
+ ${s}${i}${S}`:`
144
+ `;return`${w}
145
+ ${i}${v}`}else return`${y}${l}${g.join(" ")}${l}${v}`}function um({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=wa(t(r),e);n.push(s.trimStart())}}function Oo(e,t){const n=At(t)?t.value:t;for(const r of e)if(rn(r)&&(r.key===t||r.key===n||At(r.key)&&r.key.value===n))return r}class Vr extends ID{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Os,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,l=new this(t),c=(f,h)=>{if(typeof s=="function")h=s.call(n,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&l.items.push(g1(f,h,r))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;rn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Jn(t,t?.value):r=new Jn(t.key,t.value);const i=Oo(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);At(i.value)&&LD(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const l=this.items.findIndex(c=>s(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Oo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Oo(this.items,t)?.value;return(!n&&At(i)?i.value:i)??void 0}has(t){return!!Oo(this.items,t)}set(t,n){this.add(new Jn(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const s of this.items)qD(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!rn(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),FD(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Vc={collection:"map",default:!0,nodeClass:Vr,tag:"tag:yaml.org,2002:map",resolve(e,t){return tf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vr.from(e,t,n)};class Ho extends ID{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Hc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=rp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=rp(t);if(typeof r!="number")return;const i=this.items[r];return!n&&At(i)?i.value:i}has(t){const n=rp(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=rp(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];At(i)&&LD(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const s of this.items)r.push(Qr(s,String(i++),n));return r}toString(t,n,r){return t?FD(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof i=="function"){const f=n instanceof Set?c:String(l++);c=i.call(n,f,c)}s.items.push(Md(c,void 0,r))}}return s}}function rp(e){let t=At(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Zc={collection:"seq",default:!0,nodeClass:Ho,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ho.from(e,t,n)},Ag={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),m1(e,t,n,r)}},Eg={identify:e=>e==null,createNode:()=>new Be(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Be(null),stringify:({source:e},t)=>typeof e=="string"&&Eg.test.test(e)?e:t.options.nullStr},y1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Be(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&y1.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function wi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let l=s.indexOf(".");l<0&&(l=s.length,s+=".");let c=t-(s.length-l-1);for(;c-- >0;)s+="0"}return s}const KD={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:wi},HD={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():wi(e)}},GD={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Be(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:wi},Tg=e=>typeof e=="bigint"||Number.isInteger(e),v1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function VD(e,t,n){const{value:r}=e;return Tg(r)&&r>=0?n+r.toString(t):wi(e)}const ZD={identify:e=>Tg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>v1(e,2,8,n),stringify:e=>VD(e,8,"0o")},YD={identify:Tg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>v1(e,0,10,n),stringify:wi},WD={identify:e=>Tg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>v1(e,2,16,n),stringify:e=>VD(e,16,"0x")},KQ=[Vc,Zc,Ag,Eg,y1,ZD,YD,WD,KD,HD,GD];function nE(e){return typeof e=="bigint"||Number.isInteger(e)}const ip=({value:e})=>JSON.stringify(e),HQ=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ip},{identify:e=>e==null,createNode:()=>new Be(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ip},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ip},{identify:nE,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>nE(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ip}],GQ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},VQ=[Vc,Zc].concat(HQ,GQ),b1={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Be.BLOCK_LITERAL),t!==Be.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(c.length/f),m=new Array(h);for(let g=0,y=0;g<h;++g,y+=f)m[g]=c.substr(y,f);c=m.join(t===Be.BLOCK_LITERAL?`
146
+ `:" ")}return m1({comment:e,type:t,value:c},r,i,s)}};function QD(e,t){if(nf(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!rn(r)){if(tf(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Jn(new Be(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
147
+ ${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment}
148
+ ${s.comment}`:r.comment}r=i}e.items[n]=rn(r)?r:new Jn(r)}}else t("Expected a sequence for this tag");return e}function XD(e,t,n){const{replacer:r}=n,i=new Ho(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(s++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;i.items.push(g1(c,f,n))}return i}const x1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QD,createNode:XD};class wc extends Ho{constructor(){super(),this.add=Vr.prototype.add.bind(this),this.delete=Vr.prototype.delete.bind(this),this.get=Vr.prototype.get.bind(this),this.has=Vr.prototype.has.bind(this),this.set=Vr.prototype.set.bind(this),this.tag=wc.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let s,l;if(rn(i)?(s=Qr(i.key,"",n),l=Qr(i.value,s,n)):s=Qr(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,l)}return r}static from(t,n,r){const i=XD(t,n,r),s=new this;return s.items=i.items,s}}wc.tag="tag:yaml.org,2002:omap";const w1={collection:"seq",identify:e=>e instanceof Map,nodeClass:wc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=QD(e,t),r=[];for(const{key:i}of n.items)At(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new wc,n)},createNode:(e,t,n)=>wc.from(e,t,n)};function JD({value:e,source:t},n){return t&&(e?eL:tL).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const eL={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Be(!0),stringify:JD},tL={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Be(!1),stringify:JD},ZQ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:wi},YQ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():wi(e)}},WQ={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Be(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:wi},rf=e=>typeof e=="bigint"||Number.isInteger(e);function Pg(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const s=parseInt(e,n);return i==="-"?-1*s:s}function S1(e,t,n){const{value:r}=e;if(rf(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return wi(e)}const QQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Pg(e,2,2,n),stringify:e=>S1(e,2,"0b")},XQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Pg(e,1,8,n),stringify:e=>S1(e,8,"0")},JQ={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Pg(e,0,10,n),stringify:wi},eX={identify:rf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Pg(e,2,16,n),stringify:e=>S1(e,16,"0x")};class Sc extends Vr{constructor(t){super(t),this.tag=Sc.tag}add(t){let n;rn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Jn(t.key,null):n=new Jn(t,null),Oo(this.items,n.key)||this.items.push(n)}get(t,n){const r=Oo(this.items,t);return!n&&rn(r)?At(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Oo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Jn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),s.items.push(g1(l,null,r));return s}}Sc.tag="tag:yaml.org,2002:set";const j1={collection:"map",identify:e=>e instanceof Set,nodeClass:Sc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Sc.from(e,t,n),resolve(e,t){if(tf(e)){if(e.hasAllNullValues(!0))return Object.assign(new Sc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function N1(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),s=r.replace(/_/g,"").split(":").reduce((l,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*s:s}function nL(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return wi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const rL={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>N1(e,n),stringify:nL},iL={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>N1(e,!1),stringify:nL},zg={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(zg.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,r-1,i,s||0,l||0,c||0,f);const m=t[8];if(m&&m!=="Z"){let g=N1(m,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},rE=[Vc,Zc,Ag,Eg,eL,tL,QQ,XQ,JQ,eX,ZQ,YQ,WQ,b1,Na,w1,x1,j1,rL,iL,zg],iE=new Map([["core",KQ],["failsafe",[Vc,Zc,Ag]],["json",VQ],["yaml11",rE],["yaml-1.1",rE]]),aE={binary:b1,bool:y1,float:GD,floatExp:HD,floatNaN:KD,floatTime:iL,int:YD,intHex:WD,intOct:ZD,intTime:rL,map:Vc,merge:Na,null:Eg,omap:w1,pairs:x1,seq:Zc,set:j1,timestamp:zg},tX={"tag:yaml.org,2002:binary":b1,"tag:yaml.org,2002:merge":Na,"tag:yaml.org,2002:omap":w1,"tag:yaml.org,2002:pairs":x1,"tag:yaml.org,2002:set":j1,"tag:yaml.org,2002:timestamp":zg};function hb(e,t,n){const r=iE.get(t);if(r&&!e)return n&&!r.includes(Na)?r.concat(Na):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(iE.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Na)),i.reduce((s,l)=>{const c=typeof l=="string"?aE[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(aE).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(c)||s.push(c),s},[])}const nX=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class C1{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?hb(t,"compat"):t?hb(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?tX:{},this.tags=hb(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Os,{value:Vc}),Object.defineProperty(this,Fi,{value:Ag}),Object.defineProperty(this,Hc,{value:Zc}),this.sortMapEntries=typeof l=="function"?l:l===!0?nX:null}clone(){const t=Object.create(C1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function rX(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=UD(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=s(e.commentBefore);n.unshift(wa(f,""))}let l=!1,c=null;if(e.contents){if(nn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const m=s(e.contents.commentBefore);n.push(wa(m,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>l=!0;let h=Ec(e.contents,i,()=>c=null,f);c&&(h+=_o(h,"",s(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Ec(e.contents,i));if(e.directives?.docEnd)if(e.comment){const f=s(e.comment);f.includes(`
149
+ `)?(n.push("..."),n.push(wa(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&l&&(f=f.replace(/^\n+/,"")),f&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(wa(s(f),"")))}return n.join(`
150
+ `)+`
151
+ `}class Mg{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xr,{value:jw});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:l}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Yn({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Mg.prototype,{[Xr]:{value:jw}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=nn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ec(this.contents)&&this.contents.add(t)}addIn(t,n){ec(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=RD(this);t.anchor=!n||r.has(n)?DD(n||"a",r):n}return new p1(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const N=A=>typeof A=="number"||A instanceof String||A instanceof Number,C=n.filter(N).map(String);C.length>0&&(n=n.concat(C)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:m}=r??{},{onAnchor:g,setAnchors:y,sourceObjects:v}=EQ(this,l||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:v},S=Md(t,m,w);return c&&tn(S)&&(S.flow=!0),y(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new Jn(i,s)}delete(t){return ec(this.contents)?this.contents.delete(t):!1}deleteIn(t){return pd(t)?this.contents==null?!1:(this.contents=null,!0):ec(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return tn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return pd(t)?!n&&At(this.contents)?this.contents.value:this.contents:tn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return tn(this.contents)?this.contents.has(t):!1}hasIn(t){return pd(t)?this.contents!==void 0:tn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=cm(this.schema,[t],n):ec(this.contents)&&this.contents.set(t,n)}setIn(t,n){pd(t)?this.contents=n:this.contents==null?this.contents=cm(this.schema,Array.from(t),n):ec(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Yn({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Yn({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new C1(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=Qr(this.contents,n??"",c);if(typeof s=="function")for(const{count:h,res:m}of c.anchors.values())s(m,h);return typeof l=="function"?pc(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return rX(this,t)}}function ec(e){if(tn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class aL extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class ap extends aL{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class iX extends aL{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const sE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&l.length>80){const c=Math.min(s-39,l.length-79);l="…"+l.substring(c),s-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,s))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
152
+ `),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];f?.line===r&&f.col>i&&(c=Math.max(1,Math.min(f.col-i,80-s)));const h=" ".repeat(s)+"^".repeat(c);n.message+=`:
153
+
154
+ ${l}
155
+ ${h}
156
+ `}};function Tc(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:l,startOnNewline:c}){let f=!1,h=c,m=c,g="",y="",v=!1,w=!1,S=null,N=null,C=null,A=null,k=null,_=null,T=null;for(const z of e)switch(w&&(z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&s(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(h&&z.type!=="comment"&&z.type!=="newline"&&s(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),z.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&z.source.includes(" ")&&(S=z),m=!0;break;case"comment":{m||s(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const D=z.source.substring(1)||" ";g?g+=y+D:g=D,y="",h=!1;break}case"newline":h?g?g+=z.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=z.source,h=!0,v=!0,(N||C)&&(A=z),m=!0;break;case"anchor":N&&s(z,"MULTIPLE_ANCHORS","A node can have at most one anchor"),z.source.endsWith(":")&&s(z.offset+z.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=z,T??(T=z.offset),h=!1,m=!1,w=!0;break;case"tag":{C&&s(z,"MULTIPLE_TAGS","A node can have at most one tag"),C=z,T??(T=z.offset),h=!1,m=!1,w=!0;break}case n:(N||C)&&s(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),_&&s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),_=z,h=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){k&&s(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=z,h=!1,m=!1;break}default:s(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),h=!1,m=!1}const P=e[e.length-1],E=P?P.offset+P.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(h&&S.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&s(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:_,spaceBefore:f,comment:g,hasNewline:v,anchor:N,tag:C,newlineAfterProp:A,end:E,start:T??E}}function Rd(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
157
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Rd(t.key)||Rd(t.value))return!0}return!1;default:return!0}}function Ow(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Rd(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function sL(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,l)=>s===l||At(s)&&At(l)&&s.value===l.value;return t.some(s=>i(s.key,n))}const oE="All mapping items must start at the same column";function aX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Vr,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const m of r.items){const{start:g,key:y,sep:v,value:w}=m,S=Tc(g,{indicator:"explicit-key-ind",next:y??v?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0}),N=!S.found;if(N){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(f,"BAD_INDENT",oE)),!S.anchor&&!S.tag&&!v){h=S.end,S.comment&&(c.comment?c.comment+=`
158
+ `+S.comment:c.comment=S.comment);continue}(S.newlineAfterProp||Rd(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==r.indent&&i(f,"BAD_INDENT",oE);n.atKey=!0;const C=S.end,A=y?e(n,y,S,i):t(n,C,g,null,S,i);n.schema.compat&&Ow(r.indent,y,i),n.atKey=!1,sL(n,c.items,A)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const k=Tc(v??[],{indicator:"map-value-ind",next:w,offset:A.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=k.end,k.found){N&&(w?.type==="block-map"&&!k.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<k.found.offset-1024&&i(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const _=w?e(n,w,k,i):t(n,f,v,null,k,i);n.schema.compat&&Ow(r.indent,w,i),f=_.range[2];const T=new Jn(A,_);n.options.keepSourceTokens&&(T.srcToken=m),c.items.push(T)}else{N&&i(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(A.comment?A.comment+=`
159
+ `+k.comment:A.comment=k.comment);const _=new Jn(A);n.options.keepSourceTokens&&(_.srcToken=m),c.items.push(_)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,f,h??f],c}function sX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Ho,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:m,value:g}of r.items){const y=Tc(m,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(c.comment=y.comment);continue}const v=g?e(n,g,y,i):t(n,y.end,m,null,y,i);n.schema.compat&&Ow(r.indent,g,i),f=v.range[2],c.items.push(v)}return c.range=[r.offset,f,h??f],c}function af(e,t,n,r){let i="";if(e){let s=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":s=!0;break;case"comment":{n&&!s&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=f.substring(1)||" ";i?i+=l+m:i=m,l="";break}case"newline":i&&(l+=f),s=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:i,offset:t}}const pb="Block collections are not allowed within flow collections",mb=e=>e&&(e.type==="block-map"||e.type==="block-seq");function oX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=r.start.source==="{",c=l?"flow map":"flow sequence",f=s?.nodeClass??(l?Vr:Ho),h=new f(n.schema);h.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let g=r.offset+r.start.source.length;for(let N=0;N<r.items.length;++N){const C=r.items[N],{start:A,key:k,sep:_,value:T}=C,P=Tc(A,{flow:c,indicator:"explicit-key-ind",next:k??_?.[0],offset:g,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!P.found){if(!P.anchor&&!P.tag&&!_&&!T){N===0&&P.comma?i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):N<r.items.length-1&&i(P.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),P.comment&&(h.comment?h.comment+=`
160
+ `+P.comment:h.comment=P.comment),g=P.end;continue}!l&&n.options.strict&&Rd(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)P.comma&&i(P.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(P.comma||i(P.start,"MISSING_CHAR",`Missing , between ${c} items`),P.comment){let E="";e:for(const z of A)switch(z.type){case"comma":case"space":break;case"comment":E=z.source.substring(1);break e;default:break e}if(E){let z=h.items[h.items.length-1];rn(z)&&(z=z.value??z.key),z.comment?z.comment+=`
161
+ `+E:z.comment=E,P.comment=P.comment.substring(E.length+1)}}if(!l&&!_&&!P.found){const E=T?e(n,T,P,i):t(n,P.end,_,null,P,i);h.items.push(E),g=E.range[2],mb(T)&&i(E.range,"BLOCK_IN_FLOW",pb)}else{n.atKey=!0;const E=P.end,z=k?e(n,k,P,i):t(n,E,A,null,P,i);mb(k)&&i(z.range,"BLOCK_IN_FLOW",pb),n.atKey=!1;const D=Tc(_??[],{flow:c,indicator:"map-value-ind",next:T,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(D.found){if(!l&&!P.found&&n.options.strict){if(_)for(const I of _){if(I===D.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}P.start<D.found.offset-1024&&i(D.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${c}`):i(D.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const K=T?e(n,T,D,i):D.found?t(n,D.end,_,null,D,i):null;K?mb(T)&&i(K.range,"BLOCK_IN_FLOW",pb):D.comment&&(z.comment?z.comment+=`
162
+ `+D.comment:z.comment=D.comment);const U=new Jn(z,K);if(n.options.keepSourceTokens&&(U.srcToken=C),l){const I=h;sL(n,I.items,z)&&i(E,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(U)}else{const I=new Vr(n.schema);I.flow=!0,I.items.push(U);const H=(K??z).range;I.range=[z.range[0],H[1],H[2]],h.items.push(I)}g=K?K.range[2]:D.end}}const y=l?"}":"]",[v,...w]=r.end;let S=g;if(v?.source===y)S=v.offset+v.source.length;else{const N=c[0].toUpperCase()+c.substring(1),C=m?`${N} must end with a ${y}`:`${N} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",C),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const N=af(w,S,n.options.strict,i);N.comment&&(h.comment?h.comment+=`
163
+ `+N.comment:h.comment=N.comment),h.range=[r.offset,S,N.offset]}else h.range=[r.offset,S,S];return h}function gb(e,t,n,r,i,s){const l=n.type==="block-map"?aX(e,t,n,r,s):n.type==="block-seq"?sX(e,t,n,r,s):oX(e,t,n,r,s),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function lX(e,t,n,r,i){const s=r.tag,l=s?t.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&s?y.offset>s.offset?y:s:y??s;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!l||l==="!"||l===Vr.tagName&&c==="map"||l===Ho.tagName&&c==="seq")return gb(e,t,n,i,l);let f=t.schema.tags.find(y=>y.tag===l&&y.collection===c);if(!f){const y=t.schema.knownTags[l];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),gb(e,t,n,i,l)}const h=gb(e,t,n,i,l,f),m=f.resolve?.(h,y=>i(s,"TAG_RESOLVE_FAILED",y),t.options)??h,g=nn(m)?m:new Be(m);return g.range=h.range,g.tag=l,f?.format&&(g.format=f.format),g}function cX(e,t,n){const r=t.offset,i=uX(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Be.BLOCK_FOLDED:Be.BLOCK_LITERAL,l=t.source?dX(t.source):[];let c=l.length;for(let S=l.length-1;S>=0;--S){const N=l[S][1];if(N===""||N==="\r")c=S;else break}if(c===0){const S=i.chomp==="+"&&l.length>0?`
164
+ `.repeat(Math.max(1,l.length-1)):"";let N=r+i.length;return t.source&&(N+=t.source.length),{value:S,type:s,comment:i.comment,range:[r,N,N]}}let f=t.indent+i.indent,h=t.offset+i.length,m=0;for(let S=0;S<c;++S){const[N,C]=l[S];if(C===""||C==="\r")i.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=N.length),m=S,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+C.length+1}for(let S=l.length-1;S>=c;--S)l[S][0].length>f&&(c=S+1);let g="",y="",v=!1;for(let S=0;S<m;++S)g+=l[S][0].slice(f)+`
165
+ `;for(let S=m;S<c;++S){let[N,C]=l[S];h+=N.length+C.length+1;const A=C[C.length-1]==="\r";if(A&&(C=C.slice(0,-1)),C&&N.length<f){const _=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(h-C.length-(A?2:1),"BAD_INDENT",_),N=""}s===Be.BLOCK_LITERAL?(g+=y+N.slice(f)+C,y=`
166
+ `):N.length>f||C[0]===" "?(y===" "?y=`
167
+ `:!v&&y===`
168
+ `&&(y=`
169
+
170
+ `),g+=y+N.slice(f)+C,y=`
171
+ `,v=!0):C===""?y===`
172
+ `?g+=`
173
+ `:y=`
174
+ `:(g+=y+C,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let S=c;S<l.length;++S)g+=`
175
+ `+l[S][0].slice(f);g[g.length-1]!==`
176
+ `&&(g+=`
177
+ `);break;default:g+=`
178
+ `}const w=r+i.length+t.source.length;return{value:g,type:s,comment:i.comment,range:[r,w,w]}}function uX({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let l=0,c="",f=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const w=Number(v);!l&&w?l=w:f===-1&&(f=e+y)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,m="",g=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":h=!0;case"newline":g+=v.source.length;break;case"comment":n&&!h&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=v.source.length,m=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),g+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const S=v.source;S&&typeof S=="string"&&(g+=S.length)}}}return{mode:s,indent:l,chomp:c,comment:m,length:g}}function dX(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)s.push([t[l],t[l+1]]);return s}function fX(e,t,n){const{offset:r,type:i,source:s,end:l}=e;let c,f;const h=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":c=Be.PLAIN,f=hX(s,h);break;case"single-quoted-scalar":c=Be.QUOTE_SINGLE,f=pX(s,h);break;case"double-quoted-scalar":c=Be.QUOTE_DOUBLE,f=mX(s,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const m=r+s.length,g=af(l,m,t,n);return{value:f,type:c,comment:g.comment,range:[r,m,g.offset]}}function hX(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),oL(e)}function pX(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),oL(e.slice(1,-1)).replace(/''/g,"'")}function oL(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?s===`
181
+ `?i+=s:s=`
182
+ `:(i+=s+r[1],s=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+s+(r?.[1]??"")}function mX(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
183
+ `))if(i===`
184
+ `){const{fold:s,offset:l}=gX(e,r);n+=s,r=l}else if(i==="\\"){let s=e[++r];const l=yX[s];if(l)n+=l;else if(s===`
185
+ `)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
186
+ `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){const c={x:2,u:4,U:8}[s];n+=vX(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const s=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
187
+ `&&!(l==="\r"&&e[r+2]===`
188
+ `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function gX(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
189
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
190
+ `);)r===`
191
+ `&&(n+=`
192
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const yX={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function vX(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function lL(e,t,n,r){const{value:i,type:s,comment:l,range:c}=t.type==="block-scalar"?cX(e,t,r):fX(t,e.options.strict,r),f=n?e.directives.tagName(n.source,g=>r(n,"TAG_RESOLVE_FAILED",g)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Fi]:f?h=bX(e.schema,i,f,n,r):t.type==="scalar"?h=xX(e,i,t,r):h=e.schema[Fi];let m;try{const g=h.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);m=At(g)?g:new Be(g)}catch(g){const y=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",y),m=new Be(i)}return m.range=c,m.source=i,s&&(m.type=s),f&&(m.tag=f),h.format&&(m.format=h.format),l&&(m.comment=l),m}function bX(e,t,n,r,i){if(n==="!")return e[Fi];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if(c.test?.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Fi])}function xX({atKey:e,directives:t,schema:n},r,i,s){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Fi];if(n.compat){const c=n.compat.find(f=>f.default&&f.test?.test(r))??n[Fi];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),m=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",m,!0)}}return l}function wX(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}const SX={composeNode:cL,composeEmptyNode:_1};function cL(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:l,anchor:c,tag:f}=n;let h,m=!0;switch(t.type){case"alias":h=jX(e,t,r),(c||f)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=lL(e,t,f,r),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=lX(SX,e,t,n,r),c&&(h.anchor=c.source.substring(1));break;default:{const g=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",g),h=_1(e,t.offset,void 0,null,n,r),m=!1}}return c&&h.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!At(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&m&&(h.srcToken=t),h}function _1(e,t,n,r,{spaceBefore:i,comment:s,anchor:l,tag:c,end:f},h){const m={type:"scalar",offset:wX(t,n,r),indent:-1,source:""},g=lL(e,m,c,h);return l&&(g.anchor=l.source.substring(1),g.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function jX({options:e},{offset:t,source:n,end:r},i){const s=new p1(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=af(r,l,e.strict,i);return s.range=[t,l,c.offset],c.comment&&(s.comment=c.comment),s}function NX(e,t,{offset:n,start:r,value:i,end:s},l){const c=Object.assign({_directives:t},e),f=new Mg(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=Tc(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&l(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?cL(h,i,m,l):_1(h,m.end,r,null,m,l);const g=f.contents.range[2],y=af(s,g,!1,l);return y.comment&&(f.comment=y.comment),f.range=[n,g,y.offset],f}function nd(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function lE(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
194
+
195
+ `:`
196
+ `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class CX{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const l=nd(n);s?this.warnings.push(new iX(l,r,i)):this.errors.push(new ap(l,r,i))},this.directives=new Yn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=lE(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment}
197
+ ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(tn(s)&&!s.flow&&s.items.length>0){let l=s.items[0];rn(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
198
+ ${c}`:r}else{const l=s.commentBefore;s.commentBefore=l?`${r}
199
+ ${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:lE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const s=nd(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=NX(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ap(nd(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new ap(nd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=af(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
200
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ap(nd(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),i=new Mg(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const uL="\uFEFF",dL="",fL="",kw="";function _X(e){switch(e){case uL:return"byte-order-mark";case dL:return"doc-mode";case fL:return"flow-error-end";case kw:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
201
+ `:case`\r
202
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ui(e){switch(e){case void 0:case" ":case`
203
+ `:case"\r":case" ":return!0;default:return!1}}const cE=new Set("0123456789ABCDEFabcdef"),OX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sp=new Set(",[]{}"),kX=new Set(` ,[]{}
204
+ \r `),yb=e=>!e||kX.has(e);class AX{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
205
+ `?!0:n==="\r"?this.buffer[t+1]===`
206
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
207
+ `||!i&&!this.atEnd)return t+r+1}return n===`
208
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ui(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
209
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===uL&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const s=t[n-1];if(s===" "||s===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield dL,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ui(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ui(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ui(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(yb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&ui(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield fL,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(yb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ui(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
210
+ `,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
211
+ `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ui(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
212
+ `:t=s,n=0;break;case"\r":{const l=this.buffer[s+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
213
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
214
+ `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
215
+ `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,l=this.buffer[s];l==="\r"&&(l=this.buffer[--s]);const c=s;for(;l===" ";)l=this.buffer[--s];if(l===`
216
+ `&&s>=this.pos&&s+1+n>c)t=s;else break}while(!0);return yield kw,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(ui(s)||t&&sp.has(s))break;n=r}else if(ui(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
217
+ `?(r+=1,i=`
218
+ `,s=this.buffer[r+1]):n=r),s==="#"||t&&sp.has(s))break;if(i===`
219
+ `){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&sp.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield kw,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(yb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ui(n)||t&&sp.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ui(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(OX.has(n))n=this.buffer[++t];else if(n==="%"&&cE.has(this.buffer[t+1])&&cE.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
220
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
221
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class EX{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function gs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function uE(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function hL(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function op(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function tc(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function dE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!gs(t.start,"explicit-key-ind")&&!gs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,hL(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class TX{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new AX,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=_X(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&dE(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&uE(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{uE(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=op(this.peek(2)),r=tc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
222
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
223
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const f=n.sep[c];switch(f.type){case"newline":l.push(c);break;case"space":break;case"comment":f.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(s=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(hL(n.key)&&!gs(n.sep,"newline")){const l=tc(n.start),c=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:f}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(gs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=tc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):gs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!gs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||gs(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=op(r),s=tc(i);dE(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
224
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
225
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=op(t),r=tc(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=op(t),r=tc(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function PX(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new EX||null,prettyErrors:t}}function zX(e,t={}){const{lineCounter:n,prettyErrors:r}=PX(t),i=new TX(n?.addNewLine),s=new CX(t),l=Array.from(s.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(sE(e,n)),c.warnings.forEach(sE(e,n));return l.length>0?l:Object.assign([],{empty:!0},s.streamInfo())}function MX({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[s,l]=x.useState([]),[c,f]=x.useState([]),h=async()=>{if(!t.trim())return;i(!0),l([]),f([]);const m=zX(t),g=[],y=[];for(let v=0;v<m.length;v++){const w=m[v];if(w.errors.length>0){g.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const N=await Kq(S);y.push(`Applied "${N.displayName||N.name}" (revision ${N.configRevision})`)}catch(N){g.push(`Document ${v+1}: ${N instanceof Error?N.message:String(N)}`)}}l(y),f(g),i(!1),y.length>0&&(Xe({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:g.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return u.jsxs("section",{className:"mt-8",children:[u.jsx("div",{className:"page-section-divider"}),u.jsx("div",{className:"section-head mt-6",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),u.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",u.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",u.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),u.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
226
+ kind: Project
227
+ metadata:
228
+ name: my-project
229
+ spec:
230
+ canonicalDomain: example.com
231
+ country: US
232
+ language: en
233
+ keywords: []`,value:t,onChange:m=>n(m.target.value)}),s.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:s.map((m,g)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:m},g))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((m,g)=>u.jsx("li",{className:"text-rose-400 text-sm",children:m},g))}),u.jsx("div",{className:"mt-3",children:u.jsx(he,{type:"button",disabled:!t.trim()||r,onClick:h,children:r?"Applying...":"Apply"})})]})}function RX(){const{dashboard:e,isLoading:t,refetch:n}=al();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-28"}),u.jsx("div",{className:"skeleton-text-sm w-40"})]}),u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[u.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(E=>u.jsx("div",{className:"skeleton-text-sm w-16"},E))}),[1,2,3].map(E=>u.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"skeleton-text-sm w-16"})]}),u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),u.jsx("div",{className:"skeleton-text-sm w-8"})]},E))]})]});const r=e.projects,i=Is(),[s,l]=x.useState(!1),[c,f]=x.useState(""),[h,m]=x.useState(""),[g,y]=x.useState(""),[v,w]=x.useState("US"),[S,N]=x.useState("en"),[C,A]=x.useState(!1),[k,_]=x.useState(null),T=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),P=async()=>{if(!(!T||!g)){A(!0),_(null);try{const E=await ug(T,{displayName:h||c,canonicalDomain:g,country:v,language:S});Xe({title:"Project created",detail:`${E.displayName||E.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${E.name}`,dedupeMode:"drop"}),n(),f(""),m(""),y(""),w("US"),N("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:E.id}})}catch(E){_(E instanceof Error?E.message:"Failed to create project")}finally{A(!1)}}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Projects"}),u.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),u.jsx("div",{className:"page-header-right",children:u.jsxs(he,{type:"button",onClick:()=>l(E=>!E),children:[u.jsx(Wk,{className:"size-4 mr-1.5"}),"Add project"]})})]}),s?u.jsxs(Ue,{className:"surface-card mb-6",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),u.jsxs("div",{className:"compact-stack mt-4",children:[u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),u.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:E=>f(E.target.value)}),T&&T!==c?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),u.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:h,onChange:E=>m(E.target.value)})]})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),u.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:g,onChange:E=>y(E.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),u.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:E=>w(E.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),u.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:E=>N(E.target.value.toLowerCase())})]})]})]}),k?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:k}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(he,{type:"button",disabled:!T||!g||C,onClick:P,children:C?"Creating...":"Create project"}),u.jsx(he,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?u.jsx("div",{className:"data-table-wrapper",children:u.jsxs("table",{className:"data-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Visibility"}),u.jsx("th",{children:"Last run"}),u.jsx("th",{className:"text-right",children:"Country"})]})}),u.jsx("tbody",{children:r.map(E=>{const z=E.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:E.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Dt,{to:"/projects/$projectId",params:{projectId:E.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:D=>D.stopPropagation(),children:E.project.displayName||E.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:E.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:E.project.canonicalDomain}),u.jsx("td",{children:u.jsx(yt,{tone:E.visibilitySummary.tone,children:E.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:z?u.jsx(gg,{status:z.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:E.project.country})]},E.project.id)})})]})}):s?null:u.jsxs(Ue,{className:"surface-card empty-card",children:[u.jsx("h3",{children:"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),u.jsxs(he,{type:"button",onClick:()=>l(!0),children:[u.jsx(Wk,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(MX,{onApplied:()=>{n()}})]})}function Aw({state:e}){return u.jsx(yt,{tone:vK(e),children:hg(e)})}function pL({run:e}){const{openRun:t}=Kc();return u.jsxs("article",{className:"run-row",children:[u.jsxs("div",{className:"run-row-main",children:[u.jsxs("div",{className:"run-row-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:e.summary}),u.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),u.jsx(gg,{status:e.status})]}),u.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),u.jsxs("dl",{className:"run-row-meta",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Started"}),u.jsx("dd",{children:e.startedAt})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Duration"}),u.jsx("dd",{children:e.duration})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Trigger"}),u.jsx("dd",{children:e.triggerLabel})]})]}),u.jsx(he,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function mL({value:e,label:t,delta:n,tone:r,description:i,tooltip:s,isNumeric:l=!0,progress:c}){const m=2*Math.PI*48,g=Number.parseInt(e,10),y=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):l&&!Number.isNaN(g)?Math.min(g/100,1):.5,v=m*(1-y);return u.jsxs("div",{className:"score-gauge",children:[u.jsxs("div",{className:"gauge-ring-wrapper",children:[u.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[u.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),u.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:v,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,s&&u.jsx(Wn,{text:s})]}),u.jsx("p",{className:"gauge-delta",children:n}),u.jsx("p",{className:"gauge-description",children:i})]})}function fE({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return u.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),s=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),u.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:s})]})}function DX(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const s=t.get(i.createdAt);s?s.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:s}])=>({runId:s,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function LX({evidence:e}){const{openEvidence:t}=Kc(),[n,r]=x.useState(new Set),i=x.useMemo(()=>{const l=new Map;for(const c of e){const f=l.get(c.keyword)??[];l.set(c.keyword,[...f,c])}return[...l.entries()].map(([c,f])=>({phrase:c,items:f}))},[e]),s=l=>{r(c=>{const f=new Set(c);return f.has(l)?f.delete(l):f.add(l),f})};return u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"2rem"}}),u.jsx("th",{children:"Key Phrase"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Citation History"}),u.jsx("th",{children:"Change"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:i.map(({phrase:l,items:c})=>{const f=n.has(l),h=c.map(w=>w.citationState),m=h.includes("cited")?"cited":h.includes("emerging")?"emerging":h.includes("lost")?"lost":h.every(w=>w==="pending")?"pending":"not-cited",g=DX(c),y=c.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,v=(()=>{if(g.length===0)return"Awaiting first run";if(g.length===1)return"First observation";const w=g[g.length-1].citationState,S=g[g.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let N=0;for(let C=g.length-1;C>=0&&g[C].citationState===w;C--)N++;return w==="cited"?N<=1?"Cited in latest run":`Cited for ${N} runs`:N<=1?"Not cited in latest run":`Not cited across ${N} runs`})();return u.jsxs(x.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>s(l),"aria-expanded":f,children:[u.jsx("td",{children:u.jsx(dg,{size:14,className:`transition-transform duration-150 text-zinc-500 ${f?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:l}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(w=>u.jsx(Ad,{provider:w.provider},w.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Aw,{state:m}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(fE,{history:g})}),u.jsx("td",{className:"evidence-change-cell",children:v}),u.jsx("td",{})]}),f&&c.map(w=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Ad,{provider:w.provider})}),u.jsx("td",{children:u.jsx(Aw,{state:w.citationState})}),u.jsx("td",{children:u.jsx(fE,{history:w.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),u.jsx("td",{children:u.jsx(he,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},l)})})]})})}function IX({competitors:e}){return e.length===0?u.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):u.jsx("div",{className:"competitor-table-wrap",children:u.jsxs("table",{className:"competitor-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Pressure"}),u.jsx("th",{children:"Citations"}),u.jsx("th",{children:"Key Phrases"})]})}),u.jsx("tbody",{children:e.map(t=>u.jsxs("tr",{children:[u.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),u.jsx("td",{children:u.jsx(yt,{tone:bK(t.pressureLabel),children:t.pressureLabel})}),u.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),u.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const $X=["7d","30d","90d","all"],UX=["gap","cited","uncited"],gL={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function BX({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(null),[s,l]=x.useState(null),[c,f]=x.useState(null),[h,m]=x.useState(null),[g,y]=x.useState(!0);return x.useEffect(()=>{let v=!1;return y(!0),Promise.all([f9(e,t),h9(e,t),p9(e,t)]).then(([w,S,N])=>{v||(i(w),l(S),f(N),y(!1))}).catch(()=>{v||y(!1)}),()=>{v=!0}},[e,t]),g&&!r?u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",u.jsx(Wn,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),u.jsx("div",{className:"flex gap-1",children:$X.map(v=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===v?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(v),children:v==="all"?"All":v},v))})]}),r&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(mL,{value:`${Math.round(r.overall.citationRate*100)}`,label:"Citation Rate",delta:`${r.overall.cited} / ${r.overall.total}`,tone:r.trend==="improving"?"positive":r.trend==="declining"?"negative":"neutral",description:`Trend: ${r.trend}`,isNumeric:!0}),u.jsxs("div",{className:"flex-1 space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),u.jsx(yt,{tone:r.trend==="improving"?"positive":r.trend==="declining"?"negative":"neutral",children:r.trend})]}),Object.keys(r.byProvider).length>0&&u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),u.jsx("tbody",{children:Object.entries(r.byProvider).map(([v,w])=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:v}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},v))})]})]})]}),r.buckets.length>=1&&u.jsx(qX,{buckets:r.buckets,keywordChanges:r.keywordChanges??[]})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsx("div",{className:"flex items-center justify-between mb-4",children:u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",u.jsx(Wn,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),s&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 mb-4",children:UX.map(v=>{const w=v==="cited"?s.cited.length:v==="gap"?s.gap.length:s.uncited.length,S=h===v;return u.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?v==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":v==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>m(S?null:v),children:[v==="gap"?"Gap":v==="cited"?"Cited":"Not Cited"," (",w,")"]},v)})}),u.jsx(FX,{gaps:s,filter:h})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",u.jsx(Wn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),c&&c.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(KX,{categories:c.overall}),u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),u.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),u.jsx("tbody",{children:c.overall.map(v=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[u.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${gL[v.category]??"bg-zinc-600"}`}),v.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:v.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(v.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:v.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},v.category))})]})]}),c&&c.overall.length===0&&u.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function qX({buckets:e,keywordChanges:t}){const[n,r]=x.useState(null),i=600,s=140,l={top:30,right:10,bottom:20,left:40},c=i-l.left-l.right,f=s-l.top-l.bottom,h=1,m=e.map((v,w)=>{const S=l.left+(e.length>1?w/(e.length-1)*c:c/2),N=l.top+f-v.citationRate/h*f;return{x:S,y:N}}),g=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const v=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-v;return S<=0?[]:t.map(N=>{const A=(new Date(N.date).getTime()-v)/S;return A<0||A>1?null:{...N,x:l.left+A*c}}).filter(N=>N!==null)},[e,t,l.left,c]),y=m.map(v=>`${v.x},${v.y}`).join(" ");return u.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[u.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),u.jsxs("svg",{viewBox:`0 0 ${i} ${s}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>r(null),children:[u.jsxs("text",{x:l.left-4,y:l.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(h*100).toFixed(0),"%"]}),u.jsx("text",{x:l.left-4,y:l.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),u.jsx("line",{x1:l.left,y1:l.top+f,x2:l.left+c,y2:l.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),u.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:y}),g.map((v,w)=>u.jsxs("g",{children:[u.jsx("line",{x1:v.x,y1:l.top,x2:v.x,y2:l.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),u.jsx("text",{x:v.x,y:l.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:v.label})]},`kw-change-${w}`)),n!==null&&u.jsx("line",{x1:m[n].x,y1:l.top,x2:m[n].x,y2:l.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((v,w)=>{const{x:S,y:N}=m[w],C=n===w;return u.jsxs("g",{children:[u.jsx("circle",{cx:S,cy:N,r:"10",fill:"transparent",onMouseEnter:()=>r(w),style:{cursor:"pointer"}}),u.jsx("circle",{cx:S,cy:N,r:C?5:3,className:C?"fill-emerald-400":"fill-emerald-500"})]},w)}),n!==null&&(()=>{const v=e[n],{x:w,y:S}=m[n],N=`${(v.citationRate*100).toFixed(1)}%`,C=v.keywordCount?`${v.keywordCount} kp`:"",A=56,k=30,_=Math.max(l.left,Math.min(w-A/2,i-l.right-A)),T=S-k-8;return u.jsxs("g",{children:[u.jsx("rect",{x:_,y:T,width:A,height:k,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),u.jsx("text",{x:_+A/2,y:T+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:N}),C&&u.jsx("text",{x:_+A/2,y:T+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:C})]})})(),e.map((v,w)=>({b:v,i:w})).filter(({i:v})=>v===0||v===e.length-1||e.length<=7).map(({b:v,i:w})=>{const S=m[w].x;return u.jsx("text",{x:S,y:s-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:v.startDate.slice(5,10)},w)})]})]})}function FX({gaps:e,filter:t}){const n=x.useMemo(()=>{const r=[...e.gap.map(i=>({...i,_sort:0})),...e.cited.map(i=>({...i,_sort:1})),...e.uncited.map(i=>({...i,_sort:2}))];return t?r.filter(i=>i.category===t):r.sort((i,s)=>i._sort-s._sort)},[e,t]);return n.length===0?u.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),u.jsx("tbody",{children:n.map(r=>{const i=r.category==="cited"?"positive":r.category==="gap"?"caution":"neutral";return u.jsxs("tr",{className:`border-t border-zinc-800/40 ${r.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[u.jsx("td",{className:"py-1.5 text-zinc-200",children:r.keyword}),u.jsx("td",{className:"py-1.5",children:u.jsx(yt,{tone:i,children:r.category==="gap"?"Gap":r.category==="cited"?"Cited":"Not Cited"})}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:r.providers.length>0?r.providers.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:r.competitorsCiting.length>0?r.competitorsCiting.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:r.consistency.totalRuns>0?`${r.consistency.citedRuns}/${r.consistency.totalRuns} runs`:"—"})]},r.keywordId)})})]})}function KX({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:u.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const r=n.count/t*100;return r<.5?null:u.jsx("div",{className:`${gL[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}var HX=["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"];function O1(e){if(typeof e!="string")return!1;var t=HX;return t.includes(e)}var GX=["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"],VX=new Set(GX);function yL(e){return typeof e!="string"?!1:VX.has(e)}function vL(e){return typeof e=="string"&&e.startsWith("data-")}function Ki(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(yL(n)||vL(n))&&(t[n]=e[n]);return t}function Rg(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ki(t)}return typeof e=="object"&&!Array.isArray(e)?Ki(e):null}function Or(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(yL(n)||vL(n)||O1(n))&&(t[n]=e[n]);return t}function ZX(e){return e==null?null:x.isValidElement(e)?Or(e.props):typeof e=="object"&&!Array.isArray(e)?Or(e):null}var YX=["children","width","height","viewBox","className","style","title","desc"];function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ew.apply(null,arguments)}function WX(e,t){if(e==null)return{};var n,r,i=QX(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function QX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var k1=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:s,className:l,style:c,title:f,desc:h}=e,m=WX(e,YX),g=s||{width:r,height:i,x:0,y:0},y=bt("recharts-surface",l);return x.createElement("svg",Ew({},Or(m),{className:y,width:r,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),n)}),XX=["children","className"];function Tw(){return Tw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tw.apply(null,arguments)}function JX(e,t){if(e==null)return{};var n,r,i=eJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Hi=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=JX(e,XX),s=bt("recharts-layer",r);return x.createElement("g",Tw({className:s},Or(i),{ref:t}),n)}),bL=x.createContext(null),tJ=()=>x.useContext(bL);function kt(e){return function(){return e}}const xL=Math.cos,dm=Math.sin,Si=Math.sqrt,fm=Math.PI,Dg=2*fm,Pw=Math.PI,zw=2*Pw,bo=1e-6,nJ=zw-bo;function wL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function rJ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wL;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class iJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wL:rJ(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+l}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let l=this._x1,c=this._y1,f=r-t,h=i-n,m=l-t,g=c-n,y=m*m+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>bo)if(!(Math.abs(g*f-h*m)>bo)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,w=i-c,S=f*f+h*h,N=v*v+w*w,C=Math.sqrt(S),A=Math.sqrt(y),k=s*Math.tan((Pw-Math.acos((S+y-N)/(2*C*A)))/2),_=k/A,T=k/C;Math.abs(_-1)>bo&&this._append`L${t+_*m},${n+_*g}`,this._append`A${s},${s},0,0,${+(g*v>m*w)},${this._x1=t+T*f},${this._y1=n+T*h}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),h=t+c,m=n+f,g=1^l,y=l?i-s:s-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>bo||Math.abs(this._y1-m)>bo)&&this._append`L${h},${m}`,r&&(y<0&&(y=y%zw+zw),y>nJ?this._append`A${r},${r},0,1,${g},${t-c},${n-f}A${r},${r},0,1,${g},${this._x1=h},${this._y1=m}`:y>bo&&this._append`A${r},${r},0,${+(y>=Pw)},${g},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function A1(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new iJ(t)}function E1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SL(e){this._context=e}SL.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 Lg(e){return new SL(e)}function jL(e){return e[0]}function NL(e){return e[1]}function CL(e,t){var n=kt(!0),r=null,i=Lg,s=null,l=A1(c);e=typeof e=="function"?e:e===void 0?jL:kt(e),t=typeof t=="function"?t:t===void 0?NL:kt(t);function c(f){var h,m=(f=E1(f)).length,g,y=!1,v;for(r==null&&(s=i(v=l())),h=0;h<=m;++h)!(h<m&&n(g=f[h],h,f))===y&&((y=!y)?s.lineStart():s.lineEnd()),y&&s.point(+e(g,h,f),+t(g,h,f));if(v)return s=null,v+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:kt(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:kt(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:kt(!!f),c):n},c.curve=function(f){return arguments.length?(i=f,r!=null&&(s=i(r)),c):i},c.context=function(f){return arguments.length?(f==null?r=s=null:s=i(r=f),c):r},c}function lp(e,t,n){var r=null,i=kt(!0),s=null,l=Lg,c=null,f=A1(h);e=typeof e=="function"?e:e===void 0?jL:kt(+e),t=typeof t=="function"?t:kt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?NL:kt(+n);function h(g){var y,v,w,S=(g=E1(g)).length,N,C=!1,A,k=new Array(S),_=new Array(S);for(s==null&&(c=l(A=f())),y=0;y<=S;++y){if(!(y<S&&i(N=g[y],y,g))===C)if(C=!C)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=y-1;w>=v;--w)c.point(k[w],_[w]);c.lineEnd(),c.areaEnd()}C&&(k[y]=+e(N,y,g),_[y]=+t(N,y,g),c.point(r?+r(N,y,g):k[y],n?+n(N,y,g):_[y]))}if(A)return c=null,A+""||null}function m(){return CL().defined(i).curve(l).context(s)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:kt(+g),r=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:kt(+g),h):e},h.x1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:kt(+g),h):r},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:kt(+g),n=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:kt(+g),h):t},h.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:kt(+g),h):n},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(n)},h.lineX1=function(){return m().x(r).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:kt(!!g),h):i},h.curve=function(g){return arguments.length?(l=g,s!=null&&(c=l(s)),h):l},h.context=function(g){return arguments.length?(g==null?s=c=null:c=l(s=g),h):s},h}class _L{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function aJ(e){return new _L(e,!0)}function sJ(e){return new _L(e,!1)}const T1={draw(e,t){const n=Si(t/fm);e.moveTo(n,0),e.arc(0,0,n,0,Dg)}},oJ={draw(e,t){const n=Si(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},OL=Si(1/3),lJ=OL*2,cJ={draw(e,t){const n=Si(t/lJ),r=n*OL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},uJ={draw(e,t){const n=Si(t),r=-n/2;e.rect(r,r,n,n)}},dJ=.8908130915292852,kL=dm(fm/10)/dm(7*fm/10),fJ=dm(Dg/10)*kL,hJ=-xL(Dg/10)*kL,pJ={draw(e,t){const n=Si(t*dJ),r=fJ*n,i=hJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=Dg*s/5,c=xL(l),f=dm(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},vb=Si(3),mJ={draw(e,t){const n=-Si(t/(vb*3));e.moveTo(0,n*2),e.lineTo(-vb*n,-n),e.lineTo(vb*n,-n),e.closePath()}},qr=-.5,Fr=Si(3)/2,Mw=1/Si(12),gJ=(Mw/2+1)*3,yJ={draw(e,t){const n=Si(t/gJ),r=n/2,i=n*Mw,s=r,l=n*Mw+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(qr*r-Fr*i,Fr*r+qr*i),e.lineTo(qr*s-Fr*l,Fr*s+qr*l),e.lineTo(qr*c-Fr*f,Fr*c+qr*f),e.lineTo(qr*r+Fr*i,qr*i-Fr*r),e.lineTo(qr*s+Fr*l,qr*l-Fr*s),e.lineTo(qr*c+Fr*f,qr*f-Fr*c),e.closePath()}};function vJ(e,t){let n=null,r=A1(i);e=typeof e=="function"?e:kt(e||T1),t=typeof t=="function"?t:kt(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:kt(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function hm(){}function pm(e,t,n){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+n)/6)}function AL(e){this._context=e}AL.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:pm(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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bJ(e){return new AL(e)}function EL(e){this._context=e}EL.prototype={areaStart:hm,areaEnd:hm,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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xJ(e){return new EL(e)}function TL(e){this._context=e}TL.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wJ(e){return new TL(e)}function PL(e){this._context=e}PL.prototype={areaStart:hm,areaEnd:hm,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 SJ(e){return new PL(e)}function hE(e){return e<0?-1:1}function pE(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(hE(s)+hE(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function mE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bb(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function mm(e){this._context=e}mm.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:bb(this,this._t0,mE(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 n=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,bb(this,mE(this,n=pE(this,e,t)),n);break;default:bb(this,this._t0,n=pE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zL(e){this._context=new ML(e)}(zL.prototype=Object.create(mm.prototype)).point=function(e,t){mm.prototype.point.call(this,t,e)};function ML(e){this._context=e}ML.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,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function jJ(e){return new mm(e)}function NJ(e){return new zL(e)}function RL(e){this._context=e}RL.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=gE(e),i=gE(t),s=0,l=1;l<n;++s,++l)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[l],t[l]);(this._line||this._line!==0&&n===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 gE(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),l=new Array(n);for(i[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function CJ(e){return new RL(e)}function Ig(e,t){this._context=e,this._t=t}Ig.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 n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function _J(e){return new Ig(e,.5)}function OJ(e){return new Ig(e,0)}function kJ(e){return new Ig(e,1)}function Go(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n<l;++n)for(i=s,s=e[t[n]],r=0;r<c;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Rw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function AJ(e,t){return e[t]}function EJ(e){const t=[];return t.key=e,t}function TJ(){var e=kt([]),t=Rw,n=Go,r=AJ;function i(s){var l=Array.from(e.apply(this,arguments),EJ),c,f=l.length,h=-1,m;for(const g of s)for(c=0,++h;c<f;++c)(l[c][h]=[0,+r(g,l[c].key,h,s)]).data=g;for(c=0,m=E1(t(l));c<f;++c)l[m[c]].index=c;return n(l,m),l}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:kt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:kt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Rw:typeof s=="function"?s:kt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Go,i):n},i}function PJ(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,l;i<s;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Go(e,t)}}function zJ(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var l=0,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}Go(e,t)}}function MJ(e,t){if(!(!((l=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r<s;++r){for(var c=0,f=0,h=0;c<l;++c){for(var m=e[t[c]],g=m[r][1]||0,y=m[r-1][1]||0,v=(g-y)/2,w=0;w<c;++w){var S=e[t[w]],N=S[r][1]||0,C=S[r-1][1]||0;v+=N-C}f+=g,h+=v*g}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,Go(e,t)}}var xb={},wb={},yE;function RJ(){return yE||(yE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(wb)),wb}var Sb={},vE;function DL(){return vE||(vE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Sb)),Sb}var jb={},bE;function P1(){return bE||(bE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t})(jb)),jb}var Nb={},Cb={},xE;function DJ(){return xE||(xE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(Cb)),Cb}var wE;function z1(){return wE||(wE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DJ(),n=P1();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const s=[],l=i.length;if(l===0)return s;let c=0,f="",h="",m=!1;for(i.charCodeAt(0)===46&&(s.push(""),c++);c<l;){const g=i[c];h?g==="\\"&&c+1<l?(c++,f+=i[c]):g===h?h="":f+=g:m?g==='"'||g==="'"?h=g:g==="]"?(m=!1,s.push(f),f=""):f+=g:g==="["?(m=!0,f&&(s.push(f),f="")):g==="."?f&&(s.push(f),f=""):f+=g,c++}return f&&s.push(f),s}e.toPath=r})(Nb)),Nb}var SE;function M1(){return SE||(SE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RJ(),n=DL(),r=P1(),i=z1();function s(c,f,h){if(c==null)return h;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return h;const m=c[f];return m===void 0?n.isDeepKey(f)?s(c,i.toPath(f),h):h:m}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const m=c[f];return m===void 0?h:m}default:{if(Array.isArray(f))return l(c,f,h);if(Object.is(f?.valueOf(),-0)?f="-0":f=String(f),t.isUnsafeProperty(f))return h;const m=c[f];return m===void 0?h:m}}}function l(c,f,h){if(f.length===0)return h;let m=c;for(let g=0;g<f.length;g++){if(m==null||t.isUnsafeProperty(f[g]))return h;m=m[f[g]]}return m===void 0?h:m}e.get=s})(xb)),xb}var _b,jE;function LJ(){return jE||(jE=1,_b=M1().get),_b}var IJ=LJ();const $g=Rs(IJ);var $J=4;function Ss(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$J,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,s,l)=>{var c=n[l-1];return typeof c=="string"?i+c+s:c!==void 0?i+Ss(c)+s:i+s},"")}var yi=e=>e===0?0:e>0?1:-1,Gi=e=>typeof e=="number"&&e!=+e,Vo=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!Gi(e),Vi=e=>Pe(e)||typeof e=="string",UJ=0,Dd=e=>{var t=++UJ;return"".concat(e||"").concat(t)},zs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Pe(t)&&typeof t!="string")return r;var s;if(Vo(t)){if(n==null)return r;var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Gi(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},LL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Di(e,t,n){return Pe(e)&&Pe(t)?Ss(e+n*(t-e)):t}function IL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):$g(r,t))===n)}var Dn=e=>e===null||typeof e>"u",sf=e=>Dn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ii(e){return e!=null}function Yc(){}var BJ=["type","size","sizeType"];function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dw.apply(null,arguments)}function NE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NE(Object(n),!0).forEach(function(r){qJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t,n){return(t=FJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FJ(e){var t=KJ(e,"string");return typeof t=="symbol"?t:t+""}function KJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HJ(e,t){if(e==null)return{};var n,r,i=GJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $L={symbolCircle:T1,symbolCross:oJ,symbolDiamond:cJ,symbolSquare:uJ,symbolStar:pJ,symbolTriangle:mJ,symbolWye:yJ},VJ=Math.PI/180,ZJ=e=>{var t="symbol".concat(sf(e));return $L[t]||T1},YJ=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*VJ;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},WJ=(e,t)=>{$L["symbol".concat(sf(e))]=t},UL=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=HJ(e,BJ),s=CE(CE({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var y=ZJ(l),v=vJ().type(y).size(YJ(n,r,l)),w=v();if(w!==null)return w},{className:f,cx:h,cy:m}=s,g=Or(s);return Pe(h)&&Pe(m)&&Pe(n)?x.createElement("path",Dw({},g,{className:bt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:c()})):null};UL.registerSymbol=WJ;var BL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,R1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{O1(i)&&typeof n[i]=="function"&&(r[i]=(s=>n[i](n,s)))}),r},QJ=(e,t,n)=>r=>(e(t,n,r),null),qL=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var s=e[i];O1(i)&&typeof s=="function"&&(r||(r={}),r[i]=QJ(s,t,n))}),r};function _E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_E(Object(n),!0).forEach(function(r){JJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_E(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JJ(e,t,n){return(t=eee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eee(e){var t=tee(e,"string");return typeof t=="symbol"?t:t+""}function tee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Er(e,t){var n=XJ({},e),r=t,i=Object.keys(t),s=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return s}function gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gm.apply(null,arguments)}function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(n),!0).forEach(function(r){nee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nee(e,t,n){return(t=ree(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ree(e){var t=iee(e,"string");return typeof t=="symbol"?t:t+""}function iee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hr=32,aee={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function see(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function oee(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Hr/2,s=Hr/6,l=Hr/3,c=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:see(t.payload),x1:0,y1:i,x2:Hr,y2:i,className:"recharts-legend-icon"});if(f==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
234
+ A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
235
+ H`).concat(Hr,"M").concat(2*l,",").concat(i,`
236
+ A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Hr/8,"h").concat(Hr,"v").concat(Hr*3/4,"h").concat(-Hr,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var h=FL({},t);return delete h.legendIcon,x.cloneElement(t.legendIcon,h)}return x.createElement(UL,{fill:c,cx:i,cy:i,size:Hr,sizeType:"diameter",type:f})}function lee(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:s,iconType:l,labelStyle:c}=e,f={x:0,y:0,width:Hr,height:Hr},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((g,y)=>{var v=g.formatter||i,w=bt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:g.inactive});if(g.type==="none")return null;var S=typeof c=="object"?FL({},c):{};S.color=g.inactive?s:S.color||g.color;var N=v?v(g.value,g,y):g.value;return x.createElement("li",gm({className:w,style:h,key:"legend-item-".concat(y)},qL(e,g,y)),x.createElement(k1,{width:n,height:n,viewBox:f,style:m,"aria-label":"".concat(g.value," legend icon")},x.createElement(oee,{data:g,iconType:l,inactiveColor:s})),x.createElement("span",{className:"recharts-legend-item-text",style:S},N))})}var cee=e=>{var t=Er(e,aee),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},x.createElement(lee,gm({},t,{payload:n})))},Ob={},kb={},kE;function uee(){return kE||(kE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let s=0;s<n.length;s++){const l=n[s],c=r(l,s,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(kb)),kb}var Ab={},AE;function dee(){return AE||(AE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Ab)),Ab}var Eb={},EE;function KL(){return EE||(EE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Eb)),Eb}var Tb={},Pb={},zb={},TE;function fee(){return TE||(TE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(zb)),zb}var PE;function HL(){return PE||(PE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fee();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Pb)),Pb}var Mb={},zE;function hee(){return zE||(zE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Mb)),Mb}var ME;function pee(){return ME||(ME=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HL(),n=hee();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Tb)),Tb}var Rb={},Db={},RE;function mee(){return RE||(RE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M1();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Db)),Db}var Lb={},Ib={},$b={},Ub={},DE;function GL(){return DE||(DE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Ub)),Ub}var Bb={},LE;function VL(){return LE||(LE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Bb)),Bb}var qb={},IE;function ZL(){return IE||(IE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(qb)),qb}var $E;function gee(){return $E||($E=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GL(),n=VL(),r=ZL();function i(m,g,y){return typeof y!="function"?i(m,g,()=>{}):s(m,g,function v(w,S,N,C,A,k){const _=y(w,S,N,C,A,k);return _!==void 0?!!_:s(w,S,v,k)},new Map)}function s(m,g,y,v){if(g===m)return!0;switch(typeof g){case"object":return l(m,g,y,v);case"function":return Object.keys(g).length>0?s(m,{...g},y,v):r.isEqualsSameValueZero(m,g);default:return t.isObject(m)?typeof g=="string"?g==="":!0:r.isEqualsSameValueZero(m,g)}}function l(m,g,y,v){if(g==null)return!0;if(Array.isArray(g))return f(m,g,y,v);if(g instanceof Map)return c(m,g,y,v);if(g instanceof Set)return h(m,g,y,v);const w=Object.keys(g);if(m==null||n.isPrimitive(m))return w.length===0;if(w.length===0)return!0;if(v?.has(g))return v.get(g)===m;v?.set(g,m);try{for(let S=0;S<w.length;S++){const N=w[S];if(!n.isPrimitive(m)&&!(N in m)||g[N]===void 0&&m[N]!==void 0||g[N]===null&&m[N]!==null||!y(m[N],g[N],N,m,g,v))return!1}return!0}finally{v?.delete(g)}}function c(m,g,y,v){if(g.size===0)return!0;if(!(m instanceof Map))return!1;for(const[w,S]of g.entries()){const N=m.get(w);if(y(N,S,w,m,g,v)===!1)return!1}return!0}function f(m,g,y,v){if(g.length===0)return!0;if(!Array.isArray(m))return!1;const w=new Set;for(let S=0;S<g.length;S++){const N=g[S];let C=!1;for(let A=0;A<m.length;A++){if(w.has(A))continue;const k=m[A];let _=!1;if(y(k,N,S,m,g,v)&&(_=!0),_){w.add(A),C=!0;break}}if(!C)return!1}return!0}function h(m,g,y,v){return g.size===0?!0:m instanceof Set?f([...m],[...g],y,v):!1}e.isMatchWith=i,e.isSetMatch=h})($b)),$b}var UE;function YL(){return UE||(UE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gee();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Ib)),Ib}var Fb={},Kb={},Hb={},BE;function yee(){return BE||(BE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(Hb)),Hb}var Gb={},qE;function D1(){return qE||(qE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Gb)),Gb}var Vb={},FE;function WL(){return FE||(FE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",l="[object Symbol]",c="[object Date]",f="[object Map]",h="[object Set]",m="[object Array]",g="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",N="[object Uint8Array]",C="[object Uint8ClampedArray]",A="[object Uint16Array]",k="[object Uint32Array]",_="[object BigUint64Array]",T="[object Int8Array]",P="[object Int16Array]",E="[object Int32Array]",z="[object BigInt64Array]",D="[object Float32Array]",K="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=y,e.arrayTag=m,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=_,e.booleanTag=i,e.dataViewTag=S,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=D,e.float64ArrayTag=K,e.functionTag=g,e.int16ArrayTag=P,e.int32ArrayTag=E,e.int8ArrayTag=T,e.mapTag=f,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=A,e.uint32ArrayTag=k,e.uint8ArrayTag=N,e.uint8ClampedArrayTag=C})(Vb)),Vb}var Zb={},KE;function vee(){return KE||(KE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Zb)),Zb}var HE;function QL(){return HE||(HE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yee(),n=D1(),r=WL(),i=VL(),s=vee();function l(m,g){return c(m,void 0,m,new Map,g)}function c(m,g,y,v=new Map,w=void 0){const S=w?.(m,g,y,v);if(S!==void 0)return S;if(i.isPrimitive(m))return m;if(v.has(m))return v.get(m);if(Array.isArray(m)){const N=new Array(m.length);v.set(m,N);for(let C=0;C<m.length;C++)N[C]=c(m[C],C,y,v,w);return Object.hasOwn(m,"index")&&(N.index=m.index),Object.hasOwn(m,"input")&&(N.input=m.input),N}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const N=new RegExp(m.source,m.flags);return N.lastIndex=m.lastIndex,N}if(m instanceof Map){const N=new Map;v.set(m,N);for(const[C,A]of m)N.set(C,c(A,C,y,v,w));return N}if(m instanceof Set){const N=new Set;v.set(m,N);for(const C of m)N.add(c(C,void 0,y,v,w));return N}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(s.isTypedArray(m)){const N=new(Object.getPrototypeOf(m)).constructor(m.length);v.set(m,N);for(let C=0;C<m.length;C++)N[C]=c(m[C],C,y,v,w);return N}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const N=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return v.set(m,N),f(N,m,y,v,w),N}if(typeof File<"u"&&m instanceof File){const N=new File([m],m.name,{type:m.type});return v.set(m,N),f(N,m,y,v,w),N}if(typeof Blob<"u"&&m instanceof Blob){const N=new Blob([m],{type:m.type});return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof Error){const N=structuredClone(m);return v.set(m,N),N.message=m.message,N.name=m.name,N.stack=m.stack,N.cause=m.cause,N.constructor=m.constructor,f(N,m,y,v,w),N}if(m instanceof Boolean){const N=new Boolean(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof Number){const N=new Number(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(m instanceof String){const N=new String(m.valueOf());return v.set(m,N),f(N,m,y,v,w),N}if(typeof m=="object"&&h(m)){const N=Object.create(Object.getPrototypeOf(m));return v.set(m,N),f(N,m,y,v,w),N}return m}function f(m,g,y=m,v,w){const S=[...Object.keys(g),...t.getSymbols(g)];for(let N=0;N<S.length;N++){const C=S[N],A=Object.getOwnPropertyDescriptor(m,C);(A==null||A.writable)&&(m[C]=c(g[C],C,y,v,w))}}function h(m){switch(n.getTag(m)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=c,e.copyProperties=f})(Kb)),Kb}var GE;function bee(){return GE||(GE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QL();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Fb)),Fb}var VE;function xee(){return VE||(VE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YL(),n=bee();function r(i){return i=n.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=r})(Lb)),Lb}var Yb={},Wb={},Qb={},ZE;function wee(){return ZE||(ZE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QL(),n=D1(),r=WL();function i(s,l){return t.cloneDeepWith(s,(c,f,h,m)=>{const g=l?.(c,f,h,m);if(g!==void 0)return g;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const y={};return m.set(s,y),t.copyProperties(y,s,h,m),y}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new s.constructor(s?.valueOf());return t.copyProperties(y,s),y}case r.argumentsTag:{const y={};return t.copyProperties(y,s),y.length=s.length,y[Symbol.iterator]=s[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Qb)),Qb}var YE;function See(){return YE||(YE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wee();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Wb)),Wb}var Xb={},Jb={},WE;function XL(){return WE||(WE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(Jb)),Jb}var ex={},QE;function jee(){return QE||(QE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D1();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(ex)),ex}var XE;function Nee(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DL(),n=XL(),r=jee(),i=z1();function s(l,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?f=i.toPath(c):f=[c],f.length===0)return!1;let h=l;for(let m=0;m<f.length;m++){const g=f[m];if((h==null||!Object.hasOwn(h,g))&&!((Array.isArray(h)||r.isArguments(h))&&n.isIndex(g)&&g<h.length))return!1;h=h[g]}return!0}e.has=s})(Xb)),Xb}var JE;function Cee(){return JE||(JE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YL(),n=P1(),r=See(),i=M1(),s=Nee();function l(c,f){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return f=r.cloneDeep(f),function(h){const m=i.get(h,c);return m===void 0?s.has(h,c):f===void 0?m===void 0:t.isMatch(m,f)}}e.matchesProperty=l})(Yb)),Yb}var eT;function _ee(){return eT||(eT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KL(),n=mee(),r=xee(),i=Cee();function s(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=s})(Rb)),Rb}var tT;function Oee(){return tT||(tT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uee(),n=dee(),r=KL(),i=pee(),s=_ee();function l(c,f=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(s.iteratee(f),1)):[]}e.uniqBy=l})(Ob)),Ob}var tx,nT;function kee(){return nT||(nT=1,tx=Oee().uniqBy),tx}var Aee=kee();const rT=Rs(Aee);function JL(e,t,n){return t===!0?rT(e,n):typeof t=="function"?rT(e,t):e}var L1=x.createContext(null),Eee=e=>e,Xt=()=>{var e=x.useContext(L1);return e?e.store.dispatch:Eee},Lp=()=>{},Tee=()=>Lp,Pee=(e,t)=>e===t;function Le(e){var t=x.useContext(L1),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Lp,[t,e]);return wM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Tee,t?t.store.getState:Lp,t?t.store.getState:Lp,n,Pee)}function zee(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Mee(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ree(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var iT=e=>Array.isArray(e)?e:[e];function Dee(e){const t=Array.isArray(e[0])?e[0]:e;return Ree(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Lee(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Iee=class{constructor(e){this.value=e}deref(){return this.value}},$ee=typeof WeakRef<"u"?WeakRef:Iee,Uee=0,aT=1;function cp(){return{s:Uee,v:void 0,o:null,p:null}}function eI(e,t={}){let n=cp();const{resultEqualityCheck:r}=t;let i,s=0;function l(){let c=n;const{length:f}=arguments;for(let g=0,y=f;g<y;g++){const v=arguments[g];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const S=w.get(v);S===void 0?(c=cp(),w.set(v,c)):c=S}else{let w=c.p;w===null&&(c.p=w=new Map);const S=w.get(v);S===void 0?(c=cp(),w.set(v,c)):c=S}}const h=c;let m;if(c.s===aT)m=c.v;else if(m=e.apply(null,arguments),s++,r){const g=i?.deref?.()??i;g!=null&&r(g,m)&&(m=g,s!==0&&s--),i=typeof m=="object"&&m!==null||typeof m=="function"?new $ee(m):m}return h.s=aT,h.v=m,m}return l.clearCache=()=>{n=cp(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function Bee(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,l=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),zee(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...n,...f},{memoize:g,memoizeOptions:y=[],argsMemoize:v=eI,argsMemoizeOptions:w=[]}=m,S=iT(y),N=iT(w),C=Dee(i),A=g(function(){return s++,h.apply(null,arguments)},...S),k=v(function(){l++;const T=Lee(C,arguments);return c=A.apply(null,T),c},...N);return Object.assign(k,{resultFunc:h,memoizedResultFunc:A,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:g,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var re=Bee(eI),qee=Object.assign((e,t=re)=>{Mee(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>qee}),nx={},rx={},ix={},sT;function Fee(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const l=t(r),c=t(i);if(l===c&&l===0){if(r<i)return s==="desc"?1:-1;if(r>i)return s==="desc"?-1:1}return s==="desc"?c-l:l-c}return 0};e.compareValues=n})(ix)),ix}var ax={},sx={},oT;function tI(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(sx)),sx}var lT;function Kee(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tI(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||l!=null&&Object.hasOwn(l,s)}e.isKey=i})(ax)),ax}var cT;function Hee(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fee(),n=Kee(),r=z1();function i(s,l,c,f){if(s==null)return[];c=f?void 0:c,Array.isArray(s)||(s=Object.values(s)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const h=(v,w)=>{let S=v;for(let N=0;N<w.length&&S!=null;++N)S=S[w[N]];return S},m=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:h(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?h(w,v):typeof w=="object"?w[v]:w,g=l.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return s.map(v=>({original:v,criteria:g.map(w=>m(w,v))})).slice().sort((v,w)=>{for(let S=0;S<g.length;S++){const N=t.compareValues(v.criteria[S],w.criteria[S],c[S]);if(N!==0)return N}return 0}).map(v=>v.original)}e.orderBy=i})(rx)),rx}var ox={},uT;function Gee(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],s=Math.floor(r),l=(c,f)=>{for(let h=0;h<c.length;h++){const m=c[h];Array.isArray(m)&&f<s?l(m,f+1):i.push(m)}};return l(n,0),i}e.flatten=t})(ox)),ox}var lx={},dT;function nI(){return dT||(dT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XL(),n=HL(),r=GL(),i=ZL();function s(l,c,f){return r.isObject(f)&&(typeof c=="number"&&n.isArrayLike(f)&&t.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?i.isEqualsSameValueZero(f[c],l):!1}e.isIterateeCall=s})(lx)),lx}var fT;function Vee(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hee(),n=Gee(),r=nI();function i(s,...l){const c=l.length;return c>1&&r.isIterateeCall(s,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(s,n.flatten(l),["asc"])}e.sortBy=i})(nx)),nx}var cx,hT;function Zee(){return hT||(hT=1,cx=Vee().sortBy),cx}var Yee=Zee();const Ug=Rs(Yee);var rI=e=>e.legend.settings,Wee=e=>e.legend.size,Qee=e=>e.legend.payload,Xee=re([Qee,rI],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Ug(r,n):r});function Jee(){return Le(Xee)}var up=1;function iI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),l={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(l.height-t.height)>up||Math.abs(l.left-t.left)>up||Math.abs(l.top-t.top)>up||Math.abs(l.width-t.width)>up)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Pn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ete=typeof Symbol=="function"&&Symbol.observable||"@@observable",pT=ete,ux=()=>Math.random().toString(36).substring(7).split("").join("."),tte={INIT:`@@redux/INIT${ux()}`,REPLACE:`@@redux/REPLACE${ux()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ux()}`},ym=tte;function I1(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function aI(e,t,n){if(typeof e!="function")throw new Error(Pn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Pn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Pn(1));return n(aI)(e,t)}let r=e,i=t,s=new Map,l=s,c=0,f=!1;function h(){l===s&&(l=new Map,s.forEach((N,C)=>{l.set(C,N)}))}function m(){if(f)throw new Error(Pn(3));return i}function g(N){if(typeof N!="function")throw new Error(Pn(4));if(f)throw new Error(Pn(5));let C=!0;h();const A=c++;return l.set(A,N),function(){if(C){if(f)throw new Error(Pn(6));C=!1,h(),l.delete(A),s=null}}}function y(N){if(!I1(N))throw new Error(Pn(7));if(typeof N.type>"u")throw new Error(Pn(8));if(typeof N.type!="string")throw new Error(Pn(17));if(f)throw new Error(Pn(9));try{f=!0,i=r(i,N)}finally{f=!1}return(s=l).forEach(A=>{A()}),N}function v(N){if(typeof N!="function")throw new Error(Pn(10));r=N,y({type:ym.REPLACE})}function w(){const N=g;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Pn(11));function A(){const _=C;_.next&&_.next(m())}return A(),{unsubscribe:N(A)}},[pT](){return this}}}return y({type:ym.INIT}),{dispatch:y,subscribe:g,getState:m,replaceReducer:v,[pT]:w}}function nte(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ym.INIT})>"u")throw new Error(Pn(12));if(typeof n(void 0,{type:ym.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pn(13))})}function sI(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{nte(n)}catch(s){i=s}return function(l={},c){if(i)throw i;let f=!1;const h={};for(let m=0;m<r.length;m++){const g=r[m],y=n[g],v=l[g],w=y(v,c);if(typeof w>"u")throw c&&c.type,new Error(Pn(14));h[g]=w,f=f||w!==v}return f=f||r.length!==Object.keys(l).length,f?h:l}}function vm(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function rte(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(Pn(15))};const l={getState:i.getState,dispatch:(f,...h)=>s(f,...h)},c=e.map(f=>f(l));return s=vm(...c)(i.dispatch),{...i,dispatch:s}}}function oI(e){return I1(e)&&"type"in e&&typeof e.type=="string"}var lI=Symbol.for("immer-nothing"),mT=Symbol.for("immer-draftable"),er=Symbol.for("immer-state");function pi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cr=Object,Pc=Cr.getPrototypeOf,bm="constructor",Bg="prototype",Lw="configurable",xm="enumerable",Ip="writable",Ld="value",_a=e=>!!e&&!!e[er];function bi(e){return e?cI(e)||Fg(e)||!!e[mT]||!!e[bm]?.[mT]||Kg(e)||Hg(e):!1}var ite=Cr[Bg][bm].toString(),gT=new WeakMap;function cI(e){if(!e||!$1(e))return!1;const t=Pc(e);if(t===null||t===Cr[Bg])return!0;const n=Cr.hasOwnProperty.call(t,bm)&&t[bm];if(n===Object)return!0;if(!uc(n))return!1;let r=gT.get(n);return r===void 0&&(r=Function.toString.call(n),gT.set(n,r)),r===ite}function qg(e,t,n=!0){of(e)===0?(n?Reflect.ownKeys(e):Cr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function of(e){const t=e[er];return t?t.type_:Fg(e)?1:Kg(e)?2:Hg(e)?3:0}var yT=(e,t,n=of(e))=>n===2?e.has(t):Cr[Bg].hasOwnProperty.call(e,t),Iw=(e,t,n=of(e))=>n===2?e.get(t):e[t],wm=(e,t,n,r=of(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ate(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Fg=Array.isArray,Kg=e=>e instanceof Map,Hg=e=>e instanceof Set,$1=e=>typeof e=="object",uc=e=>typeof e=="function",dx=e=>typeof e=="boolean";function ste(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var va=e=>e.copy_||e.base_,U1=e=>e.modified_?e.copy_:e.base_;function $w(e,t){if(Kg(e))return new Map(e);if(Hg(e))return new Set(e);if(Fg(e))return Array[Bg].slice.call(e);const n=cI(e);if(t===!0||t==="class_only"&&!n){const r=Cr.getOwnPropertyDescriptors(e);delete r[er];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c[Ip]===!1&&(c[Ip]=!0,c[Lw]=!0),(c.get||c.set)&&(r[l]={[Lw]:!0,[Ip]:!0,[xm]:c[xm],[Ld]:e[l]})}return Cr.create(Pc(e),r)}else{const r=Pc(e);if(r!==null&&n)return{...e};const i=Cr.create(r);return Cr.assign(i,e)}}function B1(e,t=!1){return Gg(e)||_a(e)||!bi(e)||(of(e)>1&&Cr.defineProperties(e,{set:dp,add:dp,clear:dp,delete:dp}),Cr.freeze(e),t&&qg(e,(n,r)=>{B1(r,!0)},!1)),e}function ote(){pi(2)}var dp={[Ld]:ote};function Gg(e){return e===null||!$1(e)?!0:Cr.isFrozen(e)}var Sm="MapSet",Uw="Patches",vT="ArrayMethods",uI={};function Zo(e){const t=uI[e];return t||pi(0,e),t}var bT=e=>!!uI[e],Id,dI=()=>Id,lte=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:bT(Sm)?Zo(Sm):void 0,arrayMethodsPlugin_:bT(vT)?Zo(vT):void 0});function xT(e,t){t&&(e.patchPlugin_=Zo(Uw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bw(e){qw(e),e.drafts_.forEach(cte),e.drafts_=null}function qw(e){e===Id&&(Id=e.parent_)}var wT=e=>Id=lte(Id,e);function cte(e){const t=e[er];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ST(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[er].modified_&&(Bw(t),pi(4)),bi(e)&&(e=jT(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[er].base_,e,t)}else e=jT(t,n);return ute(t,e,!0),Bw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lI?e:void 0}function jT(e,t){if(Gg(t))return t;const n=t[er];if(!n)return jm(t,e.handledSet_,e);if(!Vg(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);pI(n,e)}return n.copy_}function ute(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&B1(t,n)}function fI(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Vg=(e,t)=>e.scope_===t,dte=[];function hI(e,t,n,r){const i=va(e),s=e.type_;if(r!==void 0&&Iw(i,r,s)===t){wm(i,r,n,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;qg(i,(f,h)=>{if(_a(h)){const m=c.get(h)||[];m.push(f),c.set(h,m)}})}const l=e.draftLocations_.get(t)??dte;for(const c of l)wm(i,c,n,s)}function fte(e,t,n){e.callbacks_.push(function(i){const s=t;if(!s||!Vg(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const l=U1(s);hI(e,s.draft_??s,l,n),pI(s,i)})}function pI(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}fI(e)}}function hte(e,t,n){const{scope_:r}=e;if(_a(n)){const i=n[er];Vg(i,r)&&i.callbacks_.push(function(){$p(e);const l=U1(i);hI(e,n,l,t)})}else bi(n)&&e.callbacks_.push(function(){const s=va(e);e.type_===3?s.has(n)&&jm(n,r.handledSet_,r):Iw(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&jm(Iw(e.copy_,t,e.type_),r.handledSet_,r)})}function jm(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||_a(e)||t.has(e)||!bi(e)||Gg(e)||(t.add(e),qg(e,(r,i)=>{if(_a(i)){const s=i[er];if(Vg(s,n)){const l=U1(s);wm(e,r,l,e.type_),fI(s)}}else bi(i)&&jm(i,t,n)})),e}function pte(e,t){const n=Fg(e),r={type_:n?1:0,scope_:t?t.scope_:dI(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Nm;n&&(i=[r],s=$d);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,[c,r]}var Nm={get(e,t){if(t===er)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=va(e);if(!yT(i,t,e.type_))return mte(e,i,t);const s=i[t];if(e.finalized_||!bi(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&ste(t))return s;if(s===fx(e.base_,t)){$p(e);const l=e.type_===1?+t:t,c=Kw(e.scope_,s,e,l);return e.copy_[l]=c}return s},has(e,t){return t in va(e)},ownKeys(e){return Reflect.ownKeys(va(e))},set(e,t,n){const r=mI(va(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=fx(va(e),t),s=i?.[er];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ate(n,i)&&(n!==void 0||yT(e.base_,t,e.type_)))return!0;$p(e),Fw(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),hte(e,t,n)),!0},deleteProperty(e,t){return $p(e),fx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Fw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=va(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ip]:!0,[Lw]:e.type_!==1||t!=="length",[xm]:r[xm],[Ld]:n[t]}},defineProperty(){pi(11)},getPrototypeOf(e){return Pc(e.base_)},setPrototypeOf(){pi(12)}},$d={};for(let e in Nm){let t=Nm[e];$d[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}$d.deleteProperty=function(e,t){return $d.set.call(this,e,t,void 0)};$d.set=function(e,t,n){return Nm.set.call(this,e[0],t,n,e[0])};function fx(e,t){const n=e[er];return(n?va(n):e)[t]}function mte(e,t,n){const r=mI(t,n);return r?Ld in r?r[Ld]:r.get?.call(e.draft_):void 0}function mI(e,t){if(!(t in e))return;let n=Pc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pc(n)}}function Fw(e){e.modified_||(e.modified_=!0,e.parent_&&Fw(e.parent_))}function $p(e){e.copy_||(e.assigned_=new Map,e.copy_=$w(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var gte=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(uc(n)&&!uc(r)){const l=r;r=n;const c=this;return function(h=l,...m){return c.produce(h,g=>r.call(this,g,...m))}}uc(r)||pi(6),i!==void 0&&!uc(i)&&pi(7);let s;if(bi(n)){const l=wT(this),c=Kw(l,n,void 0);let f=!0;try{s=r(c),f=!1}finally{f?Bw(l):qw(l)}return xT(l,i),ST(s,l)}else if(!n||!$1(n)){if(s=r(n),s===void 0&&(s=n),s===lI&&(s=void 0),this.autoFreeze_&&B1(s,!0),i){const l=[],c=[];Zo(Uw).generateReplacementPatches_(n,s,{patches_:l,inversePatches_:c}),i(l,c)}return s}else pi(1,n)},this.produceWithPatches=(n,r)=>{if(uc(n))return(c,...f)=>this.produceWithPatches(c,h=>n(h,...f));let i,s;return[this.produce(n,r,(c,f)=>{i=c,s=f}),i,s]},dx(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),dx(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),dx(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){bi(t)||pi(8),_a(t)&&(t=Yr(t));const n=wT(this),r=Kw(n,t,void 0);return r[er].isManual_=!0,qw(n),r}finishDraft(t,n){const r=t&&t[er];(!r||!r.isManual_)&&pi(9);const{scope_:i}=r;return xT(i,n),ST(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(n=n.slice(r+1));const i=Zo(Uw).applyPatches_;return _a(t)?i(t,n):this.produce(t,s=>i(s,n))}};function Kw(e,t,n,r){const[i,s]=Kg(t)?Zo(Sm).proxyMap_(t,n):Hg(t)?Zo(Sm).proxySet_(t,n):pte(t,n);return(n?.scope_??dI()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?fte(n,s,r):s.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:h}=f;s.modified_&&h&&h.generatePatches_(s,[],f)}),i}function Yr(e){return _a(e)||pi(10,e),gI(e)}function gI(e){if(!bi(e)||Gg(e))return e;const t=e[er];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$w(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=$w(e,!0);return qg(n,(i,s)=>{wm(n,i,gI(s))},r),t&&(t.finalized_=!1),n}var yte=new gte,yI=yte.produce;function vI(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var vte=vI(),bte=vI,xte=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vm:vm.apply(null,arguments)};function kr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(_r(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>oI(r)&&r.type===e,n}var bI=class md extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,md.prototype)}static get[Symbol.species](){return md}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new md(...t[0].concat(this)):new md(...t.concat(this))}};function NT(e){return bi(e)?yI(e,()=>{}):e}function fp(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function wte(e){return typeof e=="boolean"}var Ste=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let l=new bI;return n&&(wte(n)?l.push(vte):l.push(bte(n.extraArgument))),l},xI="RTK_autoBatch",Pt=()=>e=>({payload:e,meta:{[xI]:!0}}),CT=e=>t=>{setTimeout(t,e)},wI=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,l=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:CT(10):e.type==="callback"?e.queueNotification:CT(e.timeout),h=()=>{l=!1,s&&(s=!1,c.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const g=()=>i&&m(),y=r.subscribe(g);return c.add(m),()=>{y(),c.delete(m)}},dispatch(m){try{return i=!m?.meta?.[xI],s=!i,s&&(l||(l=!0,f(h))),r.dispatch(m)}finally{i=!0}}})},jte=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new bI(e);return r&&i.push(wI(typeof r=="object"?r:void 0)),i};function Nte(e){const t=Ste(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(I1(n))c=sI(n);else throw new Error(_r(1));let f;typeof r=="function"?f=r(t):f=t();let h=vm;i&&(h=xte({trace:!1,...typeof i=="object"&&i}));const m=rte(...f),g=jte(m);let y=typeof l=="function"?l(g):g();const v=h(...y);return aI(c,s,v)}function SI(e){const t={},n=[];let r;const i={addCase(s,l){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(_r(28));if(c in t)throw new Error(_r(29));return t[c]=l,i},addAsyncThunk(s,l){return l.pending&&(t[s.pending.type]=l.pending),l.rejected&&(t[s.rejected.type]=l.rejected),l.fulfilled&&(t[s.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:s.settled,reducer:l.settled}),i},addMatcher(s,l){return n.push({matcher:s,reducer:l}),i},addDefaultCase(s){return r=s,i}};return e(i),[t,n,r]}function Cte(e){return typeof e=="function"}function _te(e,t){let[n,r,i]=SI(t),s;if(Cte(e))s=()=>NT(e());else{const c=NT(e);s=()=>c}function l(c=s(),f){let h=[n[f.type],...r.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,g)=>{if(g)if(_a(m)){const v=g(m,f);return v===void 0?m:v}else{if(bi(m))return yI(m,y=>g(y,f));{const y=g(m,f);if(y===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return m},c)}return l.getInitialState=s,l}var Ote="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",kte=(e=21)=>{let t="",n=e;for(;n--;)t+=Ote[Math.random()*64|0];return t},Ate=Symbol.for("rtk-slice-createasyncthunk");function Ete(e,t){return`${e}/${t}`}function Tte({creators:e}={}){const t=e?.asyncThunk?.[Ate];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(_r(11));const l=(typeof r.reducers=="function"?r.reducers(zte()):r.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,_){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(_r(12));if(T in f.sliceCaseReducersByType)throw new Error(_r(13));return f.sliceCaseReducersByType[T]=_,h},addMatcher(k,_){return f.sliceMatchers.push({matcher:k,reducer:_}),h},exposeAction(k,_){return f.actionCreators[k]=_,h},exposeCaseReducer(k,_){return f.sliceCaseReducersByName[k]=_,h}};c.forEach(k=>{const _=l[k],T={reducerName:k,type:Ete(i,k),createNotation:typeof r.reducers=="function"};Rte(_)?Lte(T,_,h,t):Mte(T,_,h)});function m(){const[k={},_=[],T=void 0]=typeof r.extraReducers=="function"?SI(r.extraReducers):[r.extraReducers],P={...k,...f.sliceCaseReducersByType};return _te(r.initialState,E=>{for(let z in P)E.addCase(z,P[z]);for(let z of f.sliceMatchers)E.addMatcher(z.matcher,z.reducer);for(let z of _)E.addMatcher(z.matcher,z.reducer);T&&E.addDefaultCase(T)})}const g=k=>k,y=new Map,v=new WeakMap;let w;function S(k,_){return w||(w=m()),w(k,_)}function N(){return w||(w=m()),w.getInitialState()}function C(k,_=!1){function T(E){let z=E[k];return typeof z>"u"&&_&&(z=fp(v,T,N)),z}function P(E=g){const z=fp(y,_,()=>new WeakMap);return fp(z,E,()=>{const D={};for(const[K,U]of Object.entries(r.selectors??{}))D[K]=Pte(U,E,()=>fp(v,E,N),_);return D})}return{reducerPath:k,getSelectors:P,get selectors(){return P(T)},selectSlice:T}}const A={name:i,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...C(s),injectInto(k,{reducerPath:_,...T}={}){const P=_??s;return k.inject({reducerPath:P,reducer:S},T),{...A,...C(P,!0)}}};return A}}function Pte(e,t,n,r){function i(s,...l){let c=t(s);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Kn=Tte();function zte(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Mte({type:e,reducerName:t,createNotation:n},r,i){let s,l;if("reducer"in r){if(n&&!Dte(r))throw new Error(_r(17));s=r.reducer,l=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,l?kr(e,l):kr(e))}function Rte(e){return e._reducerDefinitionType==="asyncThunk"}function Dte(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Lte({type:e,reducerName:t},n,r,i){if(!i)throw new Error(_r(18));const{payloadCreator:s,fulfilled:l,pending:c,rejected:f,settled:h,options:m}=n,g=i(e,s,m);r.exposeAction(t,g),l&&r.addCase(g.fulfilled,l),c&&r.addCase(g.pending,c),f&&r.addCase(g.rejected,f),h&&r.addMatcher(g.settled,h),r.exposeCaseReducer(t,{fulfilled:l||hp,pending:c||hp,rejected:f||hp,settled:h||hp})}function hp(){}var Ite="task",jI="listener",NI="completed",q1="cancelled",$te=`task-${q1}`,Ute=`task-${NI}`,Hw=`${jI}-${q1}`,Bte=`${jI}-${NI}`,Zg=class{constructor(e){this.code=e,this.message=`${Ite} ${q1} (reason: ${e})`}name="TaskAbortError";message},F1=(e,t)=>{if(typeof e!="function")throw new TypeError(_r(32))},Cm=()=>{},CI=(e,t=Cm)=>(e.catch(t),e),_I=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Do=e=>{if(e.aborted)throw new Zg(e.reason)};function OI(e,t){let n=Cm;return new Promise((r,i)=>{const s=()=>i(new Zg(e.reason));if(e.aborted){s();return}n=_I(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Cm})}var qte=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Zg?"cancelled":"rejected",error:n}}finally{t?.()}},_m=e=>t=>CI(OI(e,t).then(n=>(Do(e),n))),kI=e=>{const t=_m(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:jc}=Object,_T={},Yg="listenerMiddleware",Fte=(e,t)=>{const n=r=>_I(e,()=>r.abort(e.reason));return(r,i)=>{F1(r);const s=new AbortController;n(s);const l=qte(async()=>{Do(e),Do(s.signal);const c=await r({pause:_m(s.signal),delay:kI(s.signal),signal:s.signal});return Do(s.signal),c},()=>s.abort(Ute));return i?.autoJoin&&t.push(l.catch(Cm)),{result:_m(e)(l),cancel(){s.abort($te)}}}},Kte=(e,t)=>{const n=async(r,i)=>{Do(t);let s=()=>{};const c=[new Promise((f,h)=>{let m=e({predicate:r,effect:(g,y)=>{y.unsubscribe(),f([g,y.getState(),y.getOriginalState()])}});s=()=>{m(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await OI(t,Promise.race(c));return Do(t),f}finally{s()}};return(r,i)=>CI(n(r,i))},AI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=kr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(_r(21));return F1(s),{predicate:i,type:t,effect:s}},EI=jc(e=>{const{type:t,predicate:n,effect:r}=AI(e);return{id:kte(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(_r(22))}}},{withTypes:()=>EI}),OT=(e,t)=>{const{type:n,effect:r,predicate:i}=AI(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},Gw=e=>{e.pending.forEach(t=>{t.abort(Hw)})},Hte=(e,t)=>()=>{for(const n of t.keys())Gw(n);e.clear()},kT=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},TI=jc(kr(`${Yg}/add`),{withTypes:()=>TI}),Gte=kr(`${Yg}/removeAll`),PI=jc(kr(`${Yg}/remove`),{withTypes:()=>PI}),Vte=(...e)=>{console.error(`${Yg}/error`,...e)},lf=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:s,onError:l=Vte}=e;F1(l);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&Gw(v)}),f=v=>{const w=OT(t,v)??EI(v);return c(w)};jc(f,{withTypes:()=>f});const h=v=>{const w=OT(t,v);return w&&(w.unsubscribe(),v.cancelActive&&Gw(w)),!!w};jc(h,{withTypes:()=>h});const m=async(v,w,S,N)=>{const C=new AbortController,A=Kte(f,C.signal),k=[];try{v.pending.add(C),r(v),await Promise.resolve(v.effect(w,jc({},S,{getOriginalState:N,condition:(_,T)=>A(_,T).then(Boolean),take:A,delay:kI(C.signal),pause:_m(C.signal),extra:s,signal:C.signal,fork:Fte(C.signal,k),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((_,T,P)=>{_!==C&&(_.abort(Hw),P.delete(_))})},cancel:()=>{C.abort(Hw),v.pending.delete(C)},throwIfCancelled:()=>{Do(C.signal)}})))}catch(_){_ instanceof Zg||kT(l,_,{raisedBy:"effect"})}finally{await Promise.all(k),C.abort(Bte),i(v),v.pending.delete(C)}},g=Hte(t,n);return{middleware:v=>w=>S=>{if(!oI(S))return w(S);if(TI.match(S))return f(S.payload);if(Gte.match(S)){g();return}if(PI.match(S))return h(S.payload);let N=v.getState();const C=()=>{if(N===_T)throw new Error(_r(23));return N};let A;try{if(A=w(S),t.size>0){const k=v.getState(),_=Array.from(t.values());for(const T of _){let P=!1;try{P=T.predicate(S,k,N)}catch(E){P=!1,kT(l,E,{raisedBy:"predicate"})}P&&m(T,S,v,C)}}}finally{N=_T}return A},startListening:f,stopListening:h,clearListeners:g}};function _r(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Zte={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},zI=Kn({name:"chartLayout",initialState:Zte,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,s;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Yte,setLayout:Wte,setChartSize:Qte,setScale:Xte}=zI.actions,Jte=zI.reducer;function MI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ct(e){return Number.isFinite(e)}function Ms(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function AT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AT(Object(n),!0).forEach(function(r){ene(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ene(e,t,n){return(t=tne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tne(e){var t=nne(e,"string");return typeof t=="symbol"?t:t+""}function nne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nn(e,t,n){return Dn(e)||Dn(t)?n:Vi(t)?$g(e,t,n):typeof t=="function"?t(e):n}var rne=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:s,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&s!=="center"&&Pe(e[s]))return gc(gc({},e),{},{[s]:e[s]+(r||0)});if((c==="horizontal"||c==="vertical"&&s==="center")&&l!=="middle"&&Pe(e[l]))return gc(gc({},e),{},{[l]:e[l]+(i||0)})}return e},Wi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",ine=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0,c=0;c<n;++c){var f=e[c],h=f?.[i];if(h!=null){var m=h[1],g=h[0],y=Gi(m)?g:m;y>=0?(h[0]=s,s+=y,h[1]=s):(h[0]=l,l+=y,h[1]=l)}}}},ane=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0;l<n;++l){var c=e[l],f=c?.[i];if(f!=null){var h=Gi(f[1])?f[0]:f[1];h>=0?(f[0]=s,s+=h,f[1]=s):(f[0]=0,f[1]=0)}}}},sne={sign:ine,expand:PJ,none:Go,silhouette:zJ,wiggle:MJ,positive:ane},one=(e,t,n)=>{var r,i=(r=sne[n])!==null&&r!==void 0?r:Go,s=TJ().keys(t).value((c,f)=>Number(Nn(c,f,0))).order(Rw).offset(i),l=s(e);return l.forEach((c,f)=>{c.forEach((h,m)=>{var g=Nn(e[m],t[f],0);Array.isArray(g)&&g.length===2&&Pe(g[0])&&Pe(g[1])&&(h[0]=g[0],h[1]=g[1])})}),l};function lne(e){return e==null?void 0:String(e)}function ET(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Dn(i[t.dataKey])){var c=IL(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var f=Nn(i,Dn(l)?t.dataKey:l),h=t.scale.map(f);return Pe(h)?h:null}var cne=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},une=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],dne=(e,t,n)=>{if(e!=null)return une(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:l}=s,c=l.reduce((f,h)=>{var m=MI(h,t,n),g=cne(m);return!ct(g[0])||!ct(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},TT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Om=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Ug(t,m=>m.coordinate),s=1/0,l=1,c=i.length;l<c;l++){var f=i[l],h=i[l-1];s=Math.min((f?.coordinate||0)-(h?.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0};function zT(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:s}=e;return gc(gc({},t),{},{dataKey:n,payload:r,value:i,name:s})}function RI(e,t){if(e)return String(e);if(typeof t=="string")return t}var fne=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},hne=(e,t)=>t==="centric"?e.angle:e.radius,Ta=e=>e.layout.width,Pa=e=>e.layout.height,pne=e=>e.layout.scale,DI=e=>e.layout.margin,Wg=re(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Qg=re(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),mne="data-recharts-item-index",gne="data-recharts-item-id",cf=60;function MT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MT(Object(n),!0).forEach(function(r){yne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yne(e,t,n){return(t=vne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vne(e){var t=bne(e,"string");return typeof t=="symbol"?t:t+""}function bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xne=e=>e.brush.height;function wne(e){var t=Qg(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:cf;return n+i}return n},0)}function Sne(e){var t=Qg(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:cf;return n+i}return n},0)}function jne(e){var t=Wg(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Nne(e){var t=Wg(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var In=re([Ta,Pa,DI,xne,wne,Sne,jne,Nne,rI,Wee],(e,t,n,r,i,s,l,c,f,h)=>{var m={left:(n.left||0)+i,right:(n.right||0)+s},g={top:(n.top||0)+l,bottom:(n.bottom||0)+c},y=pp(pp({},g),m),v=y.bottom;y.bottom+=r,y=rne(y,f,h);var w=e-y.left-y.right,S=t-y.top-y.bottom;return pp(pp({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(S,0)})}),Cne=re(In,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),LI=re(Ta,Pa,(e,t)=>({x:0,y:0,width:e,height:t})),_ne=x.createContext(null),Tr=()=>x.useContext(_ne)!=null,Xg=e=>e.brush,Jg=re([Xg,In,DI],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Pe(e.width)?e.width:t.width})),hx={},px={},mx={},RT;function One(){return RT||(RT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:s}={}){let l,c=null;const f=s!=null&&s.includes("leading"),h=s==null||s.includes("trailing"),m=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},g=()=>{h&&m(),S()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,g()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{w(),l=void 0,c=null},N=()=>{m()},C=function(...A){if(i?.aborted)return;l=this,c=A;const k=y==null;v(),f&&k&&m()};return C.schedule=v,C.cancel=S,C.flush=N,i?.addEventListener("abort",S,{once:!0}),C}e.debounce=t})(mx)),mx}var DT;function kne(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=One();function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:l=!1,trailing:c=!0,maxWait:f}=s,h=Array(2);l&&(h[0]="leading"),c&&(h[1]="trailing");let m,g=null;const y=t.debounce(function(...S){m=r.apply(this,S),g=null},i,{edges:h}),v=function(...S){return f!=null&&(g===null&&(g=Date.now()),Date.now()-g>=f)?(m=r.apply(this,S),g=Date.now(),y.cancel(),y.schedule(),m):(y.apply(this,S),m)},w=()=>(y.flush(),m);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(px)),px}var LT;function Ane(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kne();function n(r,i=0,s={}){const{leading:l=!0,trailing:c=!0}=s;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(hx)),hx}var gx,IT;function Ene(){return IT||(IT=1,gx=Ane().throttle),gx}var Tne=Ene();const Pne=Rs(Tne);var $T=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},$i={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},II=(e,t,n)=>{var{width:r=$i.width,height:i=$i.height,aspect:s,maxHeight:l}=n,c=Vo(r)?e:Number(r),f=Vo(i)?t:Number(i);return s&&s>0&&(c?f=c/s:f&&(c=f*s),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:c,calculatedHeight:f}},zne={width:0,height:0,overflow:"visible"},Mne={width:0,overflowX:"visible"},Rne={height:0,overflowY:"visible"},Dne={},Lne=e=>{var{width:t,height:n}=e,r=Vo(t),i=Vo(n);return r&&i?zne:r?Mne:i?Rne:Dne};function Ine(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=$i.width,s=$i.height):i===void 0?i=r&&r>0?void 0:$i.width:s===void 0&&(s=r&&r>0?void 0:$i.height),{width:i,height:s}}function Vw(){return Vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vw.apply(null,arguments)}function UT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UT(Object(n),!0).forEach(function(r){$ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ne(e,t,n){return(t=Une(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Une(e){var t=Bne(e,"string");return typeof t=="symbol"?t:t+""}function Bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $I=x.createContext($i.initialDimension);function qne(e){return Ms(e.width)&&Ms(e.height)}function UI(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return qne(i)?x.createElement($I.Provider,{value:i},t):null}var K1=()=>x.useContext($I),Fne=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=$i.initialDimension,width:i,height:s,minWidth:l=$i.minWidth,minHeight:c,maxHeight:f,children:h,debounce:m=$i.debounce,id:g,className:y,onResize:v,style:w={}}=e,S=x.useRef(null),N=x.useRef();N.current=v,x.useImperativeHandle(t,()=>S.current);var[C,A]=x.useState({containerWidth:r.width,containerHeight:r.height}),k=x.useCallback((z,D)=>{A(K=>{var U=Math.round(z),I=Math.round(D);return K.containerWidth===U&&K.containerHeight===I?K:{containerWidth:U,containerHeight:I}})},[]);x.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Yc;var z=I=>{var H,ge=I[0];if(ge!=null){var{width:me,height:G}=ge.contentRect;k(me,G),(H=N.current)===null||H===void 0||H.call(N,me,G)}};m>0&&(z=Pne(z,m,{trailing:!0,leading:!1}));var D=new ResizeObserver(z),{width:K,height:U}=S.current.getBoundingClientRect();return k(K,U),D.observe(S.current),()=>{D.disconnect()}},[k,m]);var{containerWidth:_,containerHeight:T}=C;$T(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:P,calculatedHeight:E}=II(_,T,{width:i,height:s,aspect:n,maxHeight:f});return $T(P!=null&&P>0||E!=null&&E>0,`The width(%s) and height(%s) of chart should be greater than 0,
237
+ please check the style of container, or the props width(%s) and height(%s),
238
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
239
+ height and width.`,P,E,i,s,l,c,n),x.createElement("div",{id:g?"".concat(g):void 0,className:bt("recharts-responsive-container",y),style:BT(BT({},w),{},{width:i,height:s,minWidth:l,minHeight:c,maxHeight:f}),ref:S},x.createElement("div",{style:Lne({width:i,height:s})},x.createElement(UI,{width:P,height:E},h)))}),Kne=x.forwardRef((e,t)=>{var n=K1();if(Ms(n.width)&&Ms(n.height))return e.children;var{width:r,height:i}=Ine({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:l}=II(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(s)&&Pe(l)?x.createElement(UI,{width:s,height:l},e.children):x.createElement(Fne,Vw({},e,{width:r,height:i,ref:t}))});function H1(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var ey=()=>{var e,t=Tr(),n=Le(Cne),r=Le(Jg),i=(e=Le(Xg))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},Hne={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Gne=()=>{var e;return(e=Le(In))!==null&&e!==void 0?e:Hne},BI=()=>Le(Ta),qI=()=>Le(Pa),Vne=()=>Le(e=>e.layout.margin),Bt=e=>e.layout.layoutType,Wc=()=>Le(Bt),G1=()=>{var e=Wc();if(e==="horizontal"||e==="vertical")return e},FI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Zne=()=>{var e=Wc();return e!==void 0},uf=e=>{var t=Xt(),n=Tr(),{width:r,height:i}=e,s=K1(),l=r,c=i;return s&&(l=s.width>0?s.width:r,c=s.height>0?s.height:i),x.useEffect(()=>{!n&&Ms(l)&&Ms(c)&&t(Qte({width:l,height:c}))},[t,n,l,c]),null},KI=Symbol.for("immer-nothing"),qT=Symbol.for("immer-draftable"),Ar=Symbol.for("immer-state");function mi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ud=Object.getPrototypeOf;function zc(e){return!!e&&!!e[Ar]}function Yo(e){return e?HI(e)||Array.isArray(e)||!!e[qT]||!!e.constructor?.[qT]||df(e)||ny(e):!1}var Yne=Object.prototype.constructor.toString(),FT=new WeakMap;function HI(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=FT.get(n);return r===void 0&&(r=Function.toString.call(n),FT.set(n,r)),r===Yne}function km(e,t,n=!0){ty(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function ty(e){const t=e[Ar];return t?t.type_:Array.isArray(e)?1:df(e)?2:ny(e)?3:0}function Zw(e,t){return ty(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function GI(e,t,n){const r=ty(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Wne(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function df(e){return e instanceof Map}function ny(e){return e instanceof Set}function xo(e){return e.copy_||e.base_}function Yw(e,t){if(df(e))return new Map(e);if(ny(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=HI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ar];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Ud(e),r)}else{const r=Ud(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function V1(e,t=!1){return ry(e)||zc(e)||!Yo(e)||(ty(e)>1&&Object.defineProperties(e,{set:mp,add:mp,clear:mp,delete:mp}),Object.freeze(e),t&&Object.values(e).forEach(n=>V1(n,!0))),e}function Qne(){mi(2)}var mp={value:Qne};function ry(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Xne={};function Wo(e){const t=Xne[e];return t||mi(0,e),t}var Bd;function VI(){return Bd}function Jne(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function KT(e,t){t&&(Wo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ww(e){Qw(e),e.drafts_.forEach(ere),e.drafts_=null}function Qw(e){e===Bd&&(Bd=e.parent_)}function HT(e){return Bd=Jne(Bd,e)}function ere(e){const t=e[Ar];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ar].modified_&&(Ww(t),mi(4)),Yo(e)&&(e=Am(t,e),t.parent_||Em(t,e)),t.patches_&&Wo("Patches").generateReplacementPatches_(n[Ar].base_,e,t.patches_,t.inversePatches_)):e=Am(t,n,[]),Ww(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KI?e:void 0}function Am(e,t,n){if(ry(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Ar];if(!i)return km(t,(s,l)=>VT(e,i,t,s,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Em(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let l=s,c=!1;i.type_===3&&(l=new Set(s),s.clear(),c=!0),km(l,(f,h)=>VT(e,i,s,f,h,n,c),r),Em(e,s,!1),n&&e.patches_&&Wo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function VT(e,t,n,r,i,s,l){if(i==null||typeof i!="object"&&!l)return;const c=ry(i);if(!(c&&!l)){if(zc(i)){const f=s&&t&&t.type_!==3&&!Zw(t.assigned_,r)?s.concat(r):void 0,h=Am(e,i,f);if(GI(n,r,h),zc(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Yo(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Am(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(df(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Em(e,i)}}}function Em(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&V1(t,n)}function tre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:VI(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=Z1;n&&(i=[r],s=qd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,c}var Z1={get(e,t){if(t===Ar)return e;const n=xo(e);if(!Zw(n,t))return nre(e,n,t);const r=n[t];return e.finalized_||!Yo(r)?r:r===yx(e.base_,t)?(vx(e),e.copy_[t]=Jw(r,e)):r},has(e,t){return t in xo(e)},ownKeys(e){return Reflect.ownKeys(xo(e))},set(e,t,n){const r=ZI(xo(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yx(xo(e),t),s=i?.[Ar];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Wne(n,i)&&(n!==void 0||Zw(e.base_,t)))return!0;vx(e),Xw(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,vx(e),Xw(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){mi(11)},getPrototypeOf(e){return Ud(e.base_)},setPrototypeOf(){mi(12)}},qd={};km(Z1,(e,t)=>{qd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qd.deleteProperty=function(e,t){return qd.set.call(this,e,t,void 0)};qd.set=function(e,t,n){return Z1.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[Ar];return(n?xo(n):e)[t]}function nre(e,t,n){const r=ZI(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function ZI(e,t){if(!(t in e))return;let n=Ud(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ud(n)}}function Xw(e){e.modified_||(e.modified_=!0,e.parent_&&Xw(e.parent_))}function vx(e){e.copy_||(e.copy_=Yw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rre=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(f=s,...h){return l.produce(f,m=>n.call(this,m,...h))}}typeof n!="function"&&mi(6),r!==void 0&&typeof r!="function"&&mi(7);let i;if(Yo(t)){const s=HT(this),l=Jw(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?Ww(s):Qw(s)}return KT(s,r),GT(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===KI&&(i=void 0),this.autoFreeze_&&V1(i,!0),r){const s=[],l=[];Wo("Patches").generateReplacementPatches_(t,i,s,l),r(s,l)}return i}else mi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,f=>t(f,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Yo(e)||mi(8),zc(e)&&(e=ire(e));const t=HT(this),n=Jw(e,void 0);return n[Ar].isManual_=!0,Qw(t),n}finishDraft(e,t){const n=e&&e[Ar];(!n||!n.isManual_)&&mi(9);const{scope_:r}=n;return KT(r,t),GT(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Wo("Patches").applyPatches_;return zc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Jw(e,t){const n=df(e)?Wo("MapSet").proxyMap_(e,t):ny(e)?Wo("MapSet").proxySet_(e,t):tre(e,t);return(t?t.scope_:VI()).drafts_.push(n),n}function ire(e){return zc(e)||mi(10,e),YI(e)}function YI(e){if(!Yo(e)||ry(e))return e;const t=e[Ar];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Yw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Yw(e,!0);return km(n,(i,s)=>{GI(n,i,YI(s))},r),t&&(t.finalized_=!1),n}var are=new rre;are.produce;var sre={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},WI=Kn({name:"legend",initialState:sre,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Pt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Yr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Pt()},removeLegendPayload:{reducer(e,t){var n=Yr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Pt()}}}),{setLegendSize:ZT,setLegendSettings:ore,addLegendPayload:lre,replaceLegendPayload:cre,removeLegendPayload:ure}=WI.actions,dre=WI.reducer,bx={exports:{}},xx={};var YT;function fre(){if(YT)return xx;YT=1;var e=Uc();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return xx.useSyncExternalStoreWithSelector=function(f,h,m,g,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function N(T){if(!C){if(C=!0,A=T,T=g(T),y!==void 0&&w.hasValue){var P=w.value;if(y(P,T))return k=P}return k=T}if(P=k,n(A,T))return P;var E=g(T);return y!==void 0&&y(P,E)?(A=T,P):(A=T,k=E)}var C=!1,A,k,_=m===void 0?null:m;return[function(){return N(h())},_===null?void 0:function(){return N(_())}]},[h,m,g,y]);var S=r(f,v[0],v[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},xx}var WT;function hre(){return WT||(WT=1,bx.exports=fre()),bx.exports}hre();function pre(e){e()}function mre(){let e=null,t=null;return{clear(){e=null,t=null},notify(){pre(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var QT={notify(){},get:()=>[]};function gre(e,t){let n,r=QT,i=0,s=!1;function l(S){m();const N=r.subscribe(S);let C=!1;return()=>{C||(C=!0,N(),g())}}function c(){r.notify()}function f(){w.onStateChange&&w.onStateChange()}function h(){return s}function m(){i++,n||(n=e.subscribe(f),r=mre())}function g(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=QT)}function y(){s||(s=!0,m())}function v(){s&&(s=!1,g())}const w={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var yre=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vre=yre(),bre=()=>typeof navigator<"u"&&navigator.product==="ReactNative",xre=bre(),wre=()=>vre||xre?x.useLayoutEffect:x.useEffect,Sre=wre();function XT(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function jre(e,t){if(XT(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!XT(e[n[i]],t[n[i]]))return!1;return!0}var Nre=Symbol.for("react-redux-context"),Cre=typeof globalThis<"u"?globalThis:{};function _re(){if(!x.createContext)return{};const e=Cre[Nre]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Ore=_re();function kre(e){const{children:t,context:n,serverState:r,store:i}=e,s=x.useMemo(()=>{const f=gre(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);Sre(()=>{const{subscription:f}=s;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[s,l]);const c=n||Ore;return x.createElement(c.Provider,{value:s},t)}var Are=kre,Ere=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Tre(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function ff(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Ere.has(r)){if(e[r]==null&&t[r]==null)continue;if(!jre(e[r],t[r]))return!1}else if(!Tre(e[r],t[r]))return!1;return!0}var Pre=["contextPayload"];function eS(){return eS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eS.apply(null,arguments)}function JT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JT(Object(n),!0).forEach(function(r){zre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zre(e,t,n){return(t=Mre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mre(e){var t=Rre(e,"string");return typeof t=="symbol"?t:t+""}function Rre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dre(e,t){if(e==null)return{};var n,r,i=Lre(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ire(e){return e.value}function $re(e){var{contextPayload:t}=e,n=Dre(e,Pre),r=JL(t,e.payloadUniqBy,Ire),i=Mc(Mc({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(cee,i)}function Ure(e,t,n,r,i,s){var{layout:l,align:c,verticalAlign:f}=t,h,m;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?h={left:((r||0)-s.width)/2}:h=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?m={top:((i||0)-s.height)/2}:m=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Mc(Mc({},h),m)}function Bre(e){var t=Xt();return x.useEffect(()=>{t(ore(e))},[t,e]),null}function qre(e){var t=Xt();return x.useEffect(()=>(t(ZT(e)),()=>{t(ZT({width:0,height:0}))}),[t,e]),null}function Fre(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Kre={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Hre(e){var t=Er(e,Kre),n=Jee(),r=tJ(),i=Vne(),{width:s,height:l,wrapperStyle:c,portal:f}=t,[h,m]=iI([n]),g=BI(),y=qI();if(g==null||y==null)return null;var v=g-(i?.left||0)-(i?.right||0),w=Fre(t.layout,l,s,v),S=f?c:Mc(Mc({position:"absolute",width:w?.width||s||"auto",height:w?.height||l||"auto"},Ure(c,t,i,g,y,h)),c),N=f??r;if(N==null||n==null)return null;var C=x.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:m},x.createElement(Bre,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement(qre,{width:h.width,height:h.height}),x.createElement($re,eS({},t,w,{margin:i,chartWidth:g,chartHeight:y,contextPayload:n})));return tl.createPortal(C,N)}var QI=x.memo(Hre,ff);QI.displayName="Legend";function tS(){return tS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tS.apply(null,arguments)}function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){Gre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gre(e,t,n){return(t=Vre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vre(e){var t=Zre(e,"string");return typeof t=="symbol"?t:t+""}function Zre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yre(e){return Array.isArray(e)&&Vi(e[0])&&Vi(e[1])?e.join(" ~ "):e}var nc={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Wre(e,t){return t==null?e:Ug(e,t)}var Qre=e=>{var{separator:t=nc.separator,contentStyle:n,itemStyle:r,labelStyle:i=nc.labelStyle,payload:s,formatter:l,itemSorter:c,wrapperClassName:f,labelClassName:h,label:m,labelFormatter:g,accessibilityLayer:y=nc.accessibilityLayer}=e,v=()=>{if(s&&s.length){var T={padding:0,margin:0},P=Wre(s,c),E=P.map((z,D)=>{if(!z||z.type==="none")return null;var K=z.formatter||l||Yre,{value:U,name:I}=z,H=U,ge=I;if(K){var me=K(U,I,z,D,s);if(Array.isArray(me))[H,ge]=me;else if(me!=null)H=me;else return null}var G=rd(rd({},nc.itemStyle),{},{color:z.color||nc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:G},Vi(ge)?x.createElement("span",{className:"recharts-tooltip-item-name"},ge):null,Vi(ge)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},H),x.createElement("span",{className:"recharts-tooltip-item-unit"},z.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:T},E)}return null},w=rd(rd({},nc.contentStyle),n),S=rd({margin:0},i),N=!Dn(m),C=N?m:"",A=bt("recharts-default-tooltip",f),k=bt("recharts-tooltip-label",h);N&&g&&s!==void 0&&s!==null&&(C=g(m,s));var _=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",tS({className:A,style:w},_),x.createElement("p",{className:k,style:S},x.isValidElement(C)?C:"".concat(C)),v())},id="recharts-tooltip-wrapper",Xre={visibility:"hidden"};function Jre(e){var{coordinate:t,translateX:n,translateY:r}=e;return bt(id,{["".concat(id,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(id,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(id,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(id,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function t2(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:s,reverseDirection:l,tooltipDimension:c,viewBox:f,viewBoxDimension:h}=e;if(s&&Pe(s[r]))return s[r];var m=n[r]-c-(i>0?i:0),g=n[r]+i;if(t[r])return l[r]?m:g;var y=f[r];if(y==null)return 0;if(l[r]){var v=m,w=y;return v<w?Math.max(g,y):Math.max(m,y)}if(h==null)return 0;var S=g+c,N=y+h;return S>N?Math.max(m,y):Math.max(g,y)}function eie(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function tie(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:l,tooltipBox:c,useTranslate3d:f,viewBox:h}=e,m,g,y;return c.height>0&&c.width>0&&n?(g=t2({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:l,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),y=t2({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:l,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),m=eie({translateX:g,translateY:y,useTranslate3d:f})):m=Xre,{cssProperties:m,cssClasses:Jre({translateX:g,translateY:y,coordinate:n})}}var nie=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),hf={isSsr:nie()};function XI(){var[e,t]=x.useState(()=>hf.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n2(Object(n),!0).forEach(function(r){rie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rie(e,t,n){return(t=iie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iie(e){var t=aie(e,"string");return typeof t=="symbol"?t:t+""}function aie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sie(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function oie(e){var t,n,r,i,s,l,c=XI(),[f,h]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var N,C,A,k;h({dismissed:!0,dismissedAtCoordinate:{x:(N=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&N!==void 0?N:0,y:(A=(k=e.coordinate)===null||k===void 0?void 0:k.y)!==null&&A!==void 0?A:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((s=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&s!==void 0?s:0)!==f.dismissedAtCoordinate.y)&&h(rc(rc({},f),{},{dismissed:!1}));var{cssClasses:m,cssProperties:g}=tie({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:rc(rc({transition:sie({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=rc(rc({},y),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:v,ref:e.innerRef},e.children)}var lie=x.memo(oie),JI=()=>{var e;return(e=Le(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function nS(){return nS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nS.apply(null,arguments)}function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r2(Object(n),!0).forEach(function(r){cie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cie(e,t,n){return(t=uie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return typeof t=="symbol"?t:t+""}function die(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a2={curveBasisClosed:xJ,curveBasisOpen:wJ,curveBasis:bJ,curveBumpX:aJ,curveBumpY:sJ,curveLinearClosed:SJ,curveLinear:Lg,curveMonotoneX:jJ,curveMonotoneY:NJ,curveNatural:CJ,curveStep:_J,curveStepAfter:kJ,curveStepBefore:OJ},Tm=e=>ct(e.x)&&ct(e.y),s2=e=>e.base!=null&&Tm(e.base)&&Tm(e),ad=e=>e.x,sd=e=>e.y,fie=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(sf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=a2["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return a2[n]||Lg},o2={connectNulls:!1,type:"linear"},hie=e=>{var{type:t=o2.type,points:n=[],baseLine:r,layout:i,connectNulls:s=o2.connectNulls}=e,l=fie(t,i),c=s?n.filter(Tm):n;if(Array.isArray(r)){var f,h=n.map((w,S)=>i2(i2({},w),{},{base:r[S]}));i==="vertical"?f=lp().y(sd).x1(ad).x0(w=>w.base.x):f=lp().x(ad).y1(sd).y0(w=>w.base.y);var m=f.defined(s2).curve(l),g=s?h.filter(s2):h;return m(g)}var y;i==="vertical"&&Pe(r)?y=lp().y(sd).x1(ad).x0(r):Pe(r)?y=lp().x(ad).y1(sd).y0(r):y=CL().x(ad).y(sd);var v=y.defined(Tm).curve(l);return v(c)},Up=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=Wc();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||s,connectNulls:e.connectNulls},c=n&&n.length?hie(l):r;return x.createElement("path",nS({},Ki(e),R1(e),{className:bt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},pie=["x","y","top","left","width","height","className"];function rS(){return rS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rS.apply(null,arguments)}function l2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l2(Object(n),!0).forEach(function(r){gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gie(e,t,n){return(t=yie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yie(e){var t=vie(e,"string");return typeof t=="symbol"?t:t+""}function vie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bie(e,t){if(e==null)return{};var n,r,i=xie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wie=(e,t,n,r,i,s)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),Sie=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:l=0,className:c}=e,f=bie(e,pie),h=mie({x:t,y:n,top:r,left:i,width:s,height:l},f);return!Pe(t)||!Pe(n)||!Pe(s)||!Pe(l)||!Pe(r)||!Pe(i)?null:x.createElement("path",rS({},Or(h),{className:bt("recharts-cross",c),d:wie(t,n,s,l,r,i)}))};function jie(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function c2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function u2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c2(Object(n),!0).forEach(function(r){Nie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nie(e,t,n){return(t=Cie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e){var t=_ie(e,"string");return typeof t=="symbol"?t:t+""}function _ie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oie=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),kie=(e,t,n)=>e.map(r=>"".concat(Oie(r)," ").concat(t,"ms ").concat(n)).join(","),Aie=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Fd=(e,t)=>Object.keys(t).reduce((n,r)=>u2(u2({},n),{},{[r]:e(r,t[r])}),{});function d2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d2(Object(n),!0).forEach(function(r){Eie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eie(e,t,n){return(t=Tie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tie(e){var t=Pie(e,"string");return typeof t=="symbol"?t:t+""}function Pie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pm=(e,t,n)=>e+(t-e)*n,iS=e=>{var{from:t,to:n}=e;return t!==n},e$=(e,t,n)=>{var r=Fd((i,s)=>{if(iS(s)){var[l,c]=e(s.from,s.to,s.velocity);return vn(vn({},s),{},{from:l,velocity:c})}return s},t);return n<1?Fd((i,s)=>iS(s)&&r[i]!=null?vn(vn({},s),{},{velocity:Pm(s.velocity,r[i].velocity,n),from:Pm(s.from,r[i].from,n)}):s,t):e$(e,r,n-1)};function zie(e,t,n,r,i,s){var l,c=r.reduce((y,v)=>vn(vn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),f=()=>Fd((y,v)=>v.from,c),h=()=>!Object.values(c).filter(iS).length,m=null,g=y=>{l||(l=y);var v=y-l,w=v/n.dt;c=e$(n,c,w),i(vn(vn(vn({},e),t),f())),l=y,h()||(m=s.setTimeout(g))};return()=>(m=s.setTimeout(g),()=>{var y;(y=m)===null||y===void 0||y()})}function Mie(e,t,n,r,i,s,l){var c=null,f=i.reduce((g,y)=>{var v=e[y],w=t[y];return v==null||w==null?g:vn(vn({},g),{},{[y]:[v,w]})},{}),h,m=g=>{h||(h=g);var y=(g-h)/r,v=Fd((S,N)=>Pm(...N,n(y)),f);if(s(vn(vn(vn({},e),t),v)),y<1)c=l.setTimeout(m);else{var w=Fd((S,N)=>Pm(...N,n(1)),f);s(vn(vn(vn({},e),t),w))}};return()=>(c=l.setTimeout(m),()=>{var g;(g=c)===null||g===void 0||g()})}const Rie=(e,t,n,r,i,s)=>{var l=Aie(e,t);return n==null?()=>(i(vn(vn({},e),t)),()=>{}):n.isStepper===!0?zie(e,t,n,l,i,s):Mie(e,t,n,r,l,i,s)};var zm=1e-4,t$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],n$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),f2=(e,t)=>n=>{var r=t$(e,t);return n$(r,n)},Die=(e,t)=>n=>{var r=t$(e,t),i=[...r.map((s,l)=>s*l).slice(1),0];return n$(i,n)},Lie=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(s=>parseFloat(s));return[i[0],i[1],i[2],i[3]]},Iie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=Lie(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},$ie=(e,t,n,r)=>{var i=f2(e,n),s=f2(t,r),l=Die(e,n),c=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,g=m,y=0;y<8;++y){var v=i(g)-m,w=l(g);if(Math.abs(v-m)<zm||w<zm)return s(g);g=c(g-v/w)}return s(g)};return f.isStepper=!1,f},h2=function(){return $ie(...Iie(...arguments))},Uie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,s=(l,c,f)=>{var h=-(l-c)*n,m=f*r,g=f+(h-m)*i/1e3,y=f*i/1e3+l;return Math.abs(y-c)<zm&&Math.abs(g)<zm?[c,0]:[y,g]};return s.isStepper=!0,s.dt=i,s},Bie=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return h2(e);case"spring":return Uie();default:if(e.split("(")[0]==="cubic-bezier")return h2(e)}return typeof e=="function"?e:null};function qie(e){var t,n=()=>null,r=!1,i=null,s=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[f,...h]=c;if(typeof f=="number"){i=e.setTimeout(s.bind(null,h),f);return}s(f),i=e.setTimeout(s.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),s(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class Fie{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,s=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function Kie(){return qie(new Fie)}var Hie=x.createContext(Kie);function Gie(e,t){var n=x.useContext(Hie);return x.useMemo(()=>t??n(e),[e,t,n])}var Vie={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},p2={t:0},wx={t:1};function r$(e){var t=Er(e,Vie),{isActive:n,canBegin:r,duration:i,easing:s,begin:l,onAnimationEnd:c,onAnimationStart:f,children:h}=t,m=XI(),g=n==="auto"?!hf.isSsr&&!m:n,y=Gie(t.animationId,t.animationManager),[v,w]=x.useState(g?p2:wx),S=x.useRef(null);return x.useEffect(()=>{g||w(wx)},[g]),x.useEffect(()=>{if(!g||!r)return Yc;var N=Rie(p2,wx,Bie(s),i,w,y.getTimeoutController()),C=()=>{S.current=N()};return y.start([f,l,C,i,c]),()=>{y.stop(),S.current&&S.current(),c()}},[g,r,i,s,l,f,c,y]),h(v.t)}function i$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Dd(t)),r=x.useRef(e);return r.current!==e&&(n.current=Dd(t),r.current=e),n.current}var Zie=["radius"],Yie=["radius"],m2,g2,y2,v2,b2,x2,w2,S2,j2,N2;function C2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C2(Object(n),!0).forEach(function(r){Wie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wie(e,t,n){return(t=Qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qie(e){var t=Xie(e,"string");return typeof t=="symbol"?t:t+""}function Xie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mm.apply(null,arguments)}function O2(e,t){if(e==null)return{};var n,r,i=Jie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var k2=(e,t,n,r,i)=>{var s=Ss(n),l=Ss(r),c=Math.min(Math.abs(s)/2,Math.abs(l)/2),f=l>=0?1:-1,h=s>=0?1:-1,m=l>=0&&s>=0||l<0&&s<0?1:0,g;if(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var S,N=(S=i[v])!==null&&S!==void 0?S:0;y[v]=N>c?c:N}g=zn(m2||(m2=Pi(["M",",",""])),e,t+f*y[0]),y[0]>0&&(g+=zn(g2||(g2=Pi(["A ",",",",0,0,",",",",",""])),y[0],y[0],m,e+h*y[0],t)),g+=zn(y2||(y2=Pi(["L ",",",""])),e+n-h*y[1],t),y[1]>0&&(g+=zn(v2||(v2=Pi(["A ",",",",0,0,",`,
240
+ `,",",""])),y[1],y[1],m,e+n,t+f*y[1])),g+=zn(b2||(b2=Pi(["L ",",",""])),e+n,t+r-f*y[2]),y[2]>0&&(g+=zn(x2||(x2=Pi(["A ",",",",0,0,",`,
241
+ `,",",""])),y[2],y[2],m,e+n-h*y[2],t+r)),g+=zn(w2||(w2=Pi(["L ",",",""])),e+h*y[3],t+r),y[3]>0&&(g+=zn(S2||(S2=Pi(["A ",",",",0,0,",`,
242
+ `,",",""])),y[3],y[3],m,e,t+r-f*y[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var C=Math.min(c,i);g=zn(j2||(j2=Pi(["M ",",",`
243
+ A `,",",",0,0,",",",",",`
244
+ L `,",",`
245
+ A `,",",",0,0,",",",",",`
246
+ L `,",",`
247
+ A `,",",",0,0,",",",",",`
248
+ L `,",",`
249
+ A `,",",",0,0,",",",","," Z"])),e,t+f*C,C,C,m,e+h*C,t,e+n-h*C,t,C,C,m,e+n,t+f*C,e+n,t+r-f*C,C,C,m,e+n-h*C,t+r,e+h*C,t+r,C,C,m,e,t+r-f*C)}else g=zn(N2||(N2=Pi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return g},A2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eae=e=>{var t=Er(e,A2),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ae=n.current.getTotalLength();ae&&i(ae)}catch{}},[]);var{x:s,y:l,width:c,height:f,radius:h,className:m}=t,{animationEasing:g,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,N=x.useRef(c),C=x.useRef(f),A=x.useRef(s),k=x.useRef(l),_=x.useMemo(()=>({x:s,y:l,width:c,height:f,radius:h}),[s,l,c,f,h]),T=i$(_,"rectangle-");if(s!==+s||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var P=bt("recharts-rectangle",m);if(!S){var E=Or(t),{radius:z}=E,D=O2(E,Zie);return x.createElement("path",Mm({},D,{x:Ss(s),y:Ss(l),width:Ss(c),height:Ss(f),radius:typeof h=="number"?h:void 0,className:P,d:k2(s,l,c,f,h)}))}var K=N.current,U=C.current,I=A.current,H=k.current,ge="0px ".concat(r===-1?1:r,"px"),me="".concat(r,"px ").concat(r,"px"),G=kie(["strokeDasharray"],y,typeof g=="string"?g:A2.animationEasing);return x.createElement(r$,{animationId:T,key:T,canBegin:r>0,duration:y,easing:g,isActive:S,begin:v},ae=>{var pe=Di(K,c,ae),xe=Di(U,f,ae),B=Di(I,s,ae),R=Di(H,l,ae);n.current&&(N.current=pe,C.current=xe,A.current=B,k.current=R);var V;w?ae>0?V={transition:G,strokeDasharray:me}:V={strokeDasharray:ge}:V={strokeDasharray:me};var X=Or(t),{radius:q}=X,W=O2(X,Yie);return x.createElement("path",Mm({},W,{radius:typeof h=="number"?h:void 0,className:P,d:k2(B,R,pe,xe,h),ref:n,style:_2(_2({},V),t.style)}))})};function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rm=Math.PI/180,iae=e=>e*180/Math.PI,Rn=(e,t,n,r)=>({x:e+Math.cos(-Rm*r)*n,y:t+Math.sin(-Rm*r)*n}),aae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},sae=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},oae=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,l=sae({x:n,y:r},{x:i,y:s});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,f=Math.acos(c);return r>s&&(f=2*Math.PI-f),{radius:l,angle:iae(f),angleInRadian:f}},lae=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},cae=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return e+l*360},uae=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:s}=oae({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:f,endAngle:h}=lae(t),m=s,g;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;g=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;g=m>=h&&m<=f}return g?T2(T2({},t),{},{radius:i,angle:cae(m,t)}):null};function a$(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,l=Rn(t,n,r,i),c=Rn(t,n,r,s);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var P2,z2,M2,R2,D2,L2,I2;function aS(){return aS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aS.apply(null,arguments)}function ko(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dae=(e,t)=>{var n=yi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},gp=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:s,isExternal:l,cornerRadius:c,cornerIsExternal:f}=e,h=c*(l?1:-1)+r,m=Math.asin(c/h)/Rm,g=f?i:i+s*m,y=Rn(t,n,h,g),v=Rn(t,n,r,g),w=f?i-s*m:i,S=Rn(t,n,h*Math.cos(m*Rm),w);return{center:y,circleTangency:v,lineTangency:S,theta:m}},s$=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:l}=e,c=dae(s,l),f=s+c,h=Rn(t,n,i,s),m=Rn(t,n,i,f),g=zn(P2||(P2=ko(["M ",",",`
250
+ A `,",",`,0,
251
+ `,",",`,
252
+ `,",",`
253
+ `])),h.x,h.y,i,i,+(Math.abs(c)>180),+(s>f),m.x,m.y);if(r>0){var y=Rn(t,n,r,s),v=Rn(t,n,r,f);g+=zn(z2||(z2=ko(["L ",",",`
254
+ A `,",",`,0,
255
+ `,",",`,
256
+ `,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(s<=f),y.x,y.y)}else g+=zn(M2||(M2=ko(["L ",","," Z"])),t,n);return g},fae=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}=e,m=yi(h-f),{circleTangency:g,lineTangency:y,theta:v}=gp({cx:t,cy:n,radius:i,angle:f,sign:m,cornerRadius:s,cornerIsExternal:c}),{circleTangency:w,lineTangency:S,theta:N}=gp({cx:t,cy:n,radius:i,angle:h,sign:-m,cornerRadius:s,cornerIsExternal:c}),C=c?Math.abs(f-h):Math.abs(f-h)-v-N;if(C<0)return l?zn(R2||(R2=ko(["M ",",",`
257
+ a`,",",",0,0,1,",`,0
258
+ a`,",",",0,0,1,",`,0
259
+ `])),y.x,y.y,s,s,s*2,s,s,-s*2):s$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var A=zn(D2||(D2=ko(["M ",",",`
260
+ A`,",",",0,0,",",",",",`
261
+ A`,",",",0,",",",",",",",`
262
+ A`,",",",0,0,",",",",",`
263
+ `])),y.x,y.y,s,s,+(m<0),g.x,g.y,i,i,+(C>180),+(m<0),w.x,w.y,s,s,+(m<0),S.x,S.y);if(r>0){var{circleTangency:k,lineTangency:_,theta:T}=gp({cx:t,cy:n,radius:r,angle:f,sign:m,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:P,lineTangency:E,theta:z}=gp({cx:t,cy:n,radius:r,angle:h,sign:-m,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),D=c?Math.abs(f-h):Math.abs(f-h)-T-z;if(D<0&&s===0)return"".concat(A,"L").concat(t,",").concat(n,"Z");A+=zn(L2||(L2=ko(["L",",",`
264
+ A`,",",",0,0,",",",",",`
265
+ A`,",",",0,",",",",",",",`
266
+ A`,",",",0,0,",",",",","Z"])),E.x,E.y,s,s,+(m<0),P.x,P.y,r,r,+(D>180),+(m>0),k.x,k.y,s,s,+(m<0),_.x,_.y)}else A+=zn(I2||(I2=ko(["L",",","Z"])),t,n);return A},hae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pae=e=>{var t=Er(e,hae),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m,className:g}=t;if(s<i||h===m)return null;var y=bt("recharts-sector",g),v=s-i,w=zs(l,v,0,!0),S;return w>0&&Math.abs(h-m)<360?S=fae({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:m}):S=s$({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:h,endAngle:m}),x.createElement("path",aS({},Or(t),{className:y,d:S}))};function mae(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(BL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:l,angle:c}=t,f=Rn(r,i,s,c),h=Rn(r,i,l,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return a$(t)}}var Sx={},jx={},Nx={},$2;function gae(){return $2||($2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tI();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Nx)),Nx}var U2;function yae(){return U2||(U2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gae();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(jx)),jx}var B2;function vae(){return B2||(B2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nI(),n=yae();function r(i,s,l){l&&typeof l!="number"&&t.isIterateeCall(i,s,l)&&(s=l=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),l=l===void 0?i<s?1:-1:n.toFinite(l);const c=Math.max(Math.ceil((s-i)/(l||1)),0),f=new Array(c);for(let h=0;h<c;h++)f[h]=i,i+=l;return f}e.range=r})(Sx)),Sx}var Cx,q2;function bae(){return q2||(q2=1,Cx=vae().range),Cx}var xae=bae();const o$=Rs(xae);var ji=e=>e.chartData,Y1=re([ji],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),iy=(e,t,n,r)=>r?Y1(e):ji(e),wae=(e,t,n)=>n?Y1(e):ji(e),Sae=re([iy],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});re([Y1],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var jae=re([ji],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Bi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ct(t)&&ct(n))return!0}return!1}function F2(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function l$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(ct(n))i=n;else if(typeof n=="function")return;if(ct(r))s=r;else if(typeof r=="function")return;var l=[i,s];if(Bi(l))return l}}function Nae(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Bi(r))return F2(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Pe(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&TT.test(i)){var f=TT.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t?.[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(Pe(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t?.[1]))}catch{}else if(typeof s=="string"&&PT.test(s)){var m=PT.exec(s);if(m==null||m[1]==null||t==null)c=void 0;else{var g=+m[1];c=t[1]+g}}else c=t?.[1];var y=[l,c];if(Bi(y))return t==null?y:F2(y,t,n)}}}var Qc=1e9,Cae={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Q1,It=!0,Jr="[DecimalError] ",Lo=Jr+"Invalid argument: ",W1=Jr+"Exponent out of range: ",Xc=Math.floor,wo=Math.pow,_ae=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Nr,jn=1e7,zt=7,c$=9007199254740991,Dm=Xc(c$/zt),_e={};_e.absoluteValue=_e.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_e.comparedTo=_e.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};_e.decimalPlaces=_e.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*zt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};_e.dividedBy=_e.div=function(e){return Ca(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,n=t.constructor;return Ot(Ca(t,new n(e),0,1),n.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return dn(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Nr))throw Error(Jr+"NaN");if(n.s<1)throw Error(Jr+(n.s?"NaN":"-Infinity"));return n.eq(Nr)?new r(0):(It=!1,t=Ca(Kd(n,s),Kd(e,s),s),It=!0,Ot(t,i))};_e.minus=_e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?f$(t,e):u$(t,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Jr+"NaN");return n.s?(It=!1,t=Ca(n,e,0,1).times(e),It=!0,n.minus(t)):Ot(new r(n),i)};_e.naturalExponential=_e.exp=function(){return d$(this)};_e.naturalLogarithm=_e.ln=function(){return Kd(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?u$(t,e):f$(t,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Lo+e);if(t=dn(i)+1,r=i.d.length-1,n=r*zt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};_e.squareRoot=_e.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(Jr+"NaN")}for(e=dn(c),It=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ui(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Ca(c,s,l+2)).times(.5),Ui(s.d).slice(0,l)===(t=Ui(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Ot(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return It=!0,Ot(r,n)};_e.times=_e.mul=function(e){var t,n,r,i,s,l,c,f,h,m=this,g=m.constructor,y=m.d,v=(e=new g(e)).d;if(!m.s||!e.s)return new g(0);for(e.s*=m.s,n=m.e+e.e,f=y.length,h=v.length,f<h&&(s=y,y=v,v=s,l=f,f=h,h=l),s=[],l=f+h,r=l;r--;)s.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)c=s[i]+v[r]*y[i-r-1]+t,s[i--]=c%jn|0,t=c/jn|0;s[i]=(s[i]+t)%jn|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,It?Ot(e,g.precision):e};_e.toDecimalPlaces=_e.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Zi(e,0,Qc),t===void 0?t=r.rounding:Zi(t,0,8),Ot(n,e+dn(n)+1,t))};_e.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Qo(r,!0):(Zi(e,0,Qc),t===void 0?t=i.rounding:Zi(t,0,8),r=Ot(new i(r),e+1,t),n=Qo(r,!0,e+1)),n};_e.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?Qo(i):(Zi(e,0,Qc),t===void 0?t=s.rounding:Zi(t,0,8),r=Ot(new s(i),e+dn(i)+1,t),n=Qo(r.abs(),!1,e+dn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return Ot(new t(e),dn(e)+1,t.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,h=12,m=+(e=new f(e));if(!e.s)return new f(Nr);if(c=new f(c),!c.s){if(e.s<1)throw Error(Jr+"Infinity");return c}if(c.eq(Nr))return c;if(r=f.precision,e.eq(Nr))return Ot(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=m<0?-m:m)<=c$){for(i=new f(Nr),t=Math.ceil(r/zt+4),It=!1;n%2&&(i=i.times(c),H2(i.d,t)),n=Xc(n/2),n!==0;)c=c.times(c),H2(c.d,t);return It=!0,e.s<0?new f(Nr).div(i):Ot(i,r)}}else if(s<0)throw Error(Jr+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,It=!1,i=e.times(Kd(c,r+h)),It=!0,i=d$(i),i.s=s,i};_e.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=dn(i),r=Qo(i,n<=s.toExpNeg||n>=s.toExpPos)):(Zi(e,1,Qc),t===void 0?t=s.rounding:Zi(t,0,8),i=Ot(new s(i),e,t),n=dn(i),r=Qo(i,e<=n||n<=s.toExpNeg,e)),r};_e.toSignificantDigits=_e.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Zi(e,1,Qc),t===void 0?t=r.rounding:Zi(t,0,8)),Ot(new r(n),e,t)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=dn(e),n=e.constructor;return Qo(e,t<=n.toExpNeg||t>=n.toExpPos)};function u$(e,t){var n,r,i,s,l,c,f,h,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),It?Ot(t,g):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=h.length):(r=h,i=l,c=f.length),l=Math.ceil(g/zt),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=h.length,c-s<0&&(s=c,r=h,h=f,f=r),n=0;s;)n=(f[--s]=f[s]+h[s]+n)/jn|0,f[s]%=jn;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,It?Ot(t,g):t}function Zi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Lo+e)}function Ui(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;t<i;t++)r=e[t]+"",n=zt-r.length,n&&(s+=ys(n)),s+=r;l=e[t],r=l+"",n=zt-r.length,n&&(s+=ys(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return s+l}var Ca=(function(){function e(r,i){var s,l=0,c=r.length;for(r=r.slice();c--;)s=r[c]*i+l,r[c]=s%jn|0,l=s/jn|0;return l&&r.unshift(l),r}function t(r,i,s,l){var c,f;if(s!=l)f=s>l?1:-1;else for(c=f=0;c<s;c++)if(r[c]!=i[c]){f=r[c]>i[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]<i[s]?1:0,r[s]=l*jn+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,l){var c,f,h,m,g,y,v,w,S,N,C,A,k,_,T,P,E,z,D=r.constructor,K=r.s==i.s?1:-1,U=r.d,I=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Jr+"Division by zero");for(f=r.e-i.e,E=I.length,T=U.length,v=new D(K),w=v.d=[],h=0;I[h]==(U[h]||0);)++h;if(I[h]>(U[h]||0)&&--f,s==null?A=s=D.precision:l?A=s+(dn(r)-dn(i))+1:A=s,A<0)return new D(0);if(A=A/zt+2|0,h=0,E==1)for(m=0,I=I[0],A++;(h<T||m)&&A--;h++)k=m*jn+(U[h]||0),w[h]=k/I|0,m=k%I|0;else{for(m=jn/(I[0]+1)|0,m>1&&(I=e(I,m),U=e(U,m),E=I.length,T=U.length),_=E,S=U.slice(0,E),N=S.length;N<E;)S[N++]=0;z=I.slice(),z.unshift(0),P=I[0],I[1]>=jn/2&&++P;do m=0,c=t(I,S,E,N),c<0?(C=S[0],E!=N&&(C=C*jn+(S[1]||0)),m=C/P|0,m>1?(m>=jn&&(m=jn-1),g=e(I,m),y=g.length,N=S.length,c=t(g,S,y,N),c==1&&(m--,n(g,E<y?z:I,y))):(m==0&&(c=m=1),g=I.slice()),y=g.length,y<N&&g.unshift(0),n(S,g,N),c==-1&&(N=S.length,c=t(I,S,E,N),c<1&&(m++,n(S,E<N?z:I,N))),N=S.length):c===0&&(m++,S=[0]),w[h++]=m,c&&S[0]?S[N++]=U[_]||0:(S=[U[_]],N=1);while((_++<T||S[0]!==void 0)&&A--)}return w[0]||w.shift(),v.e=f,Ot(v,l?s+dn(v)+1:s)}})();function d$(e,t){var n,r,i,s,l,c,f=0,h=0,m=e.constructor,g=m.precision;if(dn(e)>16)throw Error(W1+dn(e));if(!e.s)return new m(Nr);for(It=!1,c=g,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(wo(2,h))/Math.LN10*2+5|0,c+=r,n=i=s=new m(Nr),m.precision=c;;){if(i=Ot(i.times(e),c),n=n.times(++f),l=s.plus(Ca(i,n,c)),Ui(l.d).slice(0,c)===Ui(s.d).slice(0,c)){for(;h--;)s=Ot(s.times(s),c);return m.precision=g,t==null?(It=!0,Ot(s,g)):s}s=l}}function dn(e){for(var t=e.e*zt,n=e.d[0];n>=10;n/=10)t++;return t}function _x(e,t,n){if(t>e.LN10.sd())throw It=!0,n&&(e.precision=n),Error(Jr+"LN10 precision limit exceeded");return Ot(new e(e.LN10),t)}function ys(e){for(var t="";e--;)t+="0";return t}function Kd(e,t){var n,r,i,s,l,c,f,h,m,g=1,y=10,v=e,w=v.d,S=v.constructor,N=S.precision;if(v.s<1)throw Error(Jr+(v.s?"NaN":"-Infinity"));if(v.eq(Nr))return new S(0);if(t==null?(It=!1,h=N):h=t,v.eq(10))return t==null&&(It=!0),_x(S,h);if(h+=y,S.precision=h,n=Ui(w),r=n.charAt(0),s=dn(v),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Ui(v.d),r=n.charAt(0),g++;s=dn(v),r>1?(v=new S("0."+n),s++):v=new S(r+"."+n.slice(1))}else return f=_x(S,h+2,N).times(s+""),v=Kd(new S(r+"."+n.slice(1)),h-y).plus(f),S.precision=N,t==null?(It=!0,Ot(v,N)):v;for(c=l=v=Ca(v.minus(Nr),v.plus(Nr),h),m=Ot(v.times(v),h),i=3;;){if(l=Ot(l.times(m),h),f=c.plus(Ca(l,new S(i),h)),Ui(f.d).slice(0,h)===Ui(c.d).slice(0,h))return c=c.times(2),s!==0&&(c=c.plus(_x(S,h+2,N).times(s+""))),c=Ca(c,new S(g),h),S.precision=N,t==null?(It=!0,Ot(c,N)):c;c=f,i+=2}}function K2(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Xc(n/zt),e.d=[],r=(n+1)%zt,n<0&&(r+=zt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=zt;r<i;)e.d.push(+t.slice(r,r+=zt));t=t.slice(r),r=zt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),It&&(e.e>Dm||e.e<-Dm))throw Error(W1+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ot(e,t,n){var r,i,s,l,c,f,h,m,g=e.d;for(l=1,s=g[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=zt,i=t,h=g[m=0];else{if(m=Math.ceil((r+1)/zt),s=g.length,m>=s)return e;for(h=s=g[m],l=1;s>=10;s/=10)l++;r%=zt,i=r-zt+l}if(n!==void 0&&(s=wo(10,l-i-1),c=h/s%10|0,f=t<0||g[m+1]!==void 0||h%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?h/wo(10,l-i):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return f?(s=dn(e),g.length=1,t=t-s-1,g[0]=wo(10,(zt-t%zt)%zt),e.e=Xc(-t/zt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=m,s=1,m--):(g.length=m+1,s=wo(10,zt-r),g[m]=i>0?(h/wo(10,l-i)%wo(10,i)|0)*s:0),f)for(;;)if(m==0){(g[0]+=s)==jn&&(g[0]=1,++e.e);break}else{if(g[m]+=s,g[m]!=jn)break;g[m--]=0,s=1}for(r=g.length;g[--r]===0;)g.pop();if(It&&(e.e>Dm||e.e<-Dm))throw Error(W1+dn(e));return e}function f$(e,t){var n,r,i,s,l,c,f,h,m,g,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),It?Ot(t,v):t;if(f=e.d,g=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(m=l<0,m?(n=f,l=-l,c=g.length):(n=g,r=h,c=f.length),i=Math.max(Math.ceil(v/zt),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=g.length,m=i<c,m&&(c=i),i=0;i<c;i++)if(f[i]!=g[i]){m=f[i]<g[i];break}l=0}for(m&&(n=f,f=g,g=n,t.s=-t.s),c=f.length,i=g.length-c;i>0;--i)f[c++]=0;for(i=g.length;i>l;){if(f[--i]<g[i]){for(s=i;s&&f[--s]===0;)f[s]=jn-1;--f[s],f[i]+=jn}f[i]-=g[i]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,It?Ot(t,v):t):new y(0)}function Qo(e,t,n){var r,i=dn(e),s=Ui(e.d),l=s.length;return t?(n&&(r=n-l)>0?s=s.charAt(0)+"."+s.slice(1)+ys(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+ys(-i-1)+s,n&&(r=n-l)>0&&(s+=ys(r))):i>=l?(s+=ys(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+ys(r))):((r=i+1)<l&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(s+="."),s+=ys(r))),e.s<0?"-"+s:s}function H2(e,t){if(e.length>t)return e.length=t,!0}function h$(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Lo+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return K2(l,s.toString())}else if(typeof s!="string")throw Error(Lo+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,_ae.test(s))K2(l,s);else throw Error(Lo+s)}if(i.prototype=_e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=h$,i.config=i.set=Oae,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Oae(e){if(!e||typeof e!="object")throw Error(Jr+"Object expected");var t,n,r,i=["precision",1,Qc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Xc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Lo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Lo+n+": "+r);return this}var Q1=h$(Cae);Nr=new Q1(1);const nt=Q1;function p$(e){var t;return e===0?t=1:t=Math.floor(new nt(e).abs().log(10).toNumber())+1,t}function m$(e,t,n){for(var r=new nt(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var g$=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},X1=(e,t,n)=>{if(e.lte(0))return new nt(0);var r=p$(e.toNumber()),i=new nt(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new nt(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?new nt(f.toNumber()):new nt(Math.ceil(f.toNumber()))},y$=(e,t,n)=>{var r;if(e.lte(0))return new nt(0);var i=[1,2,2.5,5],s=e.toNumber(),l=Math.floor(new nt(s).abs().log(10).toNumber()),c=new nt(10).pow(l),f=e.div(c).toNumber(),h=i.findIndex(v=>v>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=n,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,c=c.mul(new nt(10).pow(m))}var g=(r=i[h])!==null&&r!==void 0?r:1,y=new nt(g).mul(c);return t?y:new nt(Math.ceil(y.toNumber()))},kae=(e,t,n)=>{var r=new nt(1),i=new nt(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new nt(10).pow(p$(e)-1),i=new nt(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new nt(Math.floor(e)))}else e===0?i=new nt(Math.floor((t-1)/2)):n||(i=new nt(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(i.add(new nt(f-l).mul(r)).toNumber());return c},v$=function(t,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:X1;if(!Number.isFinite((n-t)/(r-1)))return{step:new nt(0),tickMin:new nt(0),tickMax:new nt(0)};var c=l(new nt(n).sub(t).div(r-1),i,s),f;t<=0&&n>=0?f=new nt(0):(f=new nt(t).add(n).div(2),f=f.sub(new nt(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),m=Math.ceil(new nt(n).sub(f).div(c).toNumber()),g=h+m+1;return g>r?v$(t,n,r,i,s+1,l):(g<r&&(m=n>0?m+(r-g):m,h=n>0?h:h+(r-g)),{step:c,tickMin:f.sub(new nt(h).mul(c)),tickMax:f.add(new nt(m).mul(c))})},G2=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[f,h]=g$([n,r]);if(f===-1/0||h===1/0){var m=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?m.reverse():m}if(f===h)return kae(f,i,s);var g=l==="snap125"?y$:X1,{step:y,tickMin:v,tickMax:w}=v$(f,h,c,s,0,g),S=m$(v,w.add(new nt(.1).mul(y)),y);return n>r?S.reverse():S},V2=function(t,n){var[r,i]=t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,f]=g$([r,i]);if(c===-1/0||f===1/0)return[r,i];if(c===f)return[c];var h=l==="snap125"?y$:X1,m=Math.max(n,2),g=h(new nt(f).sub(c).div(m-1),s,0),y=[...m$(new nt(c),new nt(f),g),f];return s===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},Aae=e=>e.rootProps.barCategoryGap,ay=e=>e.rootProps.stackOffset,b$=e=>e.rootProps.reverseStackOrder,J1=e=>e.options.chartName,ej=e=>e.rootProps.syncId,x$=e=>e.rootProps.syncMethod,tj=e=>e.options.eventEmitter,Eae=e=>e.rootProps.baseValue,dr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},po={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},zi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},sy=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function oy(e,t,n){if(n!=="auto")return n;if(e!=null)return Wi(e,t)?"category":"number"}function Z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z2(Object(n),!0).forEach(function(r){Tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tae(e,t,n){return(t=Pae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pae(e){var t=zae(e,"string");return typeof t=="symbol"?t:t+""}function zae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y2={allowDataOverflow:po.allowDataOverflow,allowDecimals:po.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:po.angleAxisId,includeHidden:!1,name:void 0,reversed:po.reversed,scale:po.scale,tick:po.tick,tickCount:void 0,ticks:void 0,type:po.type,unit:void 0,niceTicks:"auto"},W2={allowDataOverflow:zi.allowDataOverflow,allowDecimals:zi.allowDecimals,allowDuplicatedCategory:zi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:zi.radiusAxisId,includeHidden:zi.includeHidden,name:void 0,reversed:zi.reversed,scale:zi.scale,tick:zi.tick,tickCount:zi.tickCount,ticks:void 0,type:zi.type,unit:void 0,niceTicks:"auto"},Mae=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},nj=re([Mae,FI],(e,t)=>{var n;if(e!=null)return e;var r=(n=oy(t,"angleAxis",Y2.type))!==null&&n!==void 0?n:"category";return Lm(Lm({},Y2),{},{type:r})}),Rae=(e,t)=>e.polarAxis.radiusAxis[t],rj=re([Rae,FI],(e,t)=>{var n;if(e!=null)return e;var r=(n=oy(t,"radiusAxis",W2.type))!==null&&n!==void 0?n:"category";return Lm(Lm({},W2),{},{type:r})}),ly=e=>e.polarOptions,ij=re([Ta,Pa,In],aae),w$=re([ly,ij],(e,t)=>{if(e!=null)return zs(e.innerRadius,t,0)}),S$=re([ly,ij],(e,t)=>{if(e!=null)return zs(e.outerRadius,t,t*.8)}),Dae=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},j$=re([ly],Dae);re([nj,j$],sy);var N$=re([ij,w$,S$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});re([rj,N$],sy);var C$=re([Bt,ly,w$,S$,Ta,Pa],(e,t,n,r,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:f,endAngle:h}=t;return{cx:zs(l,i,i/2),cy:zs(c,s,s/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),Cn=(e,t)=>t,cy=(e,t,n)=>n;function aj(e){return e?.id}function _$(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=n,l=new Map;return e.forEach(c=>{var f,h=(f=c.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var m=aj(c);h.forEach((g,y)=>{var v=s==null||i?y:String(Nn(g,s,null)),w=Nn(g,c.dataKey,0),S;l.has(v)?S=l.get(v):S={},Object.assign(S,{[m]:w}),l.set(v,S)})}}),Array.from(l.values())}function sj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var uy=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function dy(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Lae(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var _n=e=>{var t=Bt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Jc=e=>e.tooltip.settings.axisId;function oj(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(s){function l(){return s.apply(this,arguments)}return l.toString=function(){return s.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(s){var l=i[0],c=i[1];return l<=c?s>=l&&s<=c:s>=c&&s<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?s=>t.call(e,s):void 0,map:(s,l)=>{var c=e(s);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var Iae=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Bi(t)){for(var n,r,i=0;i<t.length;i++){var s=t[i];ct(s)&&((n===void 0||s<n)&&(n=s),(r===void 0||s>r)&&(r=s))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function ks(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $ae(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function lj(e){let t,n,r;e.length!==2?(t=ks,n=(c,f)=>ks(e(c),f),r=(c,f)=>e(c)-f):(t=e===ks||e===$ae?e:Uae,n=e,r=e);function i(c,f,h=0,m=c.length){if(h<m){if(t(f,f)!==0)return m;do{const g=h+m>>>1;n(c[g],f)<0?h=g+1:m=g}while(h<m)}return h}function s(c,f,h=0,m=c.length){if(h<m){if(t(f,f)!==0)return m;do{const g=h+m>>>1;n(c[g],f)<=0?h=g+1:m=g}while(h<m)}return h}function l(c,f,h=0,m=c.length){const g=i(c,f,h,m-1);return g>h&&r(c[g-1],f)>-r(c[g],f)?g-1:g}return{left:i,center:l,right:s}}function Uae(){return 0}function O$(e){return e===null?NaN:+e}function*Bae(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const qae=lj(ks),pf=qae.right;lj(O$).center;class Q2 extends Map{constructor(t,n=Hae){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(X2(this,t))}has(t){return super.has(X2(this,t))}set(t,n){return super.set(Fae(this,t),n)}delete(t){return super.delete(Kae(this,t))}}function X2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Fae({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Kae({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Hae(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Gae(e=ks){if(e===ks)return k$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function k$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Vae=Math.sqrt(50),Zae=Math.sqrt(10),Yae=Math.sqrt(2);function Im(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=Vae?10:s>=Zae?5:s>=Yae?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/l,c=Math.round(e*h),f=Math.round(t*h),c/h<e&&++c,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,c=Math.round(e/h),f=Math.round(t/h),c*h<e&&++c,f*h>t&&--f),f<c&&.5<=n&&n<2?Im(e,t,n*2):[c,f,h]}function sS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,l]=r?Im(t,e,n):Im(e,t,n);if(!(s>=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let h=0;h<c;++h)f[h]=(s-h)/-l;else for(let h=0;h<c;++h)f[h]=(s-h)*l;else if(l<0)for(let h=0;h<c;++h)f[h]=(i+h)/-l;else for(let h=0;h<c;++h)f[h]=(i+h)*l;return f}function oS(e,t,n){return t=+t,e=+e,n=+n,Im(e,t,n)[2]}function lS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?oS(t,e,n):oS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function J2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function eP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function A$(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?k$:Gae(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,m=Math.log(f),g=.5*Math.exp(2*m/3),y=.5*Math.sqrt(m*g*(f-g)/f)*(h-f/2<0?-1:1),v=Math.max(n,Math.floor(t-h*g/f+y)),w=Math.min(r,Math.floor(t+(f-h)*g/f+y));A$(e,t,v,w,i)}const s=e[t];let l=n,c=r;for(od(e,n,t),i(e[r],s)>0&&od(e,n,r);l<c;){for(od(e,l,c),++l,--c;i(e[l],s)<0;)++l;for(;i(e[c],s)>0;)--c}i(e[n],s)===0?od(e,n,c):(++c,od(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function od(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wae(e,t,n){if(e=Float64Array.from(Bae(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return eP(e);if(t>=1)return J2(e);var r,i=(r-1)*t,s=Math.floor(i),l=J2(A$(e,s).subarray(0,s+1)),c=eP(e.subarray(s+1));return l+(c-l)*(i-s)}}function Qae(e,t,n=O$){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function Xae(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function ii(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function za(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 cS=Symbol("implicit");function cj(){var e=new Q2,t=[],n=[],r=cS;function i(s){let l=e.get(s);if(l===void 0){if(r!==cS)return r;e.set(s,l=t.push(s)-1)}return n[l%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Q2;for(const l of s)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return cj(t,n).unknown(r)},ii.apply(i,arguments),i}function uj(){var e=cj().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,l,c=!1,f=0,h=0,m=.5;delete e.unknown;function g(){var y=t().length,v=i<r,w=v?i:r,S=v?r:i;s=(S-w)/Math.max(1,y-f+h*2),c&&(s=Math.floor(s)),w+=(S-w-s*(y-f))*m,l=s*(1-f),c&&(w=Math.round(w),l=Math.round(l));var N=Xae(y).map(function(C){return w+s*C});return n(v?N.reverse():N)}return e.domain=function(y){return arguments.length?(t(y),g()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,g()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,c=!0,g()},e.bandwidth=function(){return l},e.step=function(){return s},e.round=function(y){return arguments.length?(c=!!y,g()):c},e.padding=function(y){return arguments.length?(f=Math.min(1,h=+y),g()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),g()):f},e.paddingOuter=function(y){return arguments.length?(h=+y,g()):h},e.align=function(y){return arguments.length?(m=Math.max(0,Math.min(1,y)),g()):m},e.copy=function(){return uj(t(),[r,i]).round(c).paddingInner(f).paddingOuter(h).align(m)},ii.apply(g(),arguments)}function E$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return E$(t())},e}function Jae(){return E$(uj.apply(null,arguments).paddingInner(1))}function dj(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function T$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mf(){}var Hd=.7,$m=1/Hd,Nc="\\s*([+-]?\\d+)\\s*",Gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ese=/^#([0-9a-f]{3,8})$/,tse=new RegExp(`^rgb\\(${Nc},${Nc},${Nc}\\)$`),nse=new RegExp(`^rgb\\(${qi},${qi},${qi}\\)$`),rse=new RegExp(`^rgba\\(${Nc},${Nc},${Nc},${Gd}\\)$`),ise=new RegExp(`^rgba\\(${qi},${qi},${qi},${Gd}\\)$`),ase=new RegExp(`^hsl\\(${Gd},${qi},${qi}\\)$`),sse=new RegExp(`^hsla\\(${Gd},${qi},${qi},${Gd}\\)$`),tP={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};dj(mf,Vd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nP,formatHex:nP,formatHex8:ose,formatHsl:lse,formatRgb:rP,toString:rP});function nP(){return this.rgb().formatHex()}function ose(){return this.rgb().formatHex8()}function lse(){return P$(this).formatHsl()}function rP(){return this.rgb().formatRgb()}function Vd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ese.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?iP(t):n===3?new fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yp(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=tse.exec(e))?new fr(t[1],t[2],t[3],1):(t=nse.exec(e))?new fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rse.exec(e))?yp(t[1],t[2],t[3],t[4]):(t=ise.exec(e))?yp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ase.exec(e))?oP(t[1],t[2]/100,t[3]/100,1):(t=sse.exec(e))?oP(t[1],t[2]/100,t[3]/100,t[4]):tP.hasOwnProperty(e)?iP(tP[e]):e==="transparent"?new fr(NaN,NaN,NaN,0):null}function iP(e){return new fr(e>>16&255,e>>8&255,e&255,1)}function yp(e,t,n,r){return r<=0&&(e=t=n=NaN),new fr(e,t,n,r)}function cse(e){return e instanceof mf||(e=Vd(e)),e?(e=e.rgb(),new fr(e.r,e.g,e.b,e.opacity)):new fr}function uS(e,t,n,r){return arguments.length===1?cse(e):new fr(e,t,n,r??1)}function fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dj(fr,uS,T$(mf,{brighter(e){return e=e==null?$m:Math.pow($m,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hd:Math.pow(Hd,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fr(Io(this.r),Io(this.g),Io(this.b),Um(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:aP,formatHex:aP,formatHex8:use,formatRgb:sP,toString:sP}));function aP(){return`#${Ao(this.r)}${Ao(this.g)}${Ao(this.b)}`}function use(){return`#${Ao(this.r)}${Ao(this.g)}${Ao(this.b)}${Ao((isNaN(this.opacity)?1:this.opacity)*255)}`}function sP(){const e=Um(this.opacity);return`${e===1?"rgb(":"rgba("}${Io(this.r)}, ${Io(this.g)}, ${Io(this.b)}${e===1?")":`, ${e})`}`}function Um(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Io(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ao(e){return e=Io(e),(e<16?"0":"")+e.toString(16)}function oP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gi(e,t,n,r)}function P$(e){if(e instanceof gi)return new gi(e.h,e.s,e.l,e.opacity);if(e instanceof mf||(e=Vd(e)),!e)return new gi;if(e instanceof gi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n<r)*6:n===s?l=(r-t)/c+2:l=(t-n)/c+4,c/=f<.5?s+i:2-s-i,l*=60):c=f>0&&f<1?0:l,new gi(l,c,f,e.opacity)}function dse(e,t,n,r){return arguments.length===1?P$(e):new gi(e,t,n,r??1)}function gi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dj(gi,dse,T$(mf,{brighter(e){return e=e==null?$m:Math.pow($m,e),new gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hd:Math.pow(Hd,e),new gi(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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fr(Ox(e>=240?e-240:e+120,i,r),Ox(e,i,r),Ox(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new gi(lP(this.h),vp(this.s),vp(this.l),Um(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=Um(this.opacity);return`${e===1?"hsl(":"hsla("}${lP(this.h)}, ${vp(this.s)*100}%, ${vp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lP(e){return e=(e||0)%360,e<0?e+360:e}function vp(e){return Math.max(0,Math.min(1,e||0))}function Ox(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const fj=e=>()=>e;function fse(e,t){return function(n){return e+n*t}}function hse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function pse(e){return(e=+e)==1?z$:function(t,n){return n-t?hse(t,n,e):fj(isNaN(t)?n:t)}}function z$(e,t){var n=t-e;return n?fse(e,n):fj(isNaN(e)?t:e)}const cP=(function e(t){var n=pse(t);function r(i,s){var l=n((i=uS(i)).r,(s=uS(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),h=z$(i.opacity,s.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=f(m),i.opacity=h(m),i+""}}return r.gamma=e,r})(1);function mse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function gse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yse(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),l;for(l=0;l<r;++l)i[l]=eu(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(c){for(l=0;l<r;++l)s[l]=i[l](c);return s}}function vse(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bse(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=eu(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var dS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kx=new RegExp(dS.source,"g");function xse(e){return function(){return e}}function wse(e){return function(t){return e(t)+""}}function Sse(e,t){var n=dS.lastIndex=kx.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(r=dS.exec(e))&&(i=kx.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:Bm(r,i)})),n=kx.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?wse(f[0].x):xse(t):(t=f.length,function(h){for(var m=0,g;m<t;++m)c[(g=f[m]).i]=g.x(h);return c.join("")})}function eu(e,t){var n=typeof t,r;return t==null||n==="boolean"?fj(t):(n==="number"?Bm:n==="string"?(r=Vd(t))?(t=r,cP):Sse:t instanceof Vd?cP:t instanceof Date?vse:gse(t)?mse:Array.isArray(t)?yse:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bse:Bm)(e,t)}function hj(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jse(e,t){t===void 0&&(t=e,e=eu);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(l){var c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return s[c](l-c)}}function Nse(e){return function(){return e}}function qm(e){return+e}var uP=[0,1];function Qn(e){return e}function fS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Nse(isNaN(t)?NaN:.5)}function Cse(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function _se(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i<r?(r=fS(i,r),s=n(l,s)):(r=fS(r,i),s=n(s,l)),function(c){return s(r(c))}}function Ose(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=fS(e[l],e[l+1]),s[l]=n(t[l],t[l+1]);return function(c){var f=pf(e,c,1,r)-1;return s[f](i[f](c))}}function gf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function fy(){var e=uP,t=uP,n=eu,r,i,s,l=Qn,c,f,h;function m(){var y=Math.min(e.length,t.length);return l!==Qn&&(l=Cse(e[0],e[y-1])),c=y>2?Ose:_se,f=h=null,g}function g(y){return y==null||isNaN(y=+y)?s:(f||(f=c(e.map(r),t,n)))(r(l(y)))}return g.invert=function(y){return l(i((h||(h=c(t,e.map(r),Bm)))(y)))},g.domain=function(y){return arguments.length?(e=Array.from(y,qm),m()):e.slice()},g.range=function(y){return arguments.length?(t=Array.from(y),m()):t.slice()},g.rangeRound=function(y){return t=Array.from(y),n=hj,m()},g.clamp=function(y){return arguments.length?(l=y?!0:Qn,m()):l!==Qn},g.interpolate=function(y){return arguments.length?(n=y,m()):n},g.unknown=function(y){return arguments.length?(s=y,g):s},function(y,v){return r=y,i=v,m()}}function pj(){return fy()(Qn,Qn)}function kse(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Fm(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Rc(e){return e=Fm(Math.abs(e)),e?e[1]:NaN}function Ase(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function Ese(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Tse=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zd(e){if(!(t=Tse.exec(e)))throw new Error("invalid format: "+e);var t;return new mj({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]})}Zd.prototype=mj.prototype;function mj(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+""}mj.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 Pse(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Km;function zse(e,t){var n=Fm(e,t);if(!n)return Km=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(Km=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+Fm(e,Math.max(0,t+s-1))[0]}function dP(e,t){var n=Fm(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const fP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kse,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)=>dP(e*100,t),r:dP,s:zse,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hP(e){return e}var pP=Array.prototype.map,mP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mse(e){var t=e.grouping===void 0||e.thousands===void 0?hP:Ase(pP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?hP:Ese(pP.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,y){g=Zd(g);var v=g.fill,w=g.align,S=g.sign,N=g.symbol,C=g.zero,A=g.width,k=g.comma,_=g.precision,T=g.trim,P=g.type;P==="n"?(k=!0,P="g"):fP[P]||(_===void 0&&(_=12),T=!0,P="g"),(C||v==="0"&&w==="=")&&(C=!0,v="0",w="=");var E=(y&&y.prefix!==void 0?y.prefix:"")+(N==="$"?n:N==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),z=(N==="$"?r:/[%p]/.test(P)?l:"")+(y&&y.suffix!==void 0?y.suffix:""),D=fP[P],K=/[defgprs%]/.test(P);_=_===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function U(I){var H=E,ge=z,me,G,ae;if(P==="c")ge=D(I)+ge,I="";else{I=+I;var pe=I<0||1/I<0;if(I=isNaN(I)?f:D(Math.abs(I),_),T&&(I=Pse(I)),pe&&+I==0&&S!=="+"&&(pe=!1),H=(pe?S==="("?S:c:S==="-"||S==="("?"":S)+H,ge=(P==="s"&&!isNaN(I)&&Km!==void 0?mP[8+Km/3]:"")+ge+(pe&&S==="("?")":""),K){for(me=-1,G=I.length;++me<G;)if(ae=I.charCodeAt(me),48>ae||ae>57){ge=(ae===46?i+I.slice(me+1):I.slice(me))+ge,I=I.slice(0,me);break}}}k&&!C&&(I=t(I,1/0));var xe=H.length+I.length+ge.length,B=xe<A?new Array(A-xe+1).join(v):"";switch(k&&C&&(I=t(B+I,B.length?A-ge.length:1/0),B=""),w){case"<":I=H+I+ge+B;break;case"=":I=H+B+I+ge;break;case"^":I=B.slice(0,xe=B.length>>1)+H+I+ge+B.slice(xe);break;default:I=B+H+I+ge;break}return s(I)}return U.toString=function(){return g+""},U}function m(g,y){var v=Math.max(-8,Math.min(8,Math.floor(Rc(y)/3)))*3,w=Math.pow(10,-v),S=h((g=Zd(g),g.type="f",g),{suffix:mP[8+v/3]});return function(N){return S(w*N)}}return{format:h,formatPrefix:m}}var bp,gj,M$;Rse({thousands:",",grouping:[3],currency:["$",""]});function Rse(e){return bp=Mse(e),gj=bp.format,M$=bp.formatPrefix,bp}function Dse(e){return Math.max(0,-Rc(Math.abs(e)))}function Lse(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rc(t)/3)))*3-Rc(Math.abs(e)))}function Ise(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Rc(t)-Rc(e))+1}function R$(e,t,n,r){var i=lS(e,t,n),s;switch(r=Zd(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Lse(i,l))&&(r.precision=s),M$(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Ise(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Dse(i))&&(r.precision=s-(r.type==="%")*2);break}}return gj(r)}function qs(e){var t=e.domain;return e.ticks=function(n){var r=t();return sS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return R$(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,h,m=10;for(c<l&&(h=l,l=c,c=h,h=i,i=s,s=h);m-- >0;){if(h=oS(l,c,n),h===f)return r[i]=l,r[s]=c,t(r);if(h>0)l=Math.floor(l/h)*h,c=Math.ceil(c/h)*h;else if(h<0)l=Math.ceil(l*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function D$(){var e=pj();return e.copy=function(){return gf(e,D$())},ii.apply(e,arguments),qs(e)}function L$(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,qm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return L$(e).unknown(t)},e=arguments.length?Array.from(e,qm):[0,1],qs(n)}function I$(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return s<i&&(l=n,n=r,r=l,l=i,i=s,s=l),e[n]=t.floor(i),e[r]=t.ceil(s),e}function gP(e){return Math.log(e)}function yP(e){return Math.exp(e)}function $se(e){return-Math.log(-e)}function Use(e){return-Math.exp(-e)}function Bse(e){return isFinite(e)?+("1e"+e):e<0?0:e}function qse(e){return e===10?Bse:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Fse(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 vP(e){return(t,n)=>-e(-t,n)}function yj(e){const t=e(gP,yP),n=t.domain;let r=10,i,s;function l(){return i=Fse(r),s=qse(r),n()[0]<0?(i=vP(i),s=vP(s),e($se,Use)):e(gP,yP),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let h=f[0],m=f[f.length-1];const g=m<h;g&&([h,m]=[m,h]);let y=i(h),v=i(m),w,S;const N=c==null?10:+c;let C=[];if(!(r%1)&&v-y<N){if(y=Math.floor(y),v=Math.ceil(v),h>0){for(;y<=v;++y)for(w=1;w<r;++w)if(S=y<0?w/s(-y):w*s(y),!(S<h)){if(S>m)break;C.push(S)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(S=y>0?w/s(-y):w*s(y),!(S<h)){if(S>m)break;C.push(S)}C.length*2<N&&(C=sS(h,m,N))}else C=sS(y,v,Math.min(v-y,N)).map(s);return g?C.reverse():C},t.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=Zd(f)).precision==null&&(f.trim=!0),f=gj(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return m=>{let g=m/s(Math.round(i(m)));return g*r<r-.5&&(g*=r),g<=h?f(m):""}},t.nice=()=>n(I$(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function $$(){const e=yj(fy()).domain([1,10]);return e.copy=()=>gf(e,$$()).base(e.base()),ii.apply(e,arguments),e}function bP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vj(e){var t=1,n=e(bP(t),xP(t));return n.constant=function(r){return arguments.length?e(bP(t=+r),xP(t)):t},qs(n)}function U$(){var e=vj(fy());return e.copy=function(){return gf(e,U$()).constant(e.constant())},ii.apply(e,arguments)}function wP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Kse(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Hse(e){return e<0?-e*e:e*e}function bj(e){var t=e(Qn,Qn),n=1;function r(){return n===1?e(Qn,Qn):n===.5?e(Kse,Hse):e(wP(n),wP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},qs(t)}function xj(){var e=bj(fy());return e.copy=function(){return gf(e,xj()).exponent(e.exponent())},ii.apply(e,arguments),e}function Gse(){return xj.apply(null,arguments).exponent(.5)}function SP(e){return Math.sign(e)*e*e}function Vse(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function B$(){var e=pj(),t=[0,1],n=!1,r;function i(s){var l=Vse(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(SP(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,qm)).map(SP)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return B$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ii.apply(i,arguments),qs(i)}function q$(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=Qae(e,l/c);return s}function s(l){return l==null||isNaN(l=+l)?r:t[pf(n,l)]}return s.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},s.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(ks),i()},s.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},s.unknown=function(l){return arguments.length?(r=l,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return q$().domain(e).range(t).unknown(r)},ii.apply(s,arguments)}function F$(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function l(f){return f!=null&&f<=f?i[pf(r,f,0,n)]:s}function c(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,c()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,c()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return F$().domain([e,t]).range(i).unknown(s)},ii.apply(qs(l),arguments)}function K$(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[pf(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return K$().domain(e).range(t).unknown(n)},ii.apply(i,arguments)}const Ax=new Date,Ex=new Date;function bn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l<c-s?l:c},i.offset=(s,l)=>(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s<l)||!(c>0))return f;let h;do f.push(h=new Date(+s)),t(s,c),e(s);while(h<s&&s<l);return f},i.filter=s=>bn(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(Ax.setTime(+s),Ex.setTime(+l),e(Ax),e(Ex),Math.floor(n(Ax,Ex))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const Hm=bn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?bn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Hm);Hm.range;const Sa=1e3,Wr=Sa*60,ja=Wr*60,Oa=ja*24,wj=Oa*7,jP=Oa*30,Tx=Oa*365,Eo=bn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCSeconds());Eo.range;const Sj=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sa)},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getMinutes());Sj.range;const jj=bn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getUTCMinutes());jj.range;const Nj=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sa-e.getMinutes()*Wr)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getHours());Nj.range;const Cj=bn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getUTCHours());Cj.range;const yf=bn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Wr)/Oa,e=>e.getDate()-1);yf.range;const hy=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>e.getUTCDate()-1);hy.range;const H$=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oa,e=>Math.floor(e/Oa));H$.range;function ol(e){return bn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wr)/wj)}const py=ol(0),Gm=ol(1),Zse=ol(2),Yse=ol(3),Dc=ol(4),Wse=ol(5),Qse=ol(6);py.range;Gm.range;Zse.range;Yse.range;Dc.range;Wse.range;Qse.range;function ll(e){return bn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/wj)}const my=ll(0),Vm=ll(1),Xse=ll(2),Jse=ll(3),Lc=ll(4),eoe=ll(5),toe=ll(6);my.range;Vm.range;Xse.range;Jse.range;Lc.range;eoe.range;toe.range;const _j=bn(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());_j.range;const Oj=bn(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());Oj.range;const ka=bn(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());ka.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ka.range;const Aa=bn(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());Aa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Aa.range;function G$(e,t,n,r,i,s){const l=[[Eo,1,Sa],[Eo,5,5*Sa],[Eo,15,15*Sa],[Eo,30,30*Sa],[s,1,Wr],[s,5,5*Wr],[s,15,15*Wr],[s,30,30*Wr],[i,1,ja],[i,3,3*ja],[i,6,6*ja],[i,12,12*ja],[r,1,Oa],[r,2,2*Oa],[n,1,wj],[t,1,jP],[t,3,3*jP],[e,1,Tx]];function c(h,m,g){const y=m<h;y&&([h,m]=[m,h]);const v=g&&typeof g.range=="function"?g:f(h,m,g),w=v?v.range(h,+m+1):[];return y?w.reverse():w}function f(h,m,g){const y=Math.abs(m-h)/g,v=lj(([,,N])=>N).right(l,y);if(v===l.length)return e.every(lS(h/Tx,m/Tx,g));if(v===0)return Hm.every(Math.max(lS(h,m,g),1));const[w,S]=l[y/l[v-1][2]<l[v][2]/y?v-1:v];return w.every(S)}return[c,f]}const[noe,roe]=G$(Aa,Oj,my,H$,Cj,jj),[ioe,aoe]=G$(ka,_j,py,yf,Nj,Sj);function Px(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 zx(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 ld(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function soe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,l=e.shortDays,c=e.months,f=e.shortMonths,h=cd(i),m=ud(i),g=cd(s),y=ud(s),v=cd(l),w=ud(l),S=cd(c),N=ud(c),C=cd(f),A=ud(f),k={a:ae,A:pe,b:xe,B,c:null,d:AP,e:AP,f:Aoe,g:$oe,G:Boe,H:_oe,I:Ooe,j:koe,L:V$,m:Eoe,M:Toe,p:R,q:V,Q:PP,s:zP,S:Poe,u:zoe,U:Moe,V:Roe,w:Doe,W:Loe,x:null,X:null,y:Ioe,Y:Uoe,Z:qoe,"%":TP},_={a:X,A:q,b:W,B:ie,c:null,d:EP,e:EP,f:Goe,g:nle,G:ile,H:Foe,I:Koe,j:Hoe,L:Y$,m:Voe,M:Zoe,p:ye,q:we,Q:PP,s:zP,S:Yoe,u:Woe,U:Qoe,V:Xoe,w:Joe,W:ele,x:null,X:null,y:tle,Y:rle,Z:ale,"%":TP},T={a:K,A:U,b:I,B:H,c:ge,d:OP,e:OP,f:Soe,g:_P,G:CP,H:kP,I:kP,j:voe,L:woe,m:yoe,M:boe,p:D,q:goe,Q:Noe,s:Coe,S:xoe,u:doe,U:foe,V:hoe,w:uoe,W:poe,x:me,X:G,y:_P,Y:CP,Z:moe,"%":joe};k.x=P(n,k),k.X=P(r,k),k.c=P(t,k),_.x=P(n,_),_.X=P(r,_),_.c=P(t,_);function P(te,ue){return function(Se){var Z=[],Me=-1,Ee=0,it=te.length,rt,an,fn;for(Se instanceof Date||(Se=new Date(+Se));++Me<it;)te.charCodeAt(Me)===37&&(Z.push(te.slice(Ee,Me)),(an=NP[rt=te.charAt(++Me)])!=null?rt=te.charAt(++Me):an=rt==="e"?" ":"0",(fn=ue[rt])&&(rt=fn(Se,an)),Z.push(rt),Ee=Me+1);return Z.push(te.slice(Ee,Me)),Z.join("")}}function E(te,ue){return function(Se){var Z=ld(1900,void 0,1),Me=z(Z,te,Se+="",0),Ee,it;if(Me!=Se.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(ue&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(Ee=zx(ld(Z.y,0,1)),it=Ee.getUTCDay(),Ee=it>4||it===0?Vm.ceil(Ee):Vm(Ee),Ee=hy.offset(Ee,(Z.V-1)*7),Z.y=Ee.getUTCFullYear(),Z.m=Ee.getUTCMonth(),Z.d=Ee.getUTCDate()+(Z.w+6)%7):(Ee=Px(ld(Z.y,0,1)),it=Ee.getDay(),Ee=it>4||it===0?Gm.ceil(Ee):Gm(Ee),Ee=yf.offset(Ee,(Z.V-1)*7),Z.y=Ee.getFullYear(),Z.m=Ee.getMonth(),Z.d=Ee.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),it="Z"in Z?zx(ld(Z.y,0,1)).getUTCDay():Px(ld(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(it+5)%7:Z.w+Z.U*7-(it+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,zx(Z)):Px(Z)}}function z(te,ue,Se,Z){for(var Me=0,Ee=ue.length,it=Se.length,rt,an;Me<Ee;){if(Z>=it)return-1;if(rt=ue.charCodeAt(Me++),rt===37){if(rt=ue.charAt(Me++),an=T[rt in NP?ue.charAt(Me++):rt],!an||(Z=an(te,Se,Z))<0)return-1}else if(rt!=Se.charCodeAt(Z++))return-1}return Z}function D(te,ue,Se){var Z=h.exec(ue.slice(Se));return Z?(te.p=m.get(Z[0].toLowerCase()),Se+Z[0].length):-1}function K(te,ue,Se){var Z=v.exec(ue.slice(Se));return Z?(te.w=w.get(Z[0].toLowerCase()),Se+Z[0].length):-1}function U(te,ue,Se){var Z=g.exec(ue.slice(Se));return Z?(te.w=y.get(Z[0].toLowerCase()),Se+Z[0].length):-1}function I(te,ue,Se){var Z=C.exec(ue.slice(Se));return Z?(te.m=A.get(Z[0].toLowerCase()),Se+Z[0].length):-1}function H(te,ue,Se){var Z=S.exec(ue.slice(Se));return Z?(te.m=N.get(Z[0].toLowerCase()),Se+Z[0].length):-1}function ge(te,ue,Se){return z(te,t,ue,Se)}function me(te,ue,Se){return z(te,n,ue,Se)}function G(te,ue,Se){return z(te,r,ue,Se)}function ae(te){return l[te.getDay()]}function pe(te){return s[te.getDay()]}function xe(te){return f[te.getMonth()]}function B(te){return c[te.getMonth()]}function R(te){return i[+(te.getHours()>=12)]}function V(te){return 1+~~(te.getMonth()/3)}function X(te){return l[te.getUTCDay()]}function q(te){return s[te.getUTCDay()]}function W(te){return f[te.getUTCMonth()]}function ie(te){return c[te.getUTCMonth()]}function ye(te){return i[+(te.getUTCHours()>=12)]}function we(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ue=P(te+="",k);return ue.toString=function(){return te},ue},parse:function(te){var ue=E(te+="",!1);return ue.toString=function(){return te},ue},utcFormat:function(te){var ue=P(te+="",_);return ue.toString=function(){return te},ue},utcParse:function(te){var ue=E(te+="",!0);return ue.toString=function(){return te},ue}}}var NP={"-":"",_:" ",0:"0"},On=/^\s*\d+/,ooe=/^%/,loe=/[\\^$*+?|[\]().{}]/g;function ut(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function coe(e){return e.replace(loe,"\\$&")}function cd(e){return new RegExp("^(?:"+e.map(coe).join("|")+")","i")}function ud(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function uoe(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function doe(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function foe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function hoe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function poe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function CP(e,t,n){var r=On.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function _P(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function moe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function goe(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function yoe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function OP(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function voe(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kP(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function boe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function xoe(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function woe(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Soe(e,t,n){var r=On.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function joe(e,t,n){var r=ooe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Noe(e,t,n){var r=On.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Coe(e,t,n){var r=On.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function AP(e,t){return ut(e.getDate(),t,2)}function _oe(e,t){return ut(e.getHours(),t,2)}function Ooe(e,t){return ut(e.getHours()%12||12,t,2)}function koe(e,t){return ut(1+yf.count(ka(e),e),t,3)}function V$(e,t){return ut(e.getMilliseconds(),t,3)}function Aoe(e,t){return V$(e,t)+"000"}function Eoe(e,t){return ut(e.getMonth()+1,t,2)}function Toe(e,t){return ut(e.getMinutes(),t,2)}function Poe(e,t){return ut(e.getSeconds(),t,2)}function zoe(e){var t=e.getDay();return t===0?7:t}function Moe(e,t){return ut(py.count(ka(e)-1,e),t,2)}function Z$(e){var t=e.getDay();return t>=4||t===0?Dc(e):Dc.ceil(e)}function Roe(e,t){return e=Z$(e),ut(Dc.count(ka(e),e)+(ka(e).getDay()===4),t,2)}function Doe(e){return e.getDay()}function Loe(e,t){return ut(Gm.count(ka(e)-1,e),t,2)}function Ioe(e,t){return ut(e.getFullYear()%100,t,2)}function $oe(e,t){return e=Z$(e),ut(e.getFullYear()%100,t,2)}function Uoe(e,t){return ut(e.getFullYear()%1e4,t,4)}function Boe(e,t){var n=e.getDay();return e=n>=4||n===0?Dc(e):Dc.ceil(e),ut(e.getFullYear()%1e4,t,4)}function qoe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ut(t/60|0,"0",2)+ut(t%60,"0",2)}function EP(e,t){return ut(e.getUTCDate(),t,2)}function Foe(e,t){return ut(e.getUTCHours(),t,2)}function Koe(e,t){return ut(e.getUTCHours()%12||12,t,2)}function Hoe(e,t){return ut(1+hy.count(Aa(e),e),t,3)}function Y$(e,t){return ut(e.getUTCMilliseconds(),t,3)}function Goe(e,t){return Y$(e,t)+"000"}function Voe(e,t){return ut(e.getUTCMonth()+1,t,2)}function Zoe(e,t){return ut(e.getUTCMinutes(),t,2)}function Yoe(e,t){return ut(e.getUTCSeconds(),t,2)}function Woe(e){var t=e.getUTCDay();return t===0?7:t}function Qoe(e,t){return ut(my.count(Aa(e)-1,e),t,2)}function W$(e){var t=e.getUTCDay();return t>=4||t===0?Lc(e):Lc.ceil(e)}function Xoe(e,t){return e=W$(e),ut(Lc.count(Aa(e),e)+(Aa(e).getUTCDay()===4),t,2)}function Joe(e){return e.getUTCDay()}function ele(e,t){return ut(Vm.count(Aa(e)-1,e),t,2)}function tle(e,t){return ut(e.getUTCFullYear()%100,t,2)}function nle(e,t){return e=W$(e),ut(e.getUTCFullYear()%100,t,2)}function rle(e,t){return ut(e.getUTCFullYear()%1e4,t,4)}function ile(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lc(e):Lc.ceil(e),ut(e.getUTCFullYear()%1e4,t,4)}function ale(){return"+0000"}function TP(){return"%"}function PP(e){return+e}function zP(e){return Math.floor(+e/1e3)}var ic,Q$,X$;sle({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 sle(e){return ic=soe(e),Q$=ic.format,ic.parse,X$=ic.utcFormat,ic.utcParse,ic}function ole(e){return new Date(e)}function lle(e){return e instanceof Date?+e:+new Date(+e)}function kj(e,t,n,r,i,s,l,c,f,h){var m=pj(),g=m.invert,y=m.domain,v=h(".%L"),w=h(":%S"),S=h("%I:%M"),N=h("%I %p"),C=h("%a %d"),A=h("%b %d"),k=h("%B"),_=h("%Y");function T(P){return(f(P)<P?v:c(P)<P?w:l(P)<P?S:s(P)<P?N:r(P)<P?i(P)<P?C:A:n(P)<P?k:_)(P)}return m.invert=function(P){return new Date(g(P))},m.domain=function(P){return arguments.length?y(Array.from(P,lle)):y().map(ole)},m.ticks=function(P){var E=y();return e(E[0],E[E.length-1],P??10)},m.tickFormat=function(P,E){return E==null?T:h(E)},m.nice=function(P){var E=y();return(!P||typeof P.range!="function")&&(P=t(E[0],E[E.length-1],P??10)),P?y(I$(E,P)):m},m.copy=function(){return gf(m,kj(e,t,n,r,i,s,l,c,f,h))},m}function cle(){return ii.apply(kj(ioe,aoe,ka,_j,py,yf,Nj,Sj,Eo,Q$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ule(){return ii.apply(kj(noe,roe,Aa,Oj,my,hy,Cj,jj,Eo,X$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function gy(){var e=0,t=1,n,r,i,s,l=Qn,c=!1,f;function h(g){return g==null||isNaN(g=+g)?f:l(i===0?.5:(g=(s(g)-n)*i,c?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t]=g,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(g){return arguments.length?(c=!!g,h):c},h.interpolator=function(g){return arguments.length?(l=g,h):l};function m(g){return function(y){var v,w;return arguments.length?([v,w]=y,l=g(v,w),h):[l(0),l(1)]}}return h.range=m(eu),h.rangeRound=m(hj),h.unknown=function(g){return arguments.length?(f=g,h):f},function(g){return s=g,n=g(e),r=g(t),i=n===r?0:1/(r-n),h}}function Fs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function J$(){var e=qs(gy()(Qn));return e.copy=function(){return Fs(e,J$())},za.apply(e,arguments)}function e5(){var e=yj(gy()).domain([1,10]);return e.copy=function(){return Fs(e,e5()).base(e.base())},za.apply(e,arguments)}function t5(){var e=vj(gy());return e.copy=function(){return Fs(e,t5()).constant(e.constant())},za.apply(e,arguments)}function Aj(){var e=bj(gy());return e.copy=function(){return Fs(e,Aj()).exponent(e.exponent())},za.apply(e,arguments)}function dle(){return Aj.apply(null,arguments).exponent(.5)}function n5(){var e=[],t=Qn;function n(r){if(r!=null&&!isNaN(r=+r))return t((pf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(ks),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>Wae(e,s/r))},n.copy=function(){return n5(t).domain(e)},za.apply(n,arguments)}function yy(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,h=Qn,m,g=!1,y;function v(S){return isNaN(S=+S)?y:(S=.5+((S=+m(S))-s)*(r*S<r*s?c:f),h(g?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=m(e=+e),s=m(t=+t),l=m(n=+n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(g=!!S,v):g},v.interpolator=function(S){return arguments.length?(h=S,v):h};function w(S){return function(N){var C,A,k;return arguments.length?([C,A,k]=N,h=jse(S,[C,A,k]),v):[h(0),h(.5),h(1)]}}return v.range=w(eu),v.rangeRound=w(hj),v.unknown=function(S){return arguments.length?(y=S,v):y},function(S){return m=S,i=S(e),s=S(t),l=S(n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,v}}function r5(){var e=qs(yy()(Qn));return e.copy=function(){return Fs(e,r5())},za.apply(e,arguments)}function i5(){var e=yj(yy()).domain([.1,1,10]);return e.copy=function(){return Fs(e,i5()).base(e.base())},za.apply(e,arguments)}function a5(){var e=vj(yy());return e.copy=function(){return Fs(e,a5()).constant(e.constant())},za.apply(e,arguments)}function Ej(){var e=bj(yy());return e.copy=function(){return Fs(e,Ej()).exponent(e.exponent())},za.apply(e,arguments)}function fle(){return Ej.apply(null,arguments).exponent(.5)}const s5=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:uj,scaleDiverging:r5,scaleDivergingLog:i5,scaleDivergingPow:Ej,scaleDivergingSqrt:fle,scaleDivergingSymlog:a5,scaleIdentity:L$,scaleImplicit:cS,scaleLinear:D$,scaleLog:$$,scaleOrdinal:cj,scalePoint:Jae,scalePow:xj,scaleQuantile:q$,scaleQuantize:F$,scaleRadial:B$,scaleSequential:J$,scaleSequentialLog:e5,scaleSequentialPow:Aj,scaleSequentialQuantile:n5,scaleSequentialSqrt:dle,scaleSequentialSymlog:t5,scaleSqrt:Gse,scaleSymlog:U$,scaleThreshold:K$,scaleTime:cle,scaleUtc:ule,tickFormat:R$},Symbol.toStringTag,{value:"Module"}));function hle(e){var t=s5;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(sf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function MP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=hle(e);if(r!=null)return r.domain(t).range(n),r}}function Tj(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?MP(e.scale,n,r):MP(t,n,r)}function ple(e){return"scale".concat(sf(e))}function mle(e){return ple(e)in s5}var o5=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return mle(r)?r:"point"}};function gle(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var s=Math.floor((n+r)/2);(i?e[s]<t:e[s]>t)?n=s+1:r=s}return n}function l5(e,t){if(e){var n=t??e.domain(),r=n.map(s=>{var l;return(l=e(s))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return s=>{var l,c,f=gle(r,s);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,m=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(s-h)<=Math.abs(s-m)?n[f-1]:n[f]}}}function yle(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):l5(e,void 0)}function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){vle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vle(e,t,n){return(t=ble(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ble(e){var t=xle(e,"string");return typeof t=="symbol"?t:t+""}function xle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hS=[0,"auto"],gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},c5=(e,t)=>e.cartesianAxis.xAxis[t],Ma=(e,t)=>{var n=c5(e,t);return n??gn},yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:hS,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:cf},u5=(e,t)=>e.cartesianAxis.yAxis[t],Ra=(e,t)=>{var n=u5(e,t);return n??yn},wle={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Pj=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??wle},tr=(e,t,n)=>{switch(t){case"xAxis":return Ma(e,n);case"yAxis":return Ra(e,n);case"zAxis":return Pj(e,n);case"angleAxis":return nj(e,n);case"radiusAxis":return rj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Sle=(e,t,n)=>{switch(t){case"xAxis":return Ma(e,n);case"yAxis":return Ra(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vf=(e,t,n)=>{switch(t){case"xAxis":return Ma(e,n);case"yAxis":return Ra(e,n);case"angleAxis":return nj(e,n);case"radiusAxis":return rj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},d5=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function f5(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var h5=e=>e.graphicalItems.cartesianItems,jle=re([Cn,cy],f5),p5=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),tu=re([h5,tr,jle],p5,{memoizeOptions:{resultEqualityCheck:dy}}),m5=re([tu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(sj)),g5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Nle=re([tu],g5),y5=e=>e.map(t=>t.data).filter(Boolean).flat(1),Cle=re([tu],e=>e.some(t=>!t.data)),v5=re([tu],y5,{memoizeOptions:{resultEqualityCheck:dy}}),b5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},zj=re([v5,iy],b5),_le=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Nn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Nn(i,r)}))):e.map(r=>({value:r})),x5=(e,t,n,r,i,s)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:f}=r,h=_le(e,t,n);if(i&&t?.dataKey!=null&&s.length>0){var m=l.slice(c,f+1),g=m.map(y=>({value:Nn(y,t.dataKey)})).filter(y=>y.value!=null);return[...g,...h]}return h},bf=re([zj,tr,tu,iy,Cle,v5],x5);function Cc(e){if(Vi(e)||e instanceof Date){var t=Number(e);if(ct(t))return t}}function DP(e){if(Array.isArray(e)){var t=[Cc(e[0]),Cc(e[1])];return Bi(t)?t:void 0}var n=Cc(e);if(n!=null)return[n,n]}function Yi(e){return e.map(Cc).filter(Ii)}function Ole(e,t){var n=Cc(e),r=Cc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var kle=re([bf],e=>e?.map(t=>t.value).sort(Ole));function w5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Ale(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Gi(t))r=t;else if(Array.isArray(t)){var i=Yi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Yi(n.flatMap(s=>{var l=Nn(e,s.dataKey),c,f;if(Array.isArray(l)?[c,f]=l:c=f=l,!(!ct(c)||!ct(f)))return[r-c,r+f]}))}var xn=e=>{var t=_n(e),n=Jc(e);return vf(e,t,n)},Ic=re([xn],e=>e?.dataKey),Ele=re([m5,iy,xn],_$),S5=(e,t,n,r)=>{var i={},s=t.reduce((l,c)=>{if(c.stackId==null)return l;var f=l[c.stackId];return f==null&&(f=[]),f.push(c),l[c.stackId]=f,l},i);return Object.fromEntries(Object.entries(s).map(l=>{var[c,f]=l,h=r?[...f].reverse():f,m=h.map(aj);return[c,{stackedData:one(e,m,n),graphicalItems:h}]}))},j5=re([Ele,m5,ay,b$],S5),N5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var l=dne(e,i,s);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},Tle=re([tr],e=>e.allowDataOverflow),Mj=e=>{var t;if(e==null||!("domain"in e))return hS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Yi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:hS},C5=re([tr],Mj),_5=re([C5,Tle],l$),Ple=re([j5,ji,Cn,_5],N5,{memoizeOptions:{resultEqualityCheck:uy}}),Rj=e=>e.errorBars,zle=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>w5(n,r)),Ym=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var s=i.flat(),l=Math.min(...s),c=Math.max(...s);return[l,c]}},O5=function(t,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(r.length>0&&r.forEach(h=>{var m,g=h.data!=null?[...h.data]:l,y=(m=i[h.id])===null||m===void 0?void 0:m.filter(v=>w5(s,v));g.forEach(v=>{var w,S=Nn(v,(w=n.dataKey)!==null&&w!==void 0?w:h.dataKey),N=Ale(v,S,y);if(N.length>=2){var C=Math.min(...N),A=Math.max(...N);(c==null||C<c)&&(c=C),(f==null||A>f)&&(f=A)}var k=DP(S);k!=null&&(c=c==null?k[0]:Math.min(c,k[0]),f=f==null?k[1]:Math.max(f,k[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(h=>{var m=DP(Nn(h,n.dataKey));m!=null&&(c=c==null?m[0]:Math.min(c,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),ct(c)&&ct(f))return[c,f]},Mle=re([zj,tr,Nle,Rj,Cn,Sae],O5,{memoizeOptions:{resultEqualityCheck:uy}});function Rle(e){var{value:t}=e;if(Vi(t)||t instanceof Date)return t}var Dle=(e,t,n)=>{var r=e.map(Rle).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&LL(r))?o$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},k5=e=>e.referenceElements.dots,nu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Lle=re([k5,Cn,cy],nu),A5=e=>e.referenceElements.areas,Ile=re([A5,Cn,cy],nu),E5=e=>e.referenceElements.lines,$le=re([E5,Cn,cy],nu),T5=(e,t)=>{if(e!=null){var n=Yi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ule=re(Lle,Cn,T5),P5=(e,t)=>{if(e!=null){var n=Yi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ble=re([Ile,Cn],P5);function qle(e){var t;if(e.x!=null)return Yi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Yi(n)}function Fle(e){var t;if(e.y!=null)return Yi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Yi(n)}var z5=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?qle(r):Fle(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Kle=re([$le,Cn],z5),Hle=re(Ule,Kle,Ble,(e,t,n)=>Ym(e,n,t)),M5=(e,t,n,r,i,s,l,c)=>{if(n!=null)return n;var f=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",h=f?Ym(r,s,i):Ym(s,i);return Nae(t,h,e.allowDataOverflow)},Gle=re([tr,C5,_5,Ple,Mle,Hle,Bt,Cn],M5,{memoizeOptions:{resultEqualityCheck:uy}}),Vle=[0,1],R5=(e,t,n,r,i,s,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:f}=e,h=Wi(t,s);if(h&&c==null){var m;return o$(0,(m=n?.length)!==null&&m!==void 0?m:0)}return f==="category"?Dle(r,e,h):i==="expand"&&!h?Vle:l}},Dj=re([tr,Bt,zj,bf,ay,Cn,Gle],R5),ru=re([tr,d5,J1],o5),D5=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Mj(t),s=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Bi(e)){if(s)return G2(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return V2(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(s&&Bi(e))return G2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Bi(e))return V2(e,t.tickCount,t.allowDecimals,"adaptive")}}},Lj=re([Dj,vf,ru],D5),L5=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Bi(t)&&Array.isArray(n)&&n.length>0){var i,s,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(s=n[n.length-1])!==null&&s!==void 0?s:0;return[Math.min(l,c),Math.max(f,h)]}return t},Zle=re([tr,Dj,Lj,Cn],L5),Yle=re(bf,tr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Yi(e.map(g=>g.value))).sort((g,y)=>g-y),i=r[0],s=r[r.length-1];if(i==null||s==null)return 1/0;var l=s-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var f=r[c],h=r[c+1];if(!(f==null||h==null)){var m=h-f;n=Math.min(n,m)}}return n/l}}),I5=re(Yle,Bt,Aae,In,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ct(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var l=zs(n,e*s),c=e*s/2;return c-l-(c-l)/s*l}return 0}),Wle=(e,t,n)=>{var r=Ma(e,t);return r==null||typeof r.padding!="string"?0:I5(e,"xAxis",t,n,r.padding)},Qle=(e,t,n)=>{var r=Ra(e,t);return r==null||typeof r.padding!="string"?0:I5(e,"yAxis",t,n,r.padding)},Xle=re(Ma,Wle,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Jle=re(Ra,Qle,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),ece=re([In,Xle,Jg,Xg,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:s}=r;return i?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),tce=re([In,Bt,Jle,Jg,Xg,(e,t,n)=>n],(e,t,n,r,i,s)=>{var{padding:l}=i;return s?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),xf=(e,t,n,r)=>{var i;switch(t){case"xAxis":return ece(e,n,r);case"yAxis":return tce(e,n,r);case"zAxis":return(i=Pj(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return j$(e);case"radiusAxis":return N$(e,n);default:return}},$5=re([tr,xf],sy),nce=re([ru,Zle],Iae),Ij=re([tr,ru,nce,$5],Tj),U5=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,l=Wi(e,r);if(l&&(i==="number"||s!=="auto"))return t.map(c=>c.value)}},$j=re([Bt,bf,vf,Cn],U5),vy=re([Ij],oj);re([Ij],yle);re([Ij,kle],l5);re([tu,Rj,Cn],zle);function B5(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var by=(e,t)=>t,xy=(e,t,n)=>n,rce=re(Wg,by,xy,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(B5)),ice=re(Qg,by,xy,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(B5)),q5=(e,t)=>({width:e.width,height:t.height}),ace=(e,t)=>{var n=typeof t.width=="number"?t.width:cf;return{width:n,height:e.height}},sce=re(In,Ma,q5),oce=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},lce=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},cce=re(Pa,In,rce,by,xy,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=q5(t,c);l==null&&(l=oce(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;s[c.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),s}),uce=re(Ta,In,ice,by,xy,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=ace(t,c);l==null&&(l=lce(t,r,e));var h=r==="left"&&!i||r==="right"&&i;s[c.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),s}),dce=(e,t)=>{var n=Ma(e,t);if(n!=null)return cce(e,n.orientation,n.mirror)},fce=re([In,Ma,dce,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),hce=(e,t)=>{var n=Ra(e,t);if(n!=null)return uce(e,n.orientation,n.mirror)},pce=re([In,Ra,hce,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),mce=re(In,Ra,(e,t)=>{var n=typeof t.width=="number"?t.width:cf;return{width:n,height:e.height}}),F5=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:l}=n,c=Wi(e,r),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(l&&c&&s==="category"&&i&&LL(h))return f}},Uj=re([Bt,bf,tr,Cn],F5);re([Bt,Sle,ru,vy,Uj,$j,xf,Lj,Cn],(e,t,n,r,i,s,l,c,f)=>{if(t!=null){var h=Wi(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:s,duplicateDomain:i,isCategorical:h,niceTicks:c,range:l,realScaleType:n,scale:r}}});var gce=(e,t,n,r,i,s,l,c,f)=>{if(!(t==null||r==null)){var h=Wi(e,f),{type:m,ticks:g,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=m==="category"&&r.bandwidth?r.bandwidth()/v:0;w=f==="angleAxis"&&s!=null&&s.length>=2?yi(s[0]-s[1])*2*w:w;var S=g||i;return S?S.map((N,C)=>{var A=l?l.indexOf(N):N,k=r.map(A);return ct(k)?{index:C,coordinate:k+w,value:N,offset:w}:null}).filter(Ii):h&&c?c.map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:N,index:C,offset:w}:null}).filter(Ii):r.ticks?r.ticks(y).map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:N,index:C,offset:w}:null}).filter(Ii):r.domain().map((N,C)=>{var A=r.map(N);return ct(A)?{coordinate:A+w,value:l?l[N]:N,index:C,offset:w}:null}).filter(Ii)}},K5=re([Bt,vf,ru,vy,Lj,xf,Uj,$j,Cn],gce),yce=(e,t,n,r,i,s,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Wi(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&r?.length>=2?yi(r[0]-r[1])*2*h:h,c&&s?s.map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:m,index:g,offset:h}:null}).filter(Ii):n.ticks?n.ticks(f).map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:m,index:g,offset:h}:null}).filter(Ii):n.domain().map((m,g)=>{var y=n.map(m);return ct(y)?{coordinate:y+h,value:i?i[m]:m,index:g,offset:h}:null}).filter(Ii)}},H5=re([Bt,vf,vy,xf,Uj,$j,Cn],yce),G5=re(tr,vy,(e,t)=>{if(!(e==null||t==null))return Zm(Zm({},e),{},{scale:t})}),vce=re([tr,ru,Dj,$5],Tj),bce=re([vce],oj);re((e,t,n)=>Pj(e,n),bce,(e,t)=>{if(!(e==null||t==null))return Zm(Zm({},e),{},{scale:t})});var xce=re([Bt,Wg,Qg],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),wce=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};re([wce],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var s of e){var l=Math.abs(s.coordinate-t);l<r&&(r=l,i=s)}return(n=i)===null||n===void 0?void 0:n.value}});var V5=e=>e.options.defaultTooltipEventType,Z5=e=>e.options.validateTooltipEventTypes;function Y5(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function wf(e,t){var n=V5(e),r=Z5(e);return Y5(t,n,r)}function Sce(e){return Le(t=>wf(t,e))}var W5=(e,t)=>{var n,r=Number(t);if(!(Gi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},jce=e=>e.tooltip.settings,bs={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Nce={itemInteraction:{click:bs,hover:bs},axisInteraction:{click:bs,hover:bs},keyboardInteraction:bs,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},Q5=Kn({name:"tooltip",initialState:Nce,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Pt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Yr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Pt()},removeTooltipEntrySettings:{reducer(e,t){var n=Yr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Pt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Cce,replaceTooltipEntrySettings:_ce,removeTooltipEntrySettings:Oce,setTooltipSettingsState:kce,setActiveMouseOverItemIndex:Ace,mouseLeaveItem:bye,mouseLeaveChart:X5,setActiveClickItemIndex:xye,setMouseOverAxisIndex:J5,setMouseClickAxisIndex:Ece,setSyncInteraction:gd,setKeyboardInteraction:Wm}=Q5.actions,Tce=Q5.reducer;function LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(r){Pce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pce(e,t,n){return(t=zce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zce(e){var t=Mce(e,"string");return typeof t=="symbol"?t:t+""}function Mce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rce(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Dce(e){return e.index!=null}var e3=(e,t,n,r)=>{if(t==null)return bs;var i=Rce(e,t,n);if(i==null)return bs;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(Dce(i)){if(s)return xp(xp({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return xp(xp({},bs),{},{coordinate:i.coordinate})};function Lce(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Ice(e,t){var n=Lce(e),r=t[0],i=t[1];if(n===void 0)return!1;var s=Math.min(r,i),l=Math.max(r,i);return n>=s&&n<=l}function $ce(e,t,n){if(n==null||t==null)return!0;var r=Nn(e,t);return r==null||!Bi(n)?!0:Ice(r,n)}var Sd=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var s=Number(i);if(!ct(s))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(l,Math.min(s,c)),h=t[f];return h==null||$ce(h,n,r)?String(f):null},t3=(e,t,n,r,i,s,l)=>{if(s!=null){var c=l[0],f=c?.getPosition(s);if(f!=null)return f;var h=i?.[Number(s)];if(h)return n==="horizontal"?{x:h.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:h.coordinate}}},n3=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var s=e.tooltipItemPayloads[0];return s!=null?[s]:[]}return e.tooltipItemPayloads.filter(l=>{var c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},r3=e=>e.options.tooltipPayloadSearcher,iu=e=>e.tooltip;function IP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){Uce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uce(e,t,n){return(t=Bce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bce(e){var t=qce(e,"string");return typeof t=="symbol"?t:t+""}function qce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fce(e){if(typeof e=="string"||typeof e=="number")return e}function Kce(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Hce(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function UP(e){if(typeof e=="string")return e}function Gce(e){if(!(e==null||typeof e!="object")){var t="name"in e?Fce(e.name):void 0,n="unit"in e?Kce(e.unit):void 0,r="dataKey"in e?Hce(e.dataKey):void 0,i="payload"in e?e.payload:void 0,s="color"in e?UP(e.color):void 0,l="fill"in e?UP(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:s,fill:l}}}function Vce(e,t){return e??t}var i3=(e,t,n,r,i,s,l)=>{if(!(t==null||s==null)){var{chartData:c,computedData:f,dataStartIndex:h,dataEndIndex:m}=n,g=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:S,settings:N}=v,C=Vce(S,c),A=Array.isArray(C)?MI(C,h,m):C,k=(w=N?.dataKey)!==null&&w!==void 0?w:r,_=N?.nameKey,T;if(r&&Array.isArray(A)&&!Array.isArray(A[0])&&l==="axis"?T=IL(A,r,i):T=s(A,t,f,_),Array.isArray(T))T.forEach(E=>{var z,D,K=Gce(E),U=K?.name,I=K?.dataKey,H=K?.payload,ge=$P($P({},N),{},{name:U,unit:K?.unit,color:(z=K?.color)!==null&&z!==void 0?z:N?.color,fill:(D=K?.fill)!==null&&D!==void 0?D:N?.fill});y.push(zT({tooltipEntrySettings:ge,dataKey:I,payload:H,value:Nn(H,I),name:U==null?void 0:String(U)}))});else{var P;y.push(zT({tooltipEntrySettings:N,dataKey:k,payload:T,value:Nn(T,k),name:(P=Nn(T,_))!==null&&P!==void 0?P:N?.name}))}return y},g)}},Bj=re([xn,d5,J1],o5),Zce=re([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Yce=re([_n,Jc],f5),cl=re([Zce,xn,Yce],p5,{memoizeOptions:{resultEqualityCheck:dy}}),Wce=re([cl],e=>e.filter(sj)),a3=re([cl],y5,{memoizeOptions:{resultEqualityCheck:dy}}),Qce=re([cl],e=>e.some(t=>!t.data)),Xo=re([a3,ji],b5),Xce=re([Wce,ji,xn],_$),qj=re([Xo,xn,cl,ji,Qce,a3],x5),s3=re([xn],Mj),Jce=re([xn],e=>e.allowDataOverflow),o3=re([s3,Jce],l$),eue=re([cl],e=>e.filter(sj)),tue=re([Xce,eue,ay,b$],S5),nue=re([tue,ji,_n,o3],N5),rue=re([cl],g5),iue=re([Xo,xn,rue,Rj,_n,jae],O5,{memoizeOptions:{resultEqualityCheck:uy}}),aue=re([k5,_n,Jc],nu),sue=re([aue,_n],T5),oue=re([A5,_n,Jc],nu),lue=re([oue,_n],P5),cue=re([E5,_n,Jc],nu),uue=re([cue,_n],z5),due=re([sue,uue,lue],Ym),fue=re([xn,s3,o3,nue,iue,due,Bt,_n],M5),$c=re([xn,Bt,Xo,qj,ay,_n,fue],R5),hue=re([$c,xn,Bj],D5),pue=re([xn,$c,hue,_n],L5),l3=e=>{var t=_n(e),n=Jc(e),r=!1;return xf(e,t,n,r)},c3=re([xn,l3],sy),mue=re([xn,Bj,pue,c3],Tj),u3=re([mue],oj),gue=re([Bt,qj,xn,_n],F5),yue=re([Bt,qj,xn,_n],U5),vue=(e,t,n,r,i,s,l,c)=>{if(t){var{type:f}=t,h=Wi(e,c);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/m:0;return g=c==="angleAxis"&&i!=null&&i?.length>=2?yi(i[0]-i[1])*2*g:g,h&&l?l.map((y,v)=>{var w=r.map(y);return ct(w)?{coordinate:w+g,value:y,index:v,offset:g}:null}).filter(Ii):r.domain().map((y,v)=>{var w=r.map(y);return ct(w)?{coordinate:w+g,value:s?s[y]:y,index:v,offset:g}:null}).filter(Ii)}}},Da=re([Bt,xn,Bj,u3,l3,gue,yue,_n],vue),Fj=re([V5,Z5,jce],(e,t,n)=>Y5(n.shared,e,t)),d3=e=>e.tooltip.settings.trigger,Kj=e=>e.tooltip.settings.defaultIndex,Sf=re([iu,Fj,d3,Kj],e3),Yd=re([Sf,Xo,Ic,$c],Sd),f3=re([Da,Yd],W5),bue=re([Sf],e=>{if(e)return e.dataKey}),xue=re([Sf],e=>{if(e)return e.graphicalItemId}),h3=re([iu,Fj,d3,Kj],n3),wue=re([Ta,Pa,Bt,In,Da,Kj,h3],t3),Sue=re([Sf,wue],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),jue=re([Sf],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Nue=re([h3,Yd,ji,Ic,f3,r3,Fj],i3),Cue=re([Nue],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BP(Object(n),!0).forEach(function(r){_ue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ue(e,t,n){return(t=Oue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oue(e){var t=kue(e,"string");return typeof t=="symbol"?t:t+""}function kue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Aue=()=>Le(xn),Eue=()=>{var e=Aue(),t=Le(Da),n=Le(u3);return Om(!e||!n?void 0:qP(qP({},e),{},{scale:n}),t)};function FP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(n),!0).forEach(function(r){Tue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tue(e,t,n){return(t=Pue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pue(e){var t=zue(e,"string");return typeof t=="symbol"?t:t+""}function zue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mue=(e,t,n,r)=>{var i=t.find(s=>s&&s.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Rue=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var s=i.coordinate,{radius:l}=r;return ac(ac(ac({},r),Rn(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,{angle:f}=r;return ac(ac(ac({},r),Rn(r.cx,r.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Due(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var p3=(e,t,n,r,i)=>{var s,l=(s=t?.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var f,h,m,g,y,v=c>0?(f=n[c-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,w=(m=n[c])===null||m===void 0?void 0:m.coordinate,S=c>=l-1?(g=n[0])===null||g===void 0?void 0:g.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,N=void 0;if(!(v==null||w==null||S==null))if(yi(w-v)!==yi(S-w)){var C=[];if(yi(S-w)===yi(i[1]-i[0])){N=S;var A=w+i[1]-i[0];C[0]=Math.min(A,(A+v)/2),C[1]=Math.max(A,(A+v)/2)}else{N=v;var k=S+i[1]-i[0];C[0]=Math.min(w,(k+w)/2),C[1]=Math.max(w,(k+w)/2)}var _=[Math.min(w,(N+w)/2),Math.max(w,(N+w)/2)];if(e>_[0]&&e<=_[1]||e>=C[0]&&e<=C[1]){var T;return(T=n[c])===null||T===void 0?void 0:T.index}}else{var P=Math.min(v,S),E=Math.max(v,S);if(e>(P+w)/2&&e<=(E+w)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var D=0;D<l;D++){var K=t[D];if(K!=null){var U=t[D+1],I=t[D-1];if(D===0&&U!=null&&e<=(K.coordinate+U.coordinate)/2||D===l-1&&I!=null&&e>(K.coordinate+I.coordinate)/2||D>0&&D<l-1&&I!=null&&U!=null&&e>(K.coordinate+I.coordinate)/2&&e<=(K.coordinate+U.coordinate)/2)return K.index}}return-1},m3=()=>Le(J1),Hj=(e,t)=>t,g3=(e,t,n)=>n,Gj=(e,t,n,r)=>r,Lue=re(Da,e=>Ug(e,t=>t.coordinate)),Vj=re([iu,Hj,g3,Gj],e3),Zj=re([Vj,Xo,Ic,$c],Sd),Iue=(e,t,n)=>{if(t!=null){var r=iu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},y3=re([iu,Hj,g3,Gj],n3),Qm=re([Ta,Pa,Bt,In,Da,Gj,y3],t3),$ue=re([Vj,Qm],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),v3=re([Da,Zj],W5),Uue=re([y3,Zj,ji,Ic,v3,r3,Hj],i3),Bue=re([Vj,Zj],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),que=(e,t,n,r,i,s,l)=>{if(!(!e||!n||!r||!i)&&Due(e,l)){var c=fne(e,t),f=p3(c,s,i,n,r),h=Mue(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},Fue=(e,t,n,r,i,s,l)=>{if(!(!e||!r||!i||!s||!n)){var c=uae(e,n);if(c){var f=hne(c,t),h=p3(f,l,s,r,i),m=Rue(t,s,h,c);return{activeIndex:String(h),activeCoordinate:m}}}},Kue=(e,t,n,r,i,s,l,c)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?que(e,t,r,i,s,l,c):Fue(e,t,n,r,i,s,l)},Hue=re(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Gue=re(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(dr)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Lae}});function KP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(n),!0).forEach(function(r){Vue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vue(e,t,n){return(t=Zue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zue(e){var t=Yue(e,"string");return typeof t=="symbol"?t:t+""}function Yue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wue={},Que={zIndexMap:Object.values(dr).reduce((e,t)=>HP(HP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Wue)},Xue=new Set(Object.values(dr));function Jue(e){return Xue.has(e)}var b3=Kn({name:"zIndex",initialState:Que,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Pt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Jue(n)&&delete e.zIndexMap[n])},prepare:Pt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:Pt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Pt()}}}),{registerZIndexPortal:ede,unregisterZIndexPortal:Mx,registerZIndexPortalElement:tde,unregisterZIndexPortalElement:nde}=b3.actions,rde=b3.reducer;function Ks(e){var{zIndex:t,children:n}=e,r=Zne(),i=r&&t!==void 0&&t!==0,s=Tr(),l=x.useRef(void 0),c=x.useRef(new Set),f=Xt(),h=Le(g=>Hue(g,t,s));if(x.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(v=>{f(Mx({zIndex:v}))}),g.clear(),l.current=void 0;return}if(c.current.has(t)||(f(ede({zIndex:t})),c.current.add(t)),h){l.current=h;var y=c.current;y.forEach(v=>{v!==t&&(f(Mx({zIndex:v})),y.delete(v))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(y=>{f(Mx({zIndex:y}))}),g.clear()}},[f]),!i)return n;var m=h??l.current;return m?tl.createPortal(n,m):null}function pS(){return pS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pS.apply(null,arguments)}function GP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(n),!0).forEach(function(r){ide(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ide(e,t,n){return(t=ade(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ade(e){var t=sde(e,"string");return typeof t=="symbol"?t:t+""}function sde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ode(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function lde(e){var t,{coordinate:n,payload:r,index:i,offset:s,tooltipAxisBandSize:l,layout:c,cursor:f,tooltipEventType:h,chartName:m}=e,g=n,y=r,v=i;if(!f||!g||m!=="ScatterChart"&&h!=="axis")return null;var w,S,N;if(m==="ScatterChart")w=g,S=Sie,N=dr.cursorLine;else if(m==="BarChart")w=jie(c,g,s,l),S=eae,N=dr.cursorRectangle;else if(c==="radial"&&BL(g)){var{cx:C,cy:A,radius:k,startAngle:_,endAngle:T}=a$(g);w={cx:C,cy:A,startAngle:_,endAngle:T,innerRadius:k,outerRadius:k},S=pae,N=dr.cursorLine}else w={points:mae(c,g,s)},S=Up,N=dr.cursorLine;var P=typeof f=="object"&&"className"in f?f.className:void 0,E=wp(wp(wp(wp({stroke:"#ccc",pointerEvents:"none"},s),w),Rg(f)),{},{payload:y,payloadIndex:v,className:bt("recharts-tooltip-cursor",P)});return x.createElement(Ks,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:N},x.createElement(ode,{cursor:f,cursorComp:S,cursorProps:E}))}function cde(e){var t=Eue(),n=Gne(),r=Wc(),i=m3();return t==null||n==null||r==null||i==null?null:x.createElement(lde,pS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var x3=x.createContext(null),ude=()=>x.useContext(x3),Rx={exports:{}},VP;function dde(){return VP||(VP=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,m){this.fn=f,this.context=h,this.once=m||!1}function s(f,h,m,g,y){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,g||f,y),w=n?n+h:h;return f._events[w]?f._events[w].fn?f._events[w]=[f._events[w],v]:f._events[w].push(v):(f._events[w]=v,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],m,g;if(this._eventsCount===0)return h;for(g in m=this._events)t.call(m,g)&&h.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},c.prototype.listeners=function(h){var m=n?n+h:h,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var y=0,v=g.length,w=new Array(v);y<v;y++)w[y]=g[y].fn;return w},c.prototype.listenerCount=function(h){var m=n?n+h:h,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(h,m,g,y,v,w){var S=n?n+h:h;if(!this._events[S])return!1;var N=this._events[S],C=arguments.length,A,k;if(N.fn){switch(N.once&&this.removeListener(h,N.fn,void 0,!0),C){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,m),!0;case 3:return N.fn.call(N.context,m,g),!0;case 4:return N.fn.call(N.context,m,g,y),!0;case 5:return N.fn.call(N.context,m,g,y,v),!0;case 6:return N.fn.call(N.context,m,g,y,v,w),!0}for(k=1,A=new Array(C-1);k<C;k++)A[k-1]=arguments[k];N.fn.apply(N.context,A)}else{var _=N.length,T;for(k=0;k<_;k++)switch(N[k].once&&this.removeListener(h,N[k].fn,void 0,!0),C){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,m);break;case 3:N[k].fn.call(N[k].context,m,g);break;case 4:N[k].fn.call(N[k].context,m,g,y);break;default:if(!A)for(T=1,A=new Array(C-1);T<C;T++)A[T-1]=arguments[T];N[k].fn.apply(N[k].context,A)}}return!0},c.prototype.on=function(h,m,g){return s(this,h,m,g,!1)},c.prototype.once=function(h,m,g){return s(this,h,m,g,!0)},c.prototype.removeListener=function(h,m,g,y){var v=n?n+h:h;if(!this._events[v])return this;if(!m)return l(this,v),this;var w=this._events[v];if(w.fn)w.fn===m&&(!y||w.once)&&(!g||w.context===g)&&l(this,v);else{for(var S=0,N=[],C=w.length;S<C;S++)(w[S].fn!==m||y&&!w[S].once||g&&w[S].context!==g)&&N.push(w[S]);N.length?this._events[v]=N.length===1?N[0]:N:l(this,v)}return this},c.prototype.removeAllListeners=function(h){var m;return h?(m=n?n+h:h,this._events[m]&&l(this,m)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Rx)),Rx.exports}var fde=dde();const hde=Rs(fde);var Wd=new hde,mS="recharts.syncEvent.tooltip",ZP="recharts.syncEvent.brush",pde=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Gi(n))return e[n]}},mde={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},w3=Kn({name:"options",initialState:mde,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),gde=w3.reducer,{createEventEmitter:yde}=w3.actions;function vde(e){return e.tooltip.syncInteraction}var bde={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},S3=Kn({name:"chartData",initialState:bde,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:YP,setDataStartEndIndexes:xde,setComputedData:wye}=S3.actions,wde=S3.reducer,Sde=["x","y"];function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){jde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jde(e,t,n){return(t=Nde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nde(e){var t=Cde(e,"string");return typeof t=="symbol"?t:t+""}function Cde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _de(e,t){if(e==null)return{};var n,r,i=Ode(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ode(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kde(){var e=Le(ej),t=Le(tj),n=Xt(),r=Le(x$),i=Le(Da),s=Wc(),l=ey(),c=Le(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return Yc;var f=(h,m,g)=>{if(t!==g&&e===h){if(m.payload.active===!1){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(l&&m!==null&&m!==void 0&&(y=m.payload)!==null&&y!==void 0&&y.coordinate&&m.payload.sourceViewBox){var v=m.payload.coordinate,{x:w,y:S}=v,N=_de(v,Sde),{x:C,y:A,width:k,height:_}=m.payload.sourceViewBox,T=sc(sc({},N),{},{x:l.x+(k?(w-C)/k:0)*l.width,y:l.y+(_?(S-A)/_:0)*l.height});n(sc(sc({},m),{},{payload:sc(sc({},m.payload),{},{coordinate:T})}))}else n(m);return}if(i!=null){var P;if(typeof r=="function"){var E={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},z=r(i,E);P=i[z]}else r==="value"&&(P=i.find(G=>String(G.value)===m.payload.label));var{coordinate:D}=m.payload;if(D==null||l==null){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(P==null){n(gd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:K,y:U}=D,I=Math.min(K,l.x+l.width),H=Math.min(U,l.y+l.height),ge={x:s==="horizontal"?P.coordinate:I,y:s==="horizontal"?H:P.coordinate},me=gd({active:m.payload.active,coordinate:ge,dataKey:m.payload.dataKey,index:String(P.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(me)}}};return Wd.on(mS,f),()=>{Wd.off(mS,f)}},[c,n,t,e,r,i,s,l])}function Ade(){var e=Le(ej),t=Le(tj),n=Xt();x.useEffect(()=>{if(e==null)return Yc;var r=(i,s,l)=>{t!==l&&e===i&&n(xde(s))};return Wd.on(ZP,r),()=>{Wd.off(ZP,r)}},[n,t,e])}function Ede(){var e=Xt();x.useEffect(()=>{e(yde())},[e]),kde(),Ade()}function Tde(e,t,n,r,i,s){var l=Le(w=>Iue(w,e,t)),c=Le(xue),f=Le(tj),h=Le(ej),m=Le(x$),g=Le(vde),y=g?.sourceViewBox!=null,v=ey();x.useEffect(()=>{if(!y&&h!=null&&f!=null){var w=gd({active:s,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Wd.emit(mS,h,w,f)}},[y,n,l,c,i,r,f,h,m,s,v])}function QP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(r){Pde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pde(e,t,n){return(t=zde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zde(e){var t=Mde(e,"string");return typeof t=="symbol"?t:t+""}function Mde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rde(e){return e.dataKey}function Dde(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Qre,t)}var JP=[],Lde={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Ide(e){var t,n,r=Er(e,Lde),{active:i,allowEscapeViewBox:s,animationDuration:l,animationEasing:c,content:f,filterNull:h,isAnimationActive:m,offset:g,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:N,cursor:C,shared:A,trigger:k,defaultIndex:_,portal:T,axisId:P}=r,E=Xt(),z=typeof _=="number"?String(_):_;x.useEffect(()=>{E(kce({shared:A,trigger:k,axisId:P,active:i,defaultIndex:z}))},[E,A,k,P,i,z]);var D=ey(),K=JI(),U=Sce(A),{activeIndex:I,isActive:H}=(t=Le(we=>Bue(we,U,k,z)))!==null&&t!==void 0?t:{},ge=Le(we=>Uue(we,U,k,z)),me=Le(we=>v3(we,U,k,z)),G=Le(we=>$ue(we,U,k,z)),ae=ge,pe=ude(),xe=(n=i??H)!==null&&n!==void 0?n:!1,[B,R]=iI([ae,xe]),V=U==="axis"?me:void 0;Tde(U,k,G,V,I,xe);var X=T??pe;if(X==null||D==null||U==null)return null;var q=ae??JP;xe||(q=JP),h&&q.length&&(q=JL(q.filter(we=>we.value!=null&&(we.hide!==!0||r.includeHidden)),y,Rde));var W=q.length>0,ie=XP(XP({},r),{},{payload:q,label:V,active:xe,activeIndex:I,coordinate:G,accessibilityLayer:K}),ye=x.createElement(lie,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:m,active:xe,coordinate:G,hasPayload:W,offset:g,position:v,reverseDirection:w,useTranslate3d:S,viewBox:D,wrapperStyle:N,lastBoundingBox:B,innerRef:R,hasPortalFromProps:!!T},Dde(f,ie));return x.createElement(x.Fragment,null,tl.createPortal(ye,X),xe&&x.createElement(cde,{cursor:C,tooltipEventType:U,coordinate:G,payload:q,index:I}))}function $de(e,t,n){return(t=Ude(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ude(e){var t=Bde(e,"string");return typeof t=="symbol"?t:t+""}function Bde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class qde{constructor(t){$de(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fde(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ez(Object(n),!0).forEach(function(r){Kde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kde(e,t,n){return(t=Hde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hde(e){var t=Gde(e,"string");return typeof t=="symbol"?t:t+""}function Gde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vde={cacheSize:2e3,enableCache:!0},j3=Fde({},Vde),tz=new qde(j3.cacheSize),Zde={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},nz="recharts_measurement_span";function Yde(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",s=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(s,"|").concat(l,"|").concat(c)}var rz=(e,t)=>{try{var n=document.getElementById(nz);n||(n=document.createElement("span"),n.setAttribute("id",nz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Zde,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},jd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||hf.isSsr)return{width:0,height:0};if(!j3.enableCache)return rz(t,n);var r=Yde(t,n),i=tz.get(r);if(i)return i;var s=rz(t,n);return tz.set(r,s),s},N3;function Wde(e,t,n){return(t=Qde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qde(e){var t=Xde(e,"string");return typeof t=="symbol"?t:t+""}function Xde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,az=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Jde=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,efe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,tfe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},nfe=["cm","mm","pt","pc","in","Q","px"];function rfe(e){return nfe.includes(e)}var yc="NaN";function ife(e,t){return e*tfe[t]}class Mn{static parse(t){var n,[,r,i]=(n=efe.exec(t))!==null&&n!==void 0?n:[];return r==null?Mn.NaN:new Mn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Gi(t)&&(this.unit=""),n!==""&&!Jde.test(n)&&(this.num=NaN,this.unit=""),rfe(n)&&(this.num=ife(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Mn(NaN,""):new Mn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Mn(NaN,""):new Mn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mn(NaN,""):new Mn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mn(NaN,""):new Mn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Gi(this.num)}}N3=Mn;Wde(Mn,"NaN",new N3(NaN,""));function C3(e){if(e==null||e.includes(yc))return yc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=iz.exec(t))!==null&&n!==void 0?n:[],l=Mn.parse(r??""),c=Mn.parse(s??""),f=i==="*"?l.multiply(c):l.divide(c);if(f.isNaN())return yc;t=t.replace(iz,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,m,g,y]=(h=az.exec(t))!==null&&h!==void 0?h:[],v=Mn.parse(m??""),w=Mn.parse(y??""),S=g==="+"?v.add(w):v.subtract(w);if(S.isNaN())return yc;t=t.replace(az,S.toString())}return t}var sz=/\(([^()]*)\)/;function afe(e){for(var t=e,n;(n=sz.exec(t))!=null;){var[,r]=n;t=t.replace(sz,C3(r))}return t}function sfe(e){var t=e.replace(/\s+/g,"");return t=afe(t),t=C3(t),t}function ofe(e){try{return sfe(e)}catch{return yc}}function Dx(e){var t=ofe(e.slice(5,-1));return t===yc?"":t}var lfe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],cfe=["dx","dy","angle","className","breakAll"];function gS(){return gS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gS.apply(null,arguments)}function oz(e,t){if(e==null)return{};var n,r,i=ufe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ufe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _3=/[ \f\n\r\t\v\u2028\u2029]+/,O3=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Dn(t)||(n?i=t.toString().split(""):i=t.toString().split(_3));var s=i.map(c=>({word:c,width:jd(c,r).width})),l=n?0:jd(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}};function k3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function dfe(e){return Dn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var A3=(e,t,n,r)=>e.reduce((i,s)=>{var{word:l,width:c}=s,f=i[i.length-1];if(f&&c!=null&&(t==null||r||f.width+c+n<Number(t)))f.words.push(l),f.width+=c+n;else{var h={words:[l],width:c};i.push(h)}return i},[]),E3=e=>e.reduce((t,n)=>t.width>n.width?t:n),ffe="…",lz=(e,t,n,r,i,s,l,c)=>{var f=e.slice(0,t),h=O3({breakAll:n,style:r,children:f+ffe});if(!h)return[!1,[]];var m=A3(h.wordsWithComputedWidth,s,l,c),g=m.length>i||E3(m).width>Number(s);return[g,m]},hfe=(e,t,n,r,i)=>{var{maxLines:s,children:l,style:c,breakAll:f}=e,h=Pe(s),m=String(l),g=A3(t,r,n,i);if(!h||i)return g;var y=g.length>s||E3(g).width>Number(r);if(!y)return g;for(var v=0,w=m.length-1,S=0,N;v<=w&&S<=m.length-1;){var C=Math.floor((v+w)/2),A=C-1,[k,_]=lz(m,A,f,c,s,r,n,i),[T]=lz(m,C,f,c,s,r,n,i);if(!k&&!T&&(v=C+1),k&&T&&(w=C-1),!k&&T){N=_;break}S++}return N||g},cz=e=>{var t=Dn(e)?[]:e.toString().split(_3);return[{words:t,width:void 0}]},pfe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:l}=e;if((t||n)&&!hf.isSsr){var c,f,h=O3({breakAll:s,children:r,style:i});if(h){var{wordsWithComputedWidth:m,spaceWidth:g}=h;c=m,f=g}else return cz(r);return hfe({breakAll:s,children:r,maxLines:l,style:i},c,f,t,!!n)}return cz(r)},T3="#808080",mfe={angle:0,breakAll:!1,capHeight:"0.71em",fill:T3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Yj=x.forwardRef((e,t)=>{var n=Er(e,mfe),{x:r,y:i,lineHeight:s,capHeight:l,fill:c,scaleToFit:f,textAnchor:h,verticalAnchor:m}=n,g=oz(n,lfe),y=x.useMemo(()=>pfe({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),{dx:v,dy:w,angle:S,className:N,breakAll:C}=g,A=oz(g,cfe);if(!Vi(r)||!Vi(i)||y.length===0)return null;var k=Number(r)+(Pe(v)?v:0),_=Number(i)+(Pe(w)?w:0);if(!ct(k)||!ct(_))return null;var T;switch(m){case"start":T=Dx("calc(".concat(l,")"));break;case"middle":T=Dx("calc(".concat((y.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:T=Dx("calc(".concat(y.length-1," * -").concat(s,")"));break}var P=[],E=y[0];if(f&&E!=null){var z=E.width,{width:D}=g;P.push("scale(".concat(Pe(D)&&Pe(z)?D/z:1,")"))}return S&&P.push("rotate(".concat(S,", ").concat(k,", ").concat(_,")")),P.length&&(A.transform=P.join(" ")),x.createElement("text",gS({},Or(A),{ref:t,x:k,y:_,className:bt("recharts-text",N),textAnchor:h,fill:c.includes("url")?T3:c}),y.map((K,U)=>{var I=K.words.join(C?"":" ");return x.createElement("tspan",{x:k,dy:U===0?T:s,key:"".concat(I,"-").concat(U)},I)}))});Yj.displayName="Text";function uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uz(Object(n),!0).forEach(function(r){gfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gfe(e,t,n){return(t=yfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yfe(e){var t=vfe(e,"string");return typeof t=="symbol"?t:t+""}function vfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bfe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:l,height:c,upperWidth:f,lowerWidth:h}=H1(t),m=s,g=s+(f-h)/2,y=(m+g)/2,v=(f+h)/2,w=m+f/2,S=c>=0?1:-1,N=S*r,C=S>0?"end":"start",A=S>0?"start":"end",k=f>=0?1:-1,_=k*r,T=k>0?"end":"start",P=k>0?"start":"end",E=i;if(n==="top"){var z={x:m+f/2,y:l-N,horizontalAnchor:"middle",verticalAnchor:C};return E&&(z.height=Math.max(l-E.y,0),z.width=f),z}if(n==="bottom"){var D={x:g+h/2,y:l+c+N,horizontalAnchor:"middle",verticalAnchor:A};return E&&(D.height=Math.max(E.y+E.height-(l+c),0),D.width=h),D}if(n==="left"){var K={x:y-_,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return E&&(K.width=Math.max(K.x-E.x,0),K.height=c),K}if(n==="right"){var U={x:y+v+_,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return E&&(U.width=Math.max(E.x+E.width-U.x,0),U.height=c),U}var I=E?{width:v,height:c}:{};return n==="insideLeft"?Mi({x:y+_,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"},I):n==="insideRight"?Mi({x:y+v-_,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"},I):n==="insideTop"?Mi({x:m+f/2,y:l+N,horizontalAnchor:"middle",verticalAnchor:A},I):n==="insideBottom"?Mi({x:g+h/2,y:l+c-N,horizontalAnchor:"middle",verticalAnchor:C},I):n==="insideTopLeft"?Mi({x:m+_,y:l+N,horizontalAnchor:P,verticalAnchor:A},I):n==="insideTopRight"?Mi({x:m+f-_,y:l+N,horizontalAnchor:T,verticalAnchor:A},I):n==="insideBottomLeft"?Mi({x:g+_,y:l+c-N,horizontalAnchor:P,verticalAnchor:C},I):n==="insideBottomRight"?Mi({x:g+h-_,y:l+c-N,horizontalAnchor:T,verticalAnchor:C},I):n&&typeof n=="object"&&(Pe(n.x)||Vo(n.x))&&(Pe(n.y)||Vo(n.y))?Mi({x:s+zs(n.x,v),y:l+zs(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},I):Mi({x:w,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},I)},xfe=["labelRef"],wfe=["content"];function dz(e,t){if(e==null)return{};var n,r,i=Sfe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fz(Object(n),!0).forEach(function(r){jfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jfe(e,t,n){return(t=Nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nfe(e){var t=Cfe(e,"string");return typeof t=="symbol"?t:t+""}function Cfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xa.apply(null,arguments)}var P3=x.createContext(null),_fe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l,children:c}=e,f=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l}),[t,n,r,i,s,l]);return x.createElement(P3.Provider,{value:f},c)},z3=()=>{var e=x.useContext(P3),t=ey();return e||(t?H1(t):void 0)},Ofe=x.createContext(null),kfe=()=>{var e=x.useContext(Ofe),t=Le(C$);return e||t},Afe=e=>{var{value:t,formatter:n}=e,r=Dn(e.children)?t:e.children;return typeof n=="function"?n(r):r},Wj=e=>e!=null&&typeof e=="function",Efe=(e,t)=>{var n=yi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Tfe=(e,t,n,r,i)=>{var{offset:s,className:l}=e,{cx:c,cy:f,innerRadius:h,outerRadius:m,startAngle:g,endAngle:y,clockWise:v}=i,w=(h+m)/2,S=Efe(g,y),N=S>=0?1:-1,C,A;switch(t){case"insideStart":C=g+N*s,A=v;break;case"insideEnd":C=y-N*s,A=!v;break;case"end":C=y+N*s,A=v;break;default:throw new Error("Unsupported position ".concat(t))}A=S<=0?A:!A;var k=Rn(c,f,w,C),_=Rn(c,f,w,C+(A?1:-1)*359),T="M".concat(k.x,",").concat(k.y,`
267
+ A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`,
268
+ `).concat(_.x,",").concat(_.y),P=Dn(e.id)?Dd("recharts-radial-line-"):e.id;return x.createElement("text",xa({},r,{dominantBaseline:"central",className:bt("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:P,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Pfe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:c,endAngle:f}=e,h=(c+f)/2;if(n==="outside"){var{x:m,y:g}=Rn(r,i,l+t,h);return{x:m,y:g,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(s+l)/2,{x:v,y:w}=Rn(r,i,y,h);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Bp=e=>e!=null&&"cx"in e&&Pe(e.cx),zfe={angle:0,offset:5,zIndex:dr.label,position:"middle",textBreakAll:!1};function Mfe(e){if(!Bp(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function vs(e){var t=Er(e,zfe),{viewBox:n,parentViewBox:r,position:i,value:s,children:l,content:c,className:f="",textBreakAll:h,labelRef:m}=t,g=kfe(),y=z3(),v=i==="center"?y:g??y,w,S,N;n==null?w=v:Bp(n)?w=n:w=H1(n);var C=Mfe(w);if(!w||Dn(s)&&Dn(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var A=yd(yd({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:k}=A,_=dz(A,xfe);return x.cloneElement(c,_)}if(typeof c=="function"){var{content:T}=A,P=dz(A,wfe);if(S=x.createElement(c,P),x.isValidElement(S))return S}else S=Afe(t);var E=Or(t);if(Bp(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Tfe(t,i,S,E,w);N=Pfe(w,t.offset,t.position)}else{if(!C)return null;var z=bfe({viewBox:C,position:i,offset:t.offset,parentViewBox:Bp(r)?void 0:r});N=yd(yd({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return x.createElement(Ks,{zIndex:t.zIndex},x.createElement(Yj,xa({ref:m,className:bt("recharts-label",f)},E,N,{textAnchor:k3(E.textAnchor)?E.textAnchor:N.textAnchor,breakAll:h}),S))}vs.displayName="Label";var Rfe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(vs,xa({key:"label-implicit"},r)):Vi(e)?x.createElement(vs,xa({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===vs?x.cloneElement(e,yd({key:"label-implicit"},r)):x.createElement(vs,xa({key:"label-implicit",content:e},r)):Wj(e)?x.createElement(vs,xa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(vs,xa({},e,{key:"label-implicit"},r)):null};function Dfe(e){var{label:t,labelRef:n}=e,r=z3();return Rfe(t,r,n)||null}var Lfe=["valueAccessor"],Ife=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xm(){return Xm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xm.apply(null,arguments)}function hz(e,t){if(e==null)return{};var n,r,i=$fe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ufe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(dfe(t))return t},M3=x.createContext(void 0),Bfe=M3.Provider,R3=x.createContext(void 0);R3.Provider;function qfe(){return x.useContext(M3)}function Ffe(){return x.useContext(R3)}function qp(e){var{valueAccessor:t=Ufe}=e,n=hz(e,Lfe),{dataKey:r,clockWise:i,id:s,textBreakAll:l,zIndex:c}=n,f=hz(n,Ife),h=qfe(),m=Ffe(),g=h||m;return!g||!g.length?null:x.createElement(Ks,{zIndex:c??dr.label},x.createElement(Hi,{className:"recharts-label-list"},g.map((y,v)=>{var w,S=Dn(r)?t(y,v):Nn(y.payload,r),N=Dn(s)?{}:{id:"".concat(s,"-").concat(v)};return x.createElement(vs,Xm({key:"label-".concat(v)},Or(y),f,N,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:l,viewBox:y.viewBox,index:v,zIndex:0}))})))}qp.displayName="LabelList";function Kfe(e){var{label:t}=e;return t?t===!0?x.createElement(qp,{key:"labelList-implicit"}):x.isValidElement(t)||Wj(t)?x.createElement(qp,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(qp,Xm({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function yS(){return yS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yS.apply(null,arguments)}var D3=e=>{var{cx:t,cy:n,r,className:i}=e,s=bt("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?x.createElement("circle",yS({},Ki(e),R1(e),{className:s,cx:t,cy:n,r})):null},Hfe={radiusAxis:{},angleAxis:{}},L3=Kn({name:"polarAxis",initialState:Hfe,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:Sye,removeRadiusAxis:jye,addAngleAxis:Nye,removeAngleAxis:Cye}=L3.actions,Gfe=L3.reducer;function Vfe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var Lx={exports:{}},Nt={};var pz;function Zfe(){if(pz)return Nt;pz=1;var e=60103,t=60106,n=60107,r=60108,i=60114,s=60109,l=60110,c=60112,f=60113,h=60120,m=60115,g=60116,y=60121,v=60122,w=60117,S=60129,N=60131;if(typeof Symbol=="function"&&Symbol.for){var C=Symbol.for;e=C("react.element"),t=C("react.portal"),n=C("react.fragment"),r=C("react.strict_mode"),i=C("react.profiler"),s=C("react.provider"),l=C("react.context"),c=C("react.forward_ref"),f=C("react.suspense"),h=C("react.suspense_list"),m=C("react.memo"),g=C("react.lazy"),y=C("react.block"),v=C("react.server.block"),w=C("react.fundamental"),S=C("react.debug_trace_mode"),N=C("react.legacy_hidden")}function A(H){if(typeof H=="object"&&H!==null){var ge=H.$$typeof;switch(ge){case e:switch(H=H.type,H){case n:case i:case r:case f:case h:return H;default:switch(H=H&&H.$$typeof,H){case l:case c:case g:case m:case s:return H;default:return ge}}case t:return ge}}}var k=s,_=e,T=c,P=n,E=g,z=m,D=t,K=i,U=r,I=f;return Nt.ContextConsumer=l,Nt.ContextProvider=k,Nt.Element=_,Nt.ForwardRef=T,Nt.Fragment=P,Nt.Lazy=E,Nt.Memo=z,Nt.Portal=D,Nt.Profiler=K,Nt.StrictMode=U,Nt.Suspense=I,Nt.isAsyncMode=function(){return!1},Nt.isConcurrentMode=function(){return!1},Nt.isContextConsumer=function(H){return A(H)===l},Nt.isContextProvider=function(H){return A(H)===s},Nt.isElement=function(H){return typeof H=="object"&&H!==null&&H.$$typeof===e},Nt.isForwardRef=function(H){return A(H)===c},Nt.isFragment=function(H){return A(H)===n},Nt.isLazy=function(H){return A(H)===g},Nt.isMemo=function(H){return A(H)===m},Nt.isPortal=function(H){return A(H)===t},Nt.isProfiler=function(H){return A(H)===i},Nt.isStrictMode=function(H){return A(H)===r},Nt.isSuspense=function(H){return A(H)===f},Nt.isValidElementType=function(H){return typeof H=="string"||typeof H=="function"||H===n||H===i||H===S||H===r||H===f||H===h||H===N||typeof H=="object"&&H!==null&&(H.$$typeof===g||H.$$typeof===m||H.$$typeof===s||H.$$typeof===l||H.$$typeof===c||H.$$typeof===w||H.$$typeof===y||H[0]===v)},Nt.typeOf=A,Nt}var mz;function Yfe(){return mz||(mz=1,Lx.exports=Zfe()),Lx.exports}Yfe();var I3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Wfe(e){var{tooltipEntrySettings:t}=e,n=Xt(),r=Tr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Cce(t)):i.current!==t&&n(_ce({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(Oce(i.current)),i.current=null)},[n]),null}function Qfe(e){var{legendPayload:t}=e,n=Xt(),r=Tr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(lre(t)):i.current!==t&&n(cre({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(ure(i.current)),i.current=null)},[n]),null}var Ix,Xfe=()=>{var[e]=x.useState(()=>Dd("uid-"));return e},Jfe=(Ix=rg.useId)!==null&&Ix!==void 0?Ix:Xfe;function ehe(e,t){var n=Jfe();return t||(e?"".concat(e,"-").concat(n):n)}var the=x.createContext(void 0),nhe=e=>{var{id:t,type:n,children:r}=e,i=ehe("recharts-".concat(n),t);return x.createElement(the.Provider,{value:i},r(i))},rhe={cartesianItems:[],polarItems:[]},$3=Kn({name:"graphicalItems",initialState:rhe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Pt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Yr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Pt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Yr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Pt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Pt()},removePolarGraphicalItem:{reducer(e,t){var n=Yr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Pt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Yr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Pt()}}}),{addCartesianGraphicalItem:ihe,replaceCartesianGraphicalItem:ahe,removeCartesianGraphicalItem:she,addPolarGraphicalItem:_ye,removePolarGraphicalItem:Oye,replacePolarGraphicalItem:kye}=$3.actions,ohe=$3.reducer,lhe=e=>{var t=Xt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(ihe(e)):n.current!==e&&t(ahe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(she(n.current)),n.current=null)},[t]),null},che=x.memo(lhe),uhe=["points"];function gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gz(Object(n),!0).forEach(function(r){dhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dhe(e,t,n){return(t=fhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fhe(e){var t=hhe(e,"string");return typeof t=="symbol"?t:t+""}function hhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jm.apply(null,arguments)}function phe(e,t){if(e==null)return{};var n,r,i=mhe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mhe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ghe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=bt(r,typeof t!="boolean"?t.className:""),s=n??{},{points:l}=s,c=phe(s,uhe);return x.createElement(D3,Jm({},c,{className:i}))}function yhe(e,t){return e==null?!1:t?!0:e.length===1}function vhe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:s,baseProps:l,needClip:c,clipPathId:f,zIndex:h=dr.scatter}=e;if(!yhe(t,n))return null;var m=I3(n),g=ZX(n),y=t.map((w,S)=>{var N,C,A=$x($x($x({r:3},l),g),{},{index:S,cx:(N=w.x)!==null&&N!==void 0?N:void 0,cy:(C=w.y)!==null&&C!==void 0?C:void 0,dataKey:s,value:w.value,payload:w.payload,points:t});return x.createElement(ghe,{key:"dot-".concat(S),option:n,dotProps:A,className:i})}),v={};return c&&f!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(f,")")),x.createElement(Ks,{zIndex:h},x.createElement(Hi,Jm({className:r},v),y))}function yz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yz(Object(n),!0).forEach(function(r){bhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bhe(e,t,n){return(t=xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xhe(e){var t=whe(e,"string");return typeof t=="symbol"?t:t+""}function whe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var U3=0,She={xAxis:{},yAxis:{},zAxis:{}},B3=Kn({name:"cartesianAxis",initialState:She,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Pt()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Pt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Pt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Pt()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Pt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Pt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Pt()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Pt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Pt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var s,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,r].slice(-3);e.yAxis[n]=vz(vz({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:jhe,replaceXAxis:Nhe,removeXAxis:Che,addYAxis:_he,replaceYAxis:Ohe,removeYAxis:khe,addZAxis:Aye,replaceZAxis:Eye,removeZAxis:Tye,updateYAxisWidth:Ahe}=B3.actions,Ehe=B3.reducer,The=re([In],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Phe=re([The,Ta,Pa],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Qj=()=>Le(Phe),zhe=()=>Le(Cue);function bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ux(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bz(Object(n),!0).forEach(function(r){Mhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mhe(e,t,n){return(t=Rhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rhe(e){var t=Dhe(e,"string");return typeof t=="symbol"?t:t+""}function Dhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lhe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:s,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Ux(Ux(Ux({},c),Rg(i)),R1(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(D3,f),x.createElement(Hi,{className:"recharts-active-dot",clipPath:l},h)};function xz(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:l=dr.activeDot}=e,c=Le(Yd),f=zhe();if(t==null||f==null)return null;var h=t.find(m=>f.includes(m.payload));return Dn(h)?null:x.createElement(Ks,{zIndex:l},x.createElement(Lhe,{point:h,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var Ihe=e=>{var{chartData:t}=e,n=Xt(),r=Tr();return x.useEffect(()=>r?()=>{}:(n(YP(t)),()=>{n(YP(void 0))}),[t,n,r]),null},wz={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},q3=Kn({name:"brush",initialState:wz,reducers:{setBrushSettings(e,t){return t.payload==null?wz:t.payload}}}),{setBrushSettings:Pye}=q3.actions,$he=q3.reducer;function Uhe(e){return(e%180+180)%180}var Bhe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Uhe(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},qhe={dots:[],areas:[],lines:[]},F3=Kn({name:"referenceElements",initialState:qhe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Yr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Yr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Yr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:zye,removeDot:Mye,addArea:Rye,removeArea:Dye,addLine:Lye,removeLine:Iye}=F3.actions,Fhe=F3.reducer,Khe=x.createContext(void 0),Hhe=e=>{var{children:t}=e,[n]=x.useState("".concat(Dd("recharts"),"-clip")),r=Qj();if(r==null)return null;var{x:i,y:s,width:l,height:c}=r;return x.createElement(Khe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:s,height:c,width:l}))),t)};function K3(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Ghe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Bhe(r,n)}function Vhe(e,t,n){var r=n==="width",{x:i,y:s,width:l,height:c}=e;return t===1?{start:r?i:s,end:r?i+l:s+c}:{start:r?i+l:s+c,end:r?i:s}}function Qd(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function Zhe(e,t){return K3(e,t+1)}function Yhe(e,t,n,r,i){for(var s=(r||[]).slice(),{start:l,end:c}=t,f=0,h=1,m=l,g=function(){var w=r?.[f];if(w===void 0)return{v:K3(r,h)};var S=f,N,C=()=>(N===void 0&&(N=n(w,S)),N),A=w.coordinate,k=f===0||Qd(e,A,C,m,c);k||(f=0,m=l,h+=1),k&&(m=A+e*(C()/2+i),f+=h)},y;h<=s.length;)if(y=g(),y)return y.v;return[]}function Whe(e,t,n,r,i){var s=(r||[]).slice(),l=s.length;if(l===0)return[];for(var{start:c,end:f}=t,h=1;h<=l;h++){for(var m=(l-1)%h,g=c,y=!0,v=function(){var _=r[S];if(_==null)return 0;var T=S,P,E=()=>(P===void 0&&(P=n(_,T)),P),z=_.coordinate,D=S===m||Qd(e,z,E,g,f);if(!D)return y=!1,1;D&&(g=z+e*(E()/2+i))},w,S=m;S<l&&(w=v(),!(w!==0&&w===1));S+=h);if(y){for(var N=[],C=m;C<l;C+=h){var A=r[C];A!=null&&N.push(A)}return N}}return[]}function Sz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sz(Object(n),!0).forEach(function(r){Qhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qhe(e,t,n){return(t=Xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xhe(e){var t=Jhe(e,"string");return typeof t=="symbol"?t:t+""}function Jhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function epe(e,t,n,r,i){for(var s=(r||[]).slice(),l=s.length,{start:c}=t,{end:f}=t,h=function(y){var v=s[y];if(v==null)return 1;var w=v,S,N=()=>(S===void 0&&(S=n(v,y)),S);if(y===l-1){var C=e*(w.coordinate+e*N()/2-f);s[y]=w=Bn(Bn({},w),{},{tickCoord:C>0?w.coordinate-C*e:w.coordinate})}else s[y]=w=Bn(Bn({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var A=Qd(e,w.tickCoord,N,c,f);A&&(f=w.tickCoord-e*(N()/2+i),s[y]=Bn(Bn({},w),{},{isShow:!0}))}},m=l-1;m>=0;m--)h(m);return s}function tpe(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,{start:f,end:h}=t;if(s){var m=r[c-1];if(m!=null){var g=n(m,c-1),y=e*(m.coordinate+e*g/2-h);if(l[c-1]=m=Bn(Bn({},m),{},{tickCoord:y>0?m.coordinate-y*e:m.coordinate}),m.tickCoord!=null){var v=Qd(e,m.tickCoord,()=>g,f,h);v&&(h=m.tickCoord-e*(g/2+i),l[c-1]=Bn(Bn({},m),{},{isShow:!0}))}}}for(var w=s?c-1:c,S=function(A){var k=l[A];if(k==null)return 1;var _=k,T,P=()=>(T===void 0&&(T=n(k,A)),T);if(A===0){var E=e*(_.coordinate-e*P()/2-f);l[A]=_=Bn(Bn({},_),{},{tickCoord:E<0?_.coordinate-E*e:_.coordinate})}else l[A]=_=Bn(Bn({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var z=Qd(e,_.tickCoord,P,f,h);z&&(f=_.tickCoord+e*(P()/2+i),l[A]=Bn(Bn({},_),{},{isShow:!0}))}},N=0;N<w;N++)S(N);return l}function npe(e,t,n){var{tick:r,ticks:i,viewBox:s,minTickGap:l,orientation:c,interval:f,tickFormatter:h,unit:m,angle:g}=e;if(!i||!i.length||!r)return[];if(Pe(f)||hf.isSsr){var y;return(y=Zhe(i,Pe(f)?f:0))!==null&&y!==void 0?y:[]}var v=[],w=c==="top"||c==="bottom"?"width":"height",S=m&&w==="width"?jd(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},N=(T,P)=>{var E=typeof h=="function"?h(T.value,P):T.value;return w==="width"?Ghe(jd(E,{fontSize:t,letterSpacing:n}),S,g):jd(E,{fontSize:t,letterSpacing:n})[w]},C=i[0],A=i[1],k=i.length>=2&&C!=null&&A!=null?yi(A.coordinate-C.coordinate):1,_=Vhe(s,k,w);return f==="equidistantPreserveStart"?Yhe(k,_,N,i,l):f==="equidistantPreserveEnd"?Whe(k,_,N,i,l):(f==="preserveStart"||f==="preserveStartEnd"?v=tpe(k,_,N,i,l,f==="preserveStartEnd"):v=epe(k,_,N,i,l),v.filter(T=>T.isShow))}var rpe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:s=0}=e,l=0;if(t){Array.from(t).forEach(m=>{if(m){var g=m.getBoundingClientRect();g.width>l&&(l=g.width)}});var c=n?n.getBoundingClientRect().width:0,f=i+s,h=l+f+c+(n?r:0);return Math.round(h)}return 0},ipe={xAxis:{},yAxis:{}},H3=Kn({name:"renderedTicks",initialState:ipe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:ape,removeRenderedTicks:spe}=H3.actions,ope=H3.reducer,lpe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function cpe(e,t){if(e==null)return{};var n,r,i=upe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function upe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jo.apply(null,arguments)}function jz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jz(Object(n),!0).forEach(function(r){dpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dpe(e,t,n){return(t=fpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fpe(e){var t=hpe(e,"string");return typeof t=="symbol"?t:t+""}function hpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $o={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",zIndex:dr.axis};function ppe(e){var{x:t,y:n,width:r,height:i,orientation:s,mirror:l,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var h=Wt(Wt(Wt({},f),Ki(c)),{},{fill:"none"});if(s==="top"||s==="bottom"){var m=+(s==="top"&&!l||s==="bottom"&&l);h=Wt(Wt({},h),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var g=+(s==="left"&&!l||s==="right"&&l);h=Wt(Wt({},h),{},{x1:t+g*r,y1:n,x2:t+g*r,y2:n+i})}return x.createElement("line",Jo({},h,{className:bt("recharts-cartesian-axis-line",$g(c,"className"))}))}function mpe(e,t,n,r,i,s,l,c,f){var h,m,g,y,v,w,S=c?-1:1,N=e.tickSize||l,C=Pe(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":h=m=e.coordinate,y=n+ +!c*i,g=y-S*N,w=g-S*f,v=C;break;case"left":g=y=e.coordinate,m=t+ +!c*r,h=m-S*N,v=h-S*f,w=C;break;case"right":g=y=e.coordinate,m=t+ +c*r,h=m+S*N,v=h+S*f,w=C;break;default:h=m=e.coordinate,y=n+ +c*i,g=y+S*N,w=g+S*f,v=C;break}return{line:{x1:h,y1:g,x2:m,y2:y},tick:{x:v,y:w}}}function gpe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ype(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function vpe(e){var{option:t,tickProps:n,value:r}=e,i,s=bt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Wt(Wt({},n),{},{className:s}));else if(typeof t=="function")i=t(Wt(Wt({},n),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=bt(l,Vfe(t))),i=x.createElement(Yj,Jo({},n,{className:l}),r)}return i}function bpe(e){var{ticks:t,axisType:n,axisId:r}=e,i=Xt();return x.useEffect(()=>{if(r==null||n==null)return Yc;var s=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(ape({ticks:s,axisId:r,axisType:n})),()=>{i(spe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var xpe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:s,tickFormatter:l,unit:c,padding:f,tickTextProps:h,orientation:m,mirror:g,x:y,y:v,width:w,height:S,tickSize:N,tickMargin:C,fontSize:A,letterSpacing:k,getTicksConfig:_,events:T,axisType:P,axisId:E}=e,z=npe(Wt(Wt({},_),{},{ticks:n}),A,k),D=Ki(_),K=Rg(r),U=k3(D.textAnchor)?D.textAnchor:gpe(m,g),I=ype(m,g),H={};typeof i=="object"&&(H=i);var ge=Wt(Wt({},D),{},{fill:"none"},H),me=z.map(pe=>Wt({entry:pe},mpe(pe,y,v,w,S,m,N,g,C))),G=me.map(pe=>{var{entry:xe,line:B}=pe;return x.createElement(Hi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(xe.value,"-").concat(xe.coordinate,"-").concat(xe.tickCoord)},i&&x.createElement("line",Jo({},ge,B,{className:bt("recharts-cartesian-axis-tick-line",$g(i,"className"))})))}),ae=me.map((pe,xe)=>{var B,R,{entry:V,tick:X}=pe,q=Wt(Wt(Wt(Wt({verticalAnchor:I},D),{},{textAnchor:U,stroke:"none",fill:s},X),{},{index:xe,payload:V,visibleTicksCount:z.length,tickFormatter:l,padding:f},h),{},{angle:(B=(R=h?.angle)!==null&&R!==void 0?R:D.angle)!==null&&B!==void 0?B:0}),W=Wt(Wt({},q),K);return x.createElement(Hi,Jo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},qL(T,V,xe)),r&&x.createElement(vpe,{option:r,tickProps:W,value:"".concat(typeof l=="function"?l(V.value,xe):V.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},x.createElement(bpe,{ticks:z,axisId:E,axisType:P}),ae.length>0&&x.createElement(Ks,{zIndex:dr.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},ae)),G.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},G))}),wpe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:s,hide:l,ticks:c,axisType:f,axisId:h}=e,m=cpe(e,lpe),[g,y]=x.useState(""),[v,w]=x.useState(""),S=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var C;return rpe({ticks:S.current,label:(C=e.labelRef)===null||C===void 0?void 0:C.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var N=x.useCallback(C=>{if(C){var A=C.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=A;var k=A[0];if(k){var _=window.getComputedStyle(k),T=_.fontSize,P=_.letterSpacing;(T!==g||P!==v)&&(y(T),w(P))}}},[g,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(Ks,{zIndex:e.zIndex},x.createElement(Hi,{className:bt("recharts-cartesian-axis",s)},x.createElement(ppe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ki(e)}),x.createElement(xpe,{ref:N,axisType:f,events:m,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(_fe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(Dfe,{label:e.label,labelRef:e.labelRef}),e.children)))}),Xj=x.forwardRef((e,t)=>{var n=Er(e,$o);return x.createElement(wpe,Jo({},n,{ref:t}))});Xj.displayName="CartesianAxis";var Spe={},G3=Kn({name:"errorBars",initialState:Spe,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(s=>s.dataKey===r.dataKey&&s.direction===r.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:$ye,replaceErrorBar:Uye,removeErrorBar:Bye}=G3.actions,jpe=G3.reducer;function V3(e,t){var n,r,i=Le(h=>Ma(h,e)),s=Le(h=>Ra(h,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:gn.allowDataOverflow,c=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:yn.allowDataOverflow,f=l||c;return{needClip:f,needClipX:l,needClipY:c}}function Npe(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Qj(),{needClipX:s,needClipY:l,needClip:c}=V3(t,n);if(!c||!i)return null;var{x:f,y:h,width:m,height:g}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:s?f:f-m/2,y:l?h:h-g/2,width:s?m:m*2,height:l?g:g*2}))}function Cpe(e){var t=Rg(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:s}=t,l=Number(i),c=Number(s);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}function Jj(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:U3}function eN(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:U3}var Z3=(e,t,n)=>G5(e,"xAxis",Jj(e,t),n),Y3=(e,t,n)=>H5(e,"xAxis",Jj(e,t),n),W3=(e,t,n)=>G5(e,"yAxis",eN(e,t),n),Q3=(e,t,n)=>H5(e,"yAxis",eN(e,t),n),_pe=re([Bt,Z3,W3,Y3,Q3],(e,t,n,r,i)=>Wi(e,"xAxis")?Om(t,r,!1):Om(n,i,!1)),Ope=(e,t)=>t,X3=re([h5,Ope],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),J3=e=>{var t=Bt(e),n=Wi(t,"xAxis");return n?"yAxis":"xAxis"},kpe=(e,t)=>{var n=J3(e);return n==="yAxis"?eN(e,t):Jj(e,t)},Ape=(e,t,n)=>j5(e,J3(e),kpe(e,t),n),Epe=re([X3,Ape],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=aj(e);if(!(r==null||i==null)){var s=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=s?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),Tpe=re([Bt,Z3,W3,Y3,Q3,Epe,wae,_pe,X3,Eae],(e,t,n,r,i,s,l,c,f,h)=>{var{chartData:m,dataStartIndex:g,dataEndIndex:y}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=f,w;if(v&&v.length>0?w=v:w=m?.slice(g,y+1),w!=null)return Qpe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:s,displayedData:w,chartBaseValue:h,bandSize:c})}}),Ppe=["id"],zpe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uo.apply(null,arguments)}function e4(e,t){if(e==null)return{};var n,r,i=Mpe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nz(Object(n),!0).forEach(function(r){Rpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rpe(e,t,n){return(t=Dpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dpe(e){var t=Lpe(e,"string");return typeof t=="symbol"?t:t+""}function Lpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eg(e,t){return e&&e!=="none"?e:t}var Ipe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:l}=e;return[{inactive:l,dataKey:t,type:s,color:eg(r,i),value:RI(n,t),payload:e}]},$pe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:l,hide:c,unit:f,tooltipType:h,id:m}=e,g={dataDefinedOnItem:n,getPosition:Yc,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:RI(l,t),hide:c,type:h,color:eg(r,s),unit:f,graphicalItemId:m}};return x.createElement(Wfe,{tooltipEntrySettings:g})});function Upe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:l}=r,c=Ki(r);return x.createElement(vhe,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function Bpe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(s=>{var l,c,f={x:(l=s.x)!==null&&l!==void 0?l:0,y:(c=s.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return vc(vc({},f),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(Bfe,{value:t?i:void 0},n)}function Cz(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:l,type:c,stroke:f,connectNulls:h,isRange:m}=s,{id:g}=s,y=e4(s,Ppe),v=Ki(y),w=Or(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Hi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(Up,Uo({},w,{id:g,points:t,connectNulls:h,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&x.createElement(Up,Uo({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:t})),f!=="none"&&m&&Array.isArray(n)&&x.createElement(Up,Uo({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:n}))),x.createElement(Upe,{points:t,props:y,clipPathId:i}))}function qpe(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.y,f=(n=s[s.length-1])===null||n===void 0?void 0:n.y;if(!ct(c)||!ct(f))return null;var h=r*Math.abs(c-f),m=Math.max(...s.map(g=>g.x||0));return Pe(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.x||0),m)),Pe(m)?x.createElement("rect",{x:0,y:c<f?c:c-h,width:m+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function Fpe(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.x,f=(n=s[s.length-1])===null||n===void 0?void 0:n.x;if(!ct(c)||!ct(f))return null;var h=r*Math.abs(c-f),m=Math.max(...s.map(g=>g.y||0));return Pe(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(g=>g.y||0),m)),Pe(m)?x.createElement("rect",{x:c<f?c:c-h,y:0,width:h,height:Math.floor(m+(l?parseInt("".concat(l),10):1))}):null}function Kpe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:s}=e;return n==="vertical"?x.createElement(qpe,{alpha:t,points:r,baseLine:i,strokeWidth:s}):x.createElement(Fpe,{alpha:t,points:r,baseLine:i,strokeWidth:s})}function Hpe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s}=e,{points:l,baseLine:c,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:g,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),S=i$(w,"recharts-area-"),N=G1(),[C,A]=x.useState(!1),k=!C,_=x.useCallback(()=>{typeof v=="function"&&v(),A(!1)},[v]),T=x.useCallback(()=>{typeof y=="function"&&y(),A(!0)},[y]);if(N==null)return null;var P=i.current,E=s.current;return x.createElement(Bpe,{showLabels:k,points:l},r.children,x.createElement(r$,{animationId:S,begin:h,duration:m,isActive:f,easing:g,onAnimationEnd:_,onAnimationStart:T,key:S},z=>{if(P){var D=P.length/l.length,K=z===1?l:l.map((I,H)=>{var ge=Math.floor(H*D);if(P[ge]){var me=P[ge];return vc(vc({},I),{},{x:Di(me.x,I.x,z),y:Di(me.y,I.y,z)})}return I}),U;return Pe(c)?U=Di(E,c,z):Dn(c)||Gi(c)?U=Di(E,0,z):U=c.map((I,H)=>{var ge=Math.floor(H*D);if(Array.isArray(E)&&E[ge]){var me=E[ge];return vc(vc({},I),{},{x:Di(me.x,I.x,z),y:Di(me.y,I.y,z)})}return I}),z>0&&(i.current=K,s.current=U),x.createElement(Cz,{points:K,baseLine:U,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=l,s.current=c),x.createElement(Hi,null,f&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(Kpe,{alpha:z,points:l,baseLine:c,layout:N,strokeWidth:r.strokeWidth}))),x.createElement(Hi,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(Cz,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(Kfe,{label:r.label}))}function Gpe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),s=x.useRef();return x.createElement(Hpe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class Vpe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:l,needClip:c,xAxisId:f,yAxisId:h,width:m,height:g,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var S=bt("recharts-area",i),N=y,{r:C,strokeWidth:A}=Cpe(n),k=I3(n),_=C*2+A,T=c?"url(#clipPath-".concat(k?"":"dots-").concat(N,")"):void 0;return x.createElement(Ks,{zIndex:w},x.createElement(Hi,{className:S},c&&x.createElement("defs",null,x.createElement(Npe,{clipPathId:N,xAxisId:f,yAxisId:h}),!k&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:l-_/2,y:s-_/2,width:m+_,height:g+_}))),x.createElement(Gpe,{needClip:c,clipPathId:N,props:this.props})),x.createElement(xz,{points:r,mainColor:eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&x.createElement(xz,{points:v,mainColor:eg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var Zpe={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:dr.area};function Ype(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:f,fillOpacity:h,hide:m,isAnimationActive:g,legendType:y,stroke:v,xAxisId:w,yAxisId:S}=e,N=e4(e,zpe),C=Wc(),A=m3(),{needClip:k}=V3(w,S),_=Tr(),{points:T,isRange:P,baseLine:E}=(t=Le(H=>Tpe(H,e.id,_)))!==null&&t!==void 0?t:{},z=Qj();if(C!=="horizontal"&&C!=="vertical"||z==null||A!=="AreaChart"&&A!=="ComposedChart")return null;var{height:D,width:K,x:U,y:I}=z;return!T||!T.length?null:x.createElement(Vpe,Uo({},N,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,baseLine:E,connectNulls:l,dot:c,fill:f,fillOpacity:h,height:D,hide:m,layout:C,isAnimationActive:g,isRange:P,legendType:y,needClip:k,points:T,stroke:v,width:K,left:U,top:I,xAxisId:w,yAxisId:S}))}var Wpe=(e,t,n,r,i)=>{var s=n??t;if(Pe(s))return s;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return s==="dataMin"?h:s==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]};function Qpe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:l,xAxis:c,yAxis:f,displayedData:h,dataStartIndex:m,xAxisTicks:g,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,S=Wpe(s,l,n,c,f),N=s==="horizontal",C=!1,A=h.map((_,T)=>{var P,E,z,D;if(w)D=i[m+T];else{var K=Nn(_,r);Array.isArray(K)?(D=K,C=!0):D=[S,K]}var U=(P=(E=D)===null||E===void 0?void 0:E[1])!==null&&P!==void 0?P:null,I=U==null||w&&!t&&Nn(_,r)==null;if(N){var H;return{x:ET({axis:c,ticks:g,bandSize:v,entry:_,index:T}),y:I?null:(H=f.scale.map(U))!==null&&H!==void 0?H:null,value:D,payload:_}}return{x:I?null:(z=c.scale.map(U))!==null&&z!==void 0?z:null,y:ET({axis:f,ticks:y,bandSize:v,entry:_,index:T}),value:D,payload:_}}),k;return w||C?k=A.map(_=>{var T,P=Array.isArray(_.value)?_.value[0]:null;if(N){var E;return{x:_.x,y:P!=null&&_.y!=null&&(E=f.scale.map(P))!==null&&E!==void 0?E:null,payload:_.payload}}return{x:P!=null&&(T=c.scale.map(P))!==null&&T!==void 0?T:null,y:_.y,payload:_.payload}}):k=N?f.scale.map(S):c.scale.map(S),{points:A,baseLine:k??0,isRange:C}}function Xpe(e){var t=Er(e,Zpe),n=Tr();return x.createElement(nhe,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(Qfe,{legendPayload:Ipe(t)}),x.createElement($pe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(che,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:lne(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(Ype,Uo({},t,{id:r}))))}var t4=x.memo(Xpe,ff);t4.displayName="Area";var Jpe=["domain","range"],eme=["domain","range"];function _z(e,t){if(e==null)return{};var n,r,i=tme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Oz(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function n4(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=_z(e,Jpe),{domain:s,range:l}=t,c=_z(t,eme);return!Oz(n,s)||!Oz(r,l)?!1:ff(i,c)}var nme=["type"],rme=["dangerouslySetInnerHTML","ticks","scale"],ime=["id","scale"];function vS(){return vS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vS.apply(null,arguments)}function kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Az(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kz(Object(n),!0).forEach(function(r){ame(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ame(e,t,n){return(t=sme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sme(e){var t=ome(e,"string");return typeof t=="symbol"?t:t+""}function ome(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bS(e,t){if(e==null)return{};var n,r,i=lme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function cme(e){var t=Xt(),n=x.useRef(null),r=G1(),{type:i}=e,s=bS(e,nme),l=oy(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return Az(Az({},s),{},{type:l})},[s,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(jhe(c)):n.current!==c&&t(Nhe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(Che(n.current)),n.current=null)},[t]),null}var ume=e=>{var{xAxisId:t,className:n}=e,r=Le(LI),i=Tr(),s="xAxis",l=Le(C=>K5(C,s,t,i)),c=Le(C=>sce(C,t)),f=Le(C=>fce(C,t)),h=Le(C=>c5(C,t));if(c==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:m,ticks:g,scale:y}=e,v=bS(e,rme),{id:w,scale:S}=h,N=bS(h,ime);return x.createElement(Xj,vS({},v,N,{x:f.x,y:f.y,width:c.width,height:c.height,className:bt("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l,axisType:s,axisId:t}))},dme={allowDataOverflow:gn.allowDataOverflow,allowDecimals:gn.allowDecimals,allowDuplicatedCategory:gn.allowDuplicatedCategory,angle:gn.angle,axisLine:$o.axisLine,height:gn.height,hide:!1,includeHidden:gn.includeHidden,interval:gn.interval,label:!1,minTickGap:gn.minTickGap,mirror:gn.mirror,orientation:gn.orientation,padding:gn.padding,reversed:gn.reversed,scale:gn.scale,tick:gn.tick,tickCount:gn.tickCount,tickLine:$o.tickLine,tickSize:$o.tickSize,type:gn.type,niceTicks:gn.niceTicks,xAxisId:0},fme=e=>{var t=Er(e,dme);return x.createElement(x.Fragment,null,x.createElement(cme,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(ume,t))},r4=x.memo(fme,n4);r4.displayName="XAxis";var hme=["type"],pme=["dangerouslySetInnerHTML","ticks","scale"],mme=["id","scale"];function xS(){return xS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xS.apply(null,arguments)}function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ez(Object(n),!0).forEach(function(r){gme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gme(e,t,n){return(t=yme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yme(e){var t=vme(e,"string");return typeof t=="symbol"?t:t+""}function vme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wS(e,t){if(e==null)return{};var n,r,i=bme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xme(e){var t=Xt(),n=x.useRef(null),r=G1(),{type:i}=e,s=wS(e,hme),l=oy(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return Tz(Tz({},s),{},{type:l})},[l,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(_he(c)):n.current!==c&&t(Ohe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(khe(n.current)),n.current=null)},[t]),null}function wme(e){var{yAxisId:t,className:n,width:r,label:i}=e,s=x.useRef(null),l=x.useRef(null),c=Le(LI),f=Tr(),h=Xt(),m="yAxis",g=Le(P=>mce(P,t)),y=Le(P=>pce(P,t)),v=Le(P=>K5(P,m,t,f)),w=Le(P=>u5(P,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!g||Wj(i)||x.isValidElement(i)||w==null)){var P=s.current;if(P){var E=P.getCalculatedWidth();Math.round(g.width)!==Math.round(E)&&h(Ahe({id:t,width:E}))}}},[v,g,h,i,t,r,w]),g==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:N,scale:C}=e,A=wS(e,pme),{id:k,scale:_}=w,T=wS(w,mme);return x.createElement(Xj,xS({},A,T,{ref:s,labelRef:l,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:g.width,height:g.height,className:bt("recharts-".concat(m," ").concat(m),n),viewBox:c,ticks:v,axisType:m,axisId:t}))}var Sme={allowDataOverflow:yn.allowDataOverflow,allowDecimals:yn.allowDecimals,allowDuplicatedCategory:yn.allowDuplicatedCategory,angle:yn.angle,axisLine:$o.axisLine,hide:!1,includeHidden:yn.includeHidden,interval:yn.interval,label:!1,minTickGap:yn.minTickGap,mirror:yn.mirror,orientation:yn.orientation,padding:yn.padding,reversed:yn.reversed,scale:yn.scale,tick:yn.tick,tickCount:yn.tickCount,tickLine:$o.tickLine,tickSize:$o.tickSize,type:yn.type,niceTicks:yn.niceTicks,width:yn.width,yAxisId:0},jme=e=>{var t=Er(e,Sme);return x.createElement(x.Fragment,null,x.createElement(xme,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(wme,t))},i4=x.memo(jme,n4);i4.displayName="YAxis";var Nme=(e,t)=>t,tN=re([Nme,Bt,C$,_n,c3,Da,Lue,In],Kue);function Cme(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Cme(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var s=e.currentTarget;n=s.offsetWidth>0?t.width/s.offsetWidth:1,r=s.offsetHeight>0?t.height/s.offsetHeight:1}var l=(c,f)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var a4=kr("mouseClick"),s4=lf();s4.startListening({actionCreator:a4,effect:(e,t)=>{var n=e.payload,r=tN(t.getState(),nN(n));r?.activeIndex!=null&&t.dispatch(Ece({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var SS=kr("mouseMove"),o4=lf(),oc=null,mo=null,Bx=null;o4.startListening({actionCreator:SS,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s?.includes("mousemove");oc!==null&&(cancelAnimationFrame(oc),oc=null),mo!==null&&(typeof i!="number"||!l)&&(clearTimeout(mo),mo=null),Bx=nN(n);var c=()=>{var f=t.getState(),h=wf(f,f.tooltip.settings.shared);if(!Bx){oc=null,mo=null;return}if(h==="axis"){var m=tN(f,Bx);m?.activeIndex!=null?t.dispatch(J5({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(X5())}oc=null,mo=null};if(!l){c();return}i==="raf"?oc=requestAnimationFrame(c):typeof i=="number"&&mo===null&&(mo=setTimeout(c,i))}});function _me(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var Pz={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},l4=Kn({name:"rootProps",initialState:Pz,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:Pz.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Ome=l4.reducer,{updateOptions:kme}=l4.actions,Ame=null,Eme={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},c4=Kn({name:"polarOptions",initialState:Ame,reducers:Eme}),{updatePolarOptions:qye}=c4.actions,Tme=c4.reducer,u4=kr("keyDown"),d4=kr("focus"),f4=kr("blur"),wy=lf(),lc=null,go=null,Sp=null;wy.startListening({actionCreator:u4,effect:(e,t)=>{Sp=e.payload,lc!==null&&(cancelAnimationFrame(lc),lc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,s=i==="all"||i.includes("keydown");go!==null&&(typeof r!="number"||!s)&&(clearTimeout(go),go=null);var l=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=c.tooltip,m=Sp;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var g=Sd(h,Xo(c),Ic(c),$c(c)),y=g==null?-1:Number(g),v=!Number.isFinite(y)||y<0,w=Da(c),S=Xo(c),N=wf(c,c.tooltip.settings.shared);if(m==="Enter"){if(v)return;var C=Qm(c,N,"hover",String(h.index));t.dispatch(Wm({active:!h.active,activeIndex:h.index,activeCoordinate:C}));return}var A=xce(c),k=A==="left-to-right"?1:-1,_=m==="ArrowRight"?1:-1,T;if(v){var P=Ic(c),E=$c(c),z=_*k,D=ge=>({active:!1,index:String(ge),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,z>0){for(var K=0;K<S.length;K++)if(Sd(D(K),S,P,E)!=null){T=K;break}}else for(var U=S.length-1;U>=0;U--)if(Sd(D(U),S,P,E)!=null){T=U;break}if(T<0)return}else{T=y+_*k;var I=w?.length||S.length;if(I===0||T>=I||T<0)return}var H=Qm(c,N,"hover",String(T));t.dispatch(Wm({active:!0,activeIndex:T.toString(),activeCoordinate:H}))}finally{lc=null,go=null}};if(!s){l();return}r==="raf"?lc=requestAnimationFrame(l):typeof r=="number"&&go===null&&(l(),Sp=null,go=setTimeout(()=>{Sp?l():(go=null,lc=null)},r))}});wy.startListening({actionCreator:d4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var s="0",l=wf(n,n.tooltip.settings.shared),c=Qm(n,l,"hover",String(s));t.dispatch(Wm({active:!0,activeIndex:s,activeCoordinate:c}))}}}});wy.startListening({actionCreator:f4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Wm({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function h4(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Kr=kr("externalEvent"),p4=lf(),jp=new Map,dd=new Map,qx=new Map;p4.startListening({actionCreator:Kr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,s=h4(r);qx.set(i,{handler:n,reactEvent:s});var l=jp.get(i);l!==void 0&&(cancelAnimationFrame(l),jp.delete(i));var c=t.getState(),{throttleDelay:f,throttledEvents:h}=c.eventSettings,m=h,g=m==="all"||m?.includes(i),y=dd.get(i);y!==void 0&&(typeof f!="number"||!g)&&(clearTimeout(y),dd.delete(i));var v=()=>{var N=qx.get(i);try{if(!N)return;var{handler:C,reactEvent:A}=N,k=t.getState(),_={activeCoordinate:Sue(k),activeDataKey:bue(k),activeIndex:Yd(k),activeLabel:f3(k),activeTooltipIndex:Yd(k),isTooltipActive:jue(k)};C&&C(_,A)}finally{jp.delete(i),dd.delete(i),qx.delete(i)}};if(!g){v();return}if(f==="raf"){var w=requestAnimationFrame(v);jp.set(i,w)}else if(typeof f=="number"){if(!dd.has(i)){v();var S=setTimeout(v,f);dd.set(i,S)}}else v()}}});var Pme=re([iu],e=>e.tooltipItemPayloads),zme=re([Pme,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(s=>s.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),m4=kr("touchMove"),g4=lf(),yo=null,fs=null,zz=null,fd=null;g4.startListening({actionCreator:m4,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){fd=h4(n);var r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s.includes("touchmove");yo!==null&&(cancelAnimationFrame(yo),yo=null),fs!==null&&(typeof i!="number"||!l)&&(clearTimeout(fs),fs=null),zz=Array.from(n.touches).map(f=>nN({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(fd!=null){var f=t.getState(),h=wf(f,f.tooltip.settings.shared);if(h==="axis"){var m,g=(m=zz)===null||m===void 0?void 0:m[0];if(g==null){yo=null,fs=null;return}var y=tN(f,g);y?.activeIndex!=null&&t.dispatch(J5({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(h==="item"){var v,w=fd.touches[0];if(document.elementFromPoint==null||w==null)return;var S=document.elementFromPoint(w.clientX,w.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(mne),C=(v=S.getAttribute(gne))!==null&&v!==void 0?v:void 0,A=cl(f).find(T=>T.id===C);if(N==null||A==null||C==null)return;var{dataKey:k}=A,_=zme(f,N,C);t.dispatch(Ace({activeDataKey:k,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:C}))}yo=null,fs=null}};if(!l){c();return}i==="raf"?yo=requestAnimationFrame(c):typeof i=="number"&&fs===null&&(c(),fd=null,fs=setTimeout(()=>{fd?c():(fs=null,yo=null)},i))}}});var y4={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},v4=Kn({name:"eventSettings",initialState:y4,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Mme}=v4.actions,Rme=v4.reducer,Dme=sI({brush:$he,cartesianAxis:Ehe,chartData:wde,errorBars:jpe,eventSettings:Rme,graphicalItems:ohe,layout:Jte,legend:dre,options:gde,polarAxis:Gfe,polarOptions:Tme,referenceElements:Fhe,renderedTicks:ope,rootProps:Ome,tooltip:Tce,zIndex:rde}),Lme=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Nte({reducer:Dme,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([s4.middleware,o4.middleware,wy.middleware,p4.middleware,g4.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(wI({type:"raf"}))},devTools:{serialize:{replacer:_me},name:"recharts-".concat(n)}})};function Ime(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Tr(),s=x.useRef(null);if(i)return n;s.current==null&&(s.current=Lme(t,r));var l=L1;return x.createElement(Are,{context:l,store:s.current},n)}function $me(e){var{layout:t,margin:n}=e,r=Xt(),i=Tr();return x.useEffect(()=>{i||(r(Wte(t)),r(Yte(n)))},[r,i,t,n]),null}var Ume=x.memo($me,ff);function Bme(e){var t=Xt();return x.useEffect(()=>{t(kme(e))},[t,e]),null}var qme=e=>{var t=Xt();return x.useEffect(()=>{t(Mme(e))},[t,e]),null},Fme=x.memo(qme,ff);function Mz(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Xt();return x.useLayoutEffect(()=>(r.current&&i(tde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(nde({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Rz(e){var{children:t,isPanorama:n}=e,r=Le(Gue);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),s=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(Mz,{key:l,zIndex:l,isPanorama:n})),t,s.map(l=>x.createElement(Mz,{key:l,zIndex:l,isPanorama:n})))}var Kme=["children"];function Hme(e,t){if(e==null)return{};var n,r,i=Gme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tg(){return tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tg.apply(null,arguments)}var Vme={width:"100%",height:"100%",display:"block"},Zme=x.forwardRef((e,t)=>{var n=BI(),r=qI(),i=JI();if(!Ms(n)||!Ms(r))return null;var{children:s,otherAttributes:l,title:c,desc:f}=e,h,m;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?m=l.role:m=i?"application":void 0),x.createElement(k1,tg({},l,{title:c,desc:f,role:m,tabIndex:h,width:n,height:r,style:Vme,ref:t}),s)}),Yme=e=>{var{children:t}=e,n=Le(Jg);if(!n)return null;var{width:r,height:i,y:s,x:l}=n;return x.createElement(k1,{width:r,height:i,x:l,y:s},t)},Dz=x.forwardRef((e,t)=>{var{children:n}=e,r=Hme(e,Kme),i=Tr();return i?x.createElement(Yme,null,x.createElement(Rz,{isPanorama:!0},n)):x.createElement(Zme,tg({ref:t},r),x.createElement(Rz,{isPanorama:!1},n))});function Wme(){var e=Xt(),[t,n]=x.useState(null),r=Le(pne);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;ct(s)&&s!==r&&e(Xte(s))}},[t,e,r]),n}function Lz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qme(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lz(Object(n),!0).forEach(function(r){Xme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xme(e,t,n){return(t=Jme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jme(e){var t=ege(e,"string");return typeof t=="symbol"?t:t+""}function ege(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function As(){return As=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},As.apply(null,arguments)}var tge=()=>(Ede(),null);function ng(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var nge=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[s,l]=x.useState({containerWidth:ng((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:ng((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((h,m)=>{l(g=>{var y=Math.round(h),v=Math.round(m);return g.containerWidth===y&&g.containerHeight===v?g:{containerWidth:y,containerHeight:v}})},[]),f=x.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:m,height:g}=h.getBoundingClientRect();c(m,g);var y=w=>{var S=w[0];if(S!=null){var{width:N,height:C}=S.contentRect;c(N,C)}},v=new ResizeObserver(y);v.observe(h),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var h=i.current;h?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(uf,{width:s.containerWidth,height:s.containerHeight}),x.createElement("div",As({ref:f},e)))}),rge=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=x.useState({containerWidth:ng(n),containerHeight:ng(r)}),l=x.useCallback((f,h)=>{s(m=>{var g=Math.round(f),y=Math.round(h);return m.containerWidth===g&&m.containerHeight===y?m:{containerWidth:g,containerHeight:y}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:m}=f.getBoundingClientRect();l(h,m)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(uf,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",As({ref:c},e)))}),ige=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement("div",As({ref:t},e)))}),age=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(rge,As({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(ige,As({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement("div",As({ref:t},e)))});function sge(e){return e?nge:age}var oge=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:l,onDoubleClick:c,onMouseDown:f,onMouseEnter:h,onMouseLeave:m,onMouseMove:g,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:N,width:C,responsive:A,dispatchTouchEvents:k=!0}=e,_=x.useRef(null),T=Xt(),[P,E]=x.useState(null),[z,D]=x.useState(null),K=Wme(),U=K1(),I=U?.width>0?U.width:C,H=U?.height>0?U.height:i,ge=x.useCallback(ue=>{K(ue),typeof t=="function"&&t(ue),E(ue),D(ue),ue!=null&&(_.current=ue)},[K,t,E,D]),me=x.useCallback(ue=>{T(a4(ue)),T(Kr({handler:s,reactEvent:ue}))},[T,s]),G=x.useCallback(ue=>{T(SS(ue)),T(Kr({handler:h,reactEvent:ue}))},[T,h]),ae=x.useCallback(ue=>{T(X5()),T(Kr({handler:m,reactEvent:ue}))},[T,m]),pe=x.useCallback(ue=>{T(SS(ue)),T(Kr({handler:g,reactEvent:ue}))},[T,g]),xe=x.useCallback(()=>{T(d4())},[T]),B=x.useCallback(()=>{T(f4())},[T]),R=x.useCallback(ue=>{T(u4(ue.key))},[T]),V=x.useCallback(ue=>{T(Kr({handler:l,reactEvent:ue}))},[T,l]),X=x.useCallback(ue=>{T(Kr({handler:c,reactEvent:ue}))},[T,c]),q=x.useCallback(ue=>{T(Kr({handler:f,reactEvent:ue}))},[T,f]),W=x.useCallback(ue=>{T(Kr({handler:y,reactEvent:ue}))},[T,y]),ie=x.useCallback(ue=>{T(Kr({handler:S,reactEvent:ue}))},[T,S]),ye=x.useCallback(ue=>{k&&T(m4(ue)),T(Kr({handler:w,reactEvent:ue}))},[T,k,w]),we=x.useCallback(ue=>{T(Kr({handler:v,reactEvent:ue}))},[T,v]),te=sge(A);return x.createElement(x3.Provider,{value:P},x.createElement(bL.Provider,{value:z},x.createElement(te,{width:I??N?.width,height:H??N?.height,className:bt("recharts-wrapper",r),style:Qme({position:"relative",cursor:"default",width:I,height:H},N),onClick:me,onContextMenu:V,onDoubleClick:X,onFocus:xe,onBlur:B,onKeyDown:R,onMouseDown:q,onMouseEnter:G,onMouseLeave:ae,onMouseMove:pe,onMouseUp:W,onTouchEnd:we,onTouchMove:ye,onTouchStart:ie,ref:ge},x.createElement(tge,null),n)))}),lge=["width","height","responsive","children","className","style","compact","title","desc"];function cge(e,t){if(e==null)return{};var n,r,i=uge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dge=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:s,className:l,style:c,compact:f,title:h,desc:m}=e,g=cge(e,lge),y=Ki(g);return f?x.createElement(x.Fragment,null,x.createElement(uf,{width:n,height:r}),x.createElement(Dz,{otherAttributes:y,title:h,desc:m},s)):x.createElement(oge,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(Dz,{otherAttributes:y,title:h,desc:m,ref:t},x.createElement(Hhe,null,s)))});function jS(){return jS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jS.apply(null,arguments)}function Iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fge(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(n),!0).forEach(function(r){hge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hge(e,t,n){return(t=pge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pge(e){var t=mge(e,"string");return typeof t=="symbol"?t:t+""}function mge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gge={top:5,right:5,bottom:5,left:5},yge=fge({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:gge,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},y4),vge=x.forwardRef(function(t,n){var r,i=Er(t.categoricalChartProps,yge),{chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,m={chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(Ime,{preloadedState:{options:m},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:s},x.createElement(Ihe,{chartData:h.data}),x.createElement(Ume,{layout:i.layout,margin:i.margin}),x.createElement(Fme,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(Bme,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(dge,jS({},i,{ref:n})))}),bge=["axis"],xge=x.forwardRef((e,t)=>x.createElement(vge,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:bge,tooltipPayloadSearcher:pde,categoricalChartProps:e,ref:t}));const Np=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function Cp(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function wge(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Sge({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[s,l]=x.useState(!0),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[g,y]=x.useState(null),[v,w]=x.useState(null),[S,N]=x.useState("sessions"),[C,A]=x.useState("desc"),[k,_]=x.useState("sessions"),[T,P]=x.useState("desc"),[E,z]=x.useState([]);function D(X){l(!0),Kk(e).then(q=>{if(!X.current)return n(q),q.connected?Promise.all([Hk(e),Gk(e).catch(()=>[])]):null}).then(q=>{X.current||(Array.isArray(q)?(i(q[0]),z(q[1])):(i(null),z([])),l(!1))}).catch(q=>{X.current||(y(q instanceof Error?q.message:"Failed to load GA4 data"),l(!1))})}x.useEffect(()=>{const X={current:!1};return D(X),()=>{X.current=!0}},[e]);async function K(){f(!0),y(null),w(null);try{const X=await RM(e);w(`Synced ${X.rowCount.toLocaleString()} page rows and ${X.aiReferralCount.toLocaleString()} AI referral rows (${X.days} days)`);const[q,W]=await Promise.all([Hk(e),Gk(e).catch(()=>[])]);i(q),z(W);const ie=await Kk(e);n(ie)}catch(X){y(X instanceof Error?X.message:"Sync failed")}finally{f(!1)}}async function U(){m(!0),y(null),w(null);try{await g9(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),w("GA4 disconnected")}catch(X){y(X instanceof Error?X.message:"Disconnect failed")}finally{m(!1)}}function I(X){S===X?A(q=>q==="desc"?"asc":"desc"):(N(X),A("desc"))}function H(X){k===X?P(q=>q==="desc"?"asc":"desc"):(_(X),P("desc"))}const ge=x.useMemo(()=>r?.topPages?[...r.topPages].sort((X,q)=>{const W=X[S],ie=q[S];return typeof W=="string"&&typeof ie=="string"?C==="asc"?W.localeCompare(ie):ie.localeCompare(W):C==="asc"?W-ie:ie-W}):[],[r?.topPages,S,C]),me=x.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((X,q)=>{const W=X[k],ie=q[k];return typeof W=="string"&&typeof ie=="string"?T==="asc"?W.localeCompare(ie):ie.localeCompare(W):T==="asc"?W-ie:ie-W}):[],[r?.aiReferrals,k,T]);if(s&&!t)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return u.jsx(jge,{projectName:e,onConnected:()=>D({current:!1})});const G=r&&r.totalSessions>0?Math.round(r.totalOrganicSessions/r.totalSessions*100):0,ae=r?.aiReferrals.reduce((X,q)=>X+q.sessions,0)??0,pe=r&&r.totalSessions>0?Math.round(ae/r.totalSessions*100):0,xe=r?new Set(r.aiReferrals.map(X=>X.source.toLowerCase())).size:0,B=me[0]??null,{chartData:R,chartSources:V}=x.useMemo(()=>{if(E.length===0)return{chartData:[],chartSources:[]};const X=[...new Set(E.map(ie=>ie.source))],q=new Map;for(const ie of E){let ye=q.get(ie.date);ye||(ye={},q.set(ie.date,ye)),ye[ie.source]=(ye[ie.source]??0)+ie.sessions}return{chartData:[...q.entries()].sort(([ie],[ye])=>ie.localeCompare(ye)).map(([ie,ye])=>({date:ie,...ye})),chartSources:X}},[E]);return u.jsxs(u.Fragment,{children:[g&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),v&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:v}),u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",u.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(he,{variant:"outline",size:"sm",disabled:c,onClick:K,children:[u.jsx(Qk,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(he,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:h,onClick:U,children:[u.jsx(nF,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",u.jsx(Wn,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(Fx,{value:Cp(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(Fx,{value:Cp(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${G}% of total`,tone:"positive"}),u.jsx(Fx,{value:Cp(r.totalUsers),label:"Total Users",subtitle:r.totalUsers.toLocaleString(),tone:"neutral"})]}):u.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),u.jsxs(he,{variant:"outline",size:"sm",disabled:c,onClick:K,children:[u.jsx(Qk,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),"Sync from GA4"]})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",u.jsx(Wn,{text:"Counts explicit AI referrers detected in GA4 sessionSource values, such as ChatGPT, Claude, Gemini, Perplexity, OpenAI, and Copilot. Generic search-engine sources like plain Bing are intentionally excluded to avoid false positives."})]})]}),R.length>0&&u.jsxs(Ue,{className:"surface-card p-5 mb-4",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"AI sessions over time"})]}),u.jsx("div",{className:"h-64",children:u.jsx(Kne,{width:"100%",height:"100%",children:u.jsxs(xge,{data:R,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(r4,{dataKey:"date",tick:{fill:"#71717a",fontSize:11},tickLine:!1,axisLine:{stroke:"#27272a"},tickFormatter:X=>{const q=new Date(X+"T00:00:00");return`${q.getMonth()+1}/${q.getDate()}`}}),u.jsx(i4,{tick:{fill:"#71717a",fontSize:11},tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(Ide,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"},labelFormatter:X=>new Date(String(X)+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}),u.jsx(QI,{wrapperStyle:{fontSize:11,color:"#a1a1aa"}}),V.map((X,q)=>u.jsx(t4,{type:"monotone",dataKey:X,stackId:"1",stroke:Np[q%Np.length],fill:Np[q%Np.length],fillOpacity:.3},X))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(Ue,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Attributable AI visits"})]}),r.aiReferrals.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(Kx,{label:"AI Sessions",value:Cp(ae),hint:`${ae.toLocaleString()} sessions`,tone:"positive"}),u.jsx(Kx,{label:"Share of Traffic",value:`${pe}%`,hint:"of total sessions",tone:"neutral"}),u.jsx(Kx,{label:"Tracked Sources",value:String(xe),hint:`${r.aiReferrals.length} source rows`,tone:"neutral"})]}),u.jsx("div",{className:"mt-4 rounded-lg border border-emerald-800/40 bg-emerald-500/6 px-4 py-3 text-sm text-emerald-100",children:B?`Top explicit AI referrer: ${B.source} via ${B.medium}, accounting for ${B.sessions.toLocaleString()} sessions in the current sync window.`:"Explicit AI referrers detected in the current sync window."})]}):u.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-500/6 px-4 py-4 text-sm text-amber-100",children:"No explicit AI referrers were detected in the current sync window. This view intentionally favors precision over broad matching, so unattributed traffic hidden inside generic search sources is excluded."})]}),u.jsxs(Ue,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:r.aiReferrals.length>0?`${r.aiReferrals.length} rows`:"No source rows"})]}),r.aiReferrals.length>0?u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(hs,{label:"Source",sortKey:"source",current:k,dir:T,onSort:H,align:"left"}),u.jsx(hs,{label:"Medium",sortKey:"medium",current:k,dir:T,onSort:H,align:"left"}),u.jsx(hs,{label:"Sessions",sortKey:"sessions",current:k,dir:T,onSort:H,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(hs,{label:"Users",sortKey:"users",current:k,dir:T,onSort:H,align:"right"})]})}),u.jsx("tbody",{children:me.map(X=>u.jsx(Cge,{referral:X,totalSessions:ae},`${X.source}:${X.medium}`))})]})}):u.jsx("div",{className:"rounded-lg border border-dashed border-zinc-800/60 bg-zinc-950/40 px-4 py-6 text-sm text-zinc-500",children:"No AI referrer sessions detected in the current sync window."})]})]})]})]}),r&&r.topPages.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",u.jsx(Wn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(hs,{label:"Landing Page",sortKey:"landingPage",current:S,dir:C,onSort:I,align:"left"}),u.jsx(hs,{label:"Sessions",sortKey:"sessions",current:S,dir:C,onSort:I,align:"right"}),u.jsx(hs,{label:"Organic",sortKey:"organicSessions",current:S,dir:C,onSort:I,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(hs,{label:"Users",sortKey:"users",current:S,dir:C,onSort:I,align:"right"})]})}),u.jsx("tbody",{children:ge.map(X=>u.jsx(Nge,{page:X},X.landingPage))})]})})]})]}),u.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[u.jsx("span",{children:r?.lastSyncedAt?`Last synced ${wge(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows`:""})]})]})}function jge({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,s]=x.useState(null),[l,c]=x.useState(null),[f,h]=x.useState(!1),[m,g]=x.useState(null),y=x.useRef(null),v=x.useCallback(S=>{const N=S.target.files?.[0];if(!N)return;g(null),s(N.name);const C=new FileReader;C.onload=()=>{const A=C.result;try{const k=JSON.parse(A);if(!k.client_email||!k.private_key){g("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(A)}catch{g("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},C.onerror=()=>{g("Failed to read file."),c(null)},C.readAsText(N)},[]);async function w(){if(g(null),!n.trim()){g("Property ID is required.");return}if(!l){g("Please upload a service account key file.");return}h(!0);try{await m9(e,{propertyId:n.trim(),keyJson:l});try{await RM(e)}catch{}t()}catch(S){g(S instanceof Error?S.message:"Failed to connect GA4")}finally{h(!1)}}return u.jsxs(Ue,{className:"surface-card p-6",children:[u.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),u.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),m&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:m}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),u.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:S=>r(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),u.jsxs("div",{className:"mb-5",children:[u.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),u.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[u.jsx(iF,{className:"w-4 h-4 shrink-0"}),i?u.jsx("span",{className:"text-zinc-200 truncate",children:i}):u.jsx("span",{children:"Upload .json key file"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",u.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),u.jsx(he,{variant:"default",size:"sm",disabled:f||!n.trim()||!l,onClick:w,children:f?"Connecting & syncing…":"Connect GA4"})]})}function hs({label:e,sortKey:t,current:n,dir:r,onSort:i,align:s}){const l=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${s==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const b4={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function Fx({value:e,label:t,subtitle:n,tone:r}){return u.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),u.jsx("p",{className:`text-2xl font-bold tabular-nums ${b4[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Kx({value:e,label:t,hint:n,tone:r}){return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${b4[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Nge({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function Cge({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),u.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function jf(e){e.invalidateQueries({queryKey:Zr.runs.all}),e.invalidateQueries({queryKey:Zr.projects.all})}function _ge(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Oge(e,t){const n=e??"Project";return t==="gsc-sync"?`${n} will refresh after the sync completes.`:t==="inspect-sitemap"?`${n} will notify you when sitemap inspection finishes.`:`${n} will notify you when the run finishes.`}function Sy(e,t){UM({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Xe({title:_ge(e.kind),detail:Oge(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function kge(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){Xe({title:"No runs queued",detail:n.length>0?`${n.length} project${n.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const i of t)UM({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=pF({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});Xe({title:"Run-all batch queued",detail:n.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${n.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:n.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function jy(e,t){if(e instanceof Xp&&e.code==="RUN_IN_PROGRESS"){Xe({title:"Run already in progress",detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??"project"}:${t?.sourceAction??"run"}`,dedupeMode:"replace"});return}Xe({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function x4(){const e=Ds();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>_q(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function Age(){const e=Ds();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:t=>Hq(t),onSuccess:t=>{jf(e),kge(t)},onError:t=>{Xe({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Ege(){const e=Ds();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>TM(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function Tge(){const e=Ds();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>i9(t),onSuccess:(t,n)=>{jf(e),Sy(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Pge(){const e=Ds();return Xd({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>n9(t,n),onSuccess:(t,n)=>{jf(e),Sy(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{jy(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function zge({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState([]),[s,l]=x.useState([]),[c,f]=x.useState([]),[h,m]=x.useState([]),[g,y]=x.useState([]),[v,w]=x.useState(null),[S,N]=x.useState(""),[C,A]=x.useState(""),[k,_]=x.useState("30"),[T,P]=x.useState(!1),[E,z]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[D,K]=x.useState(""),[U,I]=x.useState(!0),[H,ge]=x.useState(!1),[me,G]=x.useState(!1),[ae,pe]=x.useState(!1),[xe,B]=x.useState(!1),[R,V]=x.useState(!1),[X,q]=x.useState(!1),[W,ie]=x.useState(null),[ye,we]=x.useState(!1),[te,ue]=x.useState(!1),[Se,Z]=x.useState(null),[Me,Ee]=x.useState(""),[it,rt]=x.useState(!1),[an,fn]=x.useState(!1),[Vt,fe]=x.useState("indexed"),[Je,xt]=x.useState([]),[wn,et]=x.useState(null),[Ke,at]=x.useState(!1),[qt,Ye]=x.useState(null),[ul,nr]=x.useState(null),ft=r.find(Y=>Y.connectionType==="gsc"),au=c.length>0||h.length>0||g.length>0,ai=Ege(),Ct=Tge(),rr=Pge();async function ve(Y){if(!Y){l([]),N("");return}G(!0);try{const{sites:be}=await Zq(e);l(be),N(Y.propertyId??be[0]?.siteUrl??"")}catch(be){l([]),Ye(be instanceof Error?be.message:"Failed to load Search Console properties")}finally{G(!1)}}async function mr(){B(!0);try{const Y=await Qq(e,{startDate:E.startDate||void 0,endDate:E.endDate||void 0,query:E.query||void 0,page:E.page||void 0,limit:parseInt(E.limit,10)||20});f(Y)}catch(Y){f([]),Ye(Y instanceof Error?Y.message:"Failed to load GSC performance data")}finally{B(!1)}}async function dl(){V(!0);try{const[Y,be]=await Promise.all([Jq(e,{url:D.trim()||void 0,limit:20}),e9(e)]);m(Y),y(be)}catch(Y){m([]),y([]),Ye(Y instanceof Error?Y.message:"Failed to load GSC inspection history")}finally{V(!1)}}async function Cf(){we(!0);try{const[Y,be]=await Promise.all([HS(e),t9(e).catch(()=>[])]);ie(Y),xt(be)}catch(Y){ie(null),xt([]),Ye(Y instanceof Error?Y.message:"Failed to load coverage data")}finally{we(!1)}}async function Hs(Y){at(!0),Ye(null);try{const be=await qk(e,{urls:Y}),{succeeded:Mt,failed:hn,total:Hn}=be.summary;Xe({title:"Indexing requested",detail:hn===0?`${Mt} URL${Mt!==1?"s":""} submitted for indexing.`:`${Mt}/${Hn} submitted successfully, ${hn} failed.`,tone:hn===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(be){Ye(be instanceof Error?be.message:"Failed to request indexing")}finally{at(!1)}}async function fl(){at(!0),Ye(null);try{const Y=await qk(e,{urls:[],allUnindexed:!0}),{succeeded:be,failed:Mt,total:hn}=Y.summary;Xe({title:"Indexing requested",detail:Mt===0?`${be} unindexed URL${be!==1?"s":""} submitted for indexing.`:`${be}/${hn} submitted successfully, ${Mt} failed.`,tone:Mt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to request indexing")}finally{at(!1)}}async function Qi(){if(Me.trim()){rt(!0),Ye(null);try{await Wq(e,"gsc",Me.trim()),i(Y=>Y.map(be=>be.connectionType==="gsc"?{...be,sitemapUrl:Me.trim()}:be)),Xe({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ee("")}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to save sitemap URL")}finally{rt(!1)}}}async function Ni(){Ye(null);try{const Y=await Ct.mutateAsync({projectName:e,projectLabel:e});Z(Y.sitemaps),i(be=>be.map(Mt=>Mt.connectionType==="gsc"?{...Mt,sitemapUrl:Y.primarySitemapUrl}:Mt))}catch{}}async function hl(){ue(!0),Ye(null);try{const Y=await r9(e);Z(Y.sitemaps),Y.sitemaps.length===0&&nr("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to list sitemaps")}finally{ue(!1)}}async function La(){I(!0),Ye(null);try{const[Y,be]=await Promise.all([KS().catch(()=>null),EM(e).catch(()=>[])]);n(!!Y?.google?.configured),i(be);const Mt=be.find(hn=>hn.connectionType==="gsc");await Promise.all([ve(Mt),mr(),dl(),Cf()])}finally{I(!1)}}x.useEffect(()=>{La()},[e]);async function Cy(){if(!t){Ye("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ge(!0),Ye(null),nr(null);try{const{authUrl:Y}=await Gq(e,"gsc");if(!Y.startsWith("https://accounts.google.com/")){Ye("Unexpected OAuth redirect URL. Please try again.");return}const be=window.open(Y,"_blank","width=600,height=700");if(!be){window.location.assign(Y);return}nr("Finish the Google consent flow in the popup, then close it to refresh this project.");const Mt=window.setInterval(()=>{be.closed&&(window.clearInterval(Mt),nr(null),La())},1e3)}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to start OAuth flow")}finally{ge(!1)}}async function _f(){Ye(null),nr(null);try{await Vq(e,"gsc"),i(Y=>Y.filter(be=>be.connectionType!=="gsc")),l([]),N("")}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to disconnect")}}async function su(){if(S){pe(!0),Ye(null);try{await Yq(e,"gsc",S),i(Y=>Y.map(be=>be.connectionType==="gsc"?{...be,propertyId:S}:be)),Xe({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to save GSC property")}finally{pe(!1)}}}async function Gs(){Ye(null),nr(null);try{await ai.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(k,10)||void 0,full:T||void 0}})}catch{}}async function Of(){if(C.trim()){q(!0),Ye(null),nr(null);try{const Y=await Xq(e,C.trim());w(Y),A(""),await dl()}catch(Y){Ye(Y instanceof Error?Y.message:"Failed to inspect URL")}finally{q(!1)}}}return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),u.jsx("h2",{children:"Google Search Console"})]}),u.jsx("div",{className:"flex items-center gap-2",children:ft&&u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:xe,onClick:()=>{mr()},children:xe?"Refreshing…":"Refresh data"})})]}),qt&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[qt,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ye(null),children:"×"})]}),ul&&u.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[ul,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>nr(null),children:"×"})]}),U?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(yt,{tone:ft?"positive":t?"caution":"negative",children:ft?"Connected":t?"Ready to connect":"App credentials missing"})]}),ft?u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:ft.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:_f,children:"Disconnect"})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",u.jsx("code",{children:ft.domain}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ft.propertyId??"No property selected yet"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:fi(ft.updatedAt)})]})]})]}):u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[u.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:H,onClick:Cy,children:H?"Opening…":"Connect Google Search Console"}):u.jsx(he,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Dt,{to:"/settings",children:"Open Settings"})}),!t&&u.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ft&&!ft.sitemapUrl&&u.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{className:"mt-0.5 text-amber-400",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),u.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),u.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx(he,{type:"button",size:"sm",disabled:Ct.isPending||!ft.propertyId,onClick:Ni,children:Ct.isPending?"Discovering…":"Auto-discover from GSC"}),u.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:Me,onChange:Y=>Ee(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&void Qi()}),u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:it||!Me.trim(),onClick:Qi,children:it?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ft||au)&&u.jsxs(u.Fragment,{children:[u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index coverage"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[W&&W.notIndexed.length>0&&u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:Ke,onClick:()=>{fl()},children:Ke?"Requesting…":`Request indexing (${W.notIndexed.length})`}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:ye,onClick:()=>{Cf()},children:ye?"Loading…":"Refresh coverage"})]})]}),W&&W.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Y=W.summary.indexed+W.summary.notIndexed,be=Y>0?W.summary.indexed/Y:0,Mt=Y>0?W.summary.notIndexed/Y:0,hn=54,Hn=2*Math.PI*hn,pl=Hn*(1-be),Ci=Hn*Mt,Gn=Hn*be;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative h-48 w-48",children:[u.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[u.jsx("circle",{cx:"64",cy:"64",r:hn,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:hn,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Hn,strokeDashoffset:pl,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),W.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:hn,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ci} ${Hn-Ci}`,strokeDashoffset:-Gn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[u.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(be*100).toFixed(0),"%"]}),u.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:W.summary.indexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:W.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(W.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(W.reasonGroups??[]).length," ",(W.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),W.summary.deindexed>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:W.summary.deindexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),u.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Y=>{const be=Y==="indexed"?W.indexed.length:Y==="notIndexed"?W.notIndexed.length:W.deindexed.length,Mt=Y==="indexed"?"Indexed":Y==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Vt===Y?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{fe(Y),et(null)},children:[Mt," (",be,")"]},Y)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Vt==="indexed"&&W.indexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"text-left",children:"Mobile"})]})}),u.jsx("tbody",{children:W.indexed.map(Y=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),u.jsx("td",{className:"text-zinc-400",children:Y.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Y.crawlTime?Y.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:Y.isMobileFriendly===!0?"Yes":Y.isMobileFriendly===!1?"No":"—"})]},Y.id))})]}),Vt==="notIndexed"&&!wn&&(W.reasonGroups??[]).length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Reason"}),u.jsx("th",{className:"text-right",children:"Pages"})]})}),u.jsx("tbody",{children:(W.reasonGroups??[]).map(Y=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>et(Y.reason),children:[u.jsx("td",{className:"text-zinc-200",children:Y.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.count})]},Y.reason))})]}),Vt==="notIndexed"&&!wn&&(W.reasonGroups??[]).length===0&&W.notIndexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing State"}),u.jsx("th",{className:"text-left",children:"Coverage"})]})}),u.jsx("tbody",{children:W.notIndexed.map(Y=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),u.jsx("td",{className:"text-zinc-400",children:Y.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Y.coverageState??"Unknown"})]},Y.id))})]}),Vt==="notIndexed"&&wn&&(()=>{const Y=(W.reasonGroups??[]).find(be=>be.reason===wn);return Y?u.jsxs("div",{children:[u.jsx("div",{className:"flex items-center gap-2 mb-3",children:u.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>et(null),children:["←"," Back to reasons"]})}),u.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Y.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Y.count," affected page",Y.count!==1?"s":""]})]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:Ke,onClick:()=>{Hs(Y.urls.map(be=>be.url))},children:Ke?"Requesting…":`Request indexing (${Y.count})`})]}),u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"w-8"})]})}),u.jsx("tbody",{children:Y.urls.map(be=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:be.url}),u.jsx("td",{className:"text-zinc-400",children:be.crawlTime?be.crawlTime.split("T")[0]:"—"}),u.jsx("td",{children:u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Ke,onClick:()=>{Hs([be.url])},title:"Request indexing",children:"Index"})})]},be.id))})]})]}):null})(),Vt==="deindexed"&&W.deindexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Detected"})]})}),u.jsx("tbody",{children:W.deindexed.map((Y,be)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),u.jsx("td",{className:"text-zinc-400",children:Y.previousState}),u.jsx("td",{className:"text-zinc-400",children:Y.currentState}),u.jsx("td",{className:"text-zinc-400",children:Y.transitionDate.split("T")[0]})]},`${Y.url}-${be}`))})]}),(Vt==="indexed"&&W.indexed.length===0||Vt==="notIndexed"&&!wn&&W.notIndexed.length===0||Vt==="deindexed"&&W.deindexed.length===0)&&u.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ye?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),u.jsx("h3",{children:"Search performance"})]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:xe,onClick:()=>{mr()},children:xe?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const Y=new Map;for(const He of c){const st=Y.get(He.date);st?(st.clicks+=He.clicks,st.impressions+=He.impressions):Y.set(He.date,{clicks:He.clicks,impressions:He.impressions})}const be=[...Y.entries()].sort(([He],[st])=>He.localeCompare(st));if(be.length===0)return null;const Mt=Math.max(...be.map(([,He])=>He.impressions),1),hn=be.reduce((He,[,st])=>He+st.clicks,0),Hn=be.reduce((He,[,st])=>He+st.impressions,0),pl=Hn>0?(hn/Hn*100).toFixed(1):"0.0",Ci=700,Gn=220,ht={top:12,bottom:36,left:48,right:12},$n=Ci-ht.left-ht.right,gr=Gn-ht.top-ht.bottom,Xi=$n/be.length,ml=Math.max(Math.min(Xi*.35,24),4),kf=Math.max(ml*.15,1),Af=He=>{if(He<=0)return 1;const st=Math.pow(10,Math.floor(Math.log10(He))),pt=He/st,si=pt<=1.5?1.5:pt<=3?3:pt<=5?5:10;return Math.ceil(si*st)},_i=4,Ia=Math.ceil(Af(Mt)/_i)*_i,$a=Array.from({length:_i+1},(He,st)=>Ia/_i*st),Ua=He=>He>=1e3?`${(He/1e3).toFixed(He>=1e4?0:1)}k`:String(He);return u.jsxs("div",{className:"mt-3",children:[u.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:hn.toLocaleString()})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Hn.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[pl,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ci} / ${Gn}`},children:u.jsxs("svg",{viewBox:`0 0 ${Ci} ${Gn}`,className:"h-full w-full",children:[$a.map((He,st)=>{const pt=ht.top+gr-He/Ia*gr;return u.jsxs("g",{children:[u.jsx("line",{x1:ht.left,y1:pt,x2:Ci-ht.right,y2:pt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:ht.left-6,y:pt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Ua(He)})]},`t-${st}`)}),be.map(([He,st],pt)=>{const si=ht.left+Xi*pt+Xi/2,Vs=st.impressions/Ia*gr,Oi=st.clicks/Ia*gr;return u.jsxs("g",{children:[u.jsx("title",{children:`${He}
269
+ Clicks: ${st.clicks}
270
+ Impressions: ${st.impressions}
271
+ CTR: ${st.impressions>0?(st.clicks/st.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:si-ml-kf/2,y:ht.top+gr-Vs,width:ml,height:Math.max(Vs,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:si+kf/2,y:ht.top+gr-Oi,width:ml,height:Math.max(Oi,1),rx:2,fill:"#10b981",opacity:.85})]},He)}),(()=>{const He=Math.min(be.length,7);return Array.from({length:He},(st,pt)=>{const si=be.length===1?0:Math.round(pt/(He-1)*(be.length-1)),Vs=ht.left+Xi*si+Xi/2;return u.jsx("text",{x:Vs,y:Gn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:be[si][0].slice(5)},`xl-${si}`)})})()]})})]})})(),u.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.startDate,onChange:Y=>z(be=>({...be,startDate:Y.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.endDate,onChange:Y=>z(be=>({...be,endDate:Y.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:E.query,onChange:Y=>z(be=>({...be,query:Y.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:E.page,onChange:Y=>z(be=>({...be,page:Y.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:E.limit,onChange:Y=>z(be=>({...be,limit:Y.target.value}))})]}),c.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Date"}),u.jsx("th",{className:"text-left",children:"Query"}),u.jsx("th",{className:"text-left",children:"Page"}),u.jsx("th",{className:"text-right",children:"Clicks"}),u.jsx("th",{className:"text-right",children:"Impressions"}),u.jsx("th",{className:"text-right",children:"CTR"}),u.jsx("th",{className:"text-right",children:"Position"})]})}),u.jsx("tbody",{children:c.map((Y,be)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:Y.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Y.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Y.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Y.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Y.ctr)?Y.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.position.toFixed(1)})]},`${Y.date}:${Y.query}:${Y.page}:${be}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),u.jsx("h3",{children:"Inspect a URL"})]})}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:C,onChange:Y=>A(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&void Of()}),u.jsx(he,{type:"button",size:"sm",disabled:X||!ft?.propertyId||!C.trim(),onClick:Of,children:X?"Inspecting…":"Inspect URL"})]}),v&&u.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.indexingState??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.verdict??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Xk(v.isMobileFriendly)})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:fi(v.crawlTime)})]})]})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),u.jsx("h3",{children:"Inspection log"})]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:R,onClick:()=>{dl()},children:R?"Loading…":"Refresh history"})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:D,onChange:Y=>K(Y.target.value)}),u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:R,onClick:()=>{dl()},children:"Apply filter"})]}),h.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Coverage"}),u.jsx("th",{className:"text-left",children:"Mobile"}),u.jsx("th",{className:"text-left",children:"Inspected"})]})}),u.jsx("tbody",{children:h.map(Y=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),u.jsx("td",{className:"text-zinc-300",children:Y.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Y.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Y.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Xk(Y.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:fi(Y.inspectedAt)})]},Y.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),u.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Changed at"})]})}),u.jsx("tbody",{children:g.map(Y=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),u.jsx("td",{className:"text-zinc-400",children:Y.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:Y.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:fi(Y.transitionDate)})]},`${Y.url}:${Y.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ft&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>fn(Y=>!Y),children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${an?"rotate-90":""}`,"aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),u.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),an&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),u.jsx("h3",{children:"Pick the Search Console property"})]})}),u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),u.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:me||s.length===0,onChange:Y=>N(Y.target.value),children:s.length===0?u.jsx("option",{value:"",children:me?"Loading properties…":"No properties available"}):s.map(Y=>u.jsxs("option",{value:Y.siteUrl,children:[Y.siteUrl," · ",Y.permissionLevel]},Y.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:me,onClick:()=>{ve(ft)},children:me?"Refreshing…":"Refresh properties"}),u.jsx(he,{type:"button",size:"sm",disabled:!S||ae,onClick:su,children:ae?"Saving…":"Save property"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),u.jsx("h3",{children:"Import GSC performance data"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),u.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:k,onChange:Y=>_(Y.target.value)})]}),u.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[u.jsx("input",{type:"checkbox",checked:T,onChange:Y=>P(Y.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(he,{type:"button",size:"sm",disabled:ai.isPending||!ft.propertyId,onClick:Gs,children:ai.isPending?"Queueing…":"Queue sync"}),!ft.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),u.jsx("h3",{children:"Sitemap configuration"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[ft.sitemapUrl&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ft.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:te||!ft.propertyId,onClick:()=>{hl()},children:te?"Loading…":"Browse sitemaps from GSC"}),u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:Ct.isPending||!ft.propertyId,onClick:Ni,children:Ct.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),Se&&Se.length>0&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[u.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Se.length,")"]}),Se.map(Y=>{const be=Y.contents?.[0];return u.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-zinc-200 break-all",children:Y.path}),Y.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Y.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[be&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[be.indexed," / ",be.submitted]}),u.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ee(Y.path),children:"Use"})]})]},Y.path)})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ft.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Me,onChange:Y=>Ee(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&Me.trim()&&void Qi()}),u.jsx(he,{type:"button",size:"sm",disabled:it||!Me.trim(),onClick:Qi,children:it?"Saving…":ft.sitemapUrl?"Update":"Save"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:rr.isPending||!ft.propertyId,onClick:async()=>{const be=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ft.sitemapUrl||void 0;Ye(null),nr(null);try{await rr.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:be}})}catch{}},children:rr.isPending?"Queueing…":"Inspect sitemap"})]}),!ft.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Mge({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(e.displayName),[g,y]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[S,N]=x.useState(e.language),[C,A]=x.useState(e.ownedDomains??[]),[k,_]=x.useState(""),[T,P]=x.useState(null),[E,z]=x.useState(!1),[D,K]=x.useState(!1),[U,I]=x.useState(""),[H,ge]=x.useState(""),[me,G]=x.useState(""),[ae,pe]=x.useState(""),[xe,B]=x.useState("");x.useEffect(()=>{r||(m(e.displayName),y(e.canonicalDomain),w(e.country),N(e.language),A(e.ownedDomains??[]))},[e,r]);function R(){i(!1),f(null),m(e.displayName),y(e.canonicalDomain),w(e.country),N(e.language),A(e.ownedDomains??[]),_("")}function V(){const Z=k.trim();Z&&(C.includes(Z)||A([...C,Z]),_(""))}function X(Z){A(C.filter(Me=>Me!==Z))}async function q(){if(!(!h.trim()||!g.trim()||!v.trim()||!S.trim())){l(!0),f(null);try{await t(e.name,{displayName:h.trim(),canonicalDomain:g.trim(),ownedDomains:C,country:v.trim(),language:S.trim()}),i(!1),Xe({title:"Project settings saved",detail:`${h.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Z){f(Z instanceof Error?Z.message:"Failed to save")}finally{l(!1)}}}async function W(){const Z=U.trim(),Me=H.trim(),Ee=me.trim(),it=ae.trim();if(!(!Z||!Me||!Ee||!it)){z(!0),P(null);try{const rt={label:Z,city:Me,region:Ee,country:it};xe.trim()&&(rt.timezone=xe.trim()),await Oq(e.name,rt),n(),I(""),ge(""),G(""),pe(""),B(""),K(!1),Xe({title:"Location added",detail:`${Z} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Z}`,dedupeMode:"drop"})}catch(rt){P(rt instanceof Error?rt.message:"Failed to add location")}finally{z(!1)}}}async function ie(Z){z(!0),P(null);try{await kq(e.name,Z),n(),Xe({title:"Location removed",detail:`${Z} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Z}`,dedupeMode:"drop"})}catch(Me){P(Me instanceof Error?Me.message:"Failed to remove location")}finally{z(!1)}}async function ye(Z){z(!0),P(null);try{await Aq(e.name,Z),n(),Xe({title:"Default location updated",detail:`${Z} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Me){P(Me instanceof Error?Me.message:"Failed to set default location")}finally{z(!1)}}const we=h!==e.displayName||g!==e.canonicalDomain||v!==e.country||S!==e.language||JSON.stringify(C)!==JSON.stringify(e.ownedDomains??[]),te="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",ue="block text-xs font-medium text-zinc-400 mb-1",Se=U.trim()&&H.trim()&&me.trim()&&ae.trim();return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),u.jsx("h2",{children:"Project settings"})]}),!r&&u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>f(null),children:"×"})]}),r?u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:ue,children:"Display name"}),u.jsx("input",{className:te,type:"text",value:h,onChange:Z=>m(Z.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:ue,children:"Canonical domain"}),u.jsx("input",{className:te,type:"text",value:g,onChange:Z=>y(Z.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:ue,children:"Country"}),u.jsx("input",{className:te,type:"text",value:v,onChange:Z=>w(Z.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:ue,children:"Language"}),u.jsx("input",{className:te,type:"text",value:S,onChange:Z=>N(Z.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:ue,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(Z=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[Z,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>X(Z),"aria-label":`Remove ${Z}`,children:"×"})]},Z))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${te} flex-1`,type:"text",placeholder:"docs.example.com",value:k,onChange:Z=>_(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&(Z.preventDefault(),V())}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:!k.trim(),onClick:V,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(he,{type:"button",disabled:s||!we||!h.trim()||!g.trim(),onClick:q,children:s?"Saving...":"Save changes"}),u.jsx(he,{type:"button",variant:"outline",disabled:s,onClick:R,children:"Cancel"})]})]}):u.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:u.jsx("table",{className:"w-full text-sm",children:u.jsxs("tbody",{children:[u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),u.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Z=>u.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:Z},Z))}):u.jsx("span",{className:"text-zinc-500",children:"—"})})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),u.jsxs("tr",{children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),u.jsxs("td",{className:"px-4 py-2.5",children:[T&&u.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[T,u.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>P(null),children:"×"})]}),(e.locations??[]).length>0?u.jsxs("table",{className:"w-full text-xs mb-2",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-zinc-600",children:[u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),u.jsx("th",{className:"pb-1"})]})}),u.jsx("tbody",{children:e.locations.map(Z=>u.jsxs("tr",{className:"border-t border-zinc-800/30",children:[u.jsx("td",{className:"py-1.5 pr-3",children:u.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${Z.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[Z.label,Z.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Z.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[Z.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:E,onClick:()=>ye(Z.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Z.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:E,onClick:()=>ie(Z.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Z.label}`,children:"Remove"})]})})]},Z.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),D?u.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),u.jsx("input",{className:te,type:"text",value:U,onChange:Z=>I(Z.target.value),placeholder:"nyc"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),u.jsx("input",{className:te,type:"text",value:H,onChange:Z=>ge(Z.target.value),placeholder:"New York"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),u.jsx("input",{className:te,type:"text",value:me,onChange:Z=>G(Z.target.value),placeholder:"NY"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),u.jsx("input",{className:te,type:"text",value:ae,onChange:Z=>pe(Z.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{className:"col-span-2",children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),u.jsx("input",{className:te,type:"text",value:xe,onChange:Z=>B(Z.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(he,{type:"button",size:"sm",disabled:E||!Se,onClick:W,children:E?"Adding...":"Add location"}),u.jsx(he,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{K(!1),P(null)},children:"Cancel"})]})]}):u.jsx(he,{type:"button",size:"sm",variant:"outline",onClick:()=>K(!0),children:"+ Add location"})]})]})]})})})]})}const Rge=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],$z=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function Dge({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState("daily"),[c,f]=x.useState(6),[h,m]=x.useState(""),[g,y]=x.useState("UTC"),[v,w]=x.useState(!1),[S,N]=x.useState(""),[C,A]=x.useState(!1),[k,_]=x.useState(!1),[T,P]=x.useState(null);x.useEffect(()=>{Lq(e).then(n).catch(()=>n(null))},[e]);const E=()=>{if(t&&t!=="loading"){const U=lF(t.preset??null,t.cronExpr);l(U.freq),f(U.hour),m(U.customCron);const I=$z.includes(t.timezone);y(I?t.timezone:"Other"),w(!I),N(I?"":t.timezone)}else l("daily"),f(6),m(""),y("UTC"),w(!1),N("");P(null),i(!0)},z=async()=>{A(!0),P(null);try{const I={timezone:v?S.trim()||"UTC":g};s==="custom"?I.cron=h.trim():I.preset=oF(s,c);const H=await Uk(e,I);n(H),i(!1),Xe({title:"Schedule saved",detail:W0(H.preset??null,H.cronExpr,H.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){P(U instanceof Error?U.message:"Failed to save schedule")}finally{A(!1)}},D=async()=>{if(!(!t||t==="loading")){A(!0),P(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const I=await Uk(e,U);n(I),Xe({title:I.enabled?"Schedule resumed":"Schedule paused",detail:W0(I.preset??null,I.cronExpr,I.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){P(U instanceof Error?U.message:"Failed to update schedule")}finally{A(!1)}}},K=async()=>{_(!0),P(null);try{await Iq(e),n(null),i(!1),Xe({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){P(U instanceof Error?U.message:"Failed to remove schedule")}finally{_(!1)}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:E,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(Ue,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&u.jsxs(Ue,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:W0(t.preset??null,t.cronExpr,t.timezone)}),u.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",u.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(yt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:D,children:t.enabled?"Pause":"Resume"}),u.jsx(he,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:K,children:k?"Removing...":"Remove"})]})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),r&&u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:s,onChange:U=>l(U.target.value),children:Rge.map(U=>u.jsx("option",{value:U.value,children:U.label},U.value))})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:s==="twice-daily"||s==="custom",onChange:U=>f(parseInt(U.target.value)),children:Array.from({length:24},(U,I)=>u.jsx("option",{value:I,children:lw(I)},I))})]})]}),s==="custom"&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:h,onChange:U=>m(U.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),u.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:v?"Other":g,onChange:U=>{U.target.value==="Other"?(w(!0),y("Other")):(w(!1),y(U.target.value))},children:[$z.map(U=>u.jsx("option",{value:U,children:U},U)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:U=>N(U.target.value)})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm",children:T}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),P(null)},children:"Cancel"}),u.jsx(he,{type:"button",size:"sm",disabled:C||s==="custom"&&!h.trim(),onClick:z,children:C?"Saving...":"Save schedule"})]})]})]})}const Lge=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function Ige({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState(""),[c,f]=x.useState(["citation.lost","citation.gained"]),[h,m]=x.useState(!1),[g,y]=x.useState(null),[v,w]=x.useState({});x.useEffect(()=>{$q(e).then(n).catch(()=>n([]))},[e]);const S=k=>{f(_=>_.includes(k)?_.filter(T=>T!==k):[..._,k])},N=async()=>{if(!(!s.trim()||c.length===0)){m(!0),y(null);try{const k=await Uq(e,{channel:"webhook",url:s.trim(),events:c});n(_=>_==="loading"?[k]:[..._,k]),l(""),f(["citation.lost","citation.gained"]),i(!1),Xe({title:"Webhook added",detail:`Notifications will be sent to ${k.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(k){y(k instanceof Error?k.message:"Failed to add webhook")}finally{m(!1)}}},C=async k=>{try{await Bq(e,k),n(_=>_==="loading"?_:_.filter(T=>T.id!==k)),Xe({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${k}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to remove webhook")}},A=async k=>{w(_=>({..._,[k]:{state:"testing"}}));try{const _=await qq(e,k);w(T=>({...T,[k]:{state:_.ok?"ok":"fail",status:_.status}})),_.ok&&Xe({title:"Test notification sent",detail:`Webhook returned status ${_.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${k}`,dedupeMode:"replace"})}catch{w(_=>({..._,[k]:{state:"fail"}}))}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:s,onChange:k=>l(k.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),u.jsx("div",{className:"flex flex-wrap gap-3",children:Lge.map(k=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(k.value),onChange:()=>S(k.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:k.label})]},k.value))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm",children:g}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),u.jsx(he,{type:"button",size:"sm",disabled:h||!s.trim()||c.length===0,onClick:N,children:h?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(Ue,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&u.jsxs("div",{className:"evidence-table-wrap",children:[u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Endpoint"}),u.jsx("th",{children:"Events"}),u.jsx("th",{children:"Status"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:t.map(k=>u.jsxs("tr",{children:[u.jsx("td",{className:"evidence-keyword-cell",children:u.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:k.urlHost,children:k.urlDisplay??k.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:k.events.map(_=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:_.replace("."," ")},_))})}),u.jsx("td",{children:u.jsx(yt,{tone:k.enabled?"positive":"neutral",children:k.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[k.id]&&(()=>{const _=v[k.id],T=_.state==="testing"?"Sending…":_.state==="ok"?`Delivered${_.status?` (${_.status})`:""}`:`Failed${_.status?` (${_.status})`:""}`;return u.jsx(yt,{tone:_.state==="ok"?"positive":_.state==="fail"?"negative":"neutral",children:T})})(),u.jsx(he,{variant:"ghost",size:"sm",type:"button",disabled:v[k.id]?.state==="testing",onClick:()=>A(k.id),children:"Test"}),u.jsx(he,{variant:"ghost",size:"sm",type:"button",onClick:()=>C(k.id),children:"Remove"})]})})]},k.id))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:g})]})]})}function Uz({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:s,coverageValue:l,note:c,updatedAt:f,active:h,onClick:m}){return u.jsxs("button",{type:"button",onClick:m,className:`surface-card w-full text-left transition-colors ${h?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),u.jsx("h3",{children:t})]}),u.jsx(yt,{tone:r,children:n})]}),u.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),u.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:s})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[u.jsx("span",{children:c}),u.jsx("span",{children:f?`Updated ${fi(f)}`:"No recent sync yet"})]})]})}function _p({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),u.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}function $ge({projectName:e,refreshNonce:t}){const[n,r]=x.useState(null),[i,s]=x.useState([]),[l,c]=x.useState(null),[f,h]=x.useState([]),[m,g]=x.useState([]),[y,v]=x.useState(null),[w,S]=x.useState(""),[N,C]=x.useState(""),[A,k]=x.useState(""),[_,T]=x.useState(!0),[P,E]=x.useState(!1),[z,D]=x.useState(null),[K,U]=x.useState("coverage");x.useEffect(()=>{I()},[e,t]);async function I(){T(!0),D(null);try{const B=await PM(e);if(r(B),B.connected){const[R,V,X,q]=await Promise.all([GS(e).catch(()=>null),zM(e).catch(()=>[]),u9(e).catch(()=>[]),B.siteUrl?Promise.resolve([]):l9(e).then(W=>W.sites).catch(()=>[])]);c(R),h(V),g(X),s(q)}else c(null),h([]),g([]),s([])}catch(B){D(B instanceof Error?B.message:"Failed to load Bing data")}finally{T(!1)}}async function H(){if(N.trim()){D(null);try{const B=await s9(e,N.trim());C(""),B.availableSites.length>0&&s(B.availableSites),await I()}catch(B){D(B instanceof Error?B.message:"Failed to connect")}}}async function ge(){try{await o9(e),r(null),s([]),c(null),h([]),g([]),v(null),k(""),D(null)}catch(B){D(B instanceof Error?B.message:"Failed to disconnect")}}async function me(){if(A)try{await c9(e,A),await I()}catch(B){D(B instanceof Error?B.message:"Failed to set site")}}async function G(){if(w.trim())try{const B=await MM(e,w.trim());v(B),h(R=>[B,...R])}catch(B){D(B instanceof Error?B.message:"Inspection failed")}}async function ae(B){E(!0),D(null);try{const R=await Fk(e,{urls:[B]}),{succeeded:V,failed:X,total:q}=R.summary;Xe({title:"Bing submission requested",detail:X===0?`${V} URL submitted to Bing.`:`${V}/${q} submitted successfully, ${X} failed.`,tone:X===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}catch(R){const V=R instanceof Error?R.message:"Submission failed";D(V),Xe({title:"Bing submission failed",detail:V,tone:"negative",dedupeKey:`bing:indexing:${e}:${B}`,dedupeMode:"replace"})}finally{E(!1)}}async function pe(){E(!0),D(null),Xe({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const B=await Fk(e,{allUnindexed:!0}),{succeeded:R,failed:V,total:X}=B.summary;Xe({title:"Bing submissions requested",detail:V===0?`${R}/${X} URL${X!==1?"s":""} submitted to Bing.`:`${R}/${X} submitted successfully, ${V} failed.`,tone:V===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(B){const R=B instanceof Error?B.message:"Batch submission failed";D(R),Xe({title:"Bing submissions failed",detail:R,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{E(!1)}}if(_)return u.jsx(Ue,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(yt,{tone:"caution",children:"Not connected"})]}),u.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),u.jsxs("div",{className:"mt-3",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:N,onChange:B=>C(B.target.value),onKeyDown:B=>B.key==="Enter"&&H()}),u.jsx(he,{size:"sm",disabled:!N.trim(),onClick:H,children:"Connect"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});if(!n.siteUrl)return u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(yt,{tone:"positive",children:"Connected"}),u.jsx(he,{size:"sm",variant:"ghost",onClick:ge,children:"Disconnect"})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?fi(n.updatedAt):"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),i.length>0?u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:A,onChange:B=>k(B.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(B=>u.jsxs("option",{value:B.url,children:[B.url,B.verified?" (verified)":""]},B.url))]}),u.jsx(he,{size:"sm",disabled:!A,onClick:me,children:"Set Site"})]}):u.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});const xe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(yt,{tone:"positive",children:"Connected"}),u.jsx(he,{size:"sm",variant:"ghost",onClick:ge,children:"Disconnect"})]})]}),z&&u.jsx("p",{className:"mb-3 text-xs text-rose-400",children:z}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",u.jsx("code",{children:n.siteUrl}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?fi(n.updatedAt):"—"})]})]})]})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index monitoring"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:l?.lastInspectedAt?`Last inspected ${fi(l.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:xe.map(B=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${K===B.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>U(B.key),children:B.label},B.key))}),K==="coverage"&&l&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(_p,{label:"Indexed",value:l.summary.indexed,tone:"positive"}),u.jsx(_p,{label:"Not in index",value:l.summary.notIndexed+(l.summary.unknown??0),tone:"negative"}),u.jsx(_p,{label:"Status unknown",value:l.summary.unknown??0,tone:"neutral"}),u.jsx(_p,{label:"Coverage",value:`${l.summary.percentage}%`,tone:"neutral"})]}),l.notIndexed.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",l.notIndexed.length,")"]}),u.jsx(he,{size:"sm",variant:"ghost",disabled:P,onClick:pe,children:P?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:l.notIndexed.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:P,onClick:()=>ae(B.url),children:"Submit"})})]},B.id))})]})})]}),(l.unknown??[]).length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(l.unknown??[]).length,")"]}),u.jsx(he,{size:"sm",variant:"ghost",disabled:P,onClick:pe,children:P?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:(l.unknown??[]).map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.lastCrawledDate?fi(B.lastCrawledDate):"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:P,onClick:()=>ae(B.url),children:"Submit"})})]},B.id))})]})})]}),l.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",l.indexed.length,")"]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),u.jsx("tbody",{children:l.indexed.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.lastCrawledDate?fi(B.lastCrawledDate):"—"})]},B.id))})]})})]})]}),K==="coverage"&&!l&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),K==="inspections"&&u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:w,onChange:B=>S(B.target.value),onKeyDown:B=>B.key==="Enter"&&G()}),u.jsx(he,{size:"sm",disabled:!w.trim(),onClick:G,children:"Inspect"})]}),y&&u.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[u.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),u.jsx("tbody",{children:f.map(B=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(yt,{tone:B.inIndex?"positive":"negative",children:B.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:B.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:fi(B.inspectedAt)})]},B.id))})]})})]}),K==="performance"&&u.jsx("div",{className:"mt-4",children:m.length===0?u.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),u.jsx("tbody",{children:m.map((B,R)=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:B.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:B.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:B.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(B.ctr)?B.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:B.averagePosition.toFixed(1)})]},R))})]})})})]})]})}function Uge({projectName:e}){const[t,n]=x.useState("google"),[r,i]=x.useState(!0),[s,l]=x.useState("idle"),[c,f]=x.useState(null),h=x.useRef(null),[m,g]=x.useState(!1),[y,v]=x.useState(null),[w,S]=x.useState(null),[N,C]=x.useState(!1),[A,k]=x.useState(null),[_,T]=x.useState(null),[P,E]=x.useState(0);async function z(R=!1){R||i(!0),f(null);try{const[V,X,q]=await Promise.all([KS().catch(()=>null),EM(e).catch(()=>[]),PM(e).catch(()=>null)]),W=X.find(we=>we.connectionType==="gsc")??null;g(!!V?.google?.configured),C(!!V?.bing?.configured),v(W),k(q);const[ie,ye]=await Promise.all([W?HS(e).catch(()=>null):Promise.resolve(null),q?.connected?GS(e).catch(()=>null):Promise.resolve(null)]);S(ie),T(ye)}catch(V){f(V instanceof Error?V.message:"Failed to load search console overview")}finally{i(!1)}}async function D(){if(s!=="idle")return;h.current?.abort();const R=new AbortController;h.current=R;const V=R.signal;l("syncing"),f(null);const X=[];try{async function q(){if(!y)return;const we=await TM(e);if(!we?.id)return;const te=2e3,Se=Date.now()+12e4;for(;Date.now()<Se;){if(V.aborted||(await new Promise(Me=>setTimeout(Me,te)),V.aborted))return;const Z=await Oc(we.id).catch(()=>null);if(!Z)break;if(["completed","failed","cancelled"].includes(Z.status)){Z.status!=="completed"&&X.push(`Google sync ${Z.status}`);break}}}const W=10;async function ie(){if(!A?.connected)return;const we=await zM(e).catch(()=>[]),te=[...new Set(we.map(ue=>ue.url))];if(te.length!==0)for(let ue=0;ue<te.length;ue+=W){if(V.aborted)return;const Se=te.slice(ue,ue+W),Me=(await Promise.allSettled(Se.map(Ee=>MM(e,Ee)))).filter(Ee=>Ee.status==="rejected").length;Me>0&&X.push(`${Me} Bing inspection(s) failed`)}}const ye=await Promise.allSettled([q(),ie()]);for(const we of ye)we.status==="rejected"&&X.push(we.reason instanceof Error?we.reason.message:"Sync failed");if(V.aborted)return;l("reloading"),await z(!0),E(we=>we+1),X.length>0&&f(`Partial refresh: ${X.join("; ")}`)}catch(q){V.aborted||f(q instanceof Error?q.message:"Refresh failed")}finally{V.aborted||l("idle")}}x.useEffect(()=>(z(),()=>{h.current?.abort()}),[e]);const K=y?"positive":m?"caution":"negative",U=y?"Connected":m?"Ready to connect":"Needs setup",I=w?`${w.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",H=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ge=w?.lastInspectedAt??y?.updatedAt??null,me=A?.connected?"positive":N?"caution":"negative",G=A?.connected?"Connected":N?"Ready to connect":"Needs setup",ae=_?`${_.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",pe=_?_.summary.notIndexed+(_.summary.unknown??0):0,xe=_?`${pe} not in index`:A?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",B=_?.lastInspectedAt??A?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),u.jsx("h2",{children:"Search Engine Intelligence"}),u.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:r||s!=="idle",onClick:()=>{D()},children:r?"Loading…":s==="syncing"?"Refreshing Google & Bing…":s==="reloading"?"Reloading workspaces…":"Refresh all"})]}),c&&u.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:c}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsx(Uz,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":U,tone:r?"neutral":K,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":I,note:r?"Loading overview…":H,updatedAt:ge,active:t==="google",onClick:()=>n("google")}),u.jsx(Uz,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":G,tone:r?"neutral":me,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:r?"Loading…":ae,note:r?"Loading overview…":xe,updatedAt:B,active:t==="bing",onClick:()=>n("bing")})]})]}),u.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([R,V])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===R,className:`project-subnav-link ${t===R?"project-subnav-link-active":""}`,onClick:()=>n(R),children:V},R))}),t==="google"&&u.jsx(zge,{projectName:e}),t==="bing"&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),u.jsx("h2",{children:"Bing Webmaster Tools"})]})}),u.jsx($ge,{projectName:e,refreshNonce:P})]})]})}function Bge({insights:e}){const{openEvidence:t}=Kc(),[n,r]=x.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const s=n===i.id,l=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(s?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&u.jsx(dg,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${s?"rotate-90":""}`}),u.jsx(yt,{tone:i.tone,children:i.actionLabel}),u.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),u.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),s&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map(c=>u.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx(Aw,{state:c.citationState}),u.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.keyword}),u.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&u.jsx(Ad,{provider:c.provider})})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId))})]},i.id)})})}function Ny({tab:e}){const{projectId:t}=lg({from:"/projects/$projectId"}),n=Is(),{dashboard:r,isLoading:i,refetch:s}=al();if(!r||i)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-48"}),u.jsx("div",{className:"skeleton-text-sm w-32"})]}),u.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(fe=>u.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[u.jsx("div",{className:"skeleton-circle size-20"}),u.jsx("div",{className:"skeleton-text w-16 mt-3"})]},fe))}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(fe=>u.jsx("div",{className:"skeleton-text-sm w-full"},fe))})]})]});const l=kW(r,t),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[g,y]=x.useState(!1),[v,w]=x.useState(""),[S,N]=x.useState(!1),[C,A]=x.useState(!1),[k,_]=x.useState(""),[T,P]=x.useState(!1),[E,z]=x.useState(!1),[D,K]=x.useState(""),[U,I]=x.useState(!1),[H,ge]=x.useState(void 0),[me,G]=x.useState(!1),[ae,pe]=x.useState(null),[xe,B]=x.useState(!1),R=l?.visibilityEvidence??[],V=l?.project.name??"",X=l?.project.displayName||l?.project.name||V,q=x4(),W=x.useMemo(()=>new Set(R.map(fe=>fe.location??"")),[R]),ie=W.has(""),ye=x.useMemo(()=>[...W].filter(Boolean),[W]);x.useEffect(()=>{if(H===void 0||H===""||!V){pe(null),B(!1);return}B(!0),kM(V,H).then(fe=>{pe(fe),B(!1)}).catch(()=>{pe(null),B(!1)})},[H,V]);const we=x.useMemo(()=>{if(!ae)return null;const fe=new Map;for(const Je of ae){for(const[xt,wn]of Object.entries(Je.providerRuns??{}))fe.set(`${Je.keyword}::${xt}`,wn.map(et=>({runId:et.runId,citationState:et.citationState,createdAt:et.createdAt,answerMentioned:et.answerMentioned,visibilityState:et.visibilityState,visibilityTransition:et.visibilityTransition})));(!Je.providerRuns||Object.keys(Je.providerRuns).length===0)&&fe.set(`${Je.keyword}::`,Je.runs.map(xt=>({runId:xt.runId,citationState:xt.citationState,createdAt:xt.createdAt,answerMentioned:xt.answerMentioned,visibilityState:xt.visibilityState,visibilityTransition:xt.visibilityTransition})))}return fe},[ae]),te=x.useMemo(()=>{const fe=H!==void 0?R.filter(Je=>H===""?!Je.location:Je.location===H):R;return we?fe.map(Je=>{const xt=we.get(`${Je.keyword}::${Je.provider}`)??we.get(`${Je.keyword}::`);return xt?{...Je,runHistory:xt}:Je}):fe},[R,H,we]);if(!l)return u.jsx("div",{className:"page-container",children:u.jsxs(Ue,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Project not found"}),u.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),u.jsx(he,{asChild:!0,children:u.jsx(Dt,{to:"/",children:"Return to overview"})})]})});async function ue(){try{await q.mutateAsync({projectName:V,projectLabel:X,sourceAction:"project-run"}),s()}catch{}}async function Se(){m(!0);try{await Eq(V),Xe({title:"Project deleted",detail:`${X} was removed.`,tone:"positive",dedupeKey:`project:delete:${V}`,dedupeMode:"drop"}),n({to:"/"}),s()}catch(fe){console.error("Failed to delete project:",fe)}finally{m(!1)}}async function Z(){const fe=await Tq(V),Je=typeof fe=="string"?fe:JSON.stringify(fe,null,2),xt=new Blob([Je],{type:"text/yaml"}),wn=URL.createObjectURL(xt),et=document.createElement("a");et.href=wn,et.download=`${V}.yaml`,et.click()}async function Me(){const fe=v.split(`
272
+ `).map(Je=>Je.trim()).filter(Boolean);if(fe.length!==0){N(!0);try{await Nq(V,fe),s(),w(""),y(!1)}finally{N(!1)}}}async function Ee(){const fe=k.trim();if(fe){P(!0);try{const xt=(await OM(V)).map(et=>et.domain),wn=[...new Set([...xt,fe])];await AM(V,wn),s(),_(""),A(!1)}finally{P(!1)}}}async function it(){const fe=D.trim();if(fe){I(!0);try{const Je=l?.project.ownedDomains??[];await $k(V,[...Je,fe]),s(),K(""),z(!1)}finally{I(!1)}}}async function rt(fe){I(!0);try{const Je=l?.project.ownedDomains??[];await $k(V,Je.filter(xt=>xt!==fe)),s()}finally{I(!1)}}async function an(fe,Je){await Cq(fe,Je),s()}const fn=fe=>!Number.isNaN(Number.parseInt(fe,10)),Vt=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${l.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(Ue,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[u.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),u.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",u.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(he,{type:"button",variant:"destructive",disabled:h,onClick:Se,children:h?"Deleting...":"Yes, delete project"}),u.jsx(he,{type:"button",variant:"outline",disabled:h,onClick:()=>f(!1),children:"Cancel"})]})]}):null,u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),u.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!E&&u.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>z(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:l.project.country}),u.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(fe=>u.jsx("span",{className:"tag",children:fe},fe))]}),((l.project.ownedDomains??[]).length>0||E)&&u.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(fe=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[fe,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>rt(fe),"aria-label":`Remove ${fe}`,children:"×"})]},fe)),E?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:D,onChange:fe=>K(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&it(),autoFocus:!0}),u.jsx(he,{type:"button",size:"sm",disabled:!D.trim()||U,onClick:it,children:U?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),K("")},children:"Cancel"})]}):u.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>z(!0),children:"+ domain"})]})]}),u.jsxs("div",{className:"page-header-right",children:[u.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(he,{type:"button",variant:"outline",size:"icon",onClick:Z,"aria-label":"Export project as YAML",children:u.jsx(P9,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(he,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:u.jsx(X9,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(he,{type:"button",disabled:q.isPending,onClick:ue,children:q.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Vt.map(fe=>u.jsx(Dt,{to:fe.href,className:`project-subnav-link ${fe.key===e?"project-subnav-link-active":""}`,"aria-current":fe.key===e?"page":void 0,children:fe.label},fe.key))}),e==="overview"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(mL,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:fn(l.visibilitySummary.value),progress:l.visibilitySummary.progress}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Wn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",l.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapKeyPhrases.tone}`,style:{width:l.gapKeyPhrases.progress!==void 0?`${l.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:l.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:l.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Wn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),u.jsx("span",{className:"text-zinc-600",children:"%"})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Wn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):u.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),u.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),l.providerScores.length>1&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),u.jsxs("h2",{children:["Visibility by model ",u.jsx(Wn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Model"}),u.jsx("th",{children:"Score"}),u.jsx("th",{children:"Cited key phrases"})]})}),u.jsx("tbody",{children:l.providerScores.map(fe=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Ad,{provider:fe.provider}),fe.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:fe.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${fe.score>=70?"text-emerald-400":fe.score>=40?"text-amber-400":"text-rose-400"}`,children:[fe.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[fe.cited," of ",fe.total]})]},`${fe.provider}::${fe.model??"unknown"}`))})]})})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),u.jsx("h2",{children:"Citation signals"})]})}),u.jsx(Bge,{insights:l.insights})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),u.jsx("h2",{children:"Key phrase citation tracking"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(fe=>fe.keyword)).size," key phrases tracked"]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!g),children:g?"Cancel":"+ Add key phrases"})]})]}),g&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:v,onChange:fe=>w(fe.target.value)}),u.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
273
+ `).filter(fe=>fe.trim()).length," key phrases"]}),u.jsx(he,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:Me,children:S?"Adding...":"Add key phrases"})]})]}),l.project.locations&&l.project.locations.length>0&&u.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[u.jsx("button",{className:`filter-chip ${H===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":H===void 0,onClick:()=>{ge(void 0)},children:"All locations"}),l.project.locations.map(fe=>W.has(fe.label)&&u.jsx("button",{className:`filter-chip ${H===fe.label?"filter-chip-active":""}`,type:"button","aria-pressed":H===fe.label,onClick:()=>{ge(fe.label),G(!1)},children:fe.label},fe.label)),ie&&u.jsx("button",{className:`filter-chip ${H===""?"filter-chip-active":""}`,type:"button","aria-pressed":H==="",onClick:()=>{ge(""),G(!1)},children:"No location"}),ye.length>1&&H===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${me?"filter-chip-active":""}`,type:"button","aria-pressed":me,onClick:()=>G(fe=>!fe),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(LX,{evidence:te})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),u.jsx("h2",{children:"Competitive landscape"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!C),children:C?"Cancel":"+ Add competitor"})]})]}),C&&u.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:k,onChange:fe=>_(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&Ee()}),u.jsx(he,{type:"button",size:"sm",disabled:!k.trim()||T,onClick:Ee,children:T?"Adding...":"Add"})]}),u.jsx(IX,{competitors:l.competitors})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),u.jsx("h2",{children:"Recent execution history"})]})}),u.jsx("div",{className:"run-list",children:l.recentRuns.map(fe=>u.jsx(pL,{run:fe},fe.id))})]}),u.jsx(Mge,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:an,onRefresh:()=>{s()}}),u.jsx(Dge,{projectName:l.project.name}),u.jsx(Ige,{projectName:l.project.name})]}):e==="analytics"?u.jsx(BX,{projectName:l.project.name}):e==="traffic"?u.jsx(Sge,{projectName:l.project.name}):u.jsx(Uge,{projectName:l.project.name})]})}function qge(){const{dashboard:e,isLoading:t}=al(),n=Age();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-20"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"skeleton-text w-40"}),u.jsx("div",{className:"skeleton-text-sm w-56"})]}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const r=e.runs,[i,s]=x.useState("all"),l=i==="all"?r:r.filter(f=>f.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Runs"}),u.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),u.jsx(he,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),u.jsxs("section",{children:[u.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>u.jsx("button",{className:`filter-chip ${i===f?"filter-chip-active":""}`,type:"button","aria-pressed":i===f,onClick:()=>s(f),children:f==="all"?"All runs":hg(f)},f))}),u.jsx("div",{className:"run-list",children:l.length>0?l.map(f=>u.jsx(pL,{run:f},f.id)):u.jsxs(Ue,{className:"surface-card empty-card",children:[u.jsx("h2",{children:"No runs match this filter"}),u.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function Fge({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[s,l]=x.useState(""),[c,f]=x.useState(""),[h,m]=x.useState(""),[g,y]=x.useState(""),[v,w]=x.useState(""),[S,N]=x.useState(""),[C,A]=x.useState(!1),[k,_]=x.useState(null),[T,P]=x.useState(!1),E=i?c.trim().length>0:s.trim().length>0;async function z(){if(E){A(!0),_(null),P(!1);try{const K=me=>{const G=parseInt(me.trim(),10);return Number.isFinite(G)&&G>0?G:void 0},U={},I=K(g);I!==void 0&&(U.maxConcurrency=I);const H=K(v);H!==void 0&&(U.maxRequestsPerMinute=H);const ge=K(S);ge!==void 0&&(U.maxRequestsPerDay=ge),await Rq(e.toLowerCase(),{...s.trim()?{apiKey:s.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...h.trim()?{model:h.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),l(""),f(""),m(""),y(""),w(""),N(""),P(!0),Xe({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(K){_(K instanceof Error?K.message:"Failed to update provider")}finally{A(!1)}}}const D=n??"Use default model";return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),u.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:K=>f(K.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&u.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),u.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:s,onChange:K=>l(K.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),u.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:D,value:h,onChange:K=>m(K.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),u.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:g,onChange:K=>y(K.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:K=>w(K.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:K=>N(K.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),k&&u.jsx("p",{className:"text-xs text-rose-400",children:k}),T&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(he,{type:"button",size:"sm",disabled:!E||C,onClick:z,children:C?"Saving...":"Save"})]})}function Kge({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(!1),g=t.trim().length>0&&r.trim().length>0;async function y(){if(g){l(!0),f(null),m(!1);try{await Dq({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),m(!0),Xe({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){f(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),u.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),u.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:v=>n(v.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),u.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:r,onChange:v=>i(v.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&u.jsx("p",{className:"text-xs text-rose-400",children:c}),h&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(he,{type:"button",size:"sm",disabled:!g||s,onClick:y,children:s?"Saving...":"Save Google OAuth app"})]})}function Hge(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,s]=x.useState(!1),[l,c]=x.useState("localhost"),[f,h]=x.useState("9222"),[m,g]=x.useState(!1);return x.useEffect(()=>{Bk().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),u.jsx("h2",{children:"ChatGPT (CDP)"})]}),u.jsx(yt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&u.jsxs("div",{children:[u.jsx("dt",{children:"Endpoint"}),u.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&u.jsxs("div",{children:[u.jsx("dt",{children:"Browser"}),u.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&u.jsxs("div",{children:[u.jsx("dt",{children:"Tabs"}),u.jsx("dd",{children:e.targets.map(y=>u.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":n||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),u.jsx("div",{className:"mt-2",children:u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>s(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&u.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),g(!0);try{await a9(l,parseInt(f,10)||9222);const v=await Bk().catch(()=>null);v&&t(v),s(!1),Xe({title:"CDP endpoint saved",detail:`${l}:${parseInt(f,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{g(!1)}},children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:y=>c(y.target.value),"aria-label":"CDP host"}),u.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:f,onChange:y=>h(y.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(he,{type:"submit",size:"sm",disabled:m,children:m?"Saving…":"Save endpoint"})})]})]})}const Gge={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function Vge(){const e=ef(),{dashboard:t}=al(),n=t?.settings??e?.dashboard?.settings,s=Ng(!e,e?.health).data??e?.health??Gge,[l,c]=x.useState(null),[f,h]=x.useState(!1),[m,g]=x.useState(!1),[y,v]=x.useState(""),[w,S]=x.useState(!1),[N,C]=x.useState(null),[A,k]=x.useState(!1);return n?u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Settings"}),u.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),u.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(_=>u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),u.jsx("h2",{children:_.displayName??_.name})]}),u.jsx(yt,{tone:_.state==="ready"?"positive":"caution",children:_.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Model"}),u.jsx("dd",{className:"font-mono text-xs",children:_.model})]}),_.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:_.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[_.quota.maxRequestsPerMinute,"/min · ",_.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:_.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===_.name?null:_.name),children:l===_.name?"Cancel":_.state==="ready"?_.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===_.name&&u.jsx(Fge,{providerName:_.name,keyUrl:_.keyUrl,modelHint:_.modelHint,onSaved:()=>{c(null)}})]},_.name)),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),u.jsx("h2",{children:"Search Console OAuth"})]}),u.jsx(yt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!f),children:f?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),f&&u.jsx(Kge,{onSaved:()=>{h(!1)}})]}),u.jsxs(Ue,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),u.jsx("h2",{children:"Webmaster Tools"})]}),u.jsx(yt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),m&&u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),u.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:y,onChange:_=>v(_.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),N&&u.jsx("p",{className:"text-xs text-rose-400",children:N}),A&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(he,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){S(!0),C(null),k(!1);try{await d9(y.trim()),v(""),k(!0),g(!1),Xe({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(_){C(_ instanceof Error?_.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),u.jsx(Hge,{}),u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),u.jsx("h2",{children:"API and worker"})]})}),u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"API"}),u.jsx("p",{className:"supporting-copy",children:s.apiStatus.detail})]}),u.jsx(yt,{tone:nm(s.apiStatus),children:s.apiStatus.state==="ok"?"Healthy":"Attention"})]}),u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"Worker"}),u.jsx("p",{className:"supporting-copy",children:s.workerStatus.detail})]}),u.jsx(yt,{tone:nm(s.workerStatus),children:s.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(Ue,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),u.jsx("h2",{children:"Operational guidance"})]})}),u.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(_=>u.jsx("li",{children:_},_))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const Zge=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function Yge({current:e,labels:t}){return u.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,s=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${s?"setup-step-active":""}`,role:"listitem","aria-current":s?"step":void 0,children:[u.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),u.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function Wge(){const e=ef(),{dashboard:t,isLoading:n,refetch:r}=al(),i=t??e?.dashboard;if(!i||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-24"}),u.jsx("div",{className:"skeleton-text-sm w-80"})]}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-32"}),u.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ve=>u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-1 flex-1",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ve))})]})]});const s=i.settings,f=Ng(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},h=wQ(i.setup,f,s),m=Is(),[g,y]=x.useState(0),[v,w]=x.useState(""),[S,N]=x.useState(""),[C,A]=x.useState(""),[k,_]=x.useState("US"),[T,P]=x.useState("en"),[E,z]=x.useState(null),[D,K]=x.useState(null),[U,I]=x.useState(null),[H,ge]=x.useState(!1),[me,G]=x.useState(""),[ae,pe]=x.useState(!1),[xe,B]=x.useState(null),[R,V]=x.useState(!1),X=s.providerStatuses.filter(ve=>ve.state==="ready"),[q,W]=x.useState(X[0]?.name??""),[ie,ye]=x.useState(5),[we,te]=x.useState(!1),[ue,Se]=x.useState(null),[Z,Me]=x.useState(""),[Ee,it]=x.useState(!1),[rt,an]=x.useState(null),[fn,Vt]=x.useState(!1),[fe,Je]=x.useState(!1),[xt,wn]=x.useState(!1),et=x4(),Ke=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),at=me.split(`
274
+ `).map(ve=>ve.trim()).filter(Boolean),qt=Z.split(`
275
+ `).map(ve=>ve.trim()).filter(Boolean),Ye=h.healthChecks.some(ve=>ve.id==="api"&&ve.state==="ready"),ul=async()=>{if(!(!Ke||!C)){ge(!0),I(null);try{const ve=await ug(Ke,{displayName:S||v,canonicalDomain:C,country:k,language:T});z(Ke),K(ve.id),Xe({title:"Project created",detail:`${ve.displayName||ve.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ve.name}`,dedupeMode:"drop"}),r(),y(2)}catch(ve){I(ve instanceof Error?ve.message:"Failed to create project")}finally{ge(!1)}}},nr=async()=>{if(!E)return;const ve=at;if(ve.length!==0){V(!0),B(null);try{await jq(E,ve),pe(!0),r(),y(3)}catch(mr){B(mr instanceof Error?mr.message:"Failed to save key phrases")}finally{V(!1)}}},ft=async()=>{if(!(!E||!q)){te(!0),Se(null);try{const ve=await Fq(E,q,ie);if(ve.keywords.length>0){const mr=me?me.trimEnd()+`
276
+ `+ve.keywords.join(`
277
+ `):ve.keywords.join(`
278
+ `);G(mr)}}catch(ve){Se(ve instanceof Error?ve.message:"Failed to generate key phrases")}finally{te(!1)}}},au=async()=>{if(!E)return;const ve=qt;if(ve.length!==0){Vt(!0),an(null);try{await AM(E,ve),it(!0),r(),y(4)}catch(mr){an(mr instanceof Error?mr.message:"Failed to save competitors")}finally{Vt(!1)}}},ai=async()=>{if(E){wn(!0);try{await et.mutateAsync({projectName:E,projectLabel:S||v||E,sourceAction:"setup-launch"}),Je(!0),r()}catch{}finally{wn(!1)}}},Ct=()=>y(ve=>Math.max(0,ve-1)),rr=(()=>{switch(g){case 0:return u.jsxs(Ue,{className:"surface-card step-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),u.jsx("h2",{children:"System ready"})]})}),u.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),u.jsx("div",{className:"compact-stack",children:h.healthChecks.map(ve=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:ve.label}),u.jsx("p",{className:"supporting-copy",children:ve.detail}),ve.id==="provider"&&ve.state!=="ready"&&u.jsx(Dt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),u.jsx(yt,{tone:ve.state==="ready"?"positive":"caution",children:ve.state==="ready"?"Ready":"Attention"})]},ve.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(he,{type:"button",disabled:!Ye,onClick:()=>y(1),children:"Continue"})]})]});case 1:return u.jsxs(Ue,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),u.jsx("h2",{children:"Create project"})]}),E?u.jsx(yt,{tone:"positive",children:"Created"}):null]}),E?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"text-zinc-300",children:["Project ",u.jsx("span",{className:"text-zinc-100 font-medium",children:E})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),u.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:ve=>w(ve.target.value)}),Ke&&Ke!==v?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ke]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),u.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ve=>N(ve.target.value)})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),u.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:C,onChange:ve=>A(ve.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),u.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:k,onChange:ve=>_(ve.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),u.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:T,onChange:ve=>P(ve.target.value.toLowerCase())})]})]}),U?u.jsx("p",{className:"text-rose-400 text-sm",children:U}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",disabled:!Ke||!C||H,onClick:ul,children:H?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(Ue,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),u.jsx("h2",{children:"Add key phrases"})]}),ae?u.jsxs(yt,{tone:"positive",children:[at.length," saved"]}):u.jsxs(yt,{tone:"neutral",children:[at.length," key phrase",at.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ae?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:at.map(ve=>u.jsx("li",{children:ve},ve))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[X.length>0?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsxs("div",{className:"setup-field flex-1",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),u.jsx("select",{id:"gen-provider",className:"setup-input",value:q,onChange:ve=>W(ve.target.value),children:X.map(ve=>u.jsxs("option",{value:ve.name,children:[ve.displayName??ve.name,ve.model?` (${ve.model})`:""]},ve.name))})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),u.jsx("select",{id:"gen-count",className:"setup-input",value:ie,onChange:ve=>ye(Number(ve.target.value)),children:[3,5,10,15,20].map(ve=>u.jsx("option",{value:ve,children:ve},ve))})]}),u.jsx(he,{type:"button",variant:"outline",disabled:we||!q,onClick:ft,children:we?"Analyzing site...":"Generate"})]}),ue?u.jsx("p",{className:"text-rose-400 text-sm",children:ue}):null]}):null,u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),u.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
279
+ best invisalign downtown brooklyn
280
+ pediatric dentist brooklyn heights`,value:me,onChange:ve=>G(ve.target.value)})]}),xe?u.jsx("p",{className:"text-rose-400 text-sm",children:xe}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",disabled:at.length===0||R,onClick:nr,children:R?"Saving...":`Save ${at.length} key phrase${at.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(Ue,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),u.jsx("h2",{children:"Add competitors"})]}),Ee?u.jsx(yt,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ee?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:qt.map(ve=>u.jsx("li",{children:ve},ve))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),u.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
281
+ competitor2.com`,value:Z,onChange:ve=>Me(ve.target.value)})]}),rt?u.jsx("p",{className:"text-rose-400 text-sm",children:rt}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(he,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),u.jsx(he,{type:"button",disabled:qt.length===0||fn,onClick:au,children:fn?"Saving...":`Save ${qt.length} competitor${qt.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(Ue,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),u.jsx("h2",{children:"Launch first run"})]}),fe?u.jsx(yt,{tone:"positive",children:"Queued"}):null]}),fe?u.jsxs("div",{className:"compact-stack",children:[u.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(he,{type:"button",onClick:()=>m({to:D?`/projects/${D}`:"/"}),children:"Open project"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",u.jsx("span",{className:"text-zinc-100 font-medium",children:E}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(he,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),u.jsx(he,{type:"button",disabled:xt,onClick:ai,children:xt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Setup"}),u.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),u.jsx(Yge,{current:g,labels:Zge}),u.jsx("section",{className:"setup-wizard",children:rr})]})}function Qge(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(Ue,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Route not found"}),u.jsx("p",{children:"The current path does not map to a dashboard view."}),u.jsx(he,{asChild:!0,children:u.jsx(Dt,{to:"/",children:"Return to overview"})})]})})})}function Xge(){return u.jsx(gQ,{children:u.jsx(mQ,{})})}const vi=iq()({component:Xge,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),Jge=ti({getParentRoute:()=>vi,path:"/",component:jQ,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Zr.projects.all);if(t&&t.length===0)throw MS({to:"/setup"})}}),eye=ti({getParentRoute:()=>vi,path:"/projects",component:RX}),Nf=ti({getParentRoute:()=>vi,path:"/projects/$projectId",component:()=>u.jsx(FS,{})}),tye=ti({getParentRoute:()=>Nf,path:"/",component:()=>u.jsx(Ny,{tab:"overview"})}),nye=ti({getParentRoute:()=>Nf,path:"/search-console",component:()=>u.jsx(Ny,{tab:"search-console"})}),rye=ti({getParentRoute:()=>Nf,path:"/analytics",component:()=>u.jsx(Ny,{tab:"analytics"})}),iye=ti({getParentRoute:()=>Nf,path:"/traffic",component:()=>u.jsx(Ny,{tab:"traffic"})}),aye=ti({getParentRoute:()=>vi,path:"/runs",component:qge}),sye=ti({getParentRoute:()=>vi,path:"/settings",component:Vge,beforeLoad:({context:e})=>{}}),oye=ti({getParentRoute:()=>vi,path:"/setup",component:Wge,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Zr.projects.all);if(t&&t.length>0)throw MS({to:"/"})}}),lye=ti({getParentRoute:()=>vi,path:"*",component:Qge}),cye=vi.addChildren([Jge,eye,Nf.addChildren([tye,nye,rye,iye]),aye,sye,oye,lye]);function uye(e,t){return pq({routeTree:cye,basepath:bw||"/",context:{queryClient:e},...t?.initialEntries})}const w4=N9(),dye=uye(w4),S4=document.getElementById("root");if(!S4)throw new Error("Expected #root element for web app bootstrap.");function fye(){const[e,t]=x.useState(Ik()?"ready":"checking"),[n,r]=x.useState(""),[i,s]=x.useState(""),[l,c]=x.useState(null),[f,h]=x.useState(!1);x.useEffect(()=>{if(Ik())return;let y=!1;return Pq().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(c(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const m=async y=>{if(y.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}h(!0),c(null);try{if(!(await zq(n.trim())).authenticated){c("Setup failed");return}r(""),s(""),t("ready")}catch(v){c(v instanceof Xp||v instanceof Error?v.message:"Setup failed")}finally{h(!1)}},g=async y=>{if(y.preventDefault(),!!n.trim()){h(!0),c(null);try{if(!(await Mq(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(v){c(v instanceof Xp||v instanceof Error?v.message:"Authentication failed")}finally{h(!1)}}};return e==="ready"?u.jsx(fB,{client:w4,children:u.jsx(yq,{router:dye})}):u.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:u.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:u.jsx(Ue,{className:"surface-card w-full",children:e==="checking"?u.jsx(zp,{className:"py-8",children:u.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?u.jsxs(u.Fragment,{children:[u.jsxs(xw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(ww,{children:"Create a dashboard password"}),u.jsx(Sw,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(zp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:m,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"At least 8 characters"})]}),u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),u.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:y=>s(y.target.value),placeholder:"Re-enter password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(he,{type:"submit",disabled:f||!n.trim()||!i.trim(),children:f?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(xw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(ww,{children:"Sign in to Canonry"}),u.jsx(Sw,{children:"Enter your dashboard password to continue."})]}),u.jsx(zp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:g,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Dashboard password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(he,{type:"submit",disabled:f||!n.trim(),children:f?"Signing in…":"Open dashboard"})]})})]})})})})}B6.createRoot(S4).render(u.jsx(x.StrictMode,{children:u.jsx(fye,{})}));