@ainyc/canonry 2.2.3 → 2.4.2

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.
@@ -1,301 +0,0 @@
1
- function C9(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 a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{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 a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vb={exports:{}},zd={};var WA;function _9(){if(WA)return zd;WA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return zd.Fragment=t,zd.jsx=n,zd.jsxs=n,zd}var QA;function O9(){return QA||(QA=1,Vb.exports=_9()),Vb.exports}var u=O9(),Zb={exports:{}},Xe={};var XA;function A9(){if(XA)return Xe;XA=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"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function k(B,U,M){this.props=B,this.context=U,this.refs=j,this.updater=M||x}k.prototype.isReactComponent={},k.prototype.setState=function(B,U){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,U,"setState")},k.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function A(){}A.prototype=k.prototype;function _(B,U,M){this.props=B,this.context=U,this.refs=j,this.updater=M||x}var C=_.prototype=new A;C.constructor=_,w(C,k.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function T(){}var O={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function I(B,U,M){var V=M.ref;return{$$typeof:e,type:B,key:U,ref:V!==void 0?V:null,props:M}}function F(B,U){return I(B.type,U,B.props)}function $(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function L(B){var U={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(M){return U[M]})}var J=/\/+/g;function ae(B,U){return typeof B=="object"&&B!==null&&B.key!=null?L(""+B.key):U.toString(36)}function Q(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(T,T):(B.status="pending",B.then(function(U){B.status==="pending"&&(B.status="fulfilled",B.value=U)},function(U){B.status==="pending"&&(B.status="rejected",B.reason=U)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function K(B,U,M,V,se){var ie=typeof B;(ie==="undefined"||ie==="boolean")&&(B=null);var he=!1;if(B===null)he=!0;else switch(ie){case"bigint":case"string":case"number":he=!0;break;case"object":switch(B.$$typeof){case e:case t:he=!0;break;case p:return he=B._init,K(he(B._payload),U,M,V,se)}}if(he)return se=se(B),he=V===""?"."+ae(B,0):V,P(se)?(M="",he!=null&&(M=he.replace(J,"$&/")+"/"),K(se,U,M,"",function(de){return de})):se!=null&&($(se)&&(se=F(se,M+(se.key==null||B&&B.key===se.key?"":(""+se.key).replace(J,"$&/")+"/")+he)),U.push(se)),1;he=0;var je=V===""?".":V+":";if(P(B))for(var ee=0;ee<B.length;ee++)V=B[ee],ie=je+ae(V,ee),he+=K(V,U,M,ie,se);else if(ee=v(B),typeof ee=="function")for(B=ee.call(B),ee=0;!(V=B.next()).done;)V=V.value,ie=je+ae(V,ee++),he+=K(V,U,M,ie,se);else if(ie==="object"){if(typeof B.then=="function")return K(Q(B),U,M,V,se);throw U=String(B),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return he}function X(B,U,M){if(B==null)return B;var V=[],se=0;return K(B,V,"","",function(ie){return U.call(M,ie,se++)}),V}function ye(B){if(B._status===-1){var U=B._result;U=U(),U.then(function(M){(B._status===0||B._status===-1)&&(B._status=1,B._result=M)},function(M){(B._status===0||B._status===-1)&&(B._status=2,B._result=M)}),B._status===-1&&(B._status=0,B._result=U)}if(B._status===1)return B._result.default;throw B._result}var Se=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},R={map:X,forEach:function(B,U,M){X(B,function(){U.apply(this,arguments)},M)},count:function(B){var U=0;return X(B,function(){U++}),U},toArray:function(B){return X(B,function(U){return U})||[]},only:function(B){if(!$(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Xe.Activity=m,Xe.Children=R,Xe.Component=k,Xe.Fragment=n,Xe.Profiler=i,Xe.PureComponent=_,Xe.StrictMode=r,Xe.Suspense=d,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},Xe.cache=function(B){return function(){return B.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(B,U,M){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var V=w({},B.props),se=B.key;if(U!=null)for(ie in U.key!==void 0&&(se=""+U.key),U)!z.call(U,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&U.ref===void 0||(V[ie]=U[ie]);var ie=arguments.length-2;if(ie===1)V.children=M;else if(1<ie){for(var he=Array(ie),je=0;je<ie;je++)he[je]=arguments[je+2];V.children=he}return I(B.type,se,V)},Xe.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:a,_context:B},B},Xe.createElement=function(B,U,M){var V,se={},ie=null;if(U!=null)for(V in U.key!==void 0&&(ie=""+U.key),U)z.call(U,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(se[V]=U[V]);var he=arguments.length-2;if(he===1)se.children=M;else if(1<he){for(var je=Array(he),ee=0;ee<he;ee++)je[ee]=arguments[ee+2];se.children=je}if(B&&B.defaultProps)for(V in he=B.defaultProps,he)se[V]===void 0&&(se[V]=he[V]);return I(B,ie,se)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(B){return{$$typeof:c,render:B}},Xe.isValidElement=$,Xe.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:ye}},Xe.memo=function(B,U){return{$$typeof:f,type:B,compare:U===void 0?null:U}},Xe.startTransition=function(B){var U=O.T,M={};O.T=M;try{var V=B(),se=O.S;se!==null&&se(M,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(T,Se)}catch(ie){Se(ie)}finally{U!==null&&M.types!==null&&(U.types=M.types),O.T=U}},Xe.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Xe.use=function(B){return O.H.use(B)},Xe.useActionState=function(B,U,M){return O.H.useActionState(B,U,M)},Xe.useCallback=function(B,U){return O.H.useCallback(B,U)},Xe.useContext=function(B){return O.H.useContext(B)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(B,U){return O.H.useDeferredValue(B,U)},Xe.useEffect=function(B,U){return O.H.useEffect(B,U)},Xe.useEffectEvent=function(B){return O.H.useEffectEvent(B)},Xe.useId=function(){return O.H.useId()},Xe.useImperativeHandle=function(B,U,M){return O.H.useImperativeHandle(B,U,M)},Xe.useInsertionEffect=function(B,U){return O.H.useInsertionEffect(B,U)},Xe.useLayoutEffect=function(B,U){return O.H.useLayoutEffect(B,U)},Xe.useMemo=function(B,U){return O.H.useMemo(B,U)},Xe.useOptimistic=function(B,U){return O.H.useOptimistic(B,U)},Xe.useReducer=function(B,U,M){return O.H.useReducer(B,U,M)},Xe.useRef=function(B){return O.H.useRef(B)},Xe.useState=function(B){return O.H.useState(B)},Xe.useSyncExternalStore=function(B,U,M){return O.H.useSyncExternalStore(B,U,M)},Xe.useTransition=function(){return O.H.useTransition()},Xe.version="19.2.4",Xe}var JA;function Nu(){return JA||(JA=1,Zb.exports=A9()),Zb.exports}var S=Nu();const Bi=wa(S),yy=C9({__proto__:null,default:Bi},[S]);var Yb={exports:{}},Rd={},Wb={exports:{}},Qb={};var eE;function E9(){return eE||(eE=1,(function(e){function t(K,X){var ye=K.length;K.push(X);e:for(;0<ye;){var Se=ye-1>>>1,R=K[Se];if(0<i(R,X))K[Se]=X,K[ye]=R,ye=Se;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var X=K[0],ye=K.pop();if(ye!==X){K[0]=ye;e:for(var Se=0,R=K.length,B=R>>>1;Se<B;){var U=2*(Se+1)-1,M=K[U],V=U+1,se=K[V];if(0>i(M,ye))V<R&&0>i(se,M)?(K[Se]=se,K[V]=ye,Se=V):(K[Se]=M,K[U]=ye,Se=U);else if(V<R&&0>i(se,ye))K[Se]=se,K[V]=ye,Se=V;else break e}}return X}function i(K,X){var ye=K.sortIndex-X.sortIndex;return ye!==0?ye:K.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,x=!1,w=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(K){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=K)r(f),X.sortIndex=X.expirationTime,t(d,X);else break;X=n(f)}}function P(K){if(w=!1,C(K),!x)if(n(d)!==null)x=!0,T||(T=!0,L());else{var X=n(f);X!==null&&Q(P,X.startTime-K)}}var T=!1,O=-1,z=5,I=-1;function F(){return j?!0:!(e.unstable_now()-I<z)}function $(){if(j=!1,T){var K=e.unstable_now();I=K;var X=!0;try{e:{x=!1,w&&(w=!1,A(O),O=-1),v=!0;var ye=y;try{t:{for(C(K),m=n(d);m!==null&&!(m.expirationTime>K&&F());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,y=m.priorityLevel;var R=Se(m.expirationTime<=K);if(K=e.unstable_now(),typeof R=="function"){m.callback=R,C(K),X=!0;break t}m===n(d)&&r(d),C(K)}else r(d);m=n(d)}if(m!==null)X=!0;else{var B=n(f);B!==null&&Q(P,B.startTime-K),X=!1}}break e}finally{m=null,y=ye,v=!1}X=void 0}}finally{X?L():T=!1}}}var L;if(typeof _=="function")L=function(){_($)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ae=J.port2;J.port1.onmessage=$,L=function(){ae.postMessage(null)}}else L=function(){k($,0)};function Q(K,X){O=k(function(){K(e.unstable_now())},X)}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(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var X=3;break;default:X=y}var ye=y;y=X;try{return K()}finally{y=ye}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(K,X){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var ye=y;y=K;try{return X()}finally{y=ye}},e.unstable_scheduleCallback=function(K,X,ye){var Se=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Se+ye:Se):ye=Se,K){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ye+R,K={id:p++,callback:X,priorityLevel:K,startTime:ye,expirationTime:R,sortIndex:-1},ye>Se?(K.sortIndex=ye,t(f,K),n(d)===null&&K===n(f)&&(w?(A(O),O=-1):w=!0,Q(P,ye-Se))):(K.sortIndex=R,t(d,K),x||v||(x=!0,T||(T=!0,L()))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var X=y;return function(){var ye=y;y=X;try{return K.apply(this,arguments)}finally{y=ye}}}})(Qb)),Qb}var tE;function T9(){return tE||(tE=1,Wb.exports=E9()),Wb.exports}var Xb={exports:{}},Jn={};var nE;function P9(){if(nE)return Jn;nE=1;var e=Nu();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" 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 a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jn.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},Jn.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},Jn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Jn.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Jn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Jn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Jn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Jn.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Jn.requestFormReset=function(d){r.d.r(d)},Jn.unstable_batchedUpdates=function(d,f){return d(f)},Jn.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},Jn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Jn.version="19.2.4",Jn}var rE;function LD(){if(rE)return Xb.exports;rE=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(),Xb.exports=P9(),Xb.exports}var iE;function z9(){if(iE)return Rd;iE=1;var e=T9(),t=Nu(),n=LD();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,h=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(h=l.return),s=l.return;while(s)}return l.tag===3?h:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var h=s,g=l;;){var b=h.return;if(b===null)break;var N=b.alternate;if(N===null){if(g=b.return,g!==null){h=g;continue}break}if(b.child===N.child){for(N=b.child;N;){if(N===h)return d(b),s;if(N===g)return d(b),l;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=b,g=N;else{for(var E=!1,D=b.child;D;){if(D===h){E=!0,h=b,g=N;break}if(D===g){E=!0,g=b,h=N;break}D=D.sibling}if(!E){for(D=N.child;D;){if(D===h){E=!0,h=N,g=b;break}if(D===g){E=!0,g=N,h=b;break}D=D.sibling}if(!E)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function L(s){return s===null||typeof s!="object"?null:(s=$&&s[$]||s["@@iterator"],typeof s=="function"?s:null)}var J=Symbol.for("react.client.reference");function ae(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===J?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case _:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case C:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return l=s.displayName||null,l!==null?l:ae(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return ae(s(l))}catch{}}return null}var Q=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Se=[],R=-1;function B(s){return{current:s}}function U(s){0>R||(s.current=Se[R],Se[R]=null,R--)}function M(s,l){R++,Se[R]=s.current,s.current=l}var V=B(null),se=B(null),ie=B(null),he=B(null);function je(s,l){switch(M(ie,l),M(se,s),M(V,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?bA(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=bA(l),s=xA(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(V),M(V,s)}function ee(){U(V),U(se),U(ie)}function de(s){s.memoizedState!==null&&M(he,s);var l=V.current,h=xA(l,s.type);l!==h&&(M(se,s),M(V,h))}function Ce(s){se.current===s&&(U(V),U(se)),he.current===s&&(U(he),Ad._currentValue=ye)}var Y,Ke;function Me(s){if(Y===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);Y=l&&l[1]||"",Ke=-1<h.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Y+s+Ke}var rt=!1;function it(s,l){if(!s||rt)return"";rt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ce){var oe=ce}Reflect.construct(s,[],ge)}else{try{ge.call()}catch(ce){oe=ce}s.call(ge.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(ge=s())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),E=N[0],D=N[1];if(E&&D){var H=E.split(`
4
- `),re=D.split(`
5
- `);for(b=g=0;g<H.length&&!H[g].includes("DetermineComponentFrameRoot");)g++;for(;b<re.length&&!re[b].includes("DetermineComponentFrameRoot");)b++;if(g===H.length||b===re.length)for(g=H.length-1,b=re.length-1;1<=g&&0<=b&&H[g]!==re[b];)b--;for(;1<=g&&0<=b;g--,b--)if(H[g]!==re[b]){if(g!==1||b!==1)do if(g--,b--,0>b||H[g]!==re[b]){var fe=`
6
- `+H[g].replace(" at new "," at ");return s.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",s.displayName)),fe}while(1<=g&&0<=b);break}}}finally{rt=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Me(h):""}function Nt(s,l){switch(s.tag){case 26:case 27:case 5:return Me(s.type);case 16:return Me("Lazy");case 13:return s.child!==l&&l!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return it(s.type,!1);case 11:return it(s.type.render,!1);case 1:return it(s.type,!0);case 31:return Me("Activity");default:return""}}function Lt(s){try{var l="",h=null;do l+=Nt(s,h),h=s,s=s.return;while(s);return l}catch(g){return`
7
- Error generating stack: `+g.message+`
8
- `+g.stack}}var bn=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,Ve=e.unstable_cancelCallback,be=e.unstable_shouldYield,ze=e.unstable_requestPaint,Re=e.unstable_now,_e=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,Je=e.unstable_IdlePriority,tn=e.log,xn=e.unstable_setDisableYieldValue,Qe=null,kt=null;function $t(s){if(typeof tn=="function"&&xn(s),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Qe,s)}catch{}}var ue=Math.clz32?Math.clz32:No,Mn=Math.log,or=Math.LN2;function No(s){return s>>>=0,s===0?32:31-(Mn(s)/or|0)|0}var ps=256,ko=262144,Ca=4194304;function Xr(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Co(s,l,h){var g=s.pendingLanes;if(g===0)return 0;var b=0,N=s.suspendedLanes,E=s.pingedLanes;s=s.warmLanes;var D=g&134217727;return D!==0?(g=D&~N,g!==0?b=Xr(g):(E&=D,E!==0?b=Xr(E):h||(h=D&~s,h!==0&&(b=Xr(h))))):(D=g&~N,D!==0?b=Xr(D):E!==0?b=Xr(E):h||(h=g&~s,h!==0&&(b=Xr(h)))),b===0?0:l!==0&&l!==b&&(l&N)===0&&(N=b&-b,h=l&-l,N>=h||N===32&&(h&4194048)!==0)?l:b}function ms(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function $v(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 _o(){var s=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),s}function Gl(s){for(var l=[],h=0;31>h;h++)l.push(s);return l}function Oo(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function kh(s,l,h,g,b,N){var E=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var D=s.entanglements,H=s.expirationTimes,re=s.hiddenUpdates;for(h=E&~h;0<h;){var fe=31-ue(h),ge=1<<fe;D[fe]=0,H[fe]=-1;var oe=re[fe];if(oe!==null)for(re[fe]=null,fe=0;fe<oe.length;fe++){var ce=oe[fe];ce!==null&&(ce.lane&=-536870913)}h&=~ge}g!==0&&Ch(s,g,0),N!==0&&b===0&&s.tag!==0&&(s.suspendedLanes|=N&~(E&~l))}function Ch(s,l,h){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-ue(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function _h(s,l){var h=s.entangledLanes|=l;for(s=s.entanglements;h;){var g=31-ue(h),b=1<<g;b&l|s[g]&l&&(s[g]|=l),h&=~b}}function Oh(s,l){var h=l&-l;return h=(h&42)!==0?1:Hu(h),(h&(s.suspendedLanes|l))!==0?0:h}function Hu(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Vl(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function G(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:qA(s.type))}function Ne(s,l){var h=X.p;try{return X.p=s,l()}finally{X.p=h}}var yt=Math.random().toString(36).slice(2),ct="__reactFiber$"+yt,_t="__reactProps$"+yt,Dr="__reactContainer$"+yt,Ti="__reactEvents$"+yt,gs="__reactListeners$"+yt,vr="__reactHandles$"+yt,Ah="__reactResources$"+yt,Jr="__reactMarker$"+yt;function _a(s){delete s[ct],delete s[_t],delete s[Ti],delete s[gs],delete s[vr]}function Pi(s){var l=s[ct];if(l)return l;for(var h=s.parentNode;h;){if(l=h[Dr]||h[ct]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(s=_A(s);s!==null;){if(h=s[ct])return h;s=_A(s)}return l}s=h,h=s.parentNode}return null}function Oa(s){if(s=s[ct]||s[Dr]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Ao(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function zi(s){var l=s[Ah];return l||(l=s[Ah]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function nn(s){s[Jr]=!0}var Eh=new Set,Th={};function at(s,l){vt(s,l),vt(s+"Capture",l)}function vt(s,l){for(Th[s]=l,s=0;s<l.length;s++)Eh.add(l[s])}var Ir=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]*$"),Ri={},Eo={};function Ph(s){return bn.call(Eo,s)?!0:bn.call(Ri,s)?!1:Ir.test(s)?Eo[s]=!0:(Ri[s]=!0,!1)}function zh(s,l,h){if(Ph(l))if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+h)}}function Rh(s,l,h){if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+h)}}function Aa(s,l,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(l,h,""+g)}}function ei(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function dC(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function b8(s,l,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,N=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return b.call(this)},set:function(E){h=""+E,N.call(this,E)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Uv(s){if(!s._valueTracker){var l=dC(s)?"checked":"value";s._valueTracker=b8(s,l,""+s[l])}}function fC(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return s&&(g=dC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(l.setValue(s),!0):!1}function Mh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var x8=/[\n"\\]/g;function ti(s){return s.replace(x8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Bv(s,l,h,g,b,N,E,D){s.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?s.type=E:s.removeAttribute("type"),l!=null?E==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+ei(l)):s.value!==""+ei(l)&&(s.value=""+ei(l)):E!=="submit"&&E!=="reset"||s.removeAttribute("value"),l!=null?Fv(s,E,ei(l)):h!=null?Fv(s,E,ei(h)):g!=null&&s.removeAttribute("value"),b==null&&N!=null&&(s.defaultChecked=!!N),b!=null&&(s.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?s.name=""+ei(D):s.removeAttribute("name")}function hC(s,l,h,g,b,N,E,D){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),l!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||l!=null)){Uv(s);return}h=h!=null?""+ei(h):"",l=l!=null?""+ei(l):h,D||l===s.value||(s.value=l),s.defaultValue=l}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=D?s.checked:!!g,s.defaultChecked=!!g,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.name=E),Uv(s)}function Fv(s,l,h){l==="number"&&Mh(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Zl(s,l,h,g){if(s=s.options,l){l={};for(var b=0;b<h.length;b++)l["$"+h[b]]=!0;for(h=0;h<s.length;h++)b=l.hasOwnProperty("$"+s[h].value),s[h].selected!==b&&(s[h].selected=b),b&&g&&(s[h].defaultSelected=!0)}else{for(h=""+ei(h),l=null,b=0;b<s.length;b++){if(s[b].value===h){s[b].selected=!0,g&&(s[b].defaultSelected=!0);return}l!==null||s[b].disabled||(l=s[b])}l!==null&&(l.selected=!0)}}function pC(s,l,h){if(l!=null&&(l=""+ei(l),l!==s.value&&(s.value=l),h==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=h!=null?""+ei(h):""}function mC(s,l,h,g){if(l==null){if(g!=null){if(h!=null)throw Error(r(92));if(Q(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),l=h}h=ei(l),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),Uv(s)}function Yl(s,l){if(l){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=l;return}}s.textContent=l}var w8=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 gC(s,l,h){var g=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,h):typeof h!="number"||h===0||w8.has(l)?l==="float"?s.cssFloat=h:s[l]=(""+h).trim():s[l]=h+"px"}function yC(s,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var b in l)g=l[b],l.hasOwnProperty(b)&&h[b]!==g&&gC(s,b,g)}else for(var N in l)l.hasOwnProperty(N)&&gC(s,N,l[N])}function qv(s){if(s.indexOf("-")===-1)return!1;switch(s){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 S8=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"]]),j8=/^[\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 Dh(s){return j8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ea(){}var Kv=null;function Hv(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Wl=null,Ql=null;function vC(s){var l=Oa(s);if(l&&(s=l.stateNode)){var h=s[_t]||null;e:switch(s=l.stateNode,l.type){case"input":if(Bv(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ti(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==s&&g.form===s.form){var b=g[_t]||null;if(!b)throw Error(r(90));Bv(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<h.length;l++)g=h[l],g.form===s.form&&fC(g)}break e;case"textarea":pC(s,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&Zl(s,!!h.multiple,l,!1)}}}var Gv=!1;function bC(s,l,h){if(Gv)return s(l,h);Gv=!0;try{var g=s(l);return g}finally{if(Gv=!1,(Wl!==null||Ql!==null)&&(jp(),Wl&&(l=Wl,s=Ql,Ql=Wl=null,vC(l),s)))for(l=0;l<s.length;l++)vC(s[l])}}function Gu(s,l){var h=s.stateNode;if(h===null)return null;var g=h[_t]||null;if(g===null)return null;h=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vv=!1;if(Ta)try{var Vu={};Object.defineProperty(Vu,"passive",{get:function(){Vv=!0}}),window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{Vv=!1}var ys=null,Zv=null,Ih=null;function xC(){if(Ih)return Ih;var s,l=Zv,h=l.length,g,b="value"in ys?ys.value:ys.textContent,N=b.length;for(s=0;s<h&&l[s]===b[s];s++);var E=h-s;for(g=1;g<=E&&l[h-g]===b[N-g];g++);return Ih=b.slice(s,1<g?1-g:void 0)}function Lh(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function $h(){return!0}function wC(){return!1}function br(s){function l(h,g,b,N,E){this._reactName=h,this._targetInst=b,this.type=g,this.nativeEvent=N,this.target=E,this.currentTarget=null;for(var D in s)s.hasOwnProperty(D)&&(h=s[D],this[D]=h?h(N):N[D]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?$h:wC,this.isPropagationStopped=wC,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=$h)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=$h)},persist:function(){},isPersistent:$h}),l}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uh=br(To),Zu=m({},To,{view:0,detail:0}),N8=br(Zu),Yv,Wv,Yu,Bh=m({},Zu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xv,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Yu&&(Yu&&s.type==="mousemove"?(Yv=s.screenX-Yu.screenX,Wv=s.screenY-Yu.screenY):Wv=Yv=0,Yu=s),Yv)},movementY:function(s){return"movementY"in s?s.movementY:Wv}}),SC=br(Bh),k8=m({},Bh,{dataTransfer:0}),C8=br(k8),_8=m({},Zu,{relatedTarget:0}),Qv=br(_8),O8=m({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),A8=br(O8),E8=m({},To,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),T8=br(E8),P8=m({},To,{data:0}),jC=br(P8),z8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R8={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"},M8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D8(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=M8[s])?!!l[s]:!1}function Xv(){return D8}var I8=m({},Zu,{key:function(s){if(s.key){var l=z8[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Lh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?R8[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xv,charCode:function(s){return s.type==="keypress"?Lh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Lh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),L8=br(I8),$8=m({},Bh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NC=br($8),U8=m({},Zu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xv}),B8=br(U8),F8=m({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),q8=br(F8),K8=m({},Bh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),H8=br(K8),G8=m({},To,{newState:0,oldState:0}),V8=br(G8),Z8=[9,13,27,32],Jv=Ta&&"CompositionEvent"in window,Wu=null;Ta&&"documentMode"in document&&(Wu=document.documentMode);var Y8=Ta&&"TextEvent"in window&&!Wu,kC=Ta&&(!Jv||Wu&&8<Wu&&11>=Wu),CC=" ",_C=!1;function OC(s,l){switch(s){case"keyup":return Z8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function AC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Xl=!1;function W8(s,l){switch(s){case"compositionend":return AC(l);case"keypress":return l.which!==32?null:(_C=!0,CC);case"textInput":return s=l.data,s===CC&&_C?null:s;default:return null}}function Q8(s,l){if(Xl)return s==="compositionend"||!Jv&&OC(s,l)?(s=xC(),Ih=Zv=ys=null,Xl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return kC&&l.locale!=="ko"?null:l.data;default:return null}}var X8={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 EC(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!X8[s.type]:l==="textarea"}function TC(s,l,h,g){Wl?Ql?Ql.push(g):Ql=[g]:Wl=g,l=Ep(l,"onChange"),0<l.length&&(h=new Uh("onChange","change",null,h,g),s.push({event:h,listeners:l}))}var Qu=null,Xu=null;function J8(s){hA(s,0)}function Fh(s){var l=Ao(s);if(fC(l))return s}function PC(s,l){if(s==="change")return l}var zC=!1;if(Ta){var e0;if(Ta){var t0="oninput"in document;if(!t0){var RC=document.createElement("div");RC.setAttribute("oninput","return;"),t0=typeof RC.oninput=="function"}e0=t0}else e0=!1;zC=e0&&(!document.documentMode||9<document.documentMode)}function MC(){Qu&&(Qu.detachEvent("onpropertychange",DC),Xu=Qu=null)}function DC(s){if(s.propertyName==="value"&&Fh(Xu)){var l=[];TC(l,Xu,s,Hv(s)),bC(J8,l)}}function eF(s,l,h){s==="focusin"?(MC(),Qu=l,Xu=h,Qu.attachEvent("onpropertychange",DC)):s==="focusout"&&MC()}function tF(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Fh(Xu)}function nF(s,l){if(s==="click")return Fh(l)}function rF(s,l){if(s==="input"||s==="change")return Fh(l)}function iF(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var Lr=typeof Object.is=="function"?Object.is:iF;function Ju(s,l){if(Lr(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var h=Object.keys(s),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var b=h[g];if(!bn.call(l,b)||!Lr(s[b],l[b]))return!1}return!0}function IC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function LC(s,l){var h=IC(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=l&&g>=l)return{node:h,offset:l-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=IC(h)}}function $C(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?$C(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function UC(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Mh(s.document);l instanceof s.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)s=l.contentWindow;else break;l=Mh(s.document)}return l}function n0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var aF=Ta&&"documentMode"in document&&11>=document.documentMode,Jl=null,r0=null,ed=null,i0=!1;function BC(s,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;i0||Jl==null||Jl!==Mh(g)||(g=Jl,"selectionStart"in g&&n0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),ed&&Ju(ed,g)||(ed=g,g=Ep(r0,"onSelect"),0<g.length&&(l=new Uh("onSelect","select",null,l,h),s.push({event:l,listeners:g}),l.target=Jl)))}function Po(s,l){var h={};return h[s.toLowerCase()]=l.toLowerCase(),h["Webkit"+s]="webkit"+l,h["Moz"+s]="moz"+l,h}var ec={animationend:Po("Animation","AnimationEnd"),animationiteration:Po("Animation","AnimationIteration"),animationstart:Po("Animation","AnimationStart"),transitionrun:Po("Transition","TransitionRun"),transitionstart:Po("Transition","TransitionStart"),transitioncancel:Po("Transition","TransitionCancel"),transitionend:Po("Transition","TransitionEnd")},a0={},FC={};Ta&&(FC=document.createElement("div").style,"AnimationEvent"in window||(delete ec.animationend.animation,delete ec.animationiteration.animation,delete ec.animationstart.animation),"TransitionEvent"in window||delete ec.transitionend.transition);function zo(s){if(a0[s])return a0[s];if(!ec[s])return s;var l=ec[s],h;for(h in l)if(l.hasOwnProperty(h)&&h in FC)return a0[s]=l[h];return s}var qC=zo("animationend"),KC=zo("animationiteration"),HC=zo("animationstart"),sF=zo("transitionrun"),oF=zo("transitionstart"),lF=zo("transitioncancel"),GC=zo("transitionend"),VC=new Map,s0="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(" ");s0.push("scrollEnd");function Mi(s,l){VC.set(s,l),at(l,[s])}var qh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ni=[],tc=0,o0=0;function Kh(){for(var s=tc,l=o0=tc=0;l<s;){var h=ni[l];ni[l++]=null;var g=ni[l];ni[l++]=null;var b=ni[l];ni[l++]=null;var N=ni[l];if(ni[l++]=null,g!==null&&b!==null){var E=g.pending;E===null?b.next=b:(b.next=E.next,E.next=b),g.pending=b}N!==0&&ZC(h,b,N)}}function Hh(s,l,h,g){ni[tc++]=s,ni[tc++]=l,ni[tc++]=h,ni[tc++]=g,o0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function l0(s,l,h,g){return Hh(s,l,h,g),Gh(s)}function Ro(s,l){return Hh(s,null,null,l),Gh(s)}function ZC(s,l,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var b=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(b=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,b&&l!==null&&(b=31-ue(h),s=N.hiddenUpdates,g=s[b],g===null?s[b]=[l]:g.push(l),l.lane=h|536870912),N):null}function Gh(s){if(50<Sd)throw Sd=0,yb=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var nc={};function cF(s,l,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(s,l,h,g){return new cF(s,l,h,g)}function c0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Pa(s,l){var h=s.alternate;return h===null?(h=$r(s.tag,l,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=l,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,l=s.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function YC(s,l){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,l=h.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function Vh(s,l,h,g,b,N){var E=0;if(g=s,typeof s=="function")c0(s)&&(E=1);else if(typeof s=="string")E=p9(s,h,V.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=$r(31,h,l,b),s.elementType=I,s.lanes=N,s;case w:return Mo(h.children,b,N,l);case j:E=8,b|=24;break;case k:return s=$r(12,h,l,b|2),s.elementType=k,s.lanes=N,s;case P:return s=$r(13,h,l,b),s.elementType=P,s.lanes=N,s;case T:return s=$r(19,h,l,b),s.elementType=T,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:E=10;break e;case A:E=9;break e;case C:E=11;break e;case O:E=14;break e;case z:E=16,g=null;break e}E=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=$r(E,h,l,b),l.elementType=s,l.type=g,l.lanes=N,l}function Mo(s,l,h,g){return s=$r(7,s,g,l),s.lanes=h,s}function u0(s,l,h){return s=$r(6,s,null,l),s.lanes=h,s}function WC(s){var l=$r(18,null,null,0);return l.stateNode=s,l}function d0(s,l,h){return l=$r(4,s.children!==null?s.children:[],s.key,l),l.lanes=h,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var QC=new WeakMap;function ri(s,l){if(typeof s=="object"&&s!==null){var h=QC.get(s);return h!==void 0?h:(l={value:s,source:l,stack:Lt(l)},QC.set(s,l),l)}return{value:s,source:l,stack:Lt(l)}}var rc=[],ic=0,Zh=null,td=0,ii=[],ai=0,vs=null,Ji=1,ea="";function za(s,l){rc[ic++]=td,rc[ic++]=Zh,Zh=s,td=l}function XC(s,l,h){ii[ai++]=Ji,ii[ai++]=ea,ii[ai++]=vs,vs=s;var g=Ji;s=ea;var b=32-ue(g)-1;g&=~(1<<b),h+=1;var N=32-ue(l)+b;if(30<N){var E=b-b%5;N=(g&(1<<E)-1).toString(32),g>>=E,b-=E,Ji=1<<32-ue(l)+b|h<<b|g,ea=N+s}else Ji=1<<N|h<<b|g,ea=s}function f0(s){s.return!==null&&(za(s,1),XC(s,1,0))}function h0(s){for(;s===Zh;)Zh=rc[--ic],rc[ic]=null,td=rc[--ic],rc[ic]=null;for(;s===vs;)vs=ii[--ai],ii[ai]=null,ea=ii[--ai],ii[ai]=null,Ji=ii[--ai],ii[ai]=null}function JC(s,l){ii[ai++]=Ji,ii[ai++]=ea,ii[ai++]=vs,Ji=l.id,ea=l.overflow,vs=s}var Fn=null,Ht=null,mt=!1,bs=null,si=!1,p0=Error(r(519));function xs(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nd(ri(l,s)),p0}function e_(s){var l=s.stateNode,h=s.type,g=s.memoizedProps;switch(l[ct]=s,l[_t]=g,h){case"dialog":dt("cancel",l),dt("close",l);break;case"iframe":case"object":case"embed":dt("load",l);break;case"video":case"audio":for(h=0;h<Nd.length;h++)dt(Nd[h],l);break;case"source":dt("error",l);break;case"img":case"image":case"link":dt("error",l),dt("load",l);break;case"details":dt("toggle",l);break;case"input":dt("invalid",l),hC(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":dt("invalid",l);break;case"textarea":dt("invalid",l),mC(l,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||g.suppressHydrationWarning===!0||yA(l.textContent,h)?(g.popover!=null&&(dt("beforetoggle",l),dt("toggle",l)),g.onScroll!=null&&dt("scroll",l),g.onScrollEnd!=null&&dt("scrollend",l),g.onClick!=null&&(l.onclick=Ea),l=!0):l=!1,l||xs(s,!0)}function t_(s){for(Fn=s.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:si=!1;return;case 27:case 3:si=!0;return;default:Fn=Fn.return}}function ac(s){if(s!==Fn)return!1;if(!mt)return t_(s),mt=!0,!1;var l=s.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Pb(s.type,s.memoizedProps)),h=!h),h&&Ht&&xs(s),t_(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Ht=CA(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Ht=CA(s)}else l===27?(l=Ht,Rs(s.type)?(s=Ib,Ib=null,Ht=s):Ht=l):Ht=Fn?li(s.stateNode.nextSibling):null;return!0}function Do(){Ht=Fn=null,mt=!1}function m0(){var s=bs;return s!==null&&(jr===null?jr=s:jr.push.apply(jr,s),bs=null),s}function nd(s){bs===null?bs=[s]:bs.push(s)}var g0=B(null),Io=null,Ra=null;function ws(s,l,h){M(g0,l._currentValue),l._currentValue=h}function Ma(s){s._currentValue=g0.current,U(g0)}function y0(s,l,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===h)break;s=s.return}}function v0(s,l,h,g){var b=s.child;for(b!==null&&(b.return=s);b!==null;){var N=b.dependencies;if(N!==null){var E=b.child;N=N.firstContext;e:for(;N!==null;){var D=N;N=b;for(var H=0;H<l.length;H++)if(D.context===l[H]){N.lanes|=h,D=N.alternate,D!==null&&(D.lanes|=h),y0(N.return,h,s),g||(E=null);break e}N=D.next}}else if(b.tag===18){if(E=b.return,E===null)throw Error(r(341));E.lanes|=h,N=E.alternate,N!==null&&(N.lanes|=h),y0(E,h,s),E=null}else E=b.child;if(E!==null)E.return=b;else for(E=b;E!==null;){if(E===s){E=null;break}if(b=E.sibling,b!==null){b.return=E.return,E=b;break}E=E.return}b=E}}function sc(s,l,h,g){s=null;for(var b=l,N=!1;b!==null;){if(!N){if((b.flags&524288)!==0)N=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var E=b.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var D=b.type;Lr(b.pendingProps.value,E.value)||(s!==null?s.push(D):s=[D])}}else if(b===he.current){if(E=b.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(s!==null?s.push(Ad):s=[Ad])}b=b.return}s!==null&&v0(l,s,h,g),l.flags|=262144}function Yh(s){for(s=s.firstContext;s!==null;){if(!Lr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Lo(s){Io=s,Ra=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function qn(s){return n_(Io,s)}function Wh(s,l){return Io===null&&Lo(s),n_(s,l)}function n_(s,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Ra===null){if(s===null)throw Error(r(308));Ra=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Ra=Ra.next=l;return h}var uF=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(h){return h()})}},dF=e.unstable_scheduleCallback,fF=e.unstable_NormalPriority,wn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function b0(){return{controller:new uF,data:new Map,refCount:0}}function rd(s){s.refCount--,s.refCount===0&&dF(fF,function(){s.controller.abort()})}var id=null,x0=0,oc=0,lc=null;function hF(s,l){if(id===null){var h=id=[];x0=0,oc=jb(),lc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return x0++,l.then(r_,r_),l}function r_(){if(--x0===0&&id!==null){lc!==null&&(lc.status="fulfilled");var s=id;id=null,oc=0,lc=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function pF(s,l){var h=[],g={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var b=0;b<h.length;b++)(0,h[b])(l)},function(b){for(g.status="rejected",g.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),g}var i_=K.S;K.S=function(s,l){BO=Re(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&hF(s,l),i_!==null&&i_(s,l)};var $o=B(null);function w0(){var s=$o.current;return s!==null?s:Mt.pooledCache}function Qh(s,l){l===null?M($o,$o.current):M($o,l.pool)}function a_(){var s=w0();return s===null?null:{parent:wn._currentValue,pool:s}}var cc=Error(r(460)),S0=Error(r(474)),Xh=Error(r(542)),Jh={then:function(){}};function s_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function o_(s,l,h){switch(h=s[h],h===void 0?s.push(l):h!==l&&(l.then(Ea,Ea),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c_(s),s;default:if(typeof l.status=="string")l.then(Ea,Ea);else{if(s=Mt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=g}},function(g){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c_(s),s}throw Bo=l,cc}}function Uo(s){try{var l=s._init;return l(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Bo=h,cc):h}}var Bo=null;function l_(){if(Bo===null)throw Error(r(459));var s=Bo;return Bo=null,s}function c_(s){if(s===cc||s===Xh)throw Error(r(483))}var uc=null,ad=0;function ep(s){var l=ad;return ad+=1,uc===null&&(uc=[]),o_(uc,s,l)}function sd(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function tp(s,l){throw l.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function u_(s){function l(W,Z){if(s){var ne=W.deletions;ne===null?(W.deletions=[Z],W.flags|=16):ne.push(Z)}}function h(W,Z){if(!s)return null;for(;Z!==null;)l(W,Z),Z=Z.sibling;return null}function g(W){for(var Z=new Map;W!==null;)W.key!==null?Z.set(W.key,W):Z.set(W.index,W),W=W.sibling;return Z}function b(W,Z){return W=Pa(W,Z),W.index=0,W.sibling=null,W}function N(W,Z,ne){return W.index=ne,s?(ne=W.alternate,ne!==null?(ne=ne.index,ne<Z?(W.flags|=67108866,Z):ne):(W.flags|=67108866,Z)):(W.flags|=1048576,Z)}function E(W){return s&&W.alternate===null&&(W.flags|=67108866),W}function D(W,Z,ne,pe){return Z===null||Z.tag!==6?(Z=u0(ne,W.mode,pe),Z.return=W,Z):(Z=b(Z,ne),Z.return=W,Z)}function H(W,Z,ne,pe){var He=ne.type;return He===w?fe(W,Z,ne.props.children,pe,ne.key):Z!==null&&(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&Uo(He)===Z.type)?(Z=b(Z,ne.props),sd(Z,ne),Z.return=W,Z):(Z=Vh(ne.type,ne.key,ne.props,null,W.mode,pe),sd(Z,ne),Z.return=W,Z)}function re(W,Z,ne,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ne.containerInfo||Z.stateNode.implementation!==ne.implementation?(Z=d0(ne,W.mode,pe),Z.return=W,Z):(Z=b(Z,ne.children||[]),Z.return=W,Z)}function fe(W,Z,ne,pe,He){return Z===null||Z.tag!==7?(Z=Mo(ne,W.mode,pe,He),Z.return=W,Z):(Z=b(Z,ne),Z.return=W,Z)}function ge(W,Z,ne){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=u0(""+Z,W.mode,ne),Z.return=W,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return ne=Vh(Z.type,Z.key,Z.props,null,W.mode,ne),sd(ne,Z),ne.return=W,ne;case x:return Z=d0(Z,W.mode,ne),Z.return=W,Z;case z:return Z=Uo(Z),ge(W,Z,ne)}if(Q(Z)||L(Z))return Z=Mo(Z,W.mode,ne,null),Z.return=W,Z;if(typeof Z.then=="function")return ge(W,ep(Z),ne);if(Z.$$typeof===_)return ge(W,Wh(W,Z),ne);tp(W,Z)}return null}function oe(W,Z,ne,pe){var He=Z!==null?Z.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return He!==null?null:D(W,Z,""+ne,pe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ne.key===He?H(W,Z,ne,pe):null;case x:return ne.key===He?re(W,Z,ne,pe):null;case z:return ne=Uo(ne),oe(W,Z,ne,pe)}if(Q(ne)||L(ne))return He!==null?null:fe(W,Z,ne,pe,null);if(typeof ne.then=="function")return oe(W,Z,ep(ne),pe);if(ne.$$typeof===_)return oe(W,Z,Wh(W,ne),pe);tp(W,ne)}return null}function ce(W,Z,ne,pe,He){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return W=W.get(ne)||null,D(Z,W,""+pe,He);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:return W=W.get(pe.key===null?ne:pe.key)||null,H(Z,W,pe,He);case x:return W=W.get(pe.key===null?ne:pe.key)||null,re(Z,W,pe,He);case z:return pe=Uo(pe),ce(W,Z,ne,pe,He)}if(Q(pe)||L(pe))return W=W.get(ne)||null,fe(Z,W,pe,He,null);if(typeof pe.then=="function")return ce(W,Z,ne,ep(pe),He);if(pe.$$typeof===_)return ce(W,Z,ne,Wh(Z,pe),He);tp(Z,pe)}return null}function Ie(W,Z,ne,pe){for(var He=null,bt=null,Be=Z,st=Z=0,pt=null;Be!==null&&st<ne.length;st++){Be.index>st?(pt=Be,Be=null):pt=Be.sibling;var xt=oe(W,Be,ne[st],pe);if(xt===null){Be===null&&(Be=pt);break}s&&Be&&xt.alternate===null&&l(W,Be),Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt,Be=pt}if(st===ne.length)return h(W,Be),mt&&za(W,st),He;if(Be===null){for(;st<ne.length;st++)Be=ge(W,ne[st],pe),Be!==null&&(Z=N(Be,Z,st),bt===null?He=Be:bt.sibling=Be,bt=Be);return mt&&za(W,st),He}for(Be=g(Be);st<ne.length;st++)pt=ce(Be,W,st,ne[st],pe),pt!==null&&(s&&pt.alternate!==null&&Be.delete(pt.key===null?st:pt.key),Z=N(pt,Z,st),bt===null?He=pt:bt.sibling=pt,bt=pt);return s&&Be.forEach(function($s){return l(W,$s)}),mt&&za(W,st),He}function Ze(W,Z,ne,pe){if(ne==null)throw Error(r(151));for(var He=null,bt=null,Be=Z,st=Z=0,pt=null,xt=ne.next();Be!==null&&!xt.done;st++,xt=ne.next()){Be.index>st?(pt=Be,Be=null):pt=Be.sibling;var $s=oe(W,Be,xt.value,pe);if($s===null){Be===null&&(Be=pt);break}s&&Be&&$s.alternate===null&&l(W,Be),Z=N($s,Z,st),bt===null?He=$s:bt.sibling=$s,bt=$s,Be=pt}if(xt.done)return h(W,Be),mt&&za(W,st),He;if(Be===null){for(;!xt.done;st++,xt=ne.next())xt=ge(W,xt.value,pe),xt!==null&&(Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt);return mt&&za(W,st),He}for(Be=g(Be);!xt.done;st++,xt=ne.next())xt=ce(Be,W,st,xt.value,pe),xt!==null&&(s&&xt.alternate!==null&&Be.delete(xt.key===null?st:xt.key),Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt);return s&&Be.forEach(function(k9){return l(W,k9)}),mt&&za(W,st),He}function Rt(W,Z,ne,pe){if(typeof ne=="object"&&ne!==null&&ne.type===w&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:e:{for(var He=ne.key;Z!==null;){if(Z.key===He){if(He=ne.type,He===w){if(Z.tag===7){h(W,Z.sibling),pe=b(Z,ne.props.children),pe.return=W,W=pe;break e}}else if(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&Uo(He)===Z.type){h(W,Z.sibling),pe=b(Z,ne.props),sd(pe,ne),pe.return=W,W=pe;break e}h(W,Z);break}else l(W,Z);Z=Z.sibling}ne.type===w?(pe=Mo(ne.props.children,W.mode,pe,ne.key),pe.return=W,W=pe):(pe=Vh(ne.type,ne.key,ne.props,null,W.mode,pe),sd(pe,ne),pe.return=W,W=pe)}return E(W);case x:e:{for(He=ne.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===ne.containerInfo&&Z.stateNode.implementation===ne.implementation){h(W,Z.sibling),pe=b(Z,ne.children||[]),pe.return=W,W=pe;break e}else{h(W,Z);break}else l(W,Z);Z=Z.sibling}pe=d0(ne,W.mode,pe),pe.return=W,W=pe}return E(W);case z:return ne=Uo(ne),Rt(W,Z,ne,pe)}if(Q(ne))return Ie(W,Z,ne,pe);if(L(ne)){if(He=L(ne),typeof He!="function")throw Error(r(150));return ne=He.call(ne),Ze(W,Z,ne,pe)}if(typeof ne.then=="function")return Rt(W,Z,ep(ne),pe);if(ne.$$typeof===_)return Rt(W,Z,Wh(W,ne),pe);tp(W,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Z!==null&&Z.tag===6?(h(W,Z.sibling),pe=b(Z,ne),pe.return=W,W=pe):(h(W,Z),pe=u0(ne,W.mode,pe),pe.return=W,W=pe),E(W)):h(W,Z)}return function(W,Z,ne,pe){try{ad=0;var He=Rt(W,Z,ne,pe);return uc=null,He}catch(Be){if(Be===cc||Be===Xh)throw Be;var bt=$r(29,Be,null,W.mode);return bt.lanes=pe,bt.return=W,bt}}}var Fo=u_(!0),d_=u_(!1),Ss=!1;function j0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function N0(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ns(s,l,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(St&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,l=Gh(s),ZC(s,null,h),l}return Hh(s,g,l,h),Gh(s)}function od(s,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,_h(s,h)}}function k0(s,l){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var b=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var E={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?b=N=E:N=N.next=E,h=h.next}while(h!==null);N===null?b=N=l:N=N.next=l}else b=N=l;h={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=l:s.next=l,h.lastBaseUpdate=l}var C0=!1;function ld(){if(C0){var s=lc;if(s!==null)throw s}}function cd(s,l,h,g){C0=!1;var b=s.updateQueue;Ss=!1;var N=b.firstBaseUpdate,E=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var H=D,re=H.next;H.next=null,E===null?N=re:E.next=re,E=H;var fe=s.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==E&&(D===null?fe.firstBaseUpdate=re:D.next=re,fe.lastBaseUpdate=H))}if(N!==null){var ge=b.baseState;E=0,fe=re=H=null,D=N;do{var oe=D.lane&-536870913,ce=oe!==D.lane;if(ce?(ht&oe)===oe:(g&oe)===oe){oe!==0&&oe===oc&&(C0=!0),fe!==null&&(fe=fe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ie=s,Ze=D;oe=l;var Rt=h;switch(Ze.tag){case 1:if(Ie=Ze.payload,typeof Ie=="function"){ge=Ie.call(Rt,ge,oe);break e}ge=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ze.payload,oe=typeof Ie=="function"?Ie.call(Rt,ge,oe):Ie,oe==null)break e;ge=m({},ge,oe);break e;case 2:Ss=!0}}oe=D.callback,oe!==null&&(s.flags|=64,ce&&(s.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(re=fe=ce,H=ge):fe=fe.next=ce,E|=oe;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);fe===null&&(H=ge),b.baseState=H,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,N===null&&(b.shared.lanes=0),As|=E,s.lanes=E,s.memoizedState=ge}}function f_(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function h_(s,l){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)f_(h[s],l)}var dc=B(null),np=B(0);function p_(s,l){s=Ka,M(np,s),M(dc,l),Ka=s|l.baseLanes}function _0(){M(np,Ka),M(dc,dc.current)}function O0(){Ka=np.current,U(dc),U(np)}var Ur=B(null),oi=null;function ks(s){var l=s.alternate;M(pn,pn.current&1),M(Ur,s),oi===null&&(l===null||dc.current!==null||l.memoizedState!==null)&&(oi=s)}function A0(s){M(pn,pn.current),M(Ur,s),oi===null&&(oi=s)}function m_(s){s.tag===22?(M(pn,pn.current),M(Ur,s),oi===null&&(oi=s)):Cs()}function Cs(){M(pn,pn.current),M(Ur,Ur.current)}function Br(s){U(Ur),oi===s&&(oi=null),U(pn)}var pn=B(0);function rp(s){for(var l=s;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Mb(h)||Db(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Da=0,tt=null,Pt=null,Sn=null,ip=!1,fc=!1,qo=!1,ap=0,ud=0,hc=null,mF=0;function cn(){throw Error(r(321))}function E0(s,l){if(l===null)return!1;for(var h=0;h<l.length&&h<s.length;h++)if(!Lr(s[h],l[h]))return!1;return!0}function T0(s,l,h,g,b,N){return Da=N,tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,K.H=s===null||s.memoizedState===null?X_:G0,qo=!1,N=h(g,b),qo=!1,fc&&(N=y_(l,h,g,b)),g_(s),N}function g_(s){K.H=hd;var l=Pt!==null&&Pt.next!==null;if(Da=0,Sn=Pt=tt=null,ip=!1,ud=0,hc=null,l)throw Error(r(300));s===null||jn||(s=s.dependencies,s!==null&&Yh(s)&&(jn=!0))}function y_(s,l,h,g){tt=s;var b=0;do{if(fc&&(hc=null),ud=0,fc=!1,25<=b)throw Error(r(301));if(b+=1,Sn=Pt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}K.H=J_,N=l(h,g)}while(fc);return N}function gF(){var s=K.H,l=s.useState()[0];return l=typeof l.then=="function"?dd(l):l,s=s.useState()[0],(Pt!==null?Pt.memoizedState:null)!==s&&(tt.flags|=1024),l}function P0(){var s=ap!==0;return ap=0,s}function z0(s,l,h){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~h}function R0(s){if(ip){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}ip=!1}Da=0,Sn=Pt=tt=null,fc=!1,ud=ap=0,hc=null}function lr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?tt.memoizedState=Sn=s:Sn=Sn.next=s,Sn}function mn(){if(Pt===null){var s=tt.alternate;s=s!==null?s.memoizedState:null}else s=Pt.next;var l=Sn===null?tt.memoizedState:Sn.next;if(l!==null)Sn=l,Pt=s;else{if(s===null)throw tt.alternate===null?Error(r(467)):Error(r(310));Pt=s,s={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},Sn===null?tt.memoizedState=Sn=s:Sn=Sn.next=s}return Sn}function sp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dd(s){var l=ud;return ud+=1,hc===null&&(hc=[]),s=o_(hc,s,l),l=tt,(Sn===null?l.memoizedState:Sn.next)===null&&(l=l.alternate,K.H=l===null||l.memoizedState===null?X_:G0),s}function op(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return dd(s);if(s.$$typeof===_)return qn(s)}throw Error(r(438,String(s)))}function M0(s){var l=null,h=tt.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var g=tt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=sp(),tt.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(s),g=0;g<s;g++)h[g]=F;return l.index++,h}function Ia(s,l){return typeof l=="function"?l(s):l}function lp(s){var l=mn();return D0(l,Pt,s)}function D0(s,l,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var b=s.baseQueue,N=g.pending;if(N!==null){if(b!==null){var E=b.next;b.next=N.next,N.next=E}l.baseQueue=b=N,g.pending=null}if(N=s.baseState,b===null)s.memoizedState=N;else{l=b.next;var D=E=null,H=null,re=l,fe=!1;do{var ge=re.lane&-536870913;if(ge!==re.lane?(ht&ge)===ge:(Da&ge)===ge){var oe=re.revertLane;if(oe===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ge===oc&&(fe=!0);else if((Da&oe)===oe){re=re.next,oe===oc&&(fe=!0);continue}else ge={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(D=H=ge,E=N):H=H.next=ge,tt.lanes|=oe,As|=oe;ge=re.action,qo&&h(N,ge),N=re.hasEagerState?re.eagerState:h(N,ge)}else oe={lane:ge,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(D=H=oe,E=N):H=H.next=oe,tt.lanes|=ge,As|=ge;re=re.next}while(re!==null&&re!==l);if(H===null?E=N:H.next=D,!Lr(N,s.memoizedState)&&(jn=!0,fe&&(h=lc,h!==null)))throw h;s.memoizedState=N,s.baseState=E,s.baseQueue=H,g.lastRenderedState=N}return b===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function I0(s){var l=mn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,b=h.pending,N=l.memoizedState;if(b!==null){h.pending=null;var E=b=b.next;do N=s(N,E.action),E=E.next;while(E!==b);Lr(N,l.memoizedState)||(jn=!0),l.memoizedState=N,l.baseQueue===null&&(l.baseState=N),h.lastRenderedState=N}return[N,g]}function v_(s,l,h){var g=tt,b=mn(),N=mt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=l();var E=!Lr((Pt||b).memoizedState,h);if(E&&(b.memoizedState=h,jn=!0),b=b.queue,U0(w_.bind(null,g,b,s),[s]),b.getSnapshot!==l||E||Sn!==null&&Sn.memoizedState.tag&1){if(g.flags|=2048,pc(9,{destroy:void 0},x_.bind(null,g,b,h,l),null),Mt===null)throw Error(r(349));N||(Da&127)!==0||b_(g,l,h)}return h}function b_(s,l,h){s.flags|=16384,s={getSnapshot:l,value:h},l=tt.updateQueue,l===null?(l=sp(),tt.updateQueue=l,l.stores=[s]):(h=l.stores,h===null?l.stores=[s]:h.push(s))}function x_(s,l,h,g){l.value=h,l.getSnapshot=g,S_(l)&&j_(s)}function w_(s,l,h){return h(function(){S_(l)&&j_(s)})}function S_(s){var l=s.getSnapshot;s=s.value;try{var h=l();return!Lr(s,h)}catch{return!0}}function j_(s){var l=Ro(s,2);l!==null&&Nr(l,s,2)}function L0(s){var l=lr();if(typeof s=="function"){var h=s;if(s=h(),qo){$t(!0);try{h()}finally{$t(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:s},l}function N_(s,l,h,g){return s.baseState=h,D0(s,Pt,typeof g=="function"?g:Ia)}function yF(s,l,h,g,b){if(dp(s))throw Error(r(485));if(s=l.action,s!==null){var N={payload:b,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){N.listeners.push(E)}};K.T!==null?h(!0):N.isTransition=!1,g(N),h=l.pending,h===null?(N.next=l.pending=N,k_(l,N)):(N.next=h.next,l.pending=h.next=N)}}function k_(s,l){var h=l.action,g=l.payload,b=s.state;if(l.isTransition){var N=K.T,E={};K.T=E;try{var D=h(b,g),H=K.S;H!==null&&H(E,D),C_(s,l,D)}catch(re){$0(s,l,re)}finally{N!==null&&E.types!==null&&(N.types=E.types),K.T=N}}else try{N=h(b,g),C_(s,l,N)}catch(re){$0(s,l,re)}}function C_(s,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){__(s,l,g)},function(g){return $0(s,l,g)}):__(s,l,h)}function __(s,l,h){l.status="fulfilled",l.value=h,O_(l),s.state=h,l=s.pending,l!==null&&(h=l.next,h===l?s.pending=null:(h=h.next,l.next=h,k_(s,h)))}function $0(s,l,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=h,O_(l),l=l.next;while(l!==g)}s.action=null}function O_(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function A_(s,l){return l}function E_(s,l){if(mt){var h=Mt.formState;if(h!==null){e:{var g=tt;if(mt){if(Ht){t:{for(var b=Ht,N=si;b.nodeType!==8;){if(!N){b=null;break t}if(b=li(b.nextSibling),b===null){b=null;break t}}N=b.data,b=N==="F!"||N==="F"?b:null}if(b){Ht=li(b.nextSibling),g=b.data==="F!";break e}}xs(g)}g=!1}g&&(l=h[0])}}return h=lr(),h.memoizedState=h.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A_,lastRenderedState:l},h.queue=g,h=Y_.bind(null,tt,g),g.dispatch=h,g=L0(!1),N=H0.bind(null,tt,!1,g.queue),g=lr(),b={state:l,dispatch:null,action:s,pending:null},g.queue=b,h=yF.bind(null,tt,b,N,h),b.dispatch=h,g.memoizedState=s,[l,h,!1]}function T_(s){var l=mn();return P_(l,Pt,s)}function P_(s,l,h){if(l=D0(s,l,A_)[0],s=lp(Ia)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=dd(l)}catch(E){throw E===cc?Xh:E}else g=l;l=mn();var b=l.queue,N=b.dispatch;return h!==l.memoizedState&&(tt.flags|=2048,pc(9,{destroy:void 0},vF.bind(null,b,h),null)),[g,N,s]}function vF(s,l){s.action=l}function z_(s){var l=mn(),h=Pt;if(h!==null)return P_(l,h,s);mn(),l=l.memoizedState,h=mn();var g=h.queue.dispatch;return h.memoizedState=s,[l,g,!1]}function pc(s,l,h,g){return s={tag:s,create:h,deps:g,inst:l,next:null},l=tt.updateQueue,l===null&&(l=sp(),tt.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,l.lastEffect=s),s}function R_(){return mn().memoizedState}function cp(s,l,h,g){var b=lr();tt.flags|=s,b.memoizedState=pc(1|l,{destroy:void 0},h,g===void 0?null:g)}function up(s,l,h,g){var b=mn();g=g===void 0?null:g;var N=b.memoizedState.inst;Pt!==null&&g!==null&&E0(g,Pt.memoizedState.deps)?b.memoizedState=pc(l,N,h,g):(tt.flags|=s,b.memoizedState=pc(1|l,N,h,g))}function M_(s,l){cp(8390656,8,s,l)}function U0(s,l){up(2048,8,s,l)}function bF(s){tt.flags|=4;var l=tt.updateQueue;if(l===null)l=sp(),tt.updateQueue=l,l.events=[s];else{var h=l.events;h===null?l.events=[s]:h.push(s)}}function D_(s){var l=mn().memoizedState;return bF({ref:l,nextImpl:s}),function(){if((St&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function I_(s,l){return up(4,2,s,l)}function L_(s,l){return up(4,4,s,l)}function $_(s,l){if(typeof l=="function"){s=s();var h=l(s);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function U_(s,l,h){h=h!=null?h.concat([s]):null,up(4,4,$_.bind(null,l,s),h)}function B0(){}function B_(s,l){var h=mn();l=l===void 0?null:l;var g=h.memoizedState;return l!==null&&E0(l,g[1])?g[0]:(h.memoizedState=[s,l],s)}function F_(s,l){var h=mn();l=l===void 0?null:l;var g=h.memoizedState;if(l!==null&&E0(l,g[1]))return g[0];if(g=s(),qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,l],g}function F0(s,l,h){return h===void 0||(Da&1073741824)!==0&&(ht&261930)===0?s.memoizedState=l:(s.memoizedState=h,s=qO(),tt.lanes|=s,As|=s,h)}function q_(s,l,h,g){return Lr(h,l)?h:dc.current!==null?(s=F0(s,h,g),Lr(s,l)||(jn=!0),s):(Da&42)===0||(Da&1073741824)!==0&&(ht&261930)===0?(jn=!0,s.memoizedState=h):(s=qO(),tt.lanes|=s,As|=s,l)}function K_(s,l,h,g,b){var N=X.p;X.p=N!==0&&8>N?N:8;var E=K.T,D={};K.T=D,H0(s,!1,l,h);try{var H=b(),re=K.S;if(re!==null&&re(D,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var fe=pF(H,g);fd(s,l,fe,Kr(s))}else fd(s,l,g,Kr(s))}catch(ge){fd(s,l,{then:function(){},status:"rejected",reason:ge},Kr())}finally{X.p=N,E!==null&&D.types!==null&&(E.types=D.types),K.T=E}}function xF(){}function q0(s,l,h,g){if(s.tag!==5)throw Error(r(476));var b=H_(s).queue;K_(s,b,l,ye,h===null?xF:function(){return G_(s),h(g)})}function H_(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ye},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:h},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function G_(s){var l=H_(s);l.next===null&&(l=s.alternate.memoizedState),fd(s,l.next.queue,{},Kr())}function K0(){return qn(Ad)}function V_(){return mn().memoizedState}function Z_(){return mn().memoizedState}function wF(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var h=Kr();s=js(h);var g=Ns(l,s,h);g!==null&&(Nr(g,l,h),od(g,l,h)),l={cache:b0()},s.payload=l;return}l=l.return}}function SF(s,l,h){var g=Kr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},dp(s)?W_(l,h):(h=l0(s,l,h,g),h!==null&&(Nr(h,s,g),Q_(h,l,g)))}function Y_(s,l,h){var g=Kr();fd(s,l,h,g)}function fd(s,l,h,g){var b={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(dp(s))W_(l,b);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var E=l.lastRenderedState,D=N(E,h);if(b.hasEagerState=!0,b.eagerState=D,Lr(D,E))return Hh(s,l,b,0),Mt===null&&Kh(),!1}catch{}if(h=l0(s,l,b,g),h!==null)return Nr(h,s,g),Q_(h,l,g),!0}return!1}function H0(s,l,h,g){if(g={lane:2,revertLane:jb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},dp(s)){if(l)throw Error(r(479))}else l=l0(s,h,g,2),l!==null&&Nr(l,s,2)}function dp(s){var l=s.alternate;return s===tt||l!==null&&l===tt}function W_(s,l){fc=ip=!0;var h=s.pending;h===null?l.next=l:(l.next=h.next,h.next=l),s.pending=l}function Q_(s,l,h){if((h&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,_h(s,h)}}var hd={readContext:qn,use:op,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useLayoutEffect:cn,useInsertionEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useSyncExternalStore:cn,useId:cn,useHostTransitionStatus:cn,useFormState:cn,useActionState:cn,useOptimistic:cn,useMemoCache:cn,useCacheRefresh:cn};hd.useEffectEvent=cn;var X_={readContext:qn,use:op,useCallback:function(s,l){return lr().memoizedState=[s,l===void 0?null:l],s},useContext:qn,useEffect:M_,useImperativeHandle:function(s,l,h){h=h!=null?h.concat([s]):null,cp(4194308,4,$_.bind(null,l,s),h)},useLayoutEffect:function(s,l){return cp(4194308,4,s,l)},useInsertionEffect:function(s,l){cp(4,2,s,l)},useMemo:function(s,l){var h=lr();l=l===void 0?null:l;var g=s();if(qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,l],g},useReducer:function(s,l,h){var g=lr();if(h!==void 0){var b=h(l);if(qo){$t(!0);try{h(l)}finally{$t(!1)}}}else b=l;return g.memoizedState=g.baseState=b,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:b},g.queue=s,s=s.dispatch=SF.bind(null,tt,s),[g.memoizedState,s]},useRef:function(s){var l=lr();return s={current:s},l.memoizedState=s},useState:function(s){s=L0(s);var l=s.queue,h=Y_.bind(null,tt,l);return l.dispatch=h,[s.memoizedState,h]},useDebugValue:B0,useDeferredValue:function(s,l){var h=lr();return F0(h,s,l)},useTransition:function(){var s=L0(!1);return s=K_.bind(null,tt,s.queue,!0,!1),lr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,h){var g=tt,b=lr();if(mt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),Mt===null)throw Error(r(349));(ht&127)!==0||b_(g,l,h)}b.memoizedState=h;var N={value:h,getSnapshot:l};return b.queue=N,M_(w_.bind(null,g,N,s),[s]),g.flags|=2048,pc(9,{destroy:void 0},x_.bind(null,g,N,h,l),null),h},useId:function(){var s=lr(),l=Mt.identifierPrefix;if(mt){var h=ea,g=Ji;h=(g&~(1<<32-ue(g)-1)).toString(32)+h,l="_"+l+"R_"+h,h=ap++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=mF++,l="_"+l+"r_"+h.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:K0,useFormState:E_,useActionState:E_,useOptimistic:function(s){var l=lr();l.memoizedState=l.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=H0.bind(null,tt,!0,h),h.dispatch=l,[s,l]},useMemoCache:M0,useCacheRefresh:function(){return lr().memoizedState=wF.bind(null,tt)},useEffectEvent:function(s){var l=lr(),h={impl:s};return l.memoizedState=h,function(){if((St&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},G0={readContext:qn,use:op,useCallback:B_,useContext:qn,useEffect:U0,useImperativeHandle:U_,useInsertionEffect:I_,useLayoutEffect:L_,useMemo:F_,useReducer:lp,useRef:R_,useState:function(){return lp(Ia)},useDebugValue:B0,useDeferredValue:function(s,l){var h=mn();return q_(h,Pt.memoizedState,s,l)},useTransition:function(){var s=lp(Ia)[0],l=mn().memoizedState;return[typeof s=="boolean"?s:dd(s),l]},useSyncExternalStore:v_,useId:V_,useHostTransitionStatus:K0,useFormState:T_,useActionState:T_,useOptimistic:function(s,l){var h=mn();return N_(h,Pt,s,l)},useMemoCache:M0,useCacheRefresh:Z_};G0.useEffectEvent=D_;var J_={readContext:qn,use:op,useCallback:B_,useContext:qn,useEffect:U0,useImperativeHandle:U_,useInsertionEffect:I_,useLayoutEffect:L_,useMemo:F_,useReducer:I0,useRef:R_,useState:function(){return I0(Ia)},useDebugValue:B0,useDeferredValue:function(s,l){var h=mn();return Pt===null?F0(h,s,l):q_(h,Pt.memoizedState,s,l)},useTransition:function(){var s=I0(Ia)[0],l=mn().memoizedState;return[typeof s=="boolean"?s:dd(s),l]},useSyncExternalStore:v_,useId:V_,useHostTransitionStatus:K0,useFormState:z_,useActionState:z_,useOptimistic:function(s,l){var h=mn();return Pt!==null?N_(h,Pt,s,l):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:M0,useCacheRefresh:Z_};J_.useEffectEvent=D_;function V0(s,l,h,g){l=s.memoizedState,h=h(g,l),h=h==null?l:m({},l,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Z0={enqueueSetState:function(s,l,h){s=s._reactInternals;var g=Kr(),b=js(g);b.payload=l,h!=null&&(b.callback=h),l=Ns(s,b,g),l!==null&&(Nr(l,s,g),od(l,s,g))},enqueueReplaceState:function(s,l,h){s=s._reactInternals;var g=Kr(),b=js(g);b.tag=1,b.payload=l,h!=null&&(b.callback=h),l=Ns(s,b,g),l!==null&&(Nr(l,s,g),od(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var h=Kr(),g=js(h);g.tag=2,l!=null&&(g.callback=l),l=Ns(s,g,h),l!==null&&(Nr(l,s,h),od(l,s,h))}};function eO(s,l,h,g,b,N,E){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,E):l.prototype&&l.prototype.isPureReactComponent?!Ju(h,g)||!Ju(b,N):!0}function tO(s,l,h,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==s&&Z0.enqueueReplaceState(l,l.state,null)}function Ko(s,l){var h=l;if("ref"in l){h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}if(s=s.defaultProps){h===l&&(h=m({},h));for(var b in s)h[b]===void 0&&(h[b]=s[b])}return h}function nO(s){qh(s)}function rO(s){console.error(s)}function iO(s){qh(s)}function fp(s,l){try{var h=s.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function aO(s,l,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Y0(s,l,h){return h=js(h),h.tag=3,h.payload={element:null},h.callback=function(){fp(s,l)},h}function sO(s){return s=js(s),s.tag=3,s}function oO(s,l,h,g){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var N=g.value;s.payload=function(){return b(N)},s.callback=function(){aO(l,h,g)}}var E=h.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(s.callback=function(){aO(l,h,g),typeof b!="function"&&(Es===null?Es=new Set([this]):Es.add(this));var D=g.stack;this.componentDidCatch(g.value,{componentStack:D!==null?D:""})})}function jF(s,l,h,g,b){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=h.alternate,l!==null&&sc(l,h,b,!0),h=Ur.current,h!==null){switch(h.tag){case 31:case 13:return oi===null?Np():h.alternate===null&&un===0&&(un=3),h.flags&=-257,h.flags|=65536,h.lanes=b,g===Jh?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([g]):l.add(g),xb(s,g,b)),!1;case 22:return h.flags|=65536,g===Jh?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([g]):h.add(g)),xb(s,g,b)),!1}throw Error(r(435,h.tag))}return xb(s,g,b),Np(),!1}if(mt)return l=Ur.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,g!==p0&&(s=Error(r(422),{cause:g}),nd(ri(s,h)))):(g!==p0&&(l=Error(r(423),{cause:g}),nd(ri(l,h))),s=s.current.alternate,s.flags|=65536,b&=-b,s.lanes|=b,g=ri(g,h),b=Y0(s.stateNode,g,b),k0(s,b),un!==4&&(un=2)),!1;var N=Error(r(520),{cause:g});if(N=ri(N,h),wd===null?wd=[N]:wd.push(N),un!==4&&(un=2),l===null)return!0;g=ri(g,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,s=b&-b,h.lanes|=s,s=Y0(h.stateNode,g,s),k0(h,s),!1;case 1:if(l=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Es===null||!Es.has(N))))return h.flags|=65536,b&=-b,h.lanes|=b,b=sO(b),oO(b,s,h,g),k0(h,b),!1}h=h.return}while(h!==null);return!1}var W0=Error(r(461)),jn=!1;function Kn(s,l,h,g){l.child=s===null?d_(l,null,h,g):Fo(l,s.child,h,g)}function lO(s,l,h,g,b){h=h.render;var N=l.ref;if("ref"in g){var E={};for(var D in g)D!=="ref"&&(E[D]=g[D])}else E=g;return Lo(l),g=T0(s,l,h,E,N,b),D=P0(),s!==null&&!jn?(z0(s,l,b),La(s,l,b)):(mt&&D&&f0(l),l.flags|=1,Kn(s,l,g,b),l.child)}function cO(s,l,h,g,b){if(s===null){var N=h.type;return typeof N=="function"&&!c0(N)&&N.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=N,uO(s,l,N,g,b)):(s=Vh(h.type,null,g,l,l.mode,b),s.ref=l.ref,s.return=l,l.child=s)}if(N=s.child,!ib(s,b)){var E=N.memoizedProps;if(h=h.compare,h=h!==null?h:Ju,h(E,g)&&s.ref===l.ref)return La(s,l,b)}return l.flags|=1,s=Pa(N,g),s.ref=l.ref,s.return=l,l.child=s}function uO(s,l,h,g,b){if(s!==null){var N=s.memoizedProps;if(Ju(N,g)&&s.ref===l.ref)if(jn=!1,l.pendingProps=g=N,ib(s,b))(s.flags&131072)!==0&&(jn=!0);else return l.lanes=s.lanes,La(s,l,b)}return Q0(s,l,h,g,b)}function dO(s,l,h,g){var b=g.children,N=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=l.child=s.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~N}else g=0,l.child=null;return fO(s,l,N,h,g)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Qh(l,N!==null?N.cachePool:null),N!==null?p_(l,N):_0(),m_(l);else return g=l.lanes=536870912,fO(s,l,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Qh(l,N.cachePool),p_(l,N),Cs(),l.memoizedState=null):(s!==null&&Qh(l,null),_0(),Cs());return Kn(s,l,b,h),l.child}function pd(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function fO(s,l,h,g,b){var N=w0();return N=N===null?null:{parent:wn._currentValue,pool:N},l.memoizedState={baseLanes:h,cachePool:N},s!==null&&Qh(l,null),_0(),m_(l),s!==null&&sc(s,l,g,!0),l.childLanes=b,null}function hp(s,l){return l=mp({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function hO(s,l,h){return Fo(l,s.child,null,h),s=hp(l,l.pendingProps),s.flags|=2,Br(l),l.memoizedState=null,s}function NF(s,l,h){var g=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(mt){if(g.mode==="hidden")return s=hp(l,g),l.lanes=536870912,pd(null,s);if(A0(l),(s=Ht)?(s=kA(s,si),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:vs!==null?{id:Ji,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},h=WC(s),h.return=l,l.child=h,Fn=l,Ht=null)):s=null,s===null)throw xs(l);return l.lanes=536870912,null}return hp(l,g)}var N=s.memoizedState;if(N!==null){var E=N.dehydrated;if(A0(l),b)if(l.flags&256)l.flags&=-257,l=hO(s,l,h);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(jn||sc(s,l,h,!1),b=(h&s.childLanes)!==0,jn||b){if(g=Mt,g!==null&&(E=Oh(g,h),E!==0&&E!==N.retryLane))throw N.retryLane=E,Ro(s,E),Nr(g,s,E),W0;Np(),l=hO(s,l,h)}else s=N.treeContext,Ht=li(E.nextSibling),Fn=l,mt=!0,bs=null,si=!1,s!==null&&JC(l,s),l=hp(l,g),l.flags|=4096;return l}return s=Pa(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function pp(s,l){var h=l.ref;if(h===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(l.flags|=4194816)}}function Q0(s,l,h,g,b){return Lo(l),h=T0(s,l,h,g,void 0,b),g=P0(),s!==null&&!jn?(z0(s,l,b),La(s,l,b)):(mt&&g&&f0(l),l.flags|=1,Kn(s,l,h,b),l.child)}function pO(s,l,h,g,b,N){return Lo(l),l.updateQueue=null,h=y_(l,g,h,b),g_(s),g=P0(),s!==null&&!jn?(z0(s,l,N),La(s,l,N)):(mt&&g&&f0(l),l.flags|=1,Kn(s,l,h,N),l.child)}function mO(s,l,h,g,b){if(Lo(l),l.stateNode===null){var N=nc,E=h.contextType;typeof E=="object"&&E!==null&&(N=qn(E)),N=new h(g,N),l.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Z0,l.stateNode=N,N._reactInternals=l,N=l.stateNode,N.props=g,N.state=l.memoizedState,N.refs={},j0(l),E=h.contextType,N.context=typeof E=="object"&&E!==null?qn(E):nc,N.state=l.memoizedState,E=h.getDerivedStateFromProps,typeof E=="function"&&(V0(l,h,E,g),N.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(E=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),E!==N.state&&Z0.enqueueReplaceState(N,N.state,null),cd(l,g,N,b),ld(),N.state=l.memoizedState),typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){N=l.stateNode;var D=l.memoizedProps,H=Ko(h,D);N.props=H;var re=N.context,fe=h.contextType;E=nc,typeof fe=="object"&&fe!==null&&(E=qn(fe));var ge=h.getDerivedStateFromProps;fe=typeof ge=="function"||typeof N.getSnapshotBeforeUpdate=="function",D=l.pendingProps!==D,fe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(D||re!==E)&&tO(l,N,g,E),Ss=!1;var oe=l.memoizedState;N.state=oe,cd(l,g,N,b),ld(),re=l.memoizedState,D||oe!==re||Ss?(typeof ge=="function"&&(V0(l,h,ge,g),re=l.memoizedState),(H=Ss||eO(l,h,H,g,oe,re,E))?(fe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4194308)):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=re),N.props=g,N.state=re,N.context=E,g=H):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{N=l.stateNode,N0(s,l),E=l.memoizedProps,fe=Ko(h,E),N.props=fe,ge=l.pendingProps,oe=N.context,re=h.contextType,H=nc,typeof re=="object"&&re!==null&&(H=qn(re)),D=h.getDerivedStateFromProps,(re=typeof D=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(E!==ge||oe!==H)&&tO(l,N,g,H),Ss=!1,oe=l.memoizedState,N.state=oe,cd(l,g,N,b),ld();var ce=l.memoizedState;E!==ge||oe!==ce||Ss||s!==null&&s.dependencies!==null&&Yh(s.dependencies)?(typeof D=="function"&&(V0(l,h,D,g),ce=l.memoizedState),(fe=Ss||eO(l,h,fe,g,oe,ce,H)||s!==null&&s.dependencies!==null&&Yh(s.dependencies))?(re||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,ce,H),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,ce,H)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ce),N.props=g,N.state=ce,N.context=H,g=fe):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),g=!1)}return N=g,pp(s,l),g=(l.flags&128)!==0,N||g?(N=l.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),l.flags|=1,s!==null&&g?(l.child=Fo(l,s.child,null,b),l.child=Fo(l,null,h,b)):Kn(s,l,h,b),l.memoizedState=N.state,s=l.child):s=La(s,l,b),s}function gO(s,l,h,g){return Do(),l.flags|=256,Kn(s,l,h,g),l.child}var X0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function J0(s){return{baseLanes:s,cachePool:a_()}}function eb(s,l,h){return s=s!==null?s.childLanes&~h:0,l&&(s|=qr),s}function yO(s,l,h){var g=l.pendingProps,b=!1,N=(l.flags&128)!==0,E;if((E=N)||(E=s!==null&&s.memoizedState===null?!1:(pn.current&2)!==0),E&&(b=!0,l.flags&=-129),E=(l.flags&32)!==0,l.flags&=-33,s===null){if(mt){if(b?ks(l):Cs(),(s=Ht)?(s=kA(s,si),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:vs!==null?{id:Ji,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},h=WC(s),h.return=l,l.child=h,Fn=l,Ht=null)):s=null,s===null)throw xs(l);return Db(s)?l.lanes=32:l.lanes=536870912,null}var D=g.children;return g=g.fallback,b?(Cs(),b=l.mode,D=mp({mode:"hidden",children:D},b),g=Mo(g,b,h,null),D.return=l,g.return=l,D.sibling=g,l.child=D,g=l.child,g.memoizedState=J0(h),g.childLanes=eb(s,E,h),l.memoizedState=X0,pd(null,g)):(ks(l),tb(l,D))}var H=s.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(N)l.flags&256?(ks(l),l.flags&=-257,l=nb(s,l,h)):l.memoizedState!==null?(Cs(),l.child=s.child,l.flags|=128,l=null):(Cs(),D=g.fallback,b=l.mode,g=mp({mode:"visible",children:g.children},b),D=Mo(D,b,h,null),D.flags|=2,g.return=l,D.return=l,g.sibling=D,l.child=g,Fo(l,s.child,null,h),g=l.child,g.memoizedState=J0(h),g.childLanes=eb(s,E,h),l.memoizedState=X0,l=pd(null,g));else if(ks(l),Db(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var re=E.dgst;E=re,g=Error(r(419)),g.stack="",g.digest=E,nd({value:g,source:null,stack:null}),l=nb(s,l,h)}else if(jn||sc(s,l,h,!1),E=(h&s.childLanes)!==0,jn||E){if(E=Mt,E!==null&&(g=Oh(E,h),g!==0&&g!==H.retryLane))throw H.retryLane=g,Ro(s,g),Nr(E,s,g),W0;Mb(D)||Np(),l=nb(s,l,h)}else Mb(D)?(l.flags|=192,l.child=s.child,l=null):(s=H.treeContext,Ht=li(D.nextSibling),Fn=l,mt=!0,bs=null,si=!1,s!==null&&JC(l,s),l=tb(l,g.children),l.flags|=4096);return l}return b?(Cs(),D=g.fallback,b=l.mode,H=s.child,re=H.sibling,g=Pa(H,{mode:"hidden",children:g.children}),g.subtreeFlags=H.subtreeFlags&65011712,re!==null?D=Pa(re,D):(D=Mo(D,b,h,null),D.flags|=2),D.return=l,g.return=l,g.sibling=D,l.child=g,pd(null,g),g=l.child,D=s.child.memoizedState,D===null?D=J0(h):(b=D.cachePool,b!==null?(H=wn._currentValue,b=b.parent!==H?{parent:H,pool:H}:b):b=a_(),D={baseLanes:D.baseLanes|h,cachePool:b}),g.memoizedState=D,g.childLanes=eb(s,E,h),l.memoizedState=X0,pd(s.child,g)):(ks(l),h=s.child,s=h.sibling,h=Pa(h,{mode:"visible",children:g.children}),h.return=l,h.sibling=null,s!==null&&(E=l.deletions,E===null?(l.deletions=[s],l.flags|=16):E.push(s)),l.child=h,l.memoizedState=null,h)}function tb(s,l){return l=mp({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function mp(s,l){return s=$r(22,s,null,l),s.lanes=0,s}function nb(s,l,h){return Fo(l,s.child,null,h),s=tb(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function vO(s,l,h){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),y0(s.return,l,h)}function rb(s,l,h,g,b,N){var E=s.memoizedState;E===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:b,treeForkCount:N}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=h,E.tailMode=b,E.treeForkCount=N)}function bO(s,l,h){var g=l.pendingProps,b=g.revealOrder,N=g.tail;g=g.children;var E=pn.current,D=(E&2)!==0;if(D?(E=E&1|2,l.flags|=128):E&=1,M(pn,E),Kn(s,l,g,h),g=mt?td:0,!D&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&vO(s,h,l);else if(s.tag===19)vO(s,h,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(b){case"forwards":for(h=l.child,b=null;h!==null;)s=h.alternate,s!==null&&rp(s)===null&&(b=h),h=h.sibling;h=b,h===null?(b=l.child,l.child=null):(b=h.sibling,h.sibling=null),rb(l,!1,b,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=l.child,l.child=null;b!==null;){if(s=b.alternate,s!==null&&rp(s)===null){l.child=b;break}s=b.sibling,b.sibling=h,h=b,b=s}rb(l,!0,h,null,N,g);break;case"together":rb(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function La(s,l,h){if(s!==null&&(l.dependencies=s.dependencies),As|=l.lanes,(h&l.childLanes)===0)if(s!==null){if(sc(s,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,h=Pa(s,s.pendingProps),l.child=h,h.return=l;s.sibling!==null;)s=s.sibling,h=h.sibling=Pa(s,s.pendingProps),h.return=l;h.sibling=null}return l.child}function ib(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Yh(s)))}function kF(s,l,h){switch(l.tag){case 3:je(l,l.stateNode.containerInfo),ws(l,wn,s.memoizedState.cache),Do();break;case 27:case 5:de(l);break;case 4:je(l,l.stateNode.containerInfo);break;case 10:ws(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,A0(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(ks(l),l.flags|=128,null):(h&l.child.childLanes)!==0?yO(s,l,h):(ks(l),s=La(s,l,h),s!==null?s.sibling:null);ks(l);break;case 19:var b=(s.flags&128)!==0;if(g=(h&l.childLanes)!==0,g||(sc(s,l,h,!1),g=(h&l.childLanes)!==0),b){if(g)return bO(s,l,h);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),M(pn,pn.current),g)break;return null;case 22:return l.lanes=0,dO(s,l,h,l.pendingProps);case 24:ws(l,wn,s.memoizedState.cache)}return La(s,l,h)}function xO(s,l,h){if(s!==null)if(s.memoizedProps!==l.pendingProps)jn=!0;else{if(!ib(s,h)&&(l.flags&128)===0)return jn=!1,kF(s,l,h);jn=(s.flags&131072)!==0}else jn=!1,mt&&(l.flags&1048576)!==0&&XC(l,td,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Uo(l.elementType),l.type=s,typeof s=="function")c0(s)?(g=Ko(s,g),l.tag=1,l=mO(null,l,s,g,h)):(l.tag=0,l=Q0(null,l,s,g,h));else{if(s!=null){var b=s.$$typeof;if(b===C){l.tag=11,l=lO(null,l,s,g,h);break e}else if(b===O){l.tag=14,l=cO(null,l,s,g,h);break e}}throw l=ae(s)||s,Error(r(306,l,""))}}return l;case 0:return Q0(s,l,l.type,l.pendingProps,h);case 1:return g=l.type,b=Ko(g,l.pendingProps),mO(s,l,g,b,h);case 3:e:{if(je(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var N=l.memoizedState;b=N.element,N0(s,l),cd(l,g,null,h);var E=l.memoizedState;if(g=E.cache,ws(l,wn,g),g!==N.cache&&v0(l,[wn],h,!0),ld(),g=E.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:E.cache},l.updateQueue.baseState=N,l.memoizedState=N,l.flags&256){l=gO(s,l,g,h);break e}else if(g!==b){b=ri(Error(r(424)),l),nd(b),l=gO(s,l,g,h);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Ht=li(s.firstChild),Fn=l,mt=!0,bs=null,si=!0,h=d_(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Do(),g===b){l=La(s,l,h);break e}Kn(s,l,g,h)}l=l.child}return l;case 26:return pp(s,l),s===null?(h=TA(l.type,null,l.pendingProps,null))?l.memoizedState=h:mt||(h=l.type,s=l.pendingProps,g=Tp(ie.current).createElement(h),g[ct]=l,g[_t]=s,Hn(g,h,s),nn(g),l.stateNode=g):l.memoizedState=TA(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return de(l),s===null&&mt&&(g=l.stateNode=OA(l.type,l.pendingProps,ie.current),Fn=l,si=!0,b=Ht,Rs(l.type)?(Ib=b,Ht=li(g.firstChild)):Ht=b),Kn(s,l,l.pendingProps.children,h),pp(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&mt&&((b=g=Ht)&&(g=t9(g,l.type,l.pendingProps,si),g!==null?(l.stateNode=g,Fn=l,Ht=li(g.firstChild),si=!1,b=!0):b=!1),b||xs(l)),de(l),b=l.type,N=l.pendingProps,E=s!==null?s.memoizedProps:null,g=N.children,Pb(b,N)?g=null:E!==null&&Pb(b,E)&&(l.flags|=32),l.memoizedState!==null&&(b=T0(s,l,gF,null,null,h),Ad._currentValue=b),pp(s,l),Kn(s,l,g,h),l.child;case 6:return s===null&&mt&&((s=h=Ht)&&(h=n9(h,l.pendingProps,si),h!==null?(l.stateNode=h,Fn=l,Ht=null,s=!0):s=!1),s||xs(l)),null;case 13:return yO(s,l,h);case 4:return je(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=Fo(l,null,g,h):Kn(s,l,g,h),l.child;case 11:return lO(s,l,l.type,l.pendingProps,h);case 7:return Kn(s,l,l.pendingProps,h),l.child;case 8:return Kn(s,l,l.pendingProps.children,h),l.child;case 12:return Kn(s,l,l.pendingProps.children,h),l.child;case 10:return g=l.pendingProps,ws(l,l.type,g.value),Kn(s,l,g.children,h),l.child;case 9:return b=l.type._context,g=l.pendingProps.children,Lo(l),b=qn(b),g=g(b),l.flags|=1,Kn(s,l,g,h),l.child;case 14:return cO(s,l,l.type,l.pendingProps,h);case 15:return uO(s,l,l.type,l.pendingProps,h);case 19:return bO(s,l,h);case 31:return NF(s,l,h);case 22:return dO(s,l,h,l.pendingProps);case 24:return Lo(l),g=qn(wn),s===null?(b=w0(),b===null&&(b=Mt,N=b0(),b.pooledCache=N,N.refCount++,N!==null&&(b.pooledCacheLanes|=h),b=N),l.memoizedState={parent:g,cache:b},j0(l),ws(l,wn,b)):((s.lanes&h)!==0&&(N0(s,l),cd(l,null,null,h),ld()),b=s.memoizedState,N=l.memoizedState,b.parent!==g?(b={parent:g,cache:g},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),ws(l,wn,g)):(g=N.cache,ws(l,wn,g),g!==b.cache&&v0(l,[wn],h,!0))),Kn(s,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function $a(s){s.flags|=4}function ab(s,l,h,g,b){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(b&335544128)===b)if(s.stateNode.complete)s.flags|=8192;else if(VO())s.flags|=8192;else throw Bo=Jh,S0}else s.flags&=-16777217}function wO(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!DA(l))if(VO())s.flags|=8192;else throw Bo=Jh,S0}function gp(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?_o():536870912,s.lanes|=l,vc|=l)}function md(s,l){if(!mt)switch(s.tailMode){case"hidden":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Gt(s){var l=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(l)for(var b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=g,s.childLanes=h,l}function CF(s,l,h){var g=l.pendingProps;switch(h0(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(l),null;case 1:return Gt(l),null;case 3:return h=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Ma(wn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(ac(l)?$a(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,m0())),Gt(l),null;case 26:var b=l.type,N=l.memoizedState;return s===null?($a(l),N!==null?(Gt(l),wO(l,N)):(Gt(l),ab(l,b,null,g,h))):N?N!==s.memoizedState?($a(l),Gt(l),wO(l,N)):(Gt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&$a(l),Gt(l),ab(l,b,s,g,h)),null;case 27:if(Ce(l),h=ie.current,b=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Gt(l),null}s=V.current,ac(l)?e_(l):(s=OA(b,g,h),l.stateNode=s,$a(l))}return Gt(l),null;case 5:if(Ce(l),b=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Gt(l),null}if(N=V.current,ac(l))e_(l);else{var E=Tp(ie.current);switch(N){case 1:N=E.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:N=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":N=E.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":N=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":N=E.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?E.createElement("select",{is:g.is}):E.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?E.createElement(b,{is:g.is}):E.createElement(b)}}N[ct]=l,N[_t]=g;e:for(E=l.child;E!==null;){if(E.tag===5||E.tag===6)N.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===l)break e;for(;E.sibling===null;){if(E.return===null||E.return===l)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}l.stateNode=N;e:switch(Hn(N,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&$a(l)}}return Gt(l),ab(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,h),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=ie.current,ac(l)){if(s=l.stateNode,h=l.memoizedProps,g=null,b=Fn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}s[ct]=l,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||yA(s.nodeValue,h)),s||xs(l,!0)}else s=Tp(s).createTextNode(g),s[ct]=l,l.stateNode=s}return Gt(l),null;case 31:if(h=l.memoizedState,s===null||s.memoizedState!==null){if(g=ac(l),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ct]=l}else Do(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),s=!1}else h=m0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return l.flags&256?(Br(l),l):(Br(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Gt(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(b=ac(l),g!==null&&g.dehydrated!==null){if(s===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ct]=l}else Do(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),b=!1}else b=m0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(Br(l),l):(Br(l),null)}return Br(l),(l.flags&128)!==0?(l.lanes=h,l):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=l.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==b&&(g.flags|=2048)),h!==s&&h&&(l.child.flags|=8192),gp(l,l.updateQueue),Gt(l),null);case 4:return ee(),s===null&&_b(l.stateNode.containerInfo),Gt(l),null;case 10:return Ma(l.type),Gt(l),null;case 19:if(U(pn),g=l.memoizedState,g===null)return Gt(l),null;if(b=(l.flags&128)!==0,N=g.rendering,N===null)if(b)md(g,!1);else{if(un!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(N=rp(s),N!==null){for(l.flags|=128,md(g,!1),s=N.updateQueue,l.updateQueue=s,gp(l,s),l.subtreeFlags=0,s=h,h=l.child;h!==null;)YC(h,s),h=h.sibling;return M(pn,pn.current&1|2),mt&&za(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&&Re()>wp&&(l.flags|=128,b=!0,md(g,!1),l.lanes=4194304)}else{if(!b)if(s=rp(N),s!==null){if(l.flags|=128,b=!0,s=s.updateQueue,l.updateQueue=s,gp(l,s),md(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!mt)return Gt(l),null}else 2*Re()-g.renderingStartTime>wp&&h!==536870912&&(l.flags|=128,b=!0,md(g,!1),l.lanes=4194304);g.isBackwards?(N.sibling=l.child,l.child=N):(s=g.last,s!==null?s.sibling=N:l.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Re(),s.sibling=null,h=pn.current,M(pn,b?h&1|2:h&1),mt&&za(l,g.treeForkCount),s):(Gt(l),null);case 22:case 23:return Br(l),O0(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(h&536870912)!==0&&(l.flags&128)===0&&(Gt(l),l.subtreeFlags&6&&(l.flags|=8192)):Gt(l),h=l.updateQueue,h!==null&&gp(l,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048),s!==null&&U($o),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ma(wn),Gt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function _F(s,l){switch(h0(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Ma(wn),ee(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Ce(l),null;case 31:if(l.memoizedState!==null){if(Br(l),l.alternate===null)throw Error(r(340));Do()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Br(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Do()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return U(pn),null;case 4:return ee(),null;case 10:return Ma(l.type),null;case 22:case 23:return Br(l),O0(),s!==null&&U($o),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Ma(wn),null;case 25:return null;default:return null}}function SO(s,l){switch(h0(l),l.tag){case 3:Ma(wn),ee();break;case 26:case 27:case 5:Ce(l);break;case 4:ee();break;case 31:l.memoizedState!==null&&Br(l);break;case 13:Br(l);break;case 19:U(pn);break;case 10:Ma(l.type);break;case 22:case 23:Br(l),O0(),s!==null&&U($o);break;case 24:Ma(wn)}}function gd(s,l){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var b=g.next;h=b;do{if((h.tag&s)===s){g=void 0;var N=h.create,E=h.inst;g=N(),E.destroy=g}h=h.next}while(h!==b)}}catch(D){At(l,l.return,D)}}function _s(s,l,h){try{var g=l.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var N=b.next;g=N;do{if((g.tag&s)===s){var E=g.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,b=l;var H=h,re=D;try{re()}catch(fe){At(b,H,fe)}}}g=g.next}while(g!==N)}}catch(fe){At(l,l.return,fe)}}function jO(s){var l=s.updateQueue;if(l!==null){var h=s.stateNode;try{h_(l,h)}catch(g){At(s,s.return,g)}}}function NO(s,l,h){h.props=Ko(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){At(s,l,g)}}function yd(s,l){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(b){At(s,l,b)}}function ta(s,l){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(b){At(s,l,b)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){At(s,l,b)}else h.current=null}function kO(s){var l=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(b){At(s,s.return,b)}}function sb(s,l,h){try{var g=s.stateNode;YF(g,s.type,h,l),g[_t]=l}catch(b){At(s,s.return,b)}}function CO(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Rs(s.type)||s.tag===4}function ob(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||CO(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Rs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function lb(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(s),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Ea));else if(g!==4&&(g===27&&Rs(s.type)&&(h=s.stateNode,l=null),s=s.child,s!==null))for(lb(s,l,h),s=s.sibling;s!==null;)lb(s,l,h),s=s.sibling}function yp(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?h.insertBefore(s,l):h.appendChild(s);else if(g!==4&&(g===27&&Rs(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(yp(s,l,h),s=s.sibling;s!==null;)yp(s,l,h),s=s.sibling}function _O(s){var l=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Hn(l,g,h),l[ct]=s,l[_t]=h}catch(N){At(s,s.return,N)}}var Ua=!1,Nn=!1,cb=!1,OO=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function OF(s,l){if(s=s.containerInfo,Eb=Lp,s=UC(s),n0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var b=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var E=0,D=-1,H=-1,re=0,fe=0,ge=s,oe=null;t:for(;;){for(var ce;ge!==h||b!==0&&ge.nodeType!==3||(D=E+b),ge!==N||g!==0&&ge.nodeType!==3||(H=E+g),ge.nodeType===3&&(E+=ge.nodeValue.length),(ce=ge.firstChild)!==null;)oe=ge,ge=ce;for(;;){if(ge===s)break t;if(oe===h&&++re===b&&(D=E),oe===N&&++fe===g&&(H=E),(ce=ge.nextSibling)!==null)break;ge=oe,oe=ge.parentNode}ge=ce}h=D===-1||H===-1?null:{start:D,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;for(Tb={focusedElem:s,selectionRange:h},Lp=!1,Dn=l;Dn!==null;)if(l=Dn,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Dn=s;else for(;Dn!==null;){switch(l=Dn,N=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)b=s[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=l,b=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Ie=Ko(h.type,b);s=g.getSnapshotBeforeUpdate(Ie,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ze){At(h,h.return,Ze)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,h=s.nodeType,h===9)Rb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Rb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,Dn=s;break}Dn=l.return}}function AO(s,l,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Fa(s,h),g&4&&gd(5,h);break;case 1:if(Fa(s,h),g&4)if(s=h.stateNode,l===null)try{s.componentDidMount()}catch(E){At(h,h.return,E)}else{var b=Ko(h.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(b,l,s.__reactInternalSnapshotBeforeUpdate)}catch(E){At(h,h.return,E)}}g&64&&jO(h),g&512&&yd(h,h.return);break;case 3:if(Fa(s,h),g&64&&(s=h.updateQueue,s!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{h_(s,l)}catch(E){At(h,h.return,E)}}break;case 27:l===null&&g&4&&_O(h);case 26:case 5:Fa(s,h),l===null&&g&4&&kO(h),g&512&&yd(h,h.return);break;case 12:Fa(s,h);break;case 31:Fa(s,h),g&4&&PO(s,h);break;case 13:Fa(s,h),g&4&&zO(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=IF.bind(null,h),r9(s,h))));break;case 22:if(g=h.memoizedState!==null||Ua,!g){l=l!==null&&l.memoizedState!==null||Nn,b=Ua;var N=Nn;Ua=g,(Nn=l)&&!N?qa(s,h,(h.subtreeFlags&8772)!==0):Fa(s,h),Ua=b,Nn=N}break;case 30:break;default:Fa(s,h)}}function EO(s){var l=s.alternate;l!==null&&(s.alternate=null,EO(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&_a(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Yt=null,xr=!1;function Ba(s,l,h){for(h=h.child;h!==null;)TO(s,l,h),h=h.sibling}function TO(s,l,h){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Qe,h)}catch{}switch(h.tag){case 26:Nn||ta(h,l),Ba(s,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Nn||ta(h,l);var g=Yt,b=xr;Rs(h.type)&&(Yt=h.stateNode,xr=!1),Ba(s,l,h),Cd(h.stateNode),Yt=g,xr=b;break;case 5:Nn||ta(h,l);case 6:if(g=Yt,b=xr,Yt=null,Ba(s,l,h),Yt=g,xr=b,Yt!==null)if(xr)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(h.stateNode)}catch(N){At(h,l,N)}else try{Yt.removeChild(h.stateNode)}catch(N){At(h,l,N)}break;case 18:Yt!==null&&(xr?(s=Yt,jA(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),Cc(s)):jA(Yt,h.stateNode));break;case 4:g=Yt,b=xr,Yt=h.stateNode.containerInfo,xr=!0,Ba(s,l,h),Yt=g,xr=b;break;case 0:case 11:case 14:case 15:_s(2,h,l),Nn||_s(4,h,l),Ba(s,l,h);break;case 1:Nn||(ta(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"&&NO(h,l,g)),Ba(s,l,h);break;case 21:Ba(s,l,h);break;case 22:Nn=(g=Nn)||h.memoizedState!==null,Ba(s,l,h),Nn=g;break;default:Ba(s,l,h)}}function PO(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Cc(s)}catch(h){At(l,l.return,h)}}}function zO(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Cc(s)}catch(h){At(l,l.return,h)}}function AF(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new OO),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new OO),l;default:throw Error(r(435,s.tag))}}function vp(s,l){var h=AF(s);l.forEach(function(g){if(!h.has(g)){h.add(g);var b=LF.bind(null,s,g);g.then(b,b)}})}function wr(s,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var b=h[g],N=s,E=l,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(Rs(D.type)){Yt=D.stateNode,xr=!1;break e}break;case 5:Yt=D.stateNode,xr=!1;break e;case 3:case 4:Yt=D.stateNode.containerInfo,xr=!0;break e}D=D.return}if(Yt===null)throw Error(r(160));TO(N,E,b),Yt=null,xr=!1,N=b.alternate,N!==null&&(N.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)RO(l,s),l=l.sibling}var Di=null;function RO(s,l){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:wr(l,s),Sr(s),g&4&&(_s(3,s,s.return),gd(3,s),_s(5,s,s.return));break;case 1:wr(l,s),Sr(s),g&512&&(Nn||h===null||ta(h,h.return)),g&64&&Ua&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var b=Di;if(wr(l,s),Sr(s),g&512&&(Nn||h===null||ta(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":N=b.getElementsByTagName("title")[0],(!N||N[Jr]||N[ct]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=b.createElement(g),b.head.insertBefore(N,b.querySelector("head > title"))),Hn(N,g,h),N[ct]=s,nn(N),g=N;break e;case"link":var E=RA("link","href",b).get(g+(h.href||""));if(E){for(var D=0;D<E.length;D++)if(N=E[D],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){E.splice(D,1);break t}}N=b.createElement(g),Hn(N,g,h),b.head.appendChild(N);break;case"meta":if(E=RA("meta","content",b).get(g+(h.content||""))){for(D=0;D<E.length;D++)if(N=E[D],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){E.splice(D,1);break t}}N=b.createElement(g),Hn(N,g,h),b.head.appendChild(N);break;default:throw Error(r(468,g))}N[ct]=s,nn(N),g=N}s.stateNode=g}else MA(b,s.type,s.stateNode);else s.stateNode=zA(b,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?MA(b,s.type,s.stateNode):zA(b,g,s.memoizedProps)):g===null&&s.stateNode!==null&&sb(s,s.memoizedProps,h.memoizedProps)}break;case 27:wr(l,s),Sr(s),g&512&&(Nn||h===null||ta(h,h.return)),h!==null&&g&4&&sb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(wr(l,s),Sr(s),g&512&&(Nn||h===null||ta(h,h.return)),s.flags&32){b=s.stateNode;try{Yl(b,"")}catch(Ie){At(s,s.return,Ie)}}g&4&&s.stateNode!=null&&(b=s.memoizedProps,sb(s,b,h!==null?h.memoizedProps:b)),g&1024&&(cb=!0);break;case 6:if(wr(l,s),Sr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ie){At(s,s.return,Ie)}}break;case 3:if(Rp=null,b=Di,Di=Pp(l.containerInfo),wr(l,s),Di=b,Sr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Cc(l.containerInfo)}catch(Ie){At(s,s.return,Ie)}cb&&(cb=!1,MO(s));break;case 4:g=Di,Di=Pp(s.stateNode.containerInfo),wr(l,s),Sr(s),Di=g;break;case 12:wr(l,s),Sr(s);break;case 31:wr(l,s),Sr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 13:wr(l,s),Sr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(xp=Re()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 22:b=s.memoizedState!==null;var H=h!==null&&h.memoizedState!==null,re=Ua,fe=Nn;if(Ua=re||b,Nn=fe||H,wr(l,s),Nn=fe,Ua=re,Sr(s),g&8192)e:for(l=s.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(h===null||H||Ua||Nn||Ho(s)),h=null,l=s;;){if(l.tag===5||l.tag===26){if(h===null){H=h=l;try{if(N=H.stateNode,b)E=N.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ie){At(H,H.return,Ie)}}}else if(l.tag===6){if(h===null){H=l;try{H.stateNode.nodeValue=b?"":H.memoizedProps}catch(Ie){At(H,H.return,Ie)}}}else if(l.tag===18){if(h===null){H=l;try{var ce=H.stateNode;b?NA(ce,!0):NA(H.stateNode,!1)}catch(Ie){At(H,H.return,Ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,vp(s,h))));break;case 19:wr(l,s),Sr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 30:break;case 21:break;default:wr(l,s),Sr(s)}}function Sr(s){var l=s.flags;if(l&2){try{for(var h,g=s.return;g!==null;){if(CO(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,N=ob(s);yp(s,N,b);break;case 5:var E=h.stateNode;h.flags&32&&(Yl(E,""),h.flags&=-33);var D=ob(s);yp(s,D,E);break;case 3:case 4:var H=h.stateNode.containerInfo,re=ob(s);lb(s,re,H);break;default:throw Error(r(161))}}catch(fe){At(s,s.return,fe)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function MO(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;MO(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Fa(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)AO(s,l.alternate,l),l=l.sibling}function Ho(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:_s(4,l,l.return),Ho(l);break;case 1:ta(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&NO(l,l.return,h),Ho(l);break;case 27:Cd(l.stateNode);case 26:case 5:ta(l,l.return),Ho(l);break;case 22:l.memoizedState===null&&Ho(l);break;case 30:Ho(l);break;default:Ho(l)}s=s.sibling}}function qa(s,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,b=s,N=l,E=N.flags;switch(N.tag){case 0:case 11:case 15:qa(b,N,h),gd(4,N);break;case 1:if(qa(b,N,h),g=N,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(re){At(g,g.return,re)}if(g=N,b=g.updateQueue,b!==null){var D=g.stateNode;try{var H=b.shared.hiddenCallbacks;if(H!==null)for(b.shared.hiddenCallbacks=null,b=0;b<H.length;b++)f_(H[b],D)}catch(re){At(g,g.return,re)}}h&&E&64&&jO(N),yd(N,N.return);break;case 27:_O(N);case 26:case 5:qa(b,N,h),h&&g===null&&E&4&&kO(N),yd(N,N.return);break;case 12:qa(b,N,h);break;case 31:qa(b,N,h),h&&E&4&&PO(b,N);break;case 13:qa(b,N,h),h&&E&4&&zO(b,N);break;case 22:N.memoizedState===null&&qa(b,N,h),yd(N,N.return);break;case 30:break;default:qa(b,N,h)}l=l.sibling}}function ub(s,l){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&rd(h))}function db(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&rd(s))}function Ii(s,l,h,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)DO(s,l,h,g),l=l.sibling}function DO(s,l,h,g){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Ii(s,l,h,g),b&2048&&gd(9,l);break;case 1:Ii(s,l,h,g);break;case 3:Ii(s,l,h,g),b&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&rd(s)));break;case 12:if(b&2048){Ii(s,l,h,g),s=l.stateNode;try{var N=l.memoizedProps,E=N.id,D=N.onPostCommit;typeof D=="function"&&D(E,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(H){At(l,l.return,H)}}else Ii(s,l,h,g);break;case 31:Ii(s,l,h,g);break;case 13:Ii(s,l,h,g);break;case 23:break;case 22:N=l.stateNode,E=l.alternate,l.memoizedState!==null?N._visibility&2?Ii(s,l,h,g):vd(s,l):N._visibility&2?Ii(s,l,h,g):(N._visibility|=2,mc(s,l,h,g,(l.subtreeFlags&10256)!==0||!1)),b&2048&&ub(E,l);break;case 24:Ii(s,l,h,g),b&2048&&db(l.alternate,l);break;default:Ii(s,l,h,g)}}function mc(s,l,h,g,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var N=s,E=l,D=h,H=g,re=E.flags;switch(E.tag){case 0:case 11:case 15:mc(N,E,D,H,b),gd(8,E);break;case 23:break;case 22:var fe=E.stateNode;E.memoizedState!==null?fe._visibility&2?mc(N,E,D,H,b):vd(N,E):(fe._visibility|=2,mc(N,E,D,H,b)),b&&re&2048&&ub(E.alternate,E);break;case 24:mc(N,E,D,H,b),b&&re&2048&&db(E.alternate,E);break;default:mc(N,E,D,H,b)}l=l.sibling}}function vd(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=s,g=l,b=g.flags;switch(g.tag){case 22:vd(h,g),b&2048&&ub(g.alternate,g);break;case 24:vd(h,g),b&2048&&db(g.alternate,g);break;default:vd(h,g)}l=l.sibling}}var bd=8192;function gc(s,l,h){if(s.subtreeFlags&bd)for(s=s.child;s!==null;)IO(s,l,h),s=s.sibling}function IO(s,l,h){switch(s.tag){case 26:gc(s,l,h),s.flags&bd&&s.memoizedState!==null&&m9(h,Di,s.memoizedState,s.memoizedProps);break;case 5:gc(s,l,h);break;case 3:case 4:var g=Di;Di=Pp(s.stateNode.containerInfo),gc(s,l,h),Di=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=bd,bd=16777216,gc(s,l,h),bd=g):gc(s,l,h));break;default:gc(s,l,h)}}function LO(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function xd(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];Dn=g,UO(g,s)}LO(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)$O(s),s=s.sibling}function $O(s){switch(s.tag){case 0:case 11:case 15:xd(s),s.flags&2048&&_s(9,s,s.return);break;case 3:xd(s);break;case 12:xd(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,bp(s)):xd(s);break;default:xd(s)}}function bp(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];Dn=g,UO(g,s)}LO(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:_s(8,l,l.return),bp(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,bp(l));break;default:bp(l)}s=s.sibling}}function UO(s,l){for(;Dn!==null;){var h=Dn;switch(h.tag){case 0:case 11:case 15:_s(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:rd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Dn=g;else e:for(h=s;Dn!==null;){g=Dn;var b=g.sibling,N=g.return;if(EO(g),g===h){Dn=null;break e}if(b!==null){b.return=N,Dn=b;break e}Dn=N}}}var EF={getCacheForType:function(s){var l=qn(wn),h=l.data.get(s);return h===void 0&&(h=s(),l.data.set(s,h)),h},cacheSignal:function(){return qn(wn).controller.signal}},TF=typeof WeakMap=="function"?WeakMap:Map,St=0,Mt=null,ut=null,ht=0,Ot=0,Fr=null,Os=!1,yc=!1,fb=!1,Ka=0,un=0,As=0,Go=0,hb=0,qr=0,vc=0,wd=null,jr=null,pb=!1,xp=0,BO=0,wp=1/0,Sp=null,Es=null,On=0,Ts=null,bc=null,Ha=0,mb=0,gb=null,FO=null,Sd=0,yb=null;function Kr(){return(St&2)!==0&&ht!==0?ht&-ht:K.T!==null?jb():G()}function qO(){if(qr===0)if((ht&536870912)===0||mt){var s=ko;ko<<=1,(ko&3932160)===0&&(ko=262144),qr=s}else qr=536870912;return s=Ur.current,s!==null&&(s.flags|=32),qr}function Nr(s,l,h){(s===Mt&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)&&(xc(s,0),Ps(s,ht,qr,!1)),Oo(s,h),((St&2)===0||s!==Mt)&&(s===Mt&&((St&2)===0&&(Go|=h),un===4&&Ps(s,ht,qr,!1)),na(s))}function KO(s,l,h){if((St&6)!==0)throw Error(r(327));var g=!h&&(l&127)===0&&(l&s.expiredLanes)===0||ms(s,l),b=g?RF(s,l):bb(s,l,!0),N=g;do{if(b===0){yc&&!g&&Ps(s,l,0,!1);break}else{if(h=s.current.alternate,N&&!PF(h)){b=bb(s,l,!1),N=!1;continue}if(b===2){if(N=l,s.errorRecoveryDisabledLanes&N)var E=0;else E=s.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){l=E;e:{var D=s;b=wd;var H=D.current.memoizedState.isDehydrated;if(H&&(xc(D,E).flags|=256),E=bb(D,E,!1),E!==2){if(fb&&!H){D.errorRecoveryDisabledLanes|=N,Go|=N,b=4;break e}N=jr,jr=b,N!==null&&(jr===null?jr=N:jr.push.apply(jr,N))}b=E}if(N=!1,b!==2)continue}}if(b===1){xc(s,0),Ps(s,l,0,!0);break}e:{switch(g=s,N=b,N){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ps(g,l,qr,!Os);break e;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=xp+300-Re(),10<b)){if(Ps(g,l,qr,!Os),Co(g,0,!0)!==0)break e;Ha=l,g.timeoutHandle=wA(HO.bind(null,g,h,jr,Sp,pb,l,qr,Go,vc,Os,N,"Throttled",-0,0),b);break e}HO(g,h,jr,Sp,pb,l,qr,Go,vc,Os,N,null,-0,0)}}break}while(!0);na(s)}function HO(s,l,h,g,b,N,E,D,H,re,fe,ge,oe,ce){if(s.timeoutHandle=-1,ge=l.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},IO(l,N,ge);var Ie=(N&62914560)===N?xp-Re():(N&4194048)===N?BO-Re():0;if(Ie=g9(ge,Ie),Ie!==null){Ha=N,s.cancelPendingCommit=Ie(JO.bind(null,s,l,N,h,g,b,E,D,H,fe,ge,null,oe,ce)),Ps(s,N,E,!re);return}}JO(s,l,N,h,g,b,E,D,H)}function PF(s){for(var l=s;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var b=h[g],N=b.getSnapshot;b=b.value;try{if(!Lr(N(),b))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ps(s,l,h,g){l&=~hb,l&=~Go,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var b=l;0<b;){var N=31-ue(b),E=1<<N;g[N]=-1,b&=~E}h!==0&&Ch(s,h,l)}function jp(){return(St&6)===0?(jd(0),!1):!0}function vb(){if(ut!==null){if(Ot===0)var s=ut.return;else s=ut,Ra=Io=null,R0(s),uc=null,ad=0,s=ut;for(;s!==null;)SO(s.alternate,s),s=s.return;ut=null}}function xc(s,l){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,XF(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),Ha=0,vb(),Mt=s,ut=h=Pa(s.current,null),ht=l,Ot=0,Fr=null,Os=!1,yc=ms(s,l),fb=!1,vc=qr=hb=Go=As=un=0,jr=wd=null,pb=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var b=31-ue(g),N=1<<b;l|=s[b],g&=~N}return Ka=l,Kh(),h}function GO(s,l){tt=null,K.H=hd,l===cc||l===Xh?(l=l_(),Ot=3):l===S0?(l=l_(),Ot=4):Ot=l===W0?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Fr=l,ut===null&&(un=1,fp(s,ri(l,s.current)))}function VO(){var s=Ur.current;return s===null?!0:(ht&4194048)===ht?oi===null:(ht&62914560)===ht||(ht&536870912)!==0?s===oi:!1}function ZO(){var s=K.H;return K.H=hd,s===null?hd:s}function YO(){var s=K.A;return K.A=EF,s}function Np(){un=4,Os||(ht&4194048)!==ht&&Ur.current!==null||(yc=!0),(As&134217727)===0&&(Go&134217727)===0||Mt===null||Ps(Mt,ht,qr,!1)}function bb(s,l,h){var g=St;St|=2;var b=ZO(),N=YO();(Mt!==s||ht!==l)&&(Sp=null,xc(s,l)),l=!1;var E=un;e:do try{if(Ot!==0&&ut!==null){var D=ut,H=Fr;switch(Ot){case 8:vb(),E=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(l=!0);var re=Ot;if(Ot=0,Fr=null,wc(s,D,H,re),h&&yc){E=0;break e}break;default:re=Ot,Ot=0,Fr=null,wc(s,D,H,re)}}zF(),E=un;break}catch(fe){GO(s,fe)}while(!0);return l&&s.shellSuspendCounter++,Ra=Io=null,St=g,K.H=b,K.A=N,ut===null&&(Mt=null,ht=0,Kh()),E}function zF(){for(;ut!==null;)WO(ut)}function RF(s,l){var h=St;St|=2;var g=ZO(),b=YO();Mt!==s||ht!==l?(Sp=null,wp=Re()+500,xc(s,l)):yc=ms(s,l);e:do try{if(Ot!==0&&ut!==null){l=ut;var N=Fr;t:switch(Ot){case 1:Ot=0,Fr=null,wc(s,l,N,1);break;case 2:case 9:if(s_(N)){Ot=0,Fr=null,QO(l);break}l=function(){Ot!==2&&Ot!==9||Mt!==s||(Ot=7),na(s)},N.then(l,l);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:s_(N)?(Ot=0,Fr=null,QO(l)):(Ot=0,Fr=null,wc(s,l,N,7));break;case 5:var E=null;switch(ut.tag){case 26:E=ut.memoizedState;case 5:case 27:var D=ut;if(E?DA(E):D.stateNode.complete){Ot=0,Fr=null;var H=D.sibling;if(H!==null)ut=H;else{var re=D.return;re!==null?(ut=re,kp(re)):ut=null}break t}}Ot=0,Fr=null,wc(s,l,N,5);break;case 6:Ot=0,Fr=null,wc(s,l,N,6);break;case 8:vb(),un=6;break e;default:throw Error(r(462))}}MF();break}catch(fe){GO(s,fe)}while(!0);return Ra=Io=null,K.H=g,K.A=b,St=h,ut!==null?0:(Mt=null,ht=0,Kh(),un)}function MF(){for(;ut!==null&&!be();)WO(ut)}function WO(s){var l=xO(s.alternate,s,Ka);s.memoizedProps=s.pendingProps,l===null?kp(s):ut=l}function QO(s){var l=s,h=l.alternate;switch(l.tag){case 15:case 0:l=pO(h,l,l.pendingProps,l.type,void 0,ht);break;case 11:l=pO(h,l,l.pendingProps,l.type.render,l.ref,ht);break;case 5:R0(l);default:SO(h,l),l=ut=YC(l,Ka),l=xO(h,l,Ka)}s.memoizedProps=s.pendingProps,l===null?kp(s):ut=l}function wc(s,l,h,g){Ra=Io=null,R0(l),uc=null,ad=0;var b=l.return;try{if(jF(s,b,l,h,ht)){un=1,fp(s,ri(h,s.current)),ut=null;return}}catch(N){if(b!==null)throw ut=b,N;un=1,fp(s,ri(h,s.current)),ut=null;return}l.flags&32768?(mt||g===1?s=!0:yc||(ht&536870912)!==0?s=!1:(Os=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ur.current,g!==null&&g.tag===13&&(g.flags|=16384))),XO(l,s)):kp(l)}function kp(s){var l=s;do{if((l.flags&32768)!==0){XO(l,Os);return}s=l.return;var h=CF(l.alternate,l,Ka);if(h!==null){ut=h;return}if(l=l.sibling,l!==null){ut=l;return}ut=l=s}while(l!==null);un===0&&(un=5)}function XO(s,l){do{var h=_F(s.alternate,s);if(h!==null){h.flags&=32767,ut=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(s=s.sibling,s!==null)){ut=s;return}ut=s=h}while(s!==null);un=6,ut=null}function JO(s,l,h,g,b,N,E,D,H){s.cancelPendingCommit=null;do Cp();while(On!==0);if((St&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(N=l.lanes|l.childLanes,N|=o0,kh(s,h,N,E,D,H),s===Mt&&(ut=Mt=null,ht=0),bc=l,Ts=s,Ha=h,mb=N,gb=b,FO=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,$F(Ae,function(){return iA(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=K.T,K.T=null,b=X.p,X.p=2,E=St,St|=4;try{OF(s,l,h)}finally{St=E,X.p=b,K.T=g}}On=1,eA(),tA(),nA()}}function eA(){if(On===1){On=0;var s=Ts,l=bc,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=K.T,K.T=null;var g=X.p;X.p=2;var b=St;St|=4;try{RO(l,s);var N=Tb,E=UC(s.containerInfo),D=N.focusedElem,H=N.selectionRange;if(E!==D&&D&&D.ownerDocument&&$C(D.ownerDocument.documentElement,D)){if(H!==null&&n0(D)){var re=H.start,fe=H.end;if(fe===void 0&&(fe=re),"selectionStart"in D)D.selectionStart=re,D.selectionEnd=Math.min(fe,D.value.length);else{var ge=D.ownerDocument||document,oe=ge&&ge.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ie=D.textContent.length,Ze=Math.min(H.start,Ie),Rt=H.end===void 0?Ze:Math.min(H.end,Ie);!ce.extend&&Ze>Rt&&(E=Rt,Rt=Ze,Ze=E);var W=LC(D,Ze),Z=LC(D,Rt);if(W&&Z&&(ce.rangeCount!==1||ce.anchorNode!==W.node||ce.anchorOffset!==W.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var ne=ge.createRange();ne.setStart(W.node,W.offset),ce.removeAllRanges(),Ze>Rt?(ce.addRange(ne),ce.extend(Z.node,Z.offset)):(ne.setEnd(Z.node,Z.offset),ce.addRange(ne))}}}}for(ge=[],ce=D;ce=ce.parentNode;)ce.nodeType===1&&ge.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var pe=ge[D];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Lp=!!Eb,Tb=Eb=null}finally{St=b,X.p=g,K.T=h}}s.current=l,On=2}}function tA(){if(On===2){On=0;var s=Ts,l=bc,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=K.T,K.T=null;var g=X.p;X.p=2;var b=St;St|=4;try{AO(s,l.alternate,l)}finally{St=b,X.p=g,K.T=h}}On=3}}function nA(){if(On===4||On===3){On=0,ze();var s=Ts,l=bc,h=Ha,g=FO;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?On=5:(On=0,bc=Ts=null,rA(s,s.pendingLanes));var b=s.pendingLanes;if(b===0&&(Es=null),Vl(h),l=l.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Qe,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=K.T,b=X.p,X.p=2,K.T=null;try{for(var N=s.onRecoverableError,E=0;E<g.length;E++){var D=g[E];N(D.value,{componentStack:D.stack})}}finally{K.T=l,X.p=b}}(Ha&3)!==0&&Cp(),na(s),b=s.pendingLanes,(h&261930)!==0&&(b&42)!==0?s===yb?Sd++:(Sd=0,yb=s):Sd=0,jd(0)}}function rA(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,rd(l)))}function Cp(){return eA(),tA(),nA(),iA()}function iA(){if(On!==5)return!1;var s=Ts,l=mb;mb=0;var h=Vl(Ha),g=K.T,b=X.p;try{X.p=32>h?32:h,K.T=null,h=gb,gb=null;var N=Ts,E=Ha;if(On=0,bc=Ts=null,Ha=0,(St&6)!==0)throw Error(r(331));var D=St;if(St|=4,$O(N.current),DO(N,N.current,E,h),St=D,jd(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Qe,N)}catch{}return!0}finally{X.p=b,K.T=g,rA(s,l)}}function aA(s,l,h){l=ri(h,l),l=Y0(s.stateNode,l,2),s=Ns(s,l,2),s!==null&&(Oo(s,2),na(s))}function At(s,l,h){if(s.tag===3)aA(s,s,h);else for(;l!==null;){if(l.tag===3){aA(l,s,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Es===null||!Es.has(g))){s=ri(h,s),h=sO(2),g=Ns(l,h,2),g!==null&&(oO(h,g,l,s),Oo(g,2),na(g));break}}l=l.return}}function xb(s,l,h){var g=s.pingCache;if(g===null){g=s.pingCache=new TF;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(h)||(fb=!0,b.add(h),s=DF.bind(null,s,l,h),l.then(s,s))}function DF(s,l,h){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Mt===s&&(ht&h)===h&&(un===4||un===3&&(ht&62914560)===ht&&300>Re()-xp?(St&2)===0&&xc(s,0):hb|=h,vc===ht&&(vc=0)),na(s)}function sA(s,l){l===0&&(l=_o()),s=Ro(s,l),s!==null&&(Oo(s,l),na(s))}function IF(s){var l=s.memoizedState,h=0;l!==null&&(h=l.retryLane),sA(s,h)}function LF(s,l){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,b=s.memoizedState;b!==null&&(h=b.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),sA(s,h)}function $F(s,l){return ve(s,l)}var _p=null,Sc=null,wb=!1,Op=!1,Sb=!1,zs=0;function na(s){s!==Sc&&s.next===null&&(Sc===null?_p=Sc=s:Sc=Sc.next=s),Op=!0,wb||(wb=!0,BF())}function jd(s,l){if(!Sb&&Op){Sb=!0;do for(var h=!1,g=_p;g!==null;){if(s!==0){var b=g.pendingLanes;if(b===0)var N=0;else{var E=g.suspendedLanes,D=g.pingedLanes;N=(1<<31-ue(42|s)+1)-1,N&=b&~(E&~D),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,uA(g,N))}else N=ht,N=Co(g,g===Mt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||ms(g,N)||(h=!0,uA(g,N));g=g.next}while(h);Sb=!1}}function UF(){oA()}function oA(){Op=wb=!1;var s=0;zs!==0&&QF()&&(s=zs);for(var l=Re(),h=null,g=_p;g!==null;){var b=g.next,N=lA(g,l);N===0?(g.next=null,h===null?_p=b:h.next=b,b===null&&(Sc=h)):(h=g,(s!==0||(N&3)!==0)&&(Op=!0)),g=b}On!==0&&On!==5||jd(s),zs!==0&&(zs=0)}function lA(s,l){for(var h=s.suspendedLanes,g=s.pingedLanes,b=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var E=31-ue(N),D=1<<E,H=b[E];H===-1?((D&h)===0||(D&g)!==0)&&(b[E]=$v(D,l)):H<=l&&(s.expiredLanes|=D),N&=~D}if(l=Mt,h=ht,h=Co(s,s===l?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===l&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ve(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||ms(s,h)){if(l=h&-h,l===s.callbackPriority)return l;switch(g!==null&&Ve(g),Vl(h)){case 2:case 8:h=xe;break;case 32:h=Ae;break;case 268435456:h=Je;break;default:h=Ae}return g=cA.bind(null,s),h=ve(h,g),s.callbackPriority=l,s.callbackNode=h,l}return g!==null&&g!==null&&Ve(g),s.callbackPriority=2,s.callbackNode=null,2}function cA(s,l){if(On!==0&&On!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Cp()&&s.callbackNode!==h)return null;var g=ht;return g=Co(s,s===Mt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(KO(s,g,l),lA(s,Re()),s.callbackNode!=null&&s.callbackNode===h?cA.bind(null,s):null)}function uA(s,l){if(Cp())return null;KO(s,l,!0)}function BF(){JF(function(){(St&6)!==0?ve(te,UF):oA()})}function jb(){if(zs===0){var s=oc;s===0&&(s=ps,ps<<=1,(ps&261888)===0&&(ps=256)),zs=s}return zs}function dA(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Dh(""+s)}function fA(s,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,s.id&&h.setAttribute("form",s.id),l.parentNode.insertBefore(h,l),s=new FormData(s),h.parentNode.removeChild(h),s}function FF(s,l,h,g,b){if(l==="submit"&&h&&h.stateNode===b){var N=dA((b[_t]||null).action),E=g.submitter;E&&(l=(l=E[_t]||null)?dA(l.formAction):E.getAttribute("formAction"),l!==null&&(N=l,E=null));var D=new Uh("action","action",null,g,b);s.push({event:D,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(zs!==0){var H=E?fA(b,E):new FormData(b);q0(h,{pending:!0,data:H,method:b.method,action:N},null,H)}}else typeof N=="function"&&(D.preventDefault(),H=E?fA(b,E):new FormData(b),q0(h,{pending:!0,data:H,method:b.method,action:N},N,H))},currentTarget:b}]})}}for(var Nb=0;Nb<s0.length;Nb++){var kb=s0[Nb],qF=kb.toLowerCase(),KF=kb[0].toUpperCase()+kb.slice(1);Mi(qF,"on"+KF)}Mi(qC,"onAnimationEnd"),Mi(KC,"onAnimationIteration"),Mi(HC,"onAnimationStart"),Mi("dblclick","onDoubleClick"),Mi("focusin","onFocus"),Mi("focusout","onBlur"),Mi(sF,"onTransitionRun"),Mi(oF,"onTransitionStart"),Mi(lF,"onTransitionCancel"),Mi(GC,"onTransitionEnd"),vt("onMouseEnter",["mouseout","mouseover"]),vt("onMouseLeave",["mouseout","mouseover"]),vt("onPointerEnter",["pointerout","pointerover"]),vt("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nd="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(" "),HF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nd));function hA(s,l){l=(l&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],b=g.event;g=g.listeners;e:{var N=void 0;if(l)for(var E=g.length-1;0<=E;E--){var D=g[E],H=D.instance,re=D.currentTarget;if(D=D.listener,H!==N&&b.isPropagationStopped())break e;N=D,b.currentTarget=re;try{N(b)}catch(fe){qh(fe)}b.currentTarget=null,N=H}else for(E=0;E<g.length;E++){if(D=g[E],H=D.instance,re=D.currentTarget,D=D.listener,H!==N&&b.isPropagationStopped())break e;N=D,b.currentTarget=re;try{N(b)}catch(fe){qh(fe)}b.currentTarget=null,N=H}}}}function dt(s,l){var h=l[Ti];h===void 0&&(h=l[Ti]=new Set);var g=s+"__bubble";h.has(g)||(pA(l,s,2,!1),h.add(g))}function Cb(s,l,h){var g=0;l&&(g|=4),pA(h,s,g,l)}var Ap="_reactListening"+Math.random().toString(36).slice(2);function _b(s){if(!s[Ap]){s[Ap]=!0,Eh.forEach(function(h){h!=="selectionchange"&&(HF.has(h)||Cb(h,!1,s),Cb(h,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Ap]||(l[Ap]=!0,Cb("selectionchange",!1,l))}}function pA(s,l,h,g){switch(qA(l)){case 2:var b=b9;break;case 8:b=x9;break;default:b=Fb}h=b.bind(null,l,h,s),b=void 0,!Vv||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?s.addEventListener(l,h,{capture:!0,passive:b}):s.addEventListener(l,h,!0):b!==void 0?s.addEventListener(l,h,{passive:b}):s.addEventListener(l,h,!1)}function Ob(s,l,h,g,b){var N=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var E=g.tag;if(E===3||E===4){var D=g.stateNode.containerInfo;if(D===b)break;if(E===4)for(E=g.return;E!==null;){var H=E.tag;if((H===3||H===4)&&E.stateNode.containerInfo===b)return;E=E.return}for(;D!==null;){if(E=Pi(D),E===null)return;if(H=E.tag,H===5||H===6||H===26||H===27){g=N=E;continue e}D=D.parentNode}}g=g.return}bC(function(){var re=N,fe=Hv(h),ge=[];e:{var oe=VC.get(s);if(oe!==void 0){var ce=Uh,Ie=s;switch(s){case"keypress":if(Lh(h)===0)break e;case"keydown":case"keyup":ce=L8;break;case"focusin":Ie="focus",ce=Qv;break;case"focusout":Ie="blur",ce=Qv;break;case"beforeblur":case"afterblur":ce=Qv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=SC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=C8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=B8;break;case qC:case KC:case HC:ce=A8;break;case GC:ce=q8;break;case"scroll":case"scrollend":ce=N8;break;case"wheel":ce=H8;break;case"copy":case"cut":case"paste":ce=T8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=NC;break;case"toggle":case"beforetoggle":ce=V8}var Ze=(l&4)!==0,Rt=!Ze&&(s==="scroll"||s==="scrollend"),W=Ze?oe!==null?oe+"Capture":null:oe;Ze=[];for(var Z=re,ne;Z!==null;){var pe=Z;if(ne=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ne===null||W===null||(pe=Gu(Z,W),pe!=null&&Ze.push(kd(Z,pe,ne))),Rt)break;Z=Z.return}0<Ze.length&&(oe=new ce(oe,Ie,null,h,fe),ge.push({event:oe,listeners:Ze}))}}if((l&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ce=s==="mouseout"||s==="pointerout",oe&&h!==Kv&&(Ie=h.relatedTarget||h.fromElement)&&(Pi(Ie)||Ie[Dr]))break e;if((ce||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ie=h.relatedTarget||h.toElement,ce=re,Ie=Ie?Pi(Ie):null,Ie!==null&&(Rt=a(Ie),Ze=Ie.tag,Ie!==Rt||Ze!==5&&Ze!==27&&Ze!==6)&&(Ie=null)):(ce=null,Ie=re),ce!==Ie)){if(Ze=SC,pe="onMouseLeave",W="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(Ze=NC,pe="onPointerLeave",W="onPointerEnter",Z="pointer"),Rt=ce==null?oe:Ao(ce),ne=Ie==null?oe:Ao(Ie),oe=new Ze(pe,Z+"leave",ce,h,fe),oe.target=Rt,oe.relatedTarget=ne,pe=null,Pi(fe)===re&&(Ze=new Ze(W,Z+"enter",Ie,h,fe),Ze.target=ne,Ze.relatedTarget=Rt,pe=Ze),Rt=pe,ce&&Ie)t:{for(Ze=GF,W=ce,Z=Ie,ne=0,pe=W;pe;pe=Ze(pe))ne++;pe=0;for(var He=Z;He;He=Ze(He))pe++;for(;0<ne-pe;)W=Ze(W),ne--;for(;0<pe-ne;)Z=Ze(Z),pe--;for(;ne--;){if(W===Z||Z!==null&&W===Z.alternate){Ze=W;break t}W=Ze(W),Z=Ze(Z)}Ze=null}else Ze=null;ce!==null&&mA(ge,oe,ce,Ze,!1),Ie!==null&&Rt!==null&&mA(ge,Rt,Ie,Ze,!0)}}e:{if(oe=re?Ao(re):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var bt=PC;else if(EC(oe))if(zC)bt=rF;else{bt=tF;var Be=eF}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?re&&qv(re.elementType)&&(bt=PC):bt=nF;if(bt&&(bt=bt(s,re))){TC(ge,bt,h,fe);break e}Be&&Be(s,oe,re),s==="focusout"&&re&&oe.type==="number"&&re.memoizedProps.value!=null&&Fv(oe,"number",oe.value)}switch(Be=re?Ao(re):window,s){case"focusin":(EC(Be)||Be.contentEditable==="true")&&(Jl=Be,r0=re,ed=null);break;case"focusout":ed=r0=Jl=null;break;case"mousedown":i0=!0;break;case"contextmenu":case"mouseup":case"dragend":i0=!1,BC(ge,h,fe);break;case"selectionchange":if(aF)break;case"keydown":case"keyup":BC(ge,h,fe)}var st;if(Jv)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Xl?OC(s,h)&&(pt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(pt="onCompositionStart");pt&&(kC&&h.locale!=="ko"&&(Xl||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Xl&&(st=xC()):(ys=fe,Zv="value"in ys?ys.value:ys.textContent,Xl=!0)),Be=Ep(re,pt),0<Be.length&&(pt=new jC(pt,s,null,h,fe),ge.push({event:pt,listeners:Be}),st?pt.data=st:(st=AC(h),st!==null&&(pt.data=st)))),(st=Y8?W8(s,h):Q8(s,h))&&(pt=Ep(re,"onBeforeInput"),0<pt.length&&(Be=new jC("onBeforeInput","beforeinput",null,h,fe),ge.push({event:Be,listeners:pt}),Be.data=st)),FF(ge,s,re,h,fe)}hA(ge,l)})}function kd(s,l,h){return{instance:s,listener:l,currentTarget:h}}function Ep(s,l){for(var h=l+"Capture",g=[];s!==null;){var b=s,N=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||N===null||(b=Gu(s,h),b!=null&&g.unshift(kd(s,b,N)),b=Gu(s,l),b!=null&&g.push(kd(s,b,N))),s.tag===3)return g;s=s.return}return[]}function GF(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function mA(s,l,h,g,b){for(var N=l._reactName,E=[];h!==null&&h!==g;){var D=h,H=D.alternate,re=D.stateNode;if(D=D.tag,H!==null&&H===g)break;D!==5&&D!==26&&D!==27||re===null||(H=re,b?(re=Gu(h,N),re!=null&&E.unshift(kd(h,re,H))):b||(re=Gu(h,N),re!=null&&E.push(kd(h,re,H)))),h=h.return}E.length!==0&&s.push({event:l,listeners:E})}var VF=/\r\n?/g,ZF=/\u0000|\uFFFD/g;function gA(s){return(typeof s=="string"?s:""+s).replace(VF,`
9
- `).replace(ZF,"")}function yA(s,l){return l=gA(l),gA(s)===l}function zt(s,l,h,g,b,N){switch(h){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||Yl(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&Yl(s,""+g);break;case"className":Rh(s,"class",g);break;case"tabIndex":Rh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Rh(s,h,g);break;case"style":yC(s,g,N);break;case"data":if(l!=="object"){Rh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Dh(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"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 N=="function"&&(h==="formAction"?(l!=="input"&&zt(s,l,"name",b.name,b,null),zt(s,l,"formEncType",b.formEncType,b,null),zt(s,l,"formMethod",b.formMethod,b,null),zt(s,l,"formTarget",b.formTarget,b,null)):(zt(s,l,"encType",b.encType,b,null),zt(s,l,"method",b.method,b,null),zt(s,l,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Dh(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Ea);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Dh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":dt("beforetoggle",s),dt("toggle",s),zh(s,"popover",g);break;case"xlinkActuate":Aa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Aa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Aa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Aa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Aa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Aa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Aa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Aa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Aa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":zh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=S8.get(h)||h,zh(s,h,g))}}function Ab(s,l,h,g,b,N){switch(h){case"style":yC(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?Yl(s,g):(typeof g=="number"||typeof g=="bigint")&&Yl(s,""+g);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Th.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),l=h.slice(2,b?h.length-7:void 0),N=s[_t]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(l,N,b),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(l,g,b);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):zh(s,h,g)}}}function Hn(s,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",s),dt("load",s);var g=!1,b=!1,N;for(N in h)if(h.hasOwnProperty(N)){var E=h[N];if(E!=null)switch(N){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:zt(s,l,N,E,h,null)}}b&&zt(s,l,"srcSet",h.srcSet,h,null),g&&zt(s,l,"src",h.src,h,null);return;case"input":dt("invalid",s);var D=N=E=b=null,H=null,re=null;for(g in h)if(h.hasOwnProperty(g)){var fe=h[g];if(fe!=null)switch(g){case"name":b=fe;break;case"type":E=fe;break;case"checked":H=fe;break;case"defaultChecked":re=fe;break;case"value":N=fe;break;case"defaultValue":D=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:zt(s,l,g,fe,h,null)}}hC(s,N,D,H,re,E,b,!1);return;case"select":dt("invalid",s),g=E=N=null;for(b in h)if(h.hasOwnProperty(b)&&(D=h[b],D!=null))switch(b){case"value":N=D;break;case"defaultValue":E=D;break;case"multiple":g=D;default:zt(s,l,b,D,h,null)}l=N,h=E,s.multiple=!!g,l!=null?Zl(s,!!g,l,!1):h!=null&&Zl(s,!!g,h,!0);return;case"textarea":dt("invalid",s),N=b=g=null;for(E in h)if(h.hasOwnProperty(E)&&(D=h[E],D!=null))switch(E){case"value":g=D;break;case"defaultValue":b=D;break;case"children":N=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:zt(s,l,E,D,h,null)}mC(s,g,b,N);return;case"option":for(H in h)h.hasOwnProperty(H)&&(g=h[H],g!=null)&&(H==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":zt(s,l,H,g,h,null));return;case"dialog":dt("beforetoggle",s),dt("toggle",s),dt("cancel",s),dt("close",s);break;case"iframe":case"object":dt("load",s);break;case"video":case"audio":for(g=0;g<Nd.length;g++)dt(Nd[g],s);break;case"image":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"embed":case"source":case"link":dt("error",s),dt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in h)if(h.hasOwnProperty(re)&&(g=h[re],g!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:zt(s,l,re,g,h,null)}return;default:if(qv(l)){for(fe in h)h.hasOwnProperty(fe)&&(g=h[fe],g!==void 0&&Ab(s,l,fe,g,h,void 0));return}}for(D in h)h.hasOwnProperty(D)&&(g=h[D],g!=null&&zt(s,l,D,g,h,null))}function YF(s,l,h,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,N=null,E=null,D=null,H=null,re=null,fe=null;for(ce in h){var ge=h[ce];if(h.hasOwnProperty(ce)&&ge!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":H=ge;default:g.hasOwnProperty(ce)||zt(s,l,ce,null,g,ge)}}for(var oe in g){var ce=g[oe];if(ge=h[oe],g.hasOwnProperty(oe)&&(ce!=null||ge!=null))switch(oe){case"type":N=ce;break;case"name":b=ce;break;case"checked":re=ce;break;case"defaultChecked":fe=ce;break;case"value":E=ce;break;case"defaultValue":D=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ge&&zt(s,l,oe,ce,g,ge)}}Bv(s,E,D,H,re,fe,N,b);return;case"select":ce=E=D=oe=null;for(N in h)if(H=h[N],h.hasOwnProperty(N)&&H!=null)switch(N){case"value":break;case"multiple":ce=H;default:g.hasOwnProperty(N)||zt(s,l,N,null,g,H)}for(b in g)if(N=g[b],H=h[b],g.hasOwnProperty(b)&&(N!=null||H!=null))switch(b){case"value":oe=N;break;case"defaultValue":D=N;break;case"multiple":E=N;default:N!==H&&zt(s,l,b,N,g,H)}l=D,h=E,g=ce,oe!=null?Zl(s,!!h,oe,!1):!!g!=!!h&&(l!=null?Zl(s,!!h,l,!0):Zl(s,!!h,h?[]:"",!1));return;case"textarea":ce=oe=null;for(D in h)if(b=h[D],h.hasOwnProperty(D)&&b!=null&&!g.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:zt(s,l,D,null,g,b)}for(E in g)if(b=g[E],N=h[E],g.hasOwnProperty(E)&&(b!=null||N!=null))switch(E){case"value":oe=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==N&&zt(s,l,E,b,g,N)}pC(s,oe,ce);return;case"option":for(var Ie in h)oe=h[Ie],h.hasOwnProperty(Ie)&&oe!=null&&!g.hasOwnProperty(Ie)&&(Ie==="selected"?s.selected=!1:zt(s,l,Ie,null,g,oe));for(H in g)oe=g[H],ce=h[H],g.hasOwnProperty(H)&&oe!==ce&&(oe!=null||ce!=null)&&(H==="selected"?s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":zt(s,l,H,oe,g,ce));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 Ze in h)oe=h[Ze],h.hasOwnProperty(Ze)&&oe!=null&&!g.hasOwnProperty(Ze)&&zt(s,l,Ze,null,g,oe);for(re in g)if(oe=g[re],ce=h[re],g.hasOwnProperty(re)&&oe!==ce&&(oe!=null||ce!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:zt(s,l,re,oe,g,ce)}return;default:if(qv(l)){for(var Rt in h)oe=h[Rt],h.hasOwnProperty(Rt)&&oe!==void 0&&!g.hasOwnProperty(Rt)&&Ab(s,l,Rt,void 0,g,oe);for(fe in g)oe=g[fe],ce=h[fe],!g.hasOwnProperty(fe)||oe===ce||oe===void 0&&ce===void 0||Ab(s,l,fe,oe,g,ce);return}}for(var W in h)oe=h[W],h.hasOwnProperty(W)&&oe!=null&&!g.hasOwnProperty(W)&&zt(s,l,W,null,g,oe);for(ge in g)oe=g[ge],ce=h[ge],!g.hasOwnProperty(ge)||oe===ce||oe==null&&ce==null||zt(s,l,ge,oe,g,ce)}function vA(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function WF(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var b=h[g],N=b.transferSize,E=b.initiatorType,D=b.duration;if(N&&D&&vA(E)){for(E=0,D=b.responseEnd,g+=1;g<h.length;g++){var H=h[g],re=H.startTime;if(re>D)break;var fe=H.transferSize,ge=H.initiatorType;fe&&vA(ge)&&(H=H.responseEnd,E+=fe*(H<D?1:(D-re)/(H-re)))}if(--g,l+=8*(N+E)/(b.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Eb=null,Tb=null;function Tp(s){return s.nodeType===9?s:s.ownerDocument}function bA(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xA(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Pb(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var zb=null;function QF(){var s=window.event;return s&&s.type==="popstate"?s===zb?!1:(zb=s,!0):(zb=null,!1)}var wA=typeof setTimeout=="function"?setTimeout:void 0,XF=typeof clearTimeout=="function"?clearTimeout:void 0,SA=typeof Promise=="function"?Promise:void 0,JF=typeof queueMicrotask=="function"?queueMicrotask:typeof SA<"u"?function(s){return SA.resolve(null).then(s).catch(e9)}:wA;function e9(s){setTimeout(function(){throw s})}function Rs(s){return s==="head"}function jA(s,l){var h=l,g=0;do{var b=h.nextSibling;if(s.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(b),Cc(l);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Cd(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Cd(h);for(var N=h.firstChild;N;){var E=N.nextSibling,D=N.nodeName;N[Jr]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=E}}else h==="body"&&Cd(s.ownerDocument.body);h=b}while(h);Cc(l)}function NA(s,l){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Rb(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Rb(h),_a(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function t9(s,l,h,g){for(;s.nodeType===1;){var b=h;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Jr])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==b.rel||s.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||s.getAttribute("title")!==(b.title==null?null:b.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(b.src==null?null:b.src)||s.getAttribute("type")!==(b.type==null?null:b.type)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var N=b.name==null?null:""+b.name;if(b.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=li(s.nextSibling),s===null)break}return null}function n9(s,l,h){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=li(s.nextSibling),s===null))return null;return s}function kA(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=li(s.nextSibling),s===null))return null;return s}function Mb(s){return s.data==="$?"||s.data==="$~"}function Db(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function r9(s,l){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||h.readyState!=="loading")l();else{var g=function(){l(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function li(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Ib=null;function CA(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(l===0)return li(s.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}s=s.nextSibling}return null}function _A(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return s;l--}else h!=="/$"&&h!=="/&"||l++}s=s.previousSibling}return null}function OA(s,l,h){switch(l=Tp(h),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Cd(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);_a(s)}var ci=new Map,AA=new Set;function Pp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ga=X.d;X.d={f:i9,r:a9,D:s9,C:o9,L:l9,m:c9,X:d9,S:u9,M:f9};function i9(){var s=Ga.f(),l=jp();return s||l}function a9(s){var l=Oa(s);l!==null&&l.tag===5&&l.type==="form"?G_(l):Ga.r(s)}var jc=typeof document>"u"?null:document;function EA(s,l,h){var g=jc;if(g&&typeof l=="string"&&l){var b=ti(l);b='link[rel="'+s+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),AA.has(b)||(AA.add(b),s={rel:s,crossOrigin:h,href:l},g.querySelector(b)===null&&(l=g.createElement("link"),Hn(l,"link",s),nn(l),g.head.appendChild(l)))}}function s9(s){Ga.D(s),EA("dns-prefetch",s,null)}function o9(s,l){Ga.C(s,l),EA("preconnect",s,l)}function l9(s,l,h){Ga.L(s,l,h);var g=jc;if(g&&s&&l){var b='link[rel="preload"][as="'+ti(l)+'"]';l==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+ti(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+ti(h.imageSizes)+'"]')):b+='[href="'+ti(s)+'"]';var N=b;switch(l){case"style":N=Nc(s);break;case"script":N=kc(s)}ci.has(N)||(s=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:s,as:l},h),ci.set(N,s),g.querySelector(b)!==null||l==="style"&&g.querySelector(_d(N))||l==="script"&&g.querySelector(Od(N))||(l=g.createElement("link"),Hn(l,"link",s),nn(l),g.head.appendChild(l)))}}function c9(s,l){Ga.m(s,l);var h=jc;if(h&&s){var g=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+ti(g)+'"][href="'+ti(s)+'"]',N=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=kc(s)}if(!ci.has(N)&&(s=m({rel:"modulepreload",href:s},l),ci.set(N,s),h.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Od(N)))return}g=h.createElement("link"),Hn(g,"link",s),nn(g),h.head.appendChild(g)}}}function u9(s,l,h){Ga.S(s,l,h);var g=jc;if(g&&s){var b=zi(g).hoistableStyles,N=Nc(s);l=l||"default";var E=b.get(N);if(!E){var D={loading:0,preload:null};if(E=g.querySelector(_d(N)))D.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},h),(h=ci.get(N))&&Lb(s,h);var H=E=g.createElement("link");nn(H),Hn(H,"link",s),H._p=new Promise(function(re,fe){H.onload=re,H.onerror=fe}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,zp(E,l,g)}E={type:"stylesheet",instance:E,count:1,state:D},b.set(N,E)}}}function d9(s,l){Ga.X(s,l);var h=jc;if(h&&s){var g=zi(h).hoistableScripts,b=kc(s),N=g.get(b);N||(N=h.querySelector(Od(b)),N||(s=m({src:s,async:!0},l),(l=ci.get(b))&&$b(s,l),N=h.createElement("script"),nn(N),Hn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function f9(s,l){Ga.M(s,l);var h=jc;if(h&&s){var g=zi(h).hoistableScripts,b=kc(s),N=g.get(b);N||(N=h.querySelector(Od(b)),N||(s=m({src:s,async:!0,type:"module"},l),(l=ci.get(b))&&$b(s,l),N=h.createElement("script"),nn(N),Hn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function TA(s,l,h,g){var b=(b=ie.current)?Pp(b):null;if(!b)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Nc(h.href),h=zi(b).hoistableStyles,g=h.get(l),g||(g={type:"style",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Nc(h.href);var N=zi(b).hoistableStyles,E=N.get(s);if(E||(b=b.ownerDocument||b,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,E),(N=b.querySelector(_d(s)))&&!N._p&&(E.instance=N,E.state.loading=5),ci.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ci.set(s,h),N||h9(b,s,h,E.state))),l&&g===null)throw Error(r(528,""));return E}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=kc(h),h=zi(b).hoistableScripts,g=h.get(l),g||(g={type:"script",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Nc(s){return'href="'+ti(s)+'"'}function _d(s){return'link[rel="stylesheet"]['+s+"]"}function PA(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function h9(s,l,h,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),Hn(l,"link",h),nn(l),s.head.appendChild(l))}function kc(s){return'[src="'+ti(s)+'"]'}function Od(s){return"script[async]"+s}function zA(s,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+ti(h.href)+'"]');if(g)return l.instance=g,nn(g),g;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),nn(g),Hn(g,"style",b),zp(g,h.precedence,s),l.instance=g;case"stylesheet":b=Nc(h.href);var N=s.querySelector(_d(b));if(N)return l.state.loading|=4,l.instance=N,nn(N),N;g=PA(h),(b=ci.get(b))&&Lb(g,b),N=(s.ownerDocument||s).createElement("link"),nn(N);var E=N;return E._p=new Promise(function(D,H){E.onload=D,E.onerror=H}),Hn(N,"link",g),l.state.loading|=4,zp(N,h.precedence,s),l.instance=N;case"script":return N=kc(h.src),(b=s.querySelector(Od(N)))?(l.instance=b,nn(b),b):(g=h,(b=ci.get(N))&&(g=m({},h),$b(g,b)),s=s.ownerDocument||s,b=s.createElement("script"),nn(b),Hn(b,"link",g),s.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,zp(g,h.precedence,s));return l.instance}function zp(s,l,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,N=b,E=0;E<g.length;E++){var D=g[E];if(D.dataset.precedence===l)N=D;else if(N!==b)break}N?N.parentNode.insertBefore(s,N.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(s,l.firstChild))}function Lb(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function $b(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Rp=null;function RA(s,l,h){if(Rp===null){var g=new Map,b=Rp=new Map;b.set(h,g)}else b=Rp,g=b.get(h),g||(g=new Map,b.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),b=0;b<h.length;b++){var N=h[b];if(!(N[Jr]||N[ct]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var E=N.getAttribute(l)||"";E=s+E;var D=g.get(E);D?D.push(N):g.set(E,[N])}}return g}function MA(s,l,h){s=s.ownerDocument||s,s.head.insertBefore(h,l==="title"?s.querySelector("head > title"):null)}function p9(s,l,h){if(h===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function DA(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function m9(s,l,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=Nc(g.href),N=l.querySelector(_d(b));if(N){l=N._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Mp.bind(s),l.then(s,s)),h.state.loading|=4,h.instance=N,nn(N);return}N=l.ownerDocument||l,g=PA(g),(b=ci.get(b))&&Lb(g,b),N=N.createElement("link"),nn(N);var E=N;E._p=new Promise(function(D,H){E.onload=D,E.onerror=H}),Hn(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Mp.bind(s),l.addEventListener("load",h),l.addEventListener("error",h))}}var Ub=0;function g9(s,l){return s.stylesheets&&s.count===0&&Ip(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Ip(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+l);0<s.imgBytes&&Ub===0&&(Ub=62500*WF());var b=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Ip(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>Ub?50:800)+l);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function Mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ip(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Dp=null;function Ip(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Dp=new Map,l.forEach(y9,s),Dp=null,Mp.call(s))}function y9(s,l){if(!(l.state.loading&4)){var h=Dp.get(s);if(h)var g=h.get(null);else{h=new Map,Dp.set(s,h);for(var b=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<b.length;N++){var E=b[N];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(h.set(E.dataset.precedence,E),g=E)}g&&h.set(null,g)}b=l.instance,E=b.getAttribute("data-precedence"),N=h.get(E)||g,N===g&&h.set(null,b),h.set(E,b),this.count++,g=Mp.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),N?N.parentNode.insertBefore(b,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(b,s.firstChild)),l.state.loading|=4}}var Ad={$$typeof:_,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function v9(s,l,h,g,b,N,E,D,H){this.tag=1,this.containerInfo=s,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=Gl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.hiddenUpdates=Gl(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=N,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function IA(s,l,h,g,b,N,E,D,H,re,fe,ge){return s=new v9(s,l,h,E,H,re,fe,ge,D),l=1,N===!0&&(l|=24),N=$r(3,null,null,l),s.current=N,N.stateNode=s,l=b0(),l.refCount++,s.pooledCache=l,l.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:l},j0(N),s}function LA(s){return s?(s=nc,s):nc}function $A(s,l,h,g,b,N){b=LA(b),g.context===null?g.context=b:g.pendingContext=b,g=js(l),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ns(s,g,l),h!==null&&(Nr(h,s,l),od(h,s,l))}function UA(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<l?h:l}}function Bb(s,l){UA(s,l),(s=s.alternate)&&UA(s,l)}function BA(s){if(s.tag===13||s.tag===31){var l=Ro(s,67108864);l!==null&&Nr(l,s,67108864),Bb(s,67108864)}}function FA(s){if(s.tag===13||s.tag===31){var l=Kr();l=Hu(l);var h=Ro(s,l);h!==null&&Nr(h,s,l),Bb(s,l)}}var Lp=!0;function b9(s,l,h,g){var b=K.T;K.T=null;var N=X.p;try{X.p=2,Fb(s,l,h,g)}finally{X.p=N,K.T=b}}function x9(s,l,h,g){var b=K.T;K.T=null;var N=X.p;try{X.p=8,Fb(s,l,h,g)}finally{X.p=N,K.T=b}}function Fb(s,l,h,g){if(Lp){var b=qb(g);if(b===null)Ob(s,l,g,$p,h),KA(s,g);else if(S9(b,s,l,h,g))g.stopPropagation();else if(KA(s,g),l&4&&-1<w9.indexOf(s)){for(;b!==null;){var N=Oa(b);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var E=Xr(N.pendingLanes);if(E!==0){var D=N;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var H=1<<31-ue(E);D.entanglements[1]|=H,E&=~H}na(N),(St&6)===0&&(wp=Re()+500,jd(0))}}break;case 31:case 13:D=Ro(N,2),D!==null&&Nr(D,N,2),jp(),Bb(N,2)}if(N=qb(g),N===null&&Ob(s,l,g,$p,h),N===b)break;b=N}b!==null&&g.stopPropagation()}else Ob(s,l,g,null,h)}}function qb(s){return s=Hv(s),Kb(s)}var $p=null;function Kb(s){if($p=null,s=Pi(s),s!==null){var l=a(s);if(l===null)s=null;else{var h=l.tag;if(h===13){if(s=o(l),s!==null)return s;s=null}else if(h===31){if(s=c(l),s!==null)return s;s=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return $p=s,null}function qA(s){switch(s){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(_e()){case te:return 2;case xe:return 8;case Ae:case Ge:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Hb=!1,Ms=null,Ds=null,Is=null,Ed=new Map,Td=new Map,Ls=[],w9="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 KA(s,l){switch(s){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Ds=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":Ed.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Td.delete(l.pointerId)}}function Pd(s,l,h,g,b,N){return s===null||s.nativeEvent!==N?(s={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[b]},l!==null&&(l=Oa(l),l!==null&&BA(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),s)}function S9(s,l,h,g,b){switch(l){case"focusin":return Ms=Pd(Ms,s,l,h,g,b),!0;case"dragenter":return Ds=Pd(Ds,s,l,h,g,b),!0;case"mouseover":return Is=Pd(Is,s,l,h,g,b),!0;case"pointerover":var N=b.pointerId;return Ed.set(N,Pd(Ed.get(N)||null,s,l,h,g,b)),!0;case"gotpointercapture":return N=b.pointerId,Td.set(N,Pd(Td.get(N)||null,s,l,h,g,b)),!0}return!1}function HA(s){var l=Pi(s.target);if(l!==null){var h=a(l);if(h!==null){if(l=h.tag,l===13){if(l=o(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){FA(h)});return}}else if(l===31){if(l=c(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){FA(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Up(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var h=qb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);Kv=g,h.target.dispatchEvent(g),Kv=null}else return l=Oa(h),l!==null&&BA(l),s.blockedOn=h,!1;l.shift()}return!0}function GA(s,l,h){Up(s)&&h.delete(l)}function j9(){Hb=!1,Ms!==null&&Up(Ms)&&(Ms=null),Ds!==null&&Up(Ds)&&(Ds=null),Is!==null&&Up(Is)&&(Is=null),Ed.forEach(GA),Td.forEach(GA)}function Bp(s,l){s.blockedOn===l&&(s.blockedOn=null,Hb||(Hb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,j9)))}var Fp=null;function VA(s){Fp!==s&&(Fp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fp===s&&(Fp=null);for(var l=0;l<s.length;l+=3){var h=s[l],g=s[l+1],b=s[l+2];if(typeof g!="function"){if(Kb(g||h)===null)continue;break}var N=Oa(h);N!==null&&(s.splice(l,3),l-=3,q0(N,{pending:!0,data:b,method:h.method,action:g},g,b))}}))}function Cc(s){function l(H){return Bp(H,s)}Ms!==null&&Bp(Ms,s),Ds!==null&&Bp(Ds,s),Is!==null&&Bp(Is,s),Ed.forEach(l),Td.forEach(l);for(var h=0;h<Ls.length;h++){var g=Ls[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Ls.length&&(h=Ls[0],h.blockedOn===null);)HA(h),h.blockedOn===null&&Ls.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var b=h[g],N=h[g+1],E=b[_t]||null;if(typeof N=="function")E||VA(h);else if(E){var D=null;if(N&&N.hasAttribute("formAction")){if(b=N,E=N[_t]||null)D=E.formAction;else if(Kb(b)!==null)continue}else D=E.action;typeof D=="function"?h[g+1]=D:(h.splice(g,3),g-=3),VA(h)}}}function ZA(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(E){return b=E})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function Gb(s){this._internalRoot=s}qp.prototype.render=Gb.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,g=Kr();$A(h,g,s,l,null,null)},qp.prototype.unmount=Gb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;$A(s.current,2,null,s,null,null),jp(),l[Dr]=null}};function qp(s){this._internalRoot=s}qp.prototype.unstable_scheduleHydration=function(s){if(s){var l=G();s={blockedOn:null,target:s,priority:l};for(var h=0;h<Ls.length&&l!==0&&l<Ls[h].priority;h++);Ls.splice(h,0,s),h===0&&HA(s)}};var YA=t.version;if(YA!=="19.2.4")throw Error(r(527,YA,"19.2.4"));X.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var N9={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kp.isDisabled&&Kp.supportsFiber)try{Qe=Kp.inject(N9),kt=Kp}catch{}}return Rd.createRoot=function(s,l){if(!i(s))throw Error(r(299));var h=!1,g="",b=nO,N=rO,E=iO;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError)),l=IA(s,1,!1,null,null,h,g,null,b,N,E,ZA),s[Dr]=l.current,_b(s),new Gb(l)},Rd.hydrateRoot=function(s,l,h){if(!i(s))throw Error(r(299));var g=!1,b="",N=nO,E=rO,D=iO,H=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(E=h.onCaughtError),h.onRecoverableError!==void 0&&(D=h.onRecoverableError),h.formState!==void 0&&(H=h.formState)),l=IA(s,1,!0,l,h??null,g,b,H,N,E,D,ZA),l.context=LA(null),h=l.current,g=Kr(),g=Hu(g),b=js(g),b.callback=null,Ns(h,b,g),h=g,l.current.lanes=h,Oo(l,h),na(l),s[Dr]=l.current,_b(s),new qp(l)},Rd.version="19.2.4",Rd}var aE;function R9(){if(aE)return Yb.exports;aE=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(),Yb.exports=z9(),Yb.exports}var M9=R9(),Ml=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(){}},D9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},I9=class{#t=D9;#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)}},il=new I9;function L9(e){setTimeout(e,0)}var Sl=typeof window>"u"||"Deno"in globalThis;function tr(){}function $9(e,t){return typeof e=="function"?e(t):e}function gS(e){return typeof e=="number"&&e>=0&&e!==1/0}function $D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function no(e,t){return typeof e=="function"?e(t):e}function gi(e,t){return typeof e=="function"?e(t):e}function sE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==hj(o,t.options))return!1}else if(!bf(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function oE(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jl(t.options.mutationKey)!==jl(a))return!1}else if(!bf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hj(e,t){return(t?.queryKeyHashFn||jl)(e)}function jl(e){return JSON.stringify(e,(t,n)=>yS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function bf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>bf(e[n],t[n])):!1}var U9=Object.prototype.hasOwnProperty;function pj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=lE(e)&&lE(t);if(!r&&!(yS(e)&&yS(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:U9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const x=pj(y,v,n+1);d[m]=x,x===y&&f++}return a===c&&f===a?e:d}function xf(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 lE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yS(e){if(!cE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!cE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cE(e){return Object.prototype.toString.call(e)==="[object Object]"}function B9(e){return new Promise(t=>{il.setTimeout(t,e)})}function vS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pj(e,t):t}function F9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function q9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mj=Symbol();function UD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gj(e,t){return typeof e=="function"?e(...t):!!e}function K9(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 H9=class extends Ml{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Sl&&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"}},yj=new H9;function bS(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});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 G9=L9;function V9(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=G9;const a=c=>{t?e.push(c):i(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var hn=V9(),Z9=class extends Ml{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Sl&&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}},Qm=new Z9;function Y9(e){return Math.min(1e3*2**e,3e4)}function BD(e){return(e??"online")==="online"?Qm.isOnline():!0}var xS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function FD(e){let t=!1,n=0,r;const i=bS(),a=()=>i.status!=="pending",o=w=>{if(!a()){const j=new xS(w);y(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>yj.isFocused()&&(e.networkMode==="always"||Qm.isOnline())&&e.canRun(),p=()=>BD(e.networkMode)&&e.canRun(),m=w=>{a()||(r?.(),i.resolve(w))},y=w=>{a()||(r?.(),i.reject(w))},v=()=>new Promise(w=>{r=j=>{(a()||f())&&w(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),x=()=>{if(a())return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(k){w=Promise.reject(k)}Promise.resolve(w).then(m).catch(k=>{if(a())return;const A=e.retry??(Sl?0:3),_=e.retryDelay??Y9,C=typeof _=="function"?_(n,k):_,P=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,k);if(t||!P){y(k);return}n++,e.onFail?.(n,k),B9(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):x()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?x():v().then(x),i)}}var qD=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gS(this.gcTime)&&(this.#t=il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(il.clearTimeout(this.#t),this.#t=void 0)}},W9=class extends qD{#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=dE(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=dE(this.options);t.data!==void 0&&(this.setState(uE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=vS(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(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>gi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>no(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:!$D(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(d=>d.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=UD(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{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(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=FD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof xS&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.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 xS){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,...KD(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...uE(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),hn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function KD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:BD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dE(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 vj=class extends Ml{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=bS(),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),fE(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wS(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 gi(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&&!xf(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&hE(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||gi(this.options.enabled,this.#e)!==gi(t.enabled,this.#e)||no(this.options.staleTime,this.#e)!==no(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||gi(this.options.enabled,this.#e)!==gi(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 X9(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(tr)),t}#g(){this.#x();const e=no(this.options.staleTime,this.#e);if(Sl||this.#i.isStale||!gS(e))return;const n=$D(this.#i.dataUpdatedAt,e)+1;this.#c=il.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,!(Sl||gi(this.options.enabled,this.#e)===!1||!gS(this.#l)||this.#l===0)&&(this.#u=il.setInterval(()=>{(this.options.refetchIntervalInBackground||yj.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(il.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(il.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const z=this.hasListeners(),I=!z&&fE(e,t),F=z&&hE(e,n,t,r);(I||F)&&(p={...p,...KD(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:w}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&w==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(z=i.data,j=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,z!==void 0&&(w="success",y=vS(i?.data,z,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=vS(i?.data,y,t),this.#d=y,this.#s=null}catch(z){this.#s=z}this.#s&&(v=this.#s,y=this.#d,x=Date.now(),w="error");const k=p.fetchStatus==="fetching",A=w==="pending",_=w==="error",C=A&&k,P=y!==void 0,O={status:w,fetchStatus:p.fetchStatus,isPending:A,isSuccess:w==="success",isError:_,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!A,isLoadingError:_&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&P,isStale:bj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:gi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=O.data!==void 0,I=O.status==="error"&&!z,F=J=>{I?J.reject(O.error):z&&J.resolve(O.data)},$=()=>{const J=this.#o=O.promise=bS();F(J)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&F(L);break;case"fulfilled":(I||O.data!==L.value)&&$();break;case"rejected":(!I||O.error!==L.reason)&&$();break}}return O}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),xf(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 a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const c=o;return this.#i[c]!==e[c]&&a.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){hn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Q9(e,t){return gi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fE(e,t){return Q9(e,t)||e.state.data!==void 0&&wS(e,t,t.refetchOnMount)}function wS(e,t,n){if(gi(t.enabled,e)!==!1&&no(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bj(e,t)}return!1}function hE(e,t,n,r){return(e!==t||gi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bj(e,n)}function bj(e,t){return gi(t.enabled,e)!==!1&&e.isStaleByTime(no(t.staleTime,e))}function X9(e,t){return!xf(e.getCurrentResult(),t)}function pE(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=x=>{K9(x,()=>t.signal,()=>p=!0)},y=UD(t.options,t.fetchOptions),v=async(x,w,j)=>{if(p)return Promise.reject();if(w==null&&x.pages.length)return Promise.resolve(x);const A=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:w,direction:j?"backward":"forward",meta:t.options.meta};return m(T),T})(),_=await y(A),{maxPages:C}=t.options,P=j?q9:F9;return{pages:P(x.pages,_,C),pageParams:P(x.pageParams,w,C)}};if(i&&a.length){const x=i==="backward",w=x?J9:mE,j={pages:a,pageParams:o},k=w(r,j);c=await v(j,k,x)}else{const x=e??a.length;do{const w=d===0?o[0]??r.initialPageParam:mE(r,c);if(d>0&&w==null)break;c=await v(c,w),d++}while(d<x)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function mE(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 J9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var eq=class extends qD{#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||HD(),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=FD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},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 o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}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),hn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function HD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var GD=class extends Ml{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 eq({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=Hp(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=Hp(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=Hp(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=Hp(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){hn.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=>oE(t,n))}findAll(e={}){return this.getAll().filter(t=>oE(e,t))}notify(e){hn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return hn.batch(()=>Promise.all(e.map(t=>t.continue().catch(tr))))}};function Hp(e){return e.options.scope?.id}var tq=class extends Ml{#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),xf(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&jl(n.mutationKey)!==jl(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??HD();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){hn.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(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function gE(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function nq(e,t,n){const r=e.slice(0);return r[t]=n,r}var rq=class extends Ml{#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,hn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,c=i.some((p,m)=>p!==n[m]),d=o||c,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!xf(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(gE(n,i).forEach(p=>{p.destroy()}),gE(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),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(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??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,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,o)=>a!==r[o]));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=pj(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 a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),o=t.get(i.queryHash)?.shift()??new vj(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=nq(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&&hn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},iq=class extends Ml{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??hj(r,t);let a=this.get(i);return a||(a=new W9({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}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(){hn.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=>sE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>sE(e,n)):t}notify(e){hn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){hn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){hn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},aq=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new iq,this.#e=e.mutationCache||new GD,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=yj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Qm.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(no(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}),a=this.#t.get(r.queryHash)?.state.data,o=$9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return hn.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;hn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return hn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=hn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(tr).catch(tr)}invalidateQueries(e,t={}){return hn.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=hn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(tr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(no(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tr).catch(tr)}fetchInfiniteQuery(e){return e.behavior=pE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(tr).catch(tr)}ensureInfiniteQueryData(e){return e.behavior=pE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qm.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(jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{bf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{bf(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=hj(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===mj&&(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()}},VD=S.createContext(void 0),mo=e=>{const t=S.useContext(VD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sq=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(VD.Provider,{value:e,children:t})),ZD=S.createContext(!1),YD=()=>S.useContext(ZD);ZD.Provider;function oq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lq=S.createContext(oq()),WD=()=>S.useContext(lq),QD=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},XD=e=>{S.useEffect(()=>{e.clearReset()},[e])},JD=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||gj(n,[e.error,r])),eI=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))}},cq=(e,t)=>e.isLoading&&e.isFetching&&!t,SS=(e,t)=>e?.suspense&&t.isPending,jS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uq({queries:e,...t},n){const r=mo(),i=YD(),a=WD(),o=S.useMemo(()=>e.map(w=>{const j=r.defaultQueryOptions(w);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(w=>{eI(w);const j=r.getQueryCache().get(w.queryHash);QD(w,a,j)}),XD(a);const[c]=S.useState(()=>new rq(r,o,t)),[d,f,p]=c.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(w=>m?c.subscribe(hn.batchCalls(w)):tr,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const v=d.some((w,j)=>SS(o[j],w))?d.flatMap((w,j)=>{const k=o[j];if(k&&SS(k,w)){const A=new vj(r,k);return jS(k,A,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const x=d.find((w,j)=>{const k=o[j];return k&&JD({result:w,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(x?.error)throw x.error;return f(p())}function dq(e,t,n){const r=YD(),i=WD(),a=mo(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",eI(o),QD(o,i,c),XD(i);const d=!a.getQueryCache().get(o.queryHash),[f]=S.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(y=>{const v=m?f.subscribe(hn.batchCalls(y)):tr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),S.useEffect(()=>{f.setOptions(o)},[o,f]),SS(o,p))throw jS(o,f,i);if(JD({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Sl&&cq(p,r)&&(d?jS(o,f,i):c?.promise)?.catch(tr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function es(e,t){return dq(e,vj)}function Zf(e,t){const n=mo(),[r]=S.useState(()=>new tq(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const i=S.useSyncExternalStore(S.useCallback(o=>r.subscribe(hn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=S.useCallback((o,c)=>{r.mutate(o,c).catch(tr)},[r]);if(i.error&&gj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Gp=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Jb(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function fq(e,t,n={},r={}){S.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function hq(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}var pq=!1;function wf(e){return e[e.length-1]}function mq(e){return typeof e=="function"}function Qs(e,t){return mq(e)?e(t):e}var gq=Object.prototype.hasOwnProperty,yE=Object.prototype.propertyIsEnumerable,yq=()=>Object.create(null),Vo=(e,t)=>al(e,t,yq);function al(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=xE(e)&&xE(i);if(!a&&!(Xm(e)&&Xm(i)))return i;const o=a?e:vE(e);if(!o)return i;const c=a?i:vE(i);if(!c)return i;const d=o.length,f=c.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:c[y],x=e[v],w=i[v];if(x===w){p[v]=x,(a?y<d:gq.call(e,v))&&m++;continue}if(x===null||w===null||typeof x!="object"||typeof w!="object"){p[v]=w;continue}const j=al(x,w,n,r+1);p[v]=j,j===x&&m++}return d===f&&m===d?e:p}function vE(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!yE.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(!yE.call(e,i))return!1;r.push(i)}return r}function Xm(e){if(!bE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!bE(n)||!n.hasOwnProperty("isPrototypeOf"))}function bE(e){return Object.prototype.toString.call(e)==="[object Object]"}function xE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pl(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(!pl(e[r],t[r],n))return!1;return!0}if(Xm(e)&&Xm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!pl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!pl(e[o],t[o],n)))return!1;return i===a}return!1}function cu(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});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 Sf(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function vq(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function wE(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 vq(t)}var bq=["http:","https:","mailto:","tel:"];function Jm(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Md(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+=wE(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+wE(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function xq(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function eg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=o,i(c);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var wq="Invariant failed";function co(e,t){if(!e)throw new Error(wq)}var sl=4,tI=5;function Sq(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 xj(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){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(a.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 o=Sq(a);if(o){const[c,d]=o,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+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 vy(e,t,n,r,i,a,o){o?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<f;){const v=xj(d,c,t);let x;const w=c,j=v[5];switch(c=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const A=i.static?.get(k);if(A)x=A;else{i.static??=new Map;const _=ol(n.fullPath??n.from);_.parent=i,_.depth=a,x=_,i.static.set(k,_)}}else{const A=k.toLowerCase(),_=i.staticInsensitive?.get(A);if(_)x=_;else{i.staticInsensitive??=new Map;const C=ol(n.fullPath??n.from);C.parent=i,C.depth=a,x=C,i.staticInsensitive.set(A,C)}}break}case 1:{const k=d.substring(w,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,T=!m&&i.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===C&&O.suffix===P);if(T)x=T;else{const O=tx(1,n.fullPath??n.from,_,C,P);x=O,O.depth=a,O.parent=i,i.dynamic??=[],i.dynamic.push(O)}break}case 3:{const k=d.substring(w,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,T=!m&&i.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===C&&O.suffix===P);if(T)x=T;else{const O=tx(3,n.fullPath??n.from,_,C,P);x=O,O.parent=i,O.depth=a,i.optional??=[],i.optional.push(O)}break}case 2:{const k=d.substring(w,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,T=tx(2,n.fullPath??n.from,_,C,P);x=T,T.parent=i,T.depth=a,i.wildcard??=[],i.wildcard.push(T)}}i=x}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=ol(n.fullPath??n.from);v.kind=tI,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=ol(n.fullPath??n.from);v.kind=sl,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)vy(e,t,d,c,i,a,o)}function ex(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 Gs(e){if(e.pathless)for(const t of e.pathless)Gs(t);if(e.static)for(const t of e.static.values())Gs(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Gs(t);if(e.dynamic?.length){e.dynamic.sort(ex);for(const t of e.dynamic)Gs(t)}if(e.optional?.length){e.optional.sort(ex);for(const t of e.optional)Gs(t)}if(e.wildcard?.length){e.wildcard.sort(ex);for(const t of e.wildcard)Gs(t)}}function ol(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 tx(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 jq(e,t){const n=ol("/"),r=new Uint16Array(6);for(const i of e)vy(!1,r,i,1,n,0);Gs(n),t.masksTree=n,t.flatCache=eg(1e3)}function Nq(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=wj(e,t.masksTree);return t.flatCache.set(e,r),r}function kq(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=ol("/"),vy(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),wj(r,o,n)}function Cq(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=wj(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=Aq(a.route)),t.matchCache.set(r,a),a}function _q(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Oq(e,t=!1,n){const r=ol(e.fullPath),i=new Uint16Array(6),a={},o={};let c=0;return vy(t,i,e,1,r,0,d=>{if(n?.(d,c),co(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=_q(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}c++}),Gs(r),{processedTree:{segmentTree:r,singleCache:eg(1e3),matchCache:eg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function wj(e,t,n=!1){const r=e.split("/"),i=Tq(e,r,t,n);if(!i)return null;const[a]=nI(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function nI(e,t,n){const r=Eq(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;o++,c++,d++,f++){const p=r[c];if(p.kind===sl)break;if(p.kind===tI){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],x=p.prefix?.length??0;if(v.charCodeAt(x)===123){const w=p.suffix?.length??0,j=v.substring(x+2,v.length-w-1),k=m.substring(x,m.length-w);a[j]=decodeURIComponent(k)}else{const w=v.substring(1);a[w]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],x=p.prefix?.length??0,w=p.suffix?.length??0,j=v.substring(x+3,v.length-w-1),k=p.suffix||p.prefix?m.substring(x,m.length-w):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,x=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),w=decodeURIComponent(x);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:c,path:d,segment:f}]}function Aq(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Eq(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Tq(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!wf(t),a=i&&e!=="/",o=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;c.length;){const m=c.pop(),{node:y,index:v,skipped:x,depth:w,statics:j,dynamics:k,optionals:A}=m;let{extract:_,rawParams:C,parsedParams:P}=m;if(y.skipOnParamError){if(!nx(e,t,m))continue;C=m.rawParams,_=m.extract,P=m.parsedParams}r&&y.route&&y.kind!==sl&&Dd(f,m)&&(f=m);const T=v===o;if(T&&(y.route&&!a&&Dd(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const O=T?void 0:t[v];let z;if(T&&y.index){const I={node:y.index,index:v,skipped:x,depth:w+1,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P};let F=!0;if(y.index.skipOnParamError&&(nx(e,t,I)||(F=!1)),F){if(j===o&&!k&&!A&&!x)return I;Dd(p,I)&&(p=I)}}if(y.wildcard&&Dd(d,m))for(const I of y.wildcard){const{prefix:F,suffix:$}=I;if(F&&(T||!(I.caseSensitive?O:z??=O.toLowerCase()).startsWith(F)))continue;if($){if(T)continue;const J=t.slice(v).join("/").slice(-$.length);if((I.caseSensitive?J:J.toLowerCase())!==$)continue}const L={node:I,index:o,skipped:x,depth:w,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P};if(!(I.skipOnParamError&&!nx(e,t,L))){d=L;break}}if(y.optional){const I=x|1<<w,F=w+1;for(let $=y.optional.length-1;$>=0;$--){const L=y.optional[$];c.push({node:L,index:v,skipped:I,depth:F,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!T)for(let $=y.optional.length-1;$>=0;$--){const L=y.optional[$],{prefix:J,suffix:ae}=L;if(J||ae){const Q=L.caseSensitive?O:z??=O.toLowerCase();if(J&&!Q.startsWith(J)||ae&&!Q.endsWith(ae))continue}c.push({node:L,index:v+1,skipped:x,depth:F,statics:j,dynamics:k,optionals:A+1,extract:_,rawParams:C,parsedParams:P})}}if(!T&&y.dynamic&&O)for(let I=y.dynamic.length-1;I>=0;I--){const F=y.dynamic[I],{prefix:$,suffix:L}=F;if($||L){const J=F.caseSensitive?O:z??=O.toLowerCase();if($&&!J.startsWith($)||L&&!J.endsWith(L))continue}c.push({node:F,index:v+1,skipped:x,depth:w+1,statics:j,dynamics:k+1,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!T&&y.staticInsensitive){const I=y.staticInsensitive.get(z??=O.toLowerCase());I&&c.push({node:I,index:v+1,skipped:x,depth:w+1,statics:j+1,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!T&&y.static){const I=y.static.get(O);I&&c.push({node:I,index:v+1,skipped:x,depth:w+1,statics:j+1,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(y.pathless){const I=w+1;for(let F=y.pathless.length-1;F>=0;F--){const $=y.pathless[F];c.push({node:$,index:v,skipped:x,depth:I,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}}}if(p&&d)return Dd(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function nx(e,t,n){try{const[r,i]=nI(e,t,n);n.rawParams=r,n.extract=i;const a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Dd(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===sl)>(e.node.kind===sl)||t.node.kind===sl==(e.node.kind===sl)&&t.depth>e.depth))):!0}function zm(e){return Sj(e.filter(t=>t!==void 0).join("/"))}function Sj(e){return e.replace(/\/{2,}/g,"/")}function rI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ro(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function iI(e){return ro(rI(e))}function tg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Pq(e,t,n){return tg(e,n)===tg(t,n)}function zq({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&wf(c)==="";)c.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const x=m[y];x===""?y?y===v-1&&c.push(x):c=[x]:x===".."?c.pop():x==="."||c.push(x)}}c.length>1&&(wf(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let d,f="";for(let m=0;m<c.length;m++){m>0&&(f+="/");const y=c[m];if(!y)continue;d=xj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const x=d[5],w=y.substring(0,d[1]),j=y.substring(d[4],x),k=y.substring(d[2],d[3]);v===1?f+=w||j?`${w}{$${k}}${j}`:`$${k}`:v===2?f+=w||j?`${w}{$}${j}`:"$":f+=`${w}{-$${k}}${j}`}f=Sj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function Rq(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,a=>t.get(a)??a)}function rx(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=>jE(i,n)).join("/"):jE(r,n)}function SE({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let c=0,d,f="";for(;c<o;){const p=c;d=xj(e,p,d);const m=d[5];if(c=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const x=e.substring(p,d[1]),w=e.substring(d[4],m);if(!v){i=!0,(x||w)&&(f+="/"+x+w);continue}const j=rx("_splat",t,n);f+="/"+x+j+w;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const x=e.substring(p,d[1]),w=e.substring(d[4],m),j=rx(v,t,n)??"undefined";f+="/"+x+j+w;continue}if(y===3){const v=e.substring(d[2],d[3]),x=t[v];if(x==null)continue;a[v]=x;const w=e.substring(p,d[1]),j=e.substring(d[4],m),k=rx(v,t,n)??"";f+="/"+w+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function jE(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function fr(e){return!!e?.isNotFound}function Mq(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var NS="tsr-scroll-restoration-v1_3",Dq=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function Iq(){const e=Mq();if(!e)return null;const t=e.getItem(NS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Qs(r,n)||n;try{e.setItem(NS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Vp=Iq(),Lq=e=>e.state.__TSR_key||e.href;function $q(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 ng=!1;function Uq({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=o[c];ng=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}ng=!1}function Bq(e,t){if(!Vp||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Vp))return;e.isScrollRestorationSetup=!0,ng=!1;const n=e.options.getScrollRestorationKey||Lq;window.history.scrollRestoration="manual";const r=i=>{if(ng||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=$q(i.target)}const o=n(e.state.location);Vp.set(c=>{const d=c[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",Dq(r,100),!0),e.subscribe("onRendered",i=>{const a=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Uq({storageKey:NS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Vp.set(o=>(o[a]||={},o)))})}function Fq(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 qq(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 ix(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Kq(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=ix(i):Array.isArray(a)?a.push(ix(i)):n[r]=[a,ix(i)]}return n}var Hq=Vq(JSON.parse),Gq=Zq(JSON.stringify,JSON.parse);function Vq(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Kq(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function Zq(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 a=qq(i,r);return a?`?${a}`:""}}var ml="__root__";function jj(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 _r(e){return e instanceof Response&&!!e.options}function Yq(e){return{input:({url:t})=>{for(const n of e)t=kS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=aI(e[n],t);return t}}}function Wq(e){const t=iI(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const c=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return c===i?o.pathname="/":c.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=zm(["/",t,o.pathname]),o)}}function kS(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 aI(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 Qt=(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))(Qt||{});function sI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:c};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const x=f.subsTail;if(x!==void 0&&x.version===m&&x.sub===p)return;const w=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:x,nextSub:void 0};v!==void 0&&(v.prevDep=w),y!==void 0?y.nextDep=w:p.deps=w,x!==void 0?x.nextSub=w:f.subs=w}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,x=f.nextSub,w=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,x!==void 0?x.prevSub=w:m.subsTail=w,w!==void 0?w.nextSub=x:(m.subs=x)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,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 x=y.subs;if(x!==void 0){const w=(f=x).nextSub;w!==void 0&&(m={value:p,prev:m},p=w);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const x=f.dep,w=x.flags;if(p.flags&16)v=!0;else if((w&17)===17){if(e(x)){const j=x.subs;j.nextSub!==void 0&&c(j),v=!0}}else if((w&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=x.deps,p=x,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&c(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const A=f.nextDep;if(A!==void 0){f=A;continue e}}return v}while(!0)}function c(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let Nj=0,Zo=0,uf=0;const Ya=[],{link:GNe,unlink:oI,propagate:VNe,checkDirty:Qq,shallowPropagate:ZNe}=sI({update(e){return e.depsTail!==void 0?tK(e):nK(e)},notify(e){let t=uf,n=t;do if(Ya[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(uf=t;n<--t;){const r=Ya[n];Ya[n++]=Ya[t],Ya[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,by(e)):aK.call(e)}});function Xq(){return Nj}function Jq(){++Nj}function eK(){--Nj||iK()}function tK(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,by(e)}}function nK(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function rK(e){const t=e.flags;if(t&16||t&32&&Qq(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,by(e)}}else e.flags=2}function iK(){try{for(;Zo<uf;){const e=Ya[Zo];Ya[Zo++]=void 0,rK(e)}}finally{for(;Zo<uf;){const e=Ya[Zo];Ya[Zo++]=void 0,e.flags|=10}Zo=0,uf=0}}function aK(){this.depsTail=void 0,this.flags=0,by(this);const e=this.subs;e!==void 0&&oI(e)}function by(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=oI(n,e)}function kj(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 CS=[];let Rm=0;const{link:NE,unlink:sK,propagate:oK,checkDirty:lI,shallowPropagate:kE}=sI({update(e){return e._update()},notify(e){CS[_S++]=e,e.flags&=~Qt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Qt.Mutable|Qt.Dirty,rg(e))}});let Zp=0,_S=0,oa;function rg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=sK(n,e)}function cI(){if(!(Xq()>0)){for(;Zp<_S;){const e=CS[Zp];CS[Zp++]=void 0,e.notify()}Zp=0,_S=0}}function uI(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?Qt.None:Qt.Mutable,get(){return oa!==void 0&&NE(i,oa,Rm),i._snapshot},subscribe(a){const o=kj(a),c={current:!1},d=lK(()=>{i.get(),c.current?o.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=oa,c=Object.is;if(n)oa=i,++Rm,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=Qt.Mutable|Qt.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{oa=o,n&&(i.flags&=~Qt.RecursedCheck),rg(i)}}};return n?(i.flags=Qt.Mutable|Qt.Dirty,i.get=function(){const a=i.flags;if(a&Qt.Dirty||a&Qt.Pending&&lI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&kE(o)}}else a&Qt.Pending&&(i.flags=a&~Qt.Pending);return oa!==void 0&&NE(i,oa,Rm),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(oK(o),kE(o),cI())}},i}function lK(e){const t=()=>{const r=oa;oa=n,++Rm,n.depsTail=void 0,n.flags=Qt.Watching|Qt.RecursedCheck;try{return e()}finally{oa=r,n.flags&=~Qt.RecursedCheck,rg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Qt.Watching|Qt.RecursedCheck,notify(){const r=this.flags;r&Qt.Dirty||r&Qt.Pending&&lI(this.deps,this)?t():this.flags=Qt.Watching},stop(){this.flags=Qt.None,this.depsTail=void 0,rg(this)}};return t(),n}class cK{constructor(t){this.atom=uI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(kj(t))}}class uK{constructor(t){this.atom=uI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(kj(t))}}function dK(e){return typeof e=="function"?new uK(e):new cK(e)}function fK(e){try{Jq(),e()}finally{eK(),cI()}}function df(e){let t;return fK(()=>{t=e()}),t}var OS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},xy=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),gl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const c=e.router.getMatch(o.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},CE=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const c=e.matches[o];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return o}return n?a:i},Xs=(e,t,n)=>{if(!(!_r(n)&&!fr(n)))throw _r(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:_r(n)?"redirected":r.status==="pending"?"success":r.status,context:gl(e,t.index),isFetching:!1,error:n})),fr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_r(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},dI=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},_E=(e,t,n)=>{const r=gl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Id=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Xs(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(c){n=c,Xs(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&&!_r(n)&&!fr(n)&&(e.serialError??=n)},fI=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!xy(e,t)&&(n.options.loader||n.options.beforeLoad||pI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{OS(e)},i);r._nonReactive.pendingTimeout=a}},hK=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;fI(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Xs(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},pK=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=cu(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:c}=i;o&&Id(e,n,o,"PARSE_PARAMS"),c&&Id(e,n,c,"VALIDATE_SEARCH"),fI(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){df(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=cu();const y={...gl(e,n,!1),...i.__routeContext},{search:v,params:x,cause:w}=i,j=xy(e,t),k={search:v,abortController:d,params:x,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=C=>{if(C===void 0){df(()=>{p(),m()});return}(_r(C)||fr(C))&&(p(),Id(e,n,C,"BEFORE_LOAD")),df(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:C})),m()})};let _;try{if(_=r.options.beforeLoad(k),Sf(_))return p(),_.catch(C=>{Id(e,n,C,"BEFORE_LOAD")}).then(A)}catch(C){p(),Id(e,n,C,"BEFORE_LOAD")}A(_)},mK=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),o=()=>pK(e,n,t,i),c=()=>{if(dI(e,n))return;const d=hK(e,n,i);return Sf(d)?d.then(o):o()};return a()},gK=(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(([a,o,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:o,styles:a?.styles}))},hI=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=gl(e,r),m=xy(e,n);return{params:o,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},OE=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(pq??e.router.isServer)||a.ssr===!0)&&jf(i);const o=i.options.loader,c=typeof o=="function"?o:o?.handler,d=c?.(hI(e,t,n,r,i)),f=!!c&&Sf(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;Xs(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:gl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let c=o;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:gl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,fr(o)&&await i.options.notFoundComponent?.preload?.(),Xs(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){c=f,Xs(e,e.router.getMatch(n),f)}!_r(c)&&!fr(c)&&await jf(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:gl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),Xs(e,o,a)}},yK=async(e,t,n)=>{async function r(v,x,w,j,k){const A=Date.now()-x.updatedAt,_=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,P=typeof C=="function"?C(hI(e,t,i,n,k)):C,{status:T,invalid:O}=j,z=A>_&&(!!e.forceStaleReload||j.cause==="enter"||w!==void 0&&w!==j.id);o=T==="success"&&(O||(P??z)),v&&k.options.preload===!1||(o&&!e.sync&&p?(c=!0,(async()=>{try{await OE(e,t,i,n,k);const I=e.router.getMatch(i);I._nonReactive.loaderPromise?.resolve(),I._nonReactive.loadPromise?.resolve(),I._nonReactive.loaderPromise=void 0,I._nonReactive.loadPromise=void 0}catch(I){_r(I)&&await e.router.navigate(I.options)}})()):T!=="success"||o?await OE(e,t,i,n,k):_E(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(dI(e,i)){if(!e.router.getMatch(i))return e.matches[n];_E(e,i,n)}else{const v=e.router.getMatch(i),x=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,w=xy(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&Xs(e,j,k),j.status==="pending"&&await r(w,v,x,j,d)}else{const j=w&&!e.router.state.matches.some(A=>A.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=cu(),j!==k.preload&&e.updateMatch(i,A=>({...A,preload:j})),await r(w,v,x,k,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=c?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function AE(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&OS(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=mK(t,y);Sf(v)&&await v}catch(v){if(_r(v))throw v;if(fr(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?CE(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let y=0;y<o;y++)n.push(yK(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 x=v.reason;if(_r(x))throw x;fr(x)?c??=x:d??=x}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const y=CE(t,f);co(y!==void 0);const v=t.matches[y],x=t.router.looseRoutesById[v.routeId],w=t.router.options?.defaultNotFoundComponent;!x.options.notFoundComponent&&w&&(x.options.notFoundComponent=w),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await jf(x,["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 jf(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:x}=t.matches[y],w=t.router.looseRoutesById[x];try{const j=gK(t,v,w);if(j){const k=await j;t.updateMatch(v,A=>({...A,...k}))}}catch(j){console.error(`Error executing head for route ${x}:`,j)}}const m=OS(t);if(Sf(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function EE(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function jf(e,t=Mm){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Mm?(()=>{if(e._componentsPromise===void 0){const r=EE(e,Mm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():EE(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function pI(e){for(const t of Mm)if(e.options[t]?.preload)return!0;return!1}var Mm=["component","errorComponent","pendingComponent","notFoundComponent"],io="__TSR_index",TE="popstate",PE="beforeunload";function vK(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=ig(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,c,d)=>{const f=t.state[io];c=zE(f+1,c),a({task:()=>{e.pushState(o,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:c})},replace:(o,c,d)=>{const f=t.state[io];c=zE(f,c),a({task:()=>{e.replaceState(o,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:c})},go:(o,c)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:c,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[io]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function zE(e,t){t||(t={});const n=Cj();return{...t,key:n,__TSR_key:n,[io]:e}}function bK(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=z=>i=z,c=(z=>z),d=(()=>ig(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=Cj();t.history.replaceState({[io]:0,key:z,__TSR_key:z},"")}let f=d(),p,m=!1,y=!1,v=!1,x=!1;const w=()=>f;let j,k;const A=()=>{j&&(O._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),O._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},_=(z,I,F)=>{const $=c(I);k||(p=f),f=ig(I,F),j={href:$,state:F,isPush:j?.isPush||z==="push"},k||(k=Promise.resolve().then(()=>A()))},C=z=>{f=d(),O.notify({type:z})},P=async()=>{if(y){y=!1;return}const z=d(),I=z.state[io]-f.state[io],F=I===1,$=I===-1,L=!F&&!$||m;m=!1;const J=L?"GO":$?"BACK":"FORWARD",ae=L?{type:"GO",index:I}:{type:$?"BACK":"FORWARD"};if(v)v=!1;else{const Q=a();if(typeof document<"u"&&Q.length){for(const K of Q)if(await K.blockerFn({currentLocation:f,nextLocation:z,action:J})){y=!0,t.history.go(1),O.notify(ae);return}}}f=d(),O.notify(ae)},T=z=>{if(x){x=!1;return}let I=!1;const F=a();if(typeof document<"u"&&F.length)for(const $ of F){const L=$.enableBeforeUnload??!0;if(L===!0){I=!0;break}if(typeof L=="function"&&L()===!0){I=!0;break}}if(I)return z.preventDefault(),z.returnValue=""},O=vK({getLocation:w,getLength:()=>t.history.length,pushState:(z,I)=>_("push",z,I),replaceState:(z,I)=>_("replace",z,I),back:z=>(z&&(v=!0),x=!0,t.history.back()),forward:z=>{z&&(v=!0),x=!0,t.history.forward()},go:z=>{m=!0,t.history.go(z)},createHref:z=>c(z),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(PE,T,{capture:!0}),t.removeEventListener(TE,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(PE,T,{capture:!0}),t.addEventListener(TE,P),t.history.pushState=function(...z){const I=n.apply(t.history,z);return O._ignoreSubscribers||C("PUSH"),I},t.history.replaceState=function(...z){const I=r.apply(t.history,z);return O._ignoreSubscribers||C("REPLACE"),I},O}function xK(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ig(e,t){const n=xK(e),r=n.indexOf("#"),i=n.indexOf("?"),a=Cj();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||{[io]:0,key:a,__TSR_key:a}}}function Cj(){return(Math.random()+1).toString(36).substring(7)}function yl(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 wK(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var SK=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,a=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=Rq(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=bK()),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 f;this.resolvePathCache=eg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=dK(NK(this.latestLocation)),Bq(this));let o=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=iI(c);p&&p!=="/"&&f.push(Wq({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Yq(f),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&this.__store.setState(f=>({...f,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=Oq(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&jq(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:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:c+k+f,publicHref:p,pathname:Md(c).path,external:!1,searchStr:k,search:Vo(n?.search,j),hash:Md(f.slice(1)).path,state:al(n?.state,m)}}const y=new URL(p,this.origin),v=kS(this.rewrite,y),x=this.options.parseSearch(v.search),w=this.options.stringifySearch(x);return v.search=w,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Md(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:w,search:Vo(n?.search,x),hash:Md(v.hash.slice(1)).path,state:al(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=r(a);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)=>zq({base:t,to:Sj(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=>kK({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 a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(c,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,Qs(i.params,p)),v=this.getMatchedRoutes(m);let x=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(x=[...x,this.options.notFoundRoute]),Object.keys(y).length>0)for(const I of x){const F=I.options.params?.stringify??I.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const w=t.leaveParams?m:Md(SE({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const I={};x.forEach(F=>{if(F.options.validateSearch)try{Object.assign(I,Dm(F.options.validateSearch,{...I,...j}))}catch{}}),j=I}j=CK({search:j,dest:i,destRoutes:x,_includeValidateSearch:t._includeValidateSearch}),j=Vo(f,j);const k=this.options.stringifySearch(j),A=i.hash===!0?a.hash:i.hash?Qs(i.hash,a.hash):void 0,_=A?`#${A}`:"";let C=i.state===!0?a.state:i.state?Qs(i.state,a.state):{};C=al(a.state,C);const P=`${w}${k}${_}`;let T,O,z=!1;if(this.rewrite){const I=new URL(P,this.origin),F=aI(this.rewrite,I);T=I.href.replace(I.origin,""),F.origin!==this.origin?(O=F.href,z=!0):O=F.pathname+F.search+F.hash}else T=xq(P),O=T;return{publicHref:O,href:T,pathname:w,search:j,searchStr:k,state:C,hash:A??"",external:z,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=Nq(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,Qs(m,d));a={from:t.from,...y,params:v},c=n(a)}}}return c&&(o.maskedLocation=c),o};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(f=>{r.state[f]=this.latestLocation.state[f]});const d=pl(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=ro(this.latestLocation.href)===ro(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=cu(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.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:a,href:o,...c}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=ig(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);c.to=kS(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const c=!o&&i?i:r;if(Jm(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,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 a=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...yl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...yl({resolvedLocation:f,location:d})}),await AE({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];df(()=>{this.__store.setState(x=>{const w=x.matches,j=x.pendingMatches||x.matches;return p=w.filter(k=>!j.some(A=>A.id===k.id)),m=w.filter(k=>!j.some(A=>A.routeId===k.routeId)),y=j.filter(k=>!w.some(A=>A.routeId===k.routeId)),v=j.filter(k=>w.some(A=>A.routeId===k.routeId)),{...x,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([x,w])=>{x.forEach(j=>{this.looseRoutesById[j.routeId].options[w]?.(j)})})})})}})}catch(d){_r(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):fr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.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 o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(c=>c.status==="error")&&(o=500),o!==void 0&&this.__store.setState(c=>({...c,statusCode:o}))},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,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(yl({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}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:wK(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},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&&Jm(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=jf,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(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);df(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,o]}))})});try{return r=await AE({router:this,matches:r,location:n,preload:!0,updateMatch:(o,c)=>{i.has(o)?r=r.map(d=>d.id===o?c(d):d):this.updateMatch(o,c)}}),r}catch(o){if(_r(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});fr(o)||console.error(o);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 a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=kq(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!pl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?pl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.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??Gq,parseSearch:e.parseSearch??Hq,protocolAllowlist:e.protocolAllowlist??bq}),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:a}=n;let{matchedRoutes:o}=n,c=!1;(r?r.path!=="/"&&i["**"]:ro(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:c=!0);const d=c?OK(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let x,w,j;{const J=v?.search??e.search,ae=v?._strictSearch??void 0;try{const Q=Dm(y.options.validateSearch,{...J})??void 0;x={...J,...Q},w={...ae,...Q},j=void 0}catch(Q){let K=Q;if(Q instanceof ag||(K=new ag(Q.message,{cause:Q})),t?.throwOnError)throw K;x=J,w={},j=K}}const k=y.options.loaderDeps?.({search:x})??"",A=k?JSON.stringify(k):"",{interpolatedPath:_,usedParams:C}=SE({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=y.id+_+A,T=this.getMatch(P),O=p.get(y.id),z=T?._strictParams??C;let I;if(!T)try{RE(y,C,a,z)}catch(J){if(fr(J)||_r(J)?I=J:I=new jK(J.message,{cause:J}),t?.throwOnError)throw I}Object.assign(i,z);const F=O?"stay":"enter";let $;if(T)$={...T,cause:F,params:O?.params??i,_strictParams:z,search:Vo(O?O.search:T.search,x),_strictSearch:w};else{const J=y.options.loader||y.options.beforeLoad||y.lazyFn||pI(y)?"pending":"success";$={id:P,ssr:y.options.ssr,index:m,routeId:y.id,params:O?.params??i,_strictParams:z,pathname:_,updatedAt:Date.now(),search:O?Vo(O.search,x):x,_strictSearch:w,searchError:void 0,status:J,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:cu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:O?al(O.loaderDeps,k):k,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||($.globalNotFound=d===y.id),$.searchError=j;const L=this.getParentContext(v);$.context={...L,...$.__routeContext,...$.__beforeLoadContext},f[m]=$}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],x=this.getMatch(y.id),w=p.get(y.routeId);if(y.params=w?Vo(w.params,i):i,!x){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=wf(t),a={...e.search};for(const f of t)try{Object.assign(a,Dm(f.options.validateSearch,a))}catch{}const o=wf(this.state.matches),c=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{RE(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ag=class extends Error{},jK=class extends Error{};function NK(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Dm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ag("Async validation not supported");if(n.issues)throw new ag(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 kK({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=ro(e);let a,o;const c=Cq(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),o=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function CK({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return _K(n)(e,t,r??!1)}function _K(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 a=({search:o,next:c})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));const f=c(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:o,next:c})=>{const d=c(o);if(!t._includeValidateSearch)return d;try{return{...d,...Dm(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:Qs(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const c=o[i];return c({search:a,next:f=>r(i+1,f,o)})};return function(a,o,c){return t.dest=o,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function OK(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 ml}function RE(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var AK="Error preloading route! ☝️",mI=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=ml:this.parentRoute||co(!1);let i=r?ml:n?.path;i&&i!=="/"&&(i=rI(i));const a=n?.id||i;let o=r?ml:zm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=zm(["/",o]));const c=o==="__root__"?"/":zm([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=c,this._to=ro(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=>jj({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.")}},EK=class extends mI{constructor(e){super(e)}};function _j(e){const t=e.errorComponent??Oj;return u.jsx(TK,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?S.createElement(t,{error:n,reset:r}):e.children})}var TK=class extends S.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 Oj({error:e}){const[t,n]=S.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 PK({children:e,fallback:t=null}){return gI()?u.jsx(Bi.Fragment,{children:e}):u.jsx(Bi.Fragment,{children:t})}function gI(){return Bi.useSyncExternalStore(zK,()=>!0,()=>!1)}function zK(){return()=>{}}var yI=S.createContext(null);function Ci(e){const t=S.useContext(yI);return e?.warn,t}var ax={exports:{}},sx={},ox={exports:{}},lx={};var ME;function RK(){if(ME)return lx;ME=1;var e=Nu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function c(m,y){var v=y(),x=r({inst:{value:v,getSnapshot:y}}),w=x[0].inst,j=x[1];return a(function(){w.value=v,w.getSnapshot=y,d(w)&&j({inst:w})},[m,v,y]),i(function(){return d(w)&&j({inst:w}),m(function(){d(w)&&j({inst:w})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return lx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,lx}var DE;function MK(){return DE||(DE=1,ox.exports=RK()),ox.exports}var IE;function DK(){if(IE)return sx;IE=1;var e=Nu(),t=MK();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return sx.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var x=a(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function k(T){if(!A){if(A=!0,_=T,T=y(T),v!==void 0&&w.hasValue){var O=w.value;if(v(O,T))return C=O}return C=T}if(O=C,r(_,T))return O;var z=y(T);return v!==void 0&&v(O,z)?(_=T,O):(_=T,C=z)}var A=!1,_,C,P=m===void 0?null:m;return[function(){return k(p())},P===null?void 0:function(){return k(P())}]},[p,m,y,v]);var j=i(f,x[0],x[1]);return o(function(){w.hasValue=!0,w.value=j},[j]),d(j),j},sx}var LE;function IK(){return LE||(LE=1,ax.exports=DK()),ax.exports}var vI=IK();function LK(e,t){return e===t}function $K(e,t,n=LK){const r=S.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(o);return c},[e]),i=S.useCallback(()=>e?.get(),[e]);return vI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Tr(e){const t=Ci({warn:e?.router===void 0}),n=e?.router||t,r=S.useRef(void 0);return $K(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=al(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var wy=S.createContext(void 0),UK=S.createContext(void 0);function go(e){const t=S.useContext(e.from?UK:wy);return Tr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(co(!((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 Aj(e){return go({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ej(e){const{select:t,...n}=e;return go({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Sy(e){return go({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 jy(e){return go({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function yo(e){const t=Ci();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Tj(e){return go({...e,select:t=>e.select?e.select(t.context):t.context})}var Dl=LD();const BK=wa(Dl);function FK(e,t){const n=Ci(),r=hq(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:x,children:w,target:j,disabled:k,style:A,className:_,onClick:C,onBlur:P,onFocus:T,onMouseEnter:O,onMouseLeave:z,onTouchStart:I,ignoreBlocker:F,params:$,search:L,hash:J,state:ae,mask:Q,reloadDocument:K,unsafeRelative:X,from:ye,_fromLocation:Se,...R}=e,B=gI(),U=Tr({select:_e=>{const te=_e.matches[_e.matches.length-1];return{search:te?.search,hash:_e.location.hash,path:te?.pathname}},structuralSharing:!0}),M=e.from,V=S.useMemo(()=>({...e,from:M}),[n,U,M,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=S.useMemo(()=>n.buildLocation({...V}),[n,V]),ie=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,he=se.maskedLocation?se.maskedLocation.external:se.external,je=S.useMemo(()=>ZK(ie,he,n.history,k),[k,he,ie,n.history]),ee=S.useMemo(()=>{if(je?.external)return Jm(je.href,n.protocolAllowlist)?void 0:je.href;if(!YK(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Jm(c,n.protocolAllowlist)?void 0:c}catch{}},[c,je,n.protocolAllowlist]),de=Tr({select:_e=>{if(ee)return!1;if(o?.exact){if(!Pq(_e.location.pathname,se.pathname,n.basepath))return!1}else{const te=tg(_e.location.pathname,n.basepath),xe=tg(se.pathname,n.basepath);if(!(te.startsWith(xe)&&(te.length===xe.length||te[xe.length]==="/")))return!1}return(o?.includeSearch??!0)&&!pl(_e.location.search,se.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?B&&_e.location.hash===se.hash:!0}}),Ce=de?Qs(i,{})??qK:cx,Y=de?cx:Qs(a,{})??cx,Ke=[_,Ce.className,Y.className].filter(Boolean).join(" "),Me=(A||Ce.style||Y.style)&&{...A,...Ce.style,...Y.style},[rt,it]=S.useState(!1),Nt=S.useRef(!1),Lt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,bn=f??n.options.defaultPreloadDelay??0,ve=S.useCallback(()=>{n.preloadRoute({...V,_builtLocation:se}).catch(_e=>{console.warn(_e),console.warn(AK)})},[n,V,se]);fq(r,S.useCallback(_e=>{_e?.isIntersecting&&ve()},[ve]),VK,{disabled:!!k||Lt!=="viewport"}),S.useEffect(()=>{Nt.current||!k&&Lt==="render"&&(ve(),Nt.current=!0)},[k,ve,Lt]);const Ve=_e=>{const te=_e.currentTarget.getAttribute("target"),xe=j!==void 0?j:te;if(!k&&!WK(_e)&&!_e.defaultPrevented&&(!xe||xe==="_self")&&_e.button===0){_e.preventDefault(),Dl.flushSync(()=>{it(!0)});const Ae=n.subscribe("onResolved",()=>{Ae(),it(!1)});n.navigate({...V,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:x,ignoreBlocker:F})}};if(ee)return{...R,ref:r,href:ee,...w&&{children:w},...j&&{target:j},...k&&{disabled:k},...A&&{style:A},..._&&{className:_},...C&&{onClick:C},...P&&{onBlur:P},...T&&{onFocus:T},...O&&{onMouseEnter:O},...z&&{onMouseLeave:z},...I&&{onTouchStart:I}};const be=_e=>{if(k||Lt!=="intent")return;if(!bn){ve();return}const te=_e.currentTarget;if(Ld.has(te))return;const xe=setTimeout(()=>{Ld.delete(te),ve()},bn);Ld.set(te,xe)},ze=_e=>{k||Lt!=="intent"||ve()},Re=_e=>{if(k||!Lt||!bn)return;const te=_e.currentTarget,xe=Ld.get(te);xe&&(clearTimeout(xe),Ld.delete(te))};return{...R,...Ce,...Y,href:je?.href,ref:r,onClick:_c([C,Ve]),onBlur:_c([P,Re]),onFocus:_c([T,be]),onMouseEnter:_c([O,be]),onMouseLeave:_c([z,Re]),onTouchStart:_c([I,ze]),disabled:!!k,target:j,...Me&&{style:Me},...Ke&&{className:Ke},...k&&KK,...de&&HK,...B&&rt&&GK}}var cx={},qK={className:"active"},KK={role:"link","aria-disabled":!0},HK={"data-status":"active","aria-current":"page"},GK={"data-transitioning":"transitioning"},Ld=new WeakMap,VK={rootMargin:"100px"},_c=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ZK(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function YK(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Wt=S.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=FK(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return S.createElement("a",d,o)}return S.createElement(n,a,o)});function WK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var QK=class extends mI{constructor(e){super(e),this.useMatch=t=>go({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ej({...t,from:this.id}),this.useLoaderData=t=>Aj({...t,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=Bi.forwardRef((t,n)=>u.jsx(Wt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function _i(e){return new QK(e)}function XK(){return e=>eH(e)}var JK=class extends EK{constructor(e){super(e),this.useMatch=t=>go({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ej({...t,from:this.id}),this.useLoaderData=t=>Aj({...t,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=Bi.forwardRef((t,n)=>u.jsx(Wt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function eH(e){return new JK(e)}function $E(e){return typeof e=="object"?new UE(e,{silent:!0}).createRoute(e):new UE(e,{silent:!0}).createRoute}var UE=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=_i(n);return r.isRoot=!1,r},this.silent=t?.silent}},BE=class{constructor(e){this.useMatch=t=>go({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.options.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Ej({...t,from:this.options.id}),this.useLoaderData=t=>Aj({...t,from:this.options.id}),this.useNavigate=()=>yo({from:Ci().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function FE(e){return typeof e=="object"?new BE(e):t=>new BE({id:e,...t})}function tH(e){const t=Tr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(_j,{getResetKey:()=>t,onCatch:(n,r)=>{if(fr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(fr(n))return e.fallback?.(n);throw n},children:e.children})}function nH(){return u.jsx("p",{children:"Not Found"})}function Fc(e){return u.jsx(u.Fragment,{children:e.children})}function bI(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(nH,{})}function rH(){return Ci().isScrollRestoring,null}var xI=S.memo(function({matchId:t}){const n=Ci(),r=Tr({select:x=>{const w=x.matches.findIndex(k=>k.id===t),j=x.matches[w];return co(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:x.loadedAt,parentRouteId:x.matches[w-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?u.jsx(a,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?S.Suspense:Fc,y=c?_j:Fc,v=f?tH:Fc;return u.jsxs(i.isRoot?i.options.shellComponent??Fc:Fc,{children:[u.jsx(wy.Provider,{value:t,children:u.jsx(m,{fallback:o,children:u.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||Oj,onCatch:(x,w)=>{if(fr(x))throw x;d?.(x,w)},children:u.jsx(v,{fallback:x=>{if(!f||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!i.isRoot)throw x;return S.createElement(f,x)},children:p||r._displayPending?u.jsx(PK,{fallback:o,children:u.jsx(qE,{matchId:t})}):u.jsx(qE,{matchId:t})})})})}),r.parentRouteId===ml&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(iH,{}),u.jsx(rH,{})]}):null]})});function iH(){const e=Ci(),t=S.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",...yl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var qE=S.memo(function({matchId:t}){const n=Ci(),{match:r,key:i,routeId:a}=Tr({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],c=S.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(Pj,{})},[i,o.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 d=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=cu();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return co(fr(r.error)),bI(n,o,r.error);if(r.status==="redirected")throw co(_r(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),Pj=S.memo(function(){const t=Ci(),n=S.useContext(wy),r=Tr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Tr({select:f=>{const p=f.matches.find(m=>m.id===n);return co(p),p.globalNotFound}}),o=Tr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(a)return bI(t,i,void 0);if(!o)return null;const d=u.jsx(xI,{matchId:o});return r===ml?u.jsx(S.Suspense,{fallback:c,children:d}):d});function aH(){const e=Ci(),t=S.useRef({router:e,mounted:!1}),[n,r]=S.useState(!1),{hasPendingMatches:i,isLoading:a}=Tr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=Jb(a),c=a||n||i,d=Jb(c),f=a||i,p=Jb(f);return e.startTransition=m=>{r(!0),S.startTransition(()=>{m(),r(!1)})},S.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ro(e.latestLocation.publicHref)!==ro(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Gp(()=>{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]),Gp(()=>{o&&!a&&e.emit({type:"onLoad",...yl(e.state)})},[o,e,a]),Gp(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...yl(e.state)})},[f,p,e]),Gp(()=>{if(d&&!c){const m=yl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&Fq(e)}},[c,d,e]),null}function sH(){const e=Ci(),t=e.routesById[ml].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?Fc:S.Suspense,{fallback:n,children:[u.jsx(aH,{}),u.jsx(oH,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function oH(){const e=Ci(),t=Tr({select:i=>i.matches[0]?.id}),n=Tr({select:i=>i.loadedAt}),r=t?u.jsx(xI,{matchId:t}):null;return u.jsx(wy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(_j,{getResetKey:()=>n,errorComponent:Oj,onCatch:void 0,children:r})})}var lH=e=>new cH(e),cH=class extends SK{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=$E,globalThis.createLazyFileRoute=FE):typeof window<"u"&&(window.createFileRoute=$E,window.createLazyFileRoute=FE);function uH({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(yI.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function dH({router:e,...t}){return u.jsx(uH,{router:e,...t,children:u.jsx(sH,{})})}function wI(e){return Tr({select:t=>t.location})}class is extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function fH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const hH=fH();function pH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function mH(e){return`${pH()}${e}`}function gH(e,t){if(t===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function yH(){return""}function KE(){return!!yH()}async function Ee(e,t){const n=await fetch(`${hH}${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}`,a;if(r)try{const o=JSON.parse(r);typeof o.error=="string"?i=o.error:o.error?.message?(i=o.error.message,a=o.error.code):o.message&&(i=o.message)}catch{i=r}throw new is(i,n.status,a)}if(n.status!==204)return n.json()}function zj(){return Ee("/projects")}function SI(e){return Ee(`/projects/${encodeURIComponent(e)}`)}function jI(){return Ee("/runs")}function uu(e){return Ee(`/runs/${encodeURIComponent(e)}`)}function vH(e){return Ee(`/projects/${encodeURIComponent(e)}/keywords`)}function NI(e){return Ee(`/projects/${encodeURIComponent(e)}/competitors`)}function kI(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ee(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function Ny(e,t){return Ee(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function bH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function xH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function CI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function HE(e,t){const n=await SI(e);return Ny(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 wH(e,t){const n=await SI(e);return Ny(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 SH(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Ee(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function jH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function NH(e,t){await Ee(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function kH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function CH(e){await Ee(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function _H(e){return Ee(`/projects/${encodeURIComponent(e)}/export`)}function Rj(){return Ee("/settings")}function OH(){return Ee("/session")}function AH(e){return Ee("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function EH(e){return Ee("/session",{method:"POST",body:JSON.stringify({password:e})})}function TH(e,t){return Ee(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function PH(e){return Ee("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function zH(e){try{return await Ee(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof is&&t.statusCode===404)return null;throw t}}function GE(e,t){return Ee(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function RH(e){await Ee(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function MH(e){return Ee(`/projects/${encodeURIComponent(e)}/notifications`)}function DH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function IH(e,t){await Ee(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function LH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function $H(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function UH(e){return Ee("/apply",{method:"POST",body:JSON.stringify(e)})}function BH(e){return Ee("/runs",{method:"POST",body:JSON.stringify(e??{})})}function _I(e){return Ee(`/projects/${encodeURIComponent(e)}/google/connections`)}function FH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function qH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function KH(e){return Ee(`/projects/${encodeURIComponent(e)}/google/properties`)}function HH(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function GH(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function OI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function VH(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),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 Ee(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function ZH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function YH(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 Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function WH(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Mj(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function QH(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function XH(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function JH(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function e7(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function VE(){return Ee("/cdp/status")}function t7(e,t){return Ee("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function ZE(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function AI(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/status`)}function n7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function r7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function i7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/sites`)}function a7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Dj(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function EI(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function TI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function YE(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function s7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/performance`)}function o7(e){return Ee("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function l7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function c7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function u7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function WE(e){return Ee(`/projects/${encodeURIComponent(e)}/ga/status`)}function QE(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function PI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function d7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function XE(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function JE(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function eT(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function f7(e){return Ee(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function h7(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Ee(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function p7(e,t){const n=mH(e);try{const r=await fetch(n,{credentials:"same-origin"});if(!r.ok)return{label:t,state:"error",detail:`${t} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:gH(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,lastHeartbeatAt:c}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}const m7=6e3,g7=5,y7=180;let nr=[],v7=0;const AS=new Set,ES=new Map,TS=new Map;function sg(){const e=[...nr];for(const t of AS)t(e)}function Ij(e){const t=ES.get(e);t&&(clearTimeout(t),ES.delete(e));const n=TS.get(e);n&&(clearTimeout(n),TS.delete(e))}function zI(e){Ij(e);const t=nr.length;nr=nr.filter(n=>n.id!==e),nr.length!==t&&sg()}function tT(e){Ij(e.id),ES.set(e.id,setTimeout(()=>{PS(e.id)},e.durationMs))}function b7(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function ft(e,t="negative",n=m7){const r=b7(e,t,n),i={id:String(++v7),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 a=nr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return nr=nr.map(c=>c.id===a.id?o:c),sg(),tT(o),a.id}}return nr.length>=g7&&zI(nr[0].id),nr=[...nr,i],sg(),tT(i),i.id}function PS(e){const t=nr.find(n=>n.id===e);!t||t.state==="closing"||(Ij(e),nr=nr.map(n=>n.id===e?{...n,state:"closing"}:n),sg(),TS.set(e,setTimeout(()=>{zI(e)},y7)))}function x7(e){return AS.add(e),()=>{AS.delete(e)}}function nT(){return nr}function w7(){return new aq({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new GD({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||ft({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const S7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j7=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),rT=e=>{const t=j7(e);return t.charAt(0).toUpperCase()+t.slice(1)},RI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),N7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var k7={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 C7=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...c},d)=>S.createElement("svg",{ref:d,...k7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:RI("lucide",i),...!a&&!N7(c)&&{"aria-hidden":"true"},...c},[...o.map(([f,p])=>S.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Kt=(e,t)=>{const n=S.forwardRef(({className:r,...i},a)=>S.createElement(C7,{ref:a,iconNode:t,className:RI(`lucide-${S7(rT(e))}`,`lucide-${e}`,r),...i}));return n.displayName=rT(e),n};const _7=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],O7=Kt("arrow-up",_7);const A7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],MI=Kt("check",A7);const E7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T7=Kt("chevron-down",E7);const P7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yf=Kt("chevron-right",P7);const z7=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],R7=Kt("copy",z7);const M7=[["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"}]],D7=Kt("download",M7);const I7=[["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"}]],L7=Kt("github",I7);const $7=[["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"}]],U7=Kt("globe",$7);const B7=[["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"}]],F7=Kt("layout-dashboard",B7);const q7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K7=Kt("loader-circle",q7);const H7=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],G7=Kt("maximize-2",H7);const V7=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Z7=Kt("menu",V7);const Y7=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],W7=Kt("minimize-2",Y7);const Q7=[["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"}]],X7=Kt("play",Q7);const J7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],iT=Kt("plus",J7);const eG=[["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"}]],aT=Kt("refresh-cw",eG);const tG=[["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"}]],nG=Kt("rocket",tG);const rG=[["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"}]],DI=Kt("rotate-ccw",rG);const iG=[["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"}]],aG=Kt("settings",iG);const sG=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],sT=Kt("sparkles",sG);const oG=[["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"}]],lG=Kt("trash-2",oG);const cG=[["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"}]],II=Kt("triangle-alert",cG);const uG=[["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"}]],dG=Kt("unplug",uG);const fG=[["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"}]],hG=Kt("upload",fG);const pG=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],mG=Kt("wrench",pG);const gG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wf=Kt("x",gG);var Js=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Js||{});const yG={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Yp={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function vG(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const a=r.slice(0,i).trim(),o=r.slice(i);try{const c=JSON.parse(o);return`${n} ${a}
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 ky(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ui(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function oT(e){return e===null?"Unknown":e?"Pass":"Fail"}function zS(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function bG(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function xG(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 ux(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 o=i[1]?parseInt(i[1]):6;return`Every day at ${zS(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${zS(c)} · ${r}`}return`${e} · ${r}`}function og(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function LI(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 wG(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 SG(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function jG(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function uo(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
13
- `):void 0}function NG(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:og(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:og(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>jG(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function kG(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 CG(e,t,n){const r=kG(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(c=>c.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"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}const $I="canonry.run-tracker",RS=new Set;let lT=!1,_G=0,Cy={runs:{},batches:{}};function OG(){const e=Nl();for(const t of RS)t(e)}function AG(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function EG(){typeof window>"u"||window.sessionStorage.setItem($I,JSON.stringify(Cy))}function UI(){lT||(lT=!0,!(typeof window>"u")&&(Cy=AG(window.sessionStorage.getItem($I))))}function _y(e){Cy=e,EG(),OG()}function Nl(){return UI(),Cy}function TG(e){return UI(),RS.add(e),()=>{RS.delete(e)}}function BI(e){const t=Nl();_y({...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 cT(e){const t=Nl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;_y({...t,runs:r})}function PG(e){const t=Nl(),n=`batch_${Date.now()}_${++_G}`;return _y({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function zG(e){const t=Nl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;_y({...t,batches:r})}function RG(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function MG(e,t){let n=0,r=0,i=0,a=0,o=0;for(const c of e){const d=t[c]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function uT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lj(...e){return t=>{let n=!1;const r=e.map(i=>{const a=uT(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():uT(e[i],null)}}}}function Il(...e){return S.useCallback(Lj(...e),e)}var DG=Symbol.for("react.lazy"),lg=yy[" use ".trim().toString()];function IG(e){return typeof e=="object"&&e!==null&&"then"in e}function FI(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===DG&&"_payload"in e&&IG(e._payload)}function LG(e){const t=UG(e),n=S.forwardRef((r,i)=>{let{children:a,...o}=r;FI(a)&&typeof lg=="function"&&(a=lg(a._payload));const c=S.Children.toArray(a),d=c.find(FG);if(d){const f=d.props.children,p=c.map(m=>m===d?S.Children.count(f)>1?S.Children.only(null):S.isValidElement(f)?f.props.children:null:m);return u.jsx(t,{...o,ref:i,children:S.isValidElement(f)?S.cloneElement(f,void 0,p):null})}return u.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var $G=LG("Slot");function UG(e){const t=S.forwardRef((n,r)=>{let{children:i,...a}=n;if(FI(i)&&typeof lg=="function"&&(i=lg(i._payload)),S.isValidElement(i)){const o=KG(i),c=qG(a,i.props);return i.type!==S.Fragment&&(c.ref=r?Lj(r,o):o),S.cloneElement(i,c)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BG=Symbol("radix.slottable");function FG(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BG}function qG(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function KG(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 qI(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=qI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qI(e))&&(r&&(r+=" "),r+=t);return r}const dT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fT=Ct,KI=(e,t)=>n=>{var r;if(t?.variants==null)return fT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=dT(p)||dT(m);return i[f][y]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(x=>{let[w,j]=x;return Array.isArray(j)?j.includes({...a,...c}[w]):{...a,...c}[w]===j})?[...f,m,y]:f},[]);return fT(e,o,d,n?.class,n?.className)},HG=(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},GG=(e,t)=>({classGroupId:e,validator:t}),HI=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cg="-",hT=[],VG="arbitrary..",ZG=e=>{const t=WG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return YG(o);const c=o.split(cg),d=c[0]===""&&c.length>1?1:0;return GI(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],f=n[o];return d?f?HG(f,d):d:f||hT}return n[o]||hT}}},GI=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=GI(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const c=t===0?e.join(cg):e.slice(t).join(cg),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(c))return p.classGroupId}},YG=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?VG+r:void 0})(),WG=e=>{const{theme:t,classGroups:n}=e;return QG(n,t)},QG=(e,t)=>{const n=HI();for(const r in e){const i=e[r];$j(i,n,r,t)}return n},$j=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];XG(o,t,n,r)}},XG=(e,t,n,r)=>{if(typeof e=="string"){JG(e,t,n);return}if(typeof e=="function"){eV(e,t,n,r);return}tV(e,t,n,r)},JG=(e,t,n)=>{const r=e===""?t:VI(t,e);r.classGroupId=n},eV=(e,t,n,r)=>{if(nV(e)){$j(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(GG(n,e))},tV=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[c,d]=i[o];$j(d,VI(t,c),n,r)}},VI=(e,t)=>{let n=e;const r=t.split(cg),i=r.length;for(let a=0;a<i;a++){const o=r[a];let c=n.nextPart.get(o);c||(c=HI(),n.nextPart.set(o,c)),n=c}return n},nV=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,rV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},MS="!",pT=":",iV=[],mT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),aV=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,c=0,d=0,f;const p=i.length;for(let w=0;w<p;w++){const j=i[w];if(o===0&&c===0){if(j===pT){a.push(i.slice(d,w)),d=w+1;continue}if(j==="/"){f=w;continue}}j==="["?o++:j==="]"?o--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(MS)?(y=m.slice(0,-1),v=!0):m.startsWith(MS)&&(y=m.slice(1),v=!0);const x=f&&f>d?f-d:void 0;return mT(a,v,y,x)};if(t){const i=t+pT,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):mT(iV,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},sV=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},oV=e=>({cache:rV(e.cacheSize),parseClassName:aV(e),sortModifiers:sV(e),...ZG(e)}),lV=/\s+/,cV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],c=e.trim().split(lV);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!w,k=r(j?x.substring(0,w):x);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(x),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const A=y.length===0?"":y.length===1?y[0]:a(y).join(":"),_=v?A+MS:A,C=_+k;if(o.indexOf(C)>-1)continue;o.push(C);const P=i(k,j);for(let T=0;T<P.length;++T){const O=P[T];o.push(_+O)}d=p+(d.length>0?" "+d:d)}return d},uV=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=ZI(n))&&(i&&(i+=" "),i+=r);return i},ZI=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ZI(e[r]))&&(n&&(n+=" "),n+=t);return n},dV=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=oV(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=cV(d,n);return i(d,p),p};return a=o,(...d)=>a(uV(...d))},fV=[],An=e=>{const t=n=>n[e]||fV;return t.isThemeGetter=!0,t},YI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,WI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hV=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mV=/\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$/,gV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Us=e=>hV.test(e),lt=e=>!!e&&!Number.isNaN(Number(e)),Bs=e=>!!e&&Number.isInteger(Number(e)),dx=e=>e.endsWith("%")&&lt(e.slice(0,-1)),Va=e=>pV.test(e),QI=()=>!0,bV=e=>mV.test(e)&&!gV.test(e),Uj=()=>!1,xV=e=>yV.test(e),wV=e=>vV.test(e),SV=e=>!Le(e)&&!$e(e),jV=e=>vo(e,eL,Uj),Le=e=>YI.test(e),Yo=e=>vo(e,tL,bV),gT=e=>vo(e,TV,lt),NV=e=>vo(e,rL,QI),kV=e=>vo(e,nL,Uj),yT=e=>vo(e,XI,Uj),CV=e=>vo(e,JI,wV),Wp=e=>vo(e,iL,xV),$e=e=>WI.test(e),$d=e=>Ll(e,tL),_V=e=>Ll(e,nL),vT=e=>Ll(e,XI),OV=e=>Ll(e,eL),AV=e=>Ll(e,JI),Qp=e=>Ll(e,iL,!0),EV=e=>Ll(e,rL,!0),vo=(e,t,n)=>{const r=YI.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ll=(e,t,n=!1)=>{const r=WI.exec(e);return r?r[1]?t(r[1]):n:!1},XI=e=>e==="position"||e==="percentage",JI=e=>e==="image"||e==="url",eL=e=>e==="length"||e==="size"||e==="bg-size",tL=e=>e==="length",TV=e=>e==="number",nL=e=>e==="family-name",rL=e=>e==="number"||e==="weight",iL=e=>e==="shadow",PV=()=>{const e=An("color"),t=An("font"),n=An("text"),r=An("font-weight"),i=An("tracking"),a=An("leading"),o=An("breakpoint"),c=An("container"),d=An("spacing"),f=An("radius"),p=An("shadow"),m=An("inset-shadow"),y=An("text-shadow"),v=An("drop-shadow"),x=An("blur"),w=An("perspective"),j=An("aspect"),k=An("ease"),A=An("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...C(),$e,Le],T=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],z=()=>[$e,Le,d],I=()=>[Us,"full","auto",...z()],F=()=>[Bs,"none","subgrid",$e,Le],$=()=>["auto",{span:["full",Bs,$e,Le]},Bs,$e,Le],L=()=>[Bs,"auto",$e,Le],J=()=>["auto","min","max","fr",$e,Le],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...z()],X=()=>[Us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],ye=()=>[Us,"screen","full","dvw","lvw","svw","min","max","fit",...z()],Se=()=>[Us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],R=()=>[e,$e,Le],B=()=>[...C(),vT,yT,{position:[$e,Le]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",OV,jV,{size:[$e,Le]}],V=()=>[dx,$d,Yo],se=()=>["","none","full",f,$e,Le],ie=()=>["",lt,$d,Yo],he=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[lt,dx,vT,yT],de=()=>["","none",x,$e,Le],Ce=()=>["none",lt,$e,Le],Y=()=>["none",lt,$e,Le],Ke=()=>[lt,$e,Le],Me=()=>[Us,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Va],breakpoint:[Va],color:[QI],container:[Va],"drop-shadow":[Va],ease:["in","out","in-out"],font:[SV],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Va],shadow:[Va],spacing:["px",lt],text:[Va],"text-shadow":[Va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Us,Le,$e,j]}],container:["container"],columns:[{columns:[lt,Le,$e,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:P()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",$e,Le]}],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:[lt,Us,"auto","initial","none",Le]}],grow:[{grow:["",lt,$e,Le]}],shrink:[{shrink:["",lt,$e,Le]}],order:[{order:[Bs,"first","last","none",$e,Le]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],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:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ye()]}],"min-inline-size":[{"min-inline":["auto",...ye()]}],"max-inline-size":[{"max-inline":["none",...ye()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[c,"screen",...X()]}],"min-w":[{"min-w":[c,"screen","none",...X()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,$d,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,EV,NV]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dx,Le]}],"font-family":[{font:[_V,kV,t]}],"font-features":[{"font-features":[Le]}],"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,$e,Le]}],"line-clamp":[{"line-clamp":[lt,"none",$e,gT]}],leading:[{leading:[a,...z()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",$e,Yo]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[lt,"auto",$e,Le]}],"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",$e,Le]}],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",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,$e,Le],radial:["",$e,Le],conic:[Bs,$e,Le]},AV,CV]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"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:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,$e,Le]}],"outline-w":[{outline:["",lt,$d,Yo]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,Qp,Wp]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",m,Qp,Wp]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[lt,Yo]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,Qp,Wp]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[lt,$e,Le]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"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":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:de()}],brightness:[{brightness:[lt,$e,Le]}],contrast:[{contrast:[lt,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Qp,Wp]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",lt,$e,Le]}],"hue-rotate":[{"hue-rotate":[lt,$e,Le]}],invert:[{invert:["",lt,$e,Le]}],saturate:[{saturate:[lt,$e,Le]}],sepia:[{sepia:["",lt,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[lt,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[lt,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",lt,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[lt,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[lt,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,$e,Le]}],"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",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",$e,Le]}],ease:[{ease:["linear","initial",k,$e,Le]}],delay:[{delay:[lt,$e,Le]}],animate:[{animate:["none",A,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,$e,Le]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Le]}],"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",$e,Le]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[lt,$d,Yo,gT]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zV=dV(PV);function Oi(...e){return zV(Ct(e))}const RV=KI("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"}}),we=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?$G:"button";return u.jsx(o,{ref:a,className:Oi(RV({variant:t,size:n,className:e})),...i})});we.displayName="Button";const MV=KI("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 aL({className:e,variant:t,...n}){return u.jsx("div",{className:Oi(MV({variant:t}),e),...n})}function bT({compact:e=!1}){return u.jsxs(Wt,{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 Nf({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 Et({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(aL,{variant:r,...n,children:t})}function Oy({status:e}){return u.jsx(Et,{tone:LI(e),children:ky(e)})}function ao(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function DV(e,t){const n=S.createContext(t),r=a=>{const{children:o,...c}=a,d=S.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=S.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function IV(e,t=[]){let n=[];function r(a,o){const c=S.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...x}=m,w=y?.[e]?.[d]||c,j=S.useMemo(()=>x,Object.values(x));return u.jsx(w.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||c,x=S.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>S.createContext(o));return function(c){const d=c?.[e]||a;return S.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,LV(i,...t)]}function LV(...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(a){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var kf=globalThis?.document?S.useLayoutEffect:()=>{},$V=yy[" useId ".trim().toString()]||(()=>{}),UV=0;function fx(e){const[t,n]=S.useState($V());return kf(()=>{n(r=>r??String(UV++))},[e]),e||(t?`radix-${t}`:"")}var BV=yy[" useInsertionEffect ".trim().toString()]||kf;function FV({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=qV({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=S.useRef(e!==void 0);S.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"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.`),p.current=c},[c,r])}const f=S.useCallback(p=>{if(c){const m=KV(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[c,e,a,o]);return[d,f]}function qV({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),i=S.useRef(n),a=S.useRef(t);return BV(()=>{a.current=t},[t]),S.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function KV(e){return typeof e=="function"}function sL(e){const t=HV(e),n=S.forwardRef((r,i)=>{const{children:a,...o}=r,c=S.Children.toArray(a),d=c.find(VV);if(d){const f=d.props.children,p=c.map(m=>m===d?S.Children.count(f)>1?S.Children.only(null):S.isValidElement(f)?f.props.children:null:m);return u.jsx(t,{...o,ref:i,children:S.isValidElement(f)?S.cloneElement(f,void 0,p):null})}return u.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function HV(e){const t=S.forwardRef((n,r)=>{const{children:i,...a}=n;if(S.isValidElement(i)){const o=YV(i),c=ZV(a,i.props);return i.type!==S.Fragment&&(c.ref=r?Lj(r,o):o),S.cloneElement(i,c)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GV=Symbol("radix.slottable");function VV(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GV}function ZV(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function YV(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 WV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cs=WV.reduce((e,t)=>{const n=sL(`Primitive.${t}`),r=S.forwardRef((i,a)=>{const{asChild:o,...c}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function QV(e,t){e&&Dl.flushSync(()=>e.dispatchEvent(t))}function Cf(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}function XV(e,t=globalThis?.document){const n=Cf(e);S.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 JV="DismissableLayer",DS="dismissableLayer.update",eZ="dismissableLayer.pointerDownOutside",tZ="dismissableLayer.focusOutside",xT,oL=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lL=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...d}=e,f=S.useContext(oL),[p,m]=S.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=S.useState({}),x=Il(t,O=>m(O)),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(j),A=p?w.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=A>=k,P=iZ(O=>{const z=O.target,I=[...f.branches].some(F=>F.contains(z));!C||I||(i?.(O),o?.(O),O.defaultPrevented||c?.())},y),T=aZ(O=>{const z=O.target;[...f.branches].some(F=>F.contains(z))||(a?.(O),o?.(O),O.defaultPrevented||c?.())},y);return XV(O=>{A===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},y),S.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(xT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),wT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=xT)}},[p,y,n,f]),S.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),wT())},[p,f]),S.useEffect(()=>{const O=()=>v({});return document.addEventListener(DS,O),()=>document.removeEventListener(DS,O)},[]),u.jsx(cs.div,{...d,ref:x,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ao(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ao(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ao(e.onPointerDownCapture,P.onPointerDownCapture)})});lL.displayName=JV;var nZ="DismissableLayerBranch",rZ=S.forwardRef((e,t)=>{const n=S.useContext(oL),r=S.useRef(null),i=Il(t,r);return S.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),u.jsx(cs.div,{...e,ref:i})});rZ.displayName=nZ;function iZ(e,t=globalThis?.document){const n=Cf(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){cL(eZ,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aZ(e,t=globalThis?.document){const n=Cf(e),r=S.useRef(!1);return S.useEffect(()=>{const i=a=>{a.target&&!r.current&&cL(tZ,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wT(){const e=new CustomEvent(DS);document.dispatchEvent(e)}function cL(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?QV(i,a):i.dispatchEvent(a)}var hx="focusScope.autoFocusOnMount",px="focusScope.autoFocusOnUnmount",ST={bubbles:!1,cancelable:!0},sZ="FocusScope",uL=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,d]=S.useState(null),f=Cf(i),p=Cf(a),m=S.useRef(null),y=Il(t,w=>d(w)),v=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let w=function(_){if(v.paused||!c)return;const C=_.target;c.contains(C)?m.current=C:Hs(m.current,{select:!0})},j=function(_){if(v.paused||!c)return;const C=_.relatedTarget;C!==null&&(c.contains(C)||Hs(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const P of _)P.removedNodes.length>0&&Hs(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",j);const A=new MutationObserver(k);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",j),A.disconnect()}}},[r,c,v.paused]),S.useEffect(()=>{if(c){NT.add(v);const w=document.activeElement;if(!c.contains(w)){const k=new CustomEvent(hx,ST);c.addEventListener(hx,f),c.dispatchEvent(k),k.defaultPrevented||(oZ(fZ(dL(c)),{select:!0}),document.activeElement===w&&Hs(c))}return()=>{c.removeEventListener(hx,f),setTimeout(()=>{const k=new CustomEvent(px,ST);c.addEventListener(px,p),c.dispatchEvent(k),k.defaultPrevented||Hs(w??document.body,{select:!0}),c.removeEventListener(px,p),NT.remove(v)},0)}}},[c,f,p,v]);const x=S.useCallback(w=>{if(!n&&!r||v.paused)return;const j=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(j&&k){const A=w.currentTarget,[_,C]=lZ(A);_&&C?!w.shiftKey&&k===C?(w.preventDefault(),n&&Hs(_,{select:!0})):w.shiftKey&&k===_&&(w.preventDefault(),n&&Hs(C,{select:!0})):k===A&&w.preventDefault()}},[n,r,v.paused]);return u.jsx(cs.div,{tabIndex:-1,...o,ref:y,onKeyDown:x})});uL.displayName=sZ;function oZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Hs(r,{select:t}),document.activeElement!==n)return}function lZ(e){const t=dL(e),n=jT(t,e),r=jT(t.reverse(),e);return[n,r]}function dL(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 jT(e,t){for(const n of e)if(!cZ(n,{upTo:t}))return n}function cZ(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 uZ(e){return e instanceof HTMLInputElement&&"select"in e}function Hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uZ(e)&&t&&e.select()}}var NT=dZ();function dZ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kT(e,t),e.unshift(t)},remove(t){e=kT(e,t),e[0]?.resume()}}}function kT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fZ(e){return e.filter(t=>t.tagName!=="A")}var hZ="Portal",fL=S.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=S.useState(!1);kf(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?BK.createPortal(u.jsx(cs.div,{...r,ref:t}),o):null});fL.displayName=hZ;function pZ(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var Ay=e=>{const{present:t,children:n}=e,r=mZ(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),a=Il(r.ref,gZ(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:a}):null};Ay.displayName="Presence";function mZ(e){const[t,n]=S.useState(),r=S.useRef(null),i=S.useRef(e),a=S.useRef("none"),o=e?"mounted":"unmounted",[c,d]=pZ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const f=Xp(r.current);a.current=c==="mounted"?f:"none"},[c]),kf(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=Xp(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),kf(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const w=Xp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=Xp(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:S.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Xp(e){return e?.animationName||"none"}function gZ(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 mx=0;function yZ(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??CT()),document.body.insertAdjacentElement("beforeend",e[1]??CT()),mx++,()=>{mx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mx--}},[])}function CT(){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 ca=function(){return ca=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ca.apply(this,arguments)};function hL(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 vZ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Im="right-scroll-bar-position",Lm="width-before-scroll-bar",bZ="with-scroll-bars-hidden",xZ="--removed-body-scroll-bar-size";function gx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wZ(e,t){var n=S.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 SZ=typeof window<"u"?S.useLayoutEffect:S.useEffect,_T=new WeakMap;function jZ(e,t){var n=wZ(null,function(r){return e.forEach(function(i){return gx(i,r)})});return SZ(function(){var r=_T.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(c){a.has(c)||gx(c,null)}),a.forEach(function(c){i.has(c)||gx(c,o)})}_T.set(n,e)},[e]),n}function NZ(e){return e}function kZ(e,t){t===void 0&&(t=NZ);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(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function CZ(e){e===void 0&&(e={});var t=kZ(null);return t.options=ca({async:!0,ssr:!1},e),t}var pL=function(e){var t=e.sideCar,n=hL(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 S.createElement(r,ca({},n))};pL.isSideCarExport=!0;function _Z(e,t){return e.useMedium(t),pL}var mL=CZ(),yx=function(){},Ey=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:yx,onWheelCapture:yx,onTouchMoveCapture:yx}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,j=e.allowPinchZoom,k=e.as,A=k===void 0?"div":k,_=e.gapMode,C=hL(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=y,T=jZ([n,t]),O=ca(ca({},C),i);return S.createElement(S.Fragment,null,p&&S.createElement(P,{sideCar:mL,removeScrollBar:f,shards:m,noRelative:v,noIsolation:x,inert:w,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?S.cloneElement(S.Children.only(c),ca(ca({},O),{ref:T})):S.createElement(A,ca({},O,{className:d,ref:T}),c))});Ey.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ey.classNames={fullWidth:Lm,zeroRight:Im};var OZ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AZ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=OZ();return t&&e.setAttribute("nonce",t),e}function EZ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TZ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PZ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AZ())&&(EZ(t,n),TZ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zZ=function(){var e=PZ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},gL=function(){var e=zZ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},RZ={left:0,top:0,right:0,gap:0},vx=function(e){return parseInt(e||"",10)||0},MZ=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[vx(n),vx(r),vx(i)]},DZ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RZ;var t=MZ(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])}},IZ=gL(),eu="data-scroll-locked",LZ=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
14
- .`.concat(bZ,` {
15
- overflow: hidden `).concat(r,`;
16
- padding-right: `).concat(c,"px ").concat(r,`;
17
- }
18
- body[`).concat(eu,`] {
19
- overflow: hidden `).concat(r,`;
20
- overscroll-behavior: contain;
21
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
22
- padding-left: `.concat(i,`px;
23
- padding-top: `).concat(a,`px;
24
- padding-right: `).concat(o,`px;
25
- margin-left:0;
26
- margin-top:0;
27
- margin-right: `).concat(c,"px ").concat(r,`;
28
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
29
- }
30
-
31
- .`).concat(Im,` {
32
- right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(Lm,` {
36
- margin-right: `).concat(c,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(Im," .").concat(Im,` {
40
- right: 0 `).concat(r,`;
41
- }
42
-
43
- .`).concat(Lm," .").concat(Lm,` {
44
- margin-right: 0 `).concat(r,`;
45
- }
46
-
47
- body[`).concat(eu,`] {
48
- `).concat(xZ,": ").concat(c,`px;
49
- }
50
- `)},OT=function(){var e=parseInt(document.body.getAttribute(eu)||"0",10);return isFinite(e)?e:0},$Z=function(){S.useEffect(function(){return document.body.setAttribute(eu,(OT()+1).toString()),function(){var e=OT()-1;e<=0?document.body.removeAttribute(eu):document.body.setAttribute(eu,e.toString())}},[])},UZ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;$Z();var a=S.useMemo(function(){return DZ(i)},[i]);return S.createElement(IZ,{styles:LZ(a,!t,i,n?"":"!important")})},IS=!1;if(typeof window<"u")try{var Jp=Object.defineProperty({},"passive",{get:function(){return IS=!0,!0}});window.addEventListener("test",Jp,Jp),window.removeEventListener("test",Jp,Jp)}catch{IS=!1}var Oc=IS?{passive:!1}:!1,BZ=function(e){return e.tagName==="TEXTAREA"},yL=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BZ(e)&&n[t]==="visible")},FZ=function(e){return yL(e,"overflowY")},qZ=function(e){return yL(e,"overflowX")},AT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=vL(e,r);if(i){var a=bL(e,r),o=a[1],c=a[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},KZ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},HZ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},vL=function(e,t){return e==="v"?FZ(t):qZ(t)},bL=function(e,t){return e==="v"?KZ(t):HZ(t)},GZ=function(e,t){return e==="h"&&t==="rtl"?-1:1},VZ=function(e,t,n,r,i){var a=GZ(e,window.getComputedStyle(t).direction),o=a*r,c=n.target,d=t.contains(c),f=!1,p=o>0,m=0,y=0;do{if(!c)break;var v=bL(e,c),x=v[0],w=v[1],j=v[2],k=w-j-a*x;(x||k)&&vL(e,c)&&(m+=k,y+=x);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},em=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ET=function(e){return[e.deltaX,e.deltaY]},TT=function(e){return e&&"current"in e?e.current:e},ZZ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YZ=function(e){return`
51
- .block-interactivity-`.concat(e,` {pointer-events: none;}
52
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
53
- `)},WZ=0,Ac=[];function QZ(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(WZ++)[0],a=S.useState(gL)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=vZ([e.lockRef.current],(e.shards||[]).map(TT),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=S.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var k=em(w),A=n.current,_="deltaX"in w?w.deltaX:A[0]-k[0],C="deltaY"in w?w.deltaY:A[1]-k[1],P,T=w.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in w&&O==="h"&&T.type==="range")return!1;var z=window.getSelection(),I=z&&z.anchorNode,F=I?I===T||I.contains(T):!1;if(F)return!1;var $=AT(O,T);if(!$)return!0;if($?P=O:(P=O==="v"?"h":"v",$=AT(O,T)),!$)return!1;if(!r.current&&"changedTouches"in w&&(_||C)&&(r.current=P),!P)return!0;var L=r.current||P;return VZ(L,j,w,L==="h"?_:C)},[]),d=S.useCallback(function(w){var j=w;if(!(!Ac.length||Ac[Ac.length-1]!==a)){var k="deltaY"in j?ET(j):em(j),A=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&ZZ(P.delta,k)})[0];if(A&&A.should){j.cancelable&&j.preventDefault();return}if(!A){var _=(o.current.shards||[]).map(TT).filter(Boolean).filter(function(P){return P.contains(j.target)}),C=_.length>0?c(j,_[0]):!o.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=S.useCallback(function(w,j,k,A){var _={name:w,delta:j,target:k,should:A,shadowParent:XZ(k)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=S.useCallback(function(w){n.current=em(w),r.current=void 0},[]),m=S.useCallback(function(w){f(w.type,ET(w),w.target,c(w,e.lockRef.current))},[]),y=S.useCallback(function(w){f(w.type,em(w),w.target,c(w,e.lockRef.current))},[]);S.useEffect(function(){return Ac.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Oc),document.addEventListener("touchmove",d,Oc),document.addEventListener("touchstart",p,Oc),function(){Ac=Ac.filter(function(w){return w!==a}),document.removeEventListener("wheel",d,Oc),document.removeEventListener("touchmove",d,Oc),document.removeEventListener("touchstart",p,Oc)}},[]);var v=e.removeScrollBar,x=e.inert;return S.createElement(S.Fragment,null,x?S.createElement(a,{styles:YZ(i)}):null,v?S.createElement(UZ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function XZ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JZ=_Z(mL,QZ);var xL=S.forwardRef(function(e,t){return S.createElement(Ey,ca({},e,{ref:t,sideCar:JZ}))});xL.classNames=Ey.classNames;var eY=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ec=new WeakMap,tm=new WeakMap,nm={},bx=0,wL=function(e){return e&&(e.host||wL(e.parentNode))},tY=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wL(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})},nY=function(e,t,n,r){var i=tY(t,Array.isArray(e)?e:[e]);nm[n]||(nm[n]=new WeakMap);var a=nm[n],o=[],c=new Set,d=new Set(i),f=function(m){!m||c.has(m)||(c.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(c.has(y))p(y);else try{var v=y.getAttribute(r),x=v!==null&&v!=="false",w=(Ec.get(y)||0)+1,j=(a.get(y)||0)+1;Ec.set(y,w),a.set(y,j),o.push(y),w===1&&x&&tm.set(y,!0),j===1&&y.setAttribute(n,"true"),x||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),c.clear(),bx++,function(){o.forEach(function(m){var y=Ec.get(m)-1,v=a.get(m)-1;Ec.set(m,y),a.set(m,v),y||(tm.has(m)||m.removeAttribute(r),tm.delete(m)),v||m.removeAttribute(n)}),bx--,bx||(Ec=new WeakMap,Ec=new WeakMap,tm=new WeakMap,nm={})}},rY=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=eY(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),nY(r,i,n,"aria-hidden")):function(){return null}},Ty="Dialog",[SL]=IV(Ty),[iY,Yi]=SL(Ty),jL=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=S.useRef(null),d=S.useRef(null),[f,p]=FV({prop:r,defaultProp:i??!1,onChange:a,caller:Ty});return u.jsx(iY,{scope:t,triggerRef:c,contentRef:d,contentId:fx(),titleId:fx(),descriptionId:fx(),open:f,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};jL.displayName=Ty;var NL="DialogTrigger",aY=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(NL,n),a=Il(t,i.triggerRef);return u.jsx(cs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qj(i.open),...r,ref:a,onClick:ao(e.onClick,i.onOpenToggle)})});aY.displayName=NL;var Bj="DialogPortal",[sY,kL]=SL(Bj,{forceMount:void 0}),CL=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Yi(Bj,t);return u.jsx(sY,{scope:t,forceMount:n,children:S.Children.map(r,o=>u.jsx(Ay,{present:n||a.open,children:u.jsx(fL,{asChild:!0,container:i,children:o})}))})};CL.displayName=Bj;var ug="DialogOverlay",_L=S.forwardRef((e,t)=>{const n=kL(ug,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Yi(ug,e.__scopeDialog);return a.modal?u.jsx(Ay,{present:r||a.open,children:u.jsx(lY,{...i,ref:t})}):null});_L.displayName=ug;var oY=sL("DialogOverlay.RemoveScroll"),lY=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(ug,n);return u.jsx(xL,{as:oY,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(cs.div,{"data-state":qj(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),kl="DialogContent",OL=S.forwardRef((e,t)=>{const n=kL(kl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Yi(kl,e.__scopeDialog);return u.jsx(Ay,{present:r||a.open,children:a.modal?u.jsx(cY,{...i,ref:t}):u.jsx(uY,{...i,ref:t})})});OL.displayName=kl;var cY=S.forwardRef((e,t)=>{const n=Yi(kl,e.__scopeDialog),r=S.useRef(null),i=Il(t,n.contentRef,r);return S.useEffect(()=>{const a=r.current;if(a)return rY(a)},[]),u.jsx(AL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ao(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ao(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&a.preventDefault()}),onFocusOutside:ao(e.onFocusOutside,a=>a.preventDefault())})}),uY=S.forwardRef((e,t)=>{const n=Yi(kl,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return u.jsx(AL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),AL=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=Yi(kl,n),d=S.useRef(null),f=Il(t,d);return yZ(),u.jsxs(u.Fragment,{children:[u.jsx(uL,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:u.jsx(lL,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":qj(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(dY,{titleId:c.titleId}),u.jsx(hY,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Fj="DialogTitle",EL=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(Fj,n);return u.jsx(cs.h2,{id:i.titleId,...r,ref:t})});EL.displayName=Fj;var TL="DialogDescription",PL=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(TL,n);return u.jsx(cs.p,{id:i.descriptionId,...r,ref:t})});PL.displayName=TL;var zL="DialogClose",RL=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(zL,n);return u.jsx(cs.button,{type:"button",...r,ref:t,onClick:ao(e.onClick,()=>i.onOpenChange(!1))})});RL.displayName=zL;function qj(e){return e?"open":"closed"}var ML="DialogTitleWarning",[YNe,DL]=DV(ML,{contentName:kl,titleName:Fj,docsSlug:"dialog"}),dY=({titleId:e})=>{const t=DL(ML),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
54
-
55
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
56
-
57
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fY="DialogDescriptionWarning",hY=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DL(fY).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},IL=jL,LL=CL,Kj=_L,Hj=OL,Gj=EL,$L=PL,UL=RL;const pY=IL,mY=LL,BL=S.forwardRef(({className:e,...t},n)=>u.jsx(Kj,{ref:n,className:Oi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));BL.displayName=Kj.displayName;const gY=400,yY=1200,vY=720,FL=S.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=S.useState(vY),o=S.useRef(!1),c=S.useRef(0),d=S.useRef(0),f=S.useCallback(y=>{o.current=!0,c.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=S.useCallback(y=>{if(!o.current)return;const v=c.current-y.clientX,x=Math.min(yY,Math.max(gY,d.current+v));a(x)},[]),m=S.useCallback(()=>{o.current=!1},[]);return u.jsxs(mY,{children:[u.jsx(BL,{}),u.jsxs(Hj,{ref:r,className:Oi("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:f,onPointerMove:p,onPointerUp:m}),t,u.jsxs(UL,{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(Wf,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});FL.displayName=Hj.displayName;const bY=({className:e,...t})=>u.jsx("div",{className:Oi("flex flex-col gap-1.5 pr-10",e),...t}),qL=S.forwardRef(({className:e,...t},n)=>u.jsx(Gj,{ref:n,className:Oi("text-lg font-medium text-zinc-50",e),...t}));qL.displayName=Gj.displayName;const KL=S.forwardRef(({className:e,...t},n)=>u.jsx($L,{ref:n,className:Oi("text-sm text-zinc-500",e),...t}));KL.displayName=$L.displayName;function xY({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(pY,{open:r,onOpenChange:a=>a?void 0:i(),children:u.jsxs(FL,{children:[u.jsxs(bY,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(qL,{id:"drawer-title",children:e}),u.jsx(KL,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function me(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in c||(c[y]=f[y].bind(c))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(c){var d;const f=n?.Parent?new a:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class tu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class HL extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const GL={};function fo(e){return GL}function VL(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 LS(e,t){return typeof t=="bigint"?t.toString():t}function Vj(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Zj(e){return e==null}function Yj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function wY(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 d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}const PT=Symbol("evaluating");function Tt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==PT)return r===void 0&&(r=PT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function $l(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function bo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function zT(e){return JSON.stringify(e)}function SY(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ZL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function dg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const jY=Vj(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function du(e){if(dg(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(dg(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function YL(e){return du(e)?{...e}:Array.isArray(e)?[...e]:e}const NY=new Set(["string","number","symbol"]);function fu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(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 kY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const CY={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 _Y(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 a=bo(e._zod.def,{get shape(){const o={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=n.shape[c])}return $l(this,"shape",o),o},checks:[]});return xo(e,a)}function OY(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 a=bo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return $l(this,"shape",o),o},checks:[]});return xo(e,a)}function AY(e,t){if(!du(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=bo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return $l(this,"shape",a),a}});return xo(e,i)}function EY(e,t){if(!du(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=bo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return $l(this,"shape",r),r}});return xo(e,n)}function TY(e,t){const n=bo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return $l(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return xo(e,n)}function PY(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 o=bo(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(n)for(const f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(const f in c)d[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return $l(this,"shape",d),d},checks:[]});return xo(t,o)}function zY(e,t,n){const r=bo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return $l(this,"shape",a),a}});return xo(t,r)}function Kc(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 Hc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function rm(e){return typeof e=="string"?e:e?.message}function ho(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=rm(e.inst?._zod.def?.error?.(e))??rm(t?.error?.(e))??rm(n.customError?.(e))??rm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Wj(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _f(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const WL=(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,LS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},QL=me("$ZodError",WL),XL=me("$ZodError",WL,{Parent:Error});function RY(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 MY(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(e),n}const Qj=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new tu;if(o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>ho(d,a,fo())));throw ZL(c,i?.callee),c}return o.value},Xj=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>ho(d,a,fo())));throw ZL(c,i?.callee),c}return o.value},Py=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new tu;return a.issues.length?{success:!1,error:new(e??QL)(a.issues.map(o=>ho(o,i,fo())))}:{success:!0,data:a.value}},DY=Py(XL),zy=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>ho(o,i,fo())))}:{success:!0,data:a.value}},IY=zy(XL),LY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qj(e)(t,n,i)},$Y=e=>(t,n,r)=>Qj(e)(t,n,r),UY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xj(e)(t,n,i)},BY=e=>async(t,n,r)=>Xj(e)(t,n,r),FY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Py(e)(t,n,i)},qY=e=>(t,n,r)=>Py(e)(t,n,r),KY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zy(e)(t,n,i)},HY=e=>async(t,n,r)=>zy(e)(t,n,r),GY=/^[cC][^\s-]{8,}$/,VY=/^[0-9a-z]+$/,ZY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,YY=/^[0-9a-vA-V]{20}$/,WY=/^[A-Za-z0-9]{27}$/,QY=/^[a-zA-Z0-9_-]{21}$/,XY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,JY=/^([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})$/,RT=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)$/,eW=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function nW(){return new RegExp(tW,"u")}const rW=/^(?:(?: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])$/,iW=/^(([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}|:))$/,aW=/^((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])$/,sW=/^(([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])$/,oW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JL=/^[A-Za-z0-9_-]*$/,lW=/^\+[1-9]\d{6,14}$/,e5="(?:(?:\\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])))",cW=new RegExp(`^${e5}$`);function t5(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 uW(e){return new RegExp(`^${t5(e)}$`)}function dW(e){const t=t5({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(`^${e5}T(?:${r})$`)}const fW=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},hW=/^-?\d+$/,n5=/^-?\d+(?:\.\d+)?$/,pW=/^(?:true|false)$/i,mW=/^[^A-Z]*$/,gW=/^[^a-z]*$/,Rr=me("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),r5={number:"number",bigint:"bigint",object:"date"},i5=me("$ZodCheckLessThan",(e,t)=>{Rr.init(e,t);const n=r5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(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})}}),a5=me("$ZodCheckGreaterThan",(e,t)=>{Rr.init(e,t);const n=r5[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(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})}}),yW=me("$ZodCheckMultipleOf",(e,t)=>{Rr.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):wY(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})}}),vW=me("$ZodCheckNumberFormat",(e,t)=>{Rr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=CY[t.format];e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=hW)}),e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.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}):o.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&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bW=me("$ZodCheckMaxLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Zj(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 o=Wj(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),xW=me("$ZodCheckMinLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Zj(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 o=Wj(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),wW=me("$ZodCheckLengthEquals",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Zj(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,a=i.length;if(a===t.length)return;const o=Wj(i),c=a>t.length;r.issues.push({origin:o,...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})}}),Ry=me("$ZodCheckStringFormat",(e,t)=>{var n,r;Rr.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.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=()=>{})}),SW=me("$ZodCheckRegex",(e,t)=>{Ry.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})}}),jW=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mW),Ry.init(e,t)}),NW=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gW),Ry.init(e,t)}),kW=me("$ZodCheckIncludes",(e,t)=>{Rr.init(e,t);const n=fu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.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})}}),CW=me("$ZodCheckStartsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`^${fu(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})}}),_W=me("$ZodCheckEndsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`.*${fu(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})}}),OW=me("$ZodCheckOverwrite",(e,t)=>{Rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class AW{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(`
58
- `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
59
- `))}}const EW={major:4,minor:3,patch:6},an=me("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=EW;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,c,d)=>{let f=Kc(o),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new tu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=Kc(o,y)))});else{if(o.issues.length===y)continue;f||(f=Kc(o,y))}}return p?p.then(()=>o):o},a=(o,c,d)=>{if(Kc(o))return o.aborted=!0,o;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new tu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,c)):a(f,o,c)}const d=e._zod.parse(o,c);if(d instanceof Promise){if(c.async===!1)throw new tu;return d.then(f=>i(f,r,c))}return i(d,r,c)}}Tt(e,"~standard",()=>({validate:i=>{try{const a=DY(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return IY(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Jj=me("$ZodString",(e,t)=>{an.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fW(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}}),Jt=me("$ZodStringFormat",(e,t)=>{Ry.init(e,t),Jj.init(e,t)}),TW=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=JY),Jt.init(e,t)}),PW=me("$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=RT(r))}else t.pattern??(t.pattern=RT());Jt.init(e,t)}),zW=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eW),Jt.init(e,t)}),RW=me("$ZodURL",(e,t)=>{Jt.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})}}}),MW=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=nW()),Jt.init(e,t)}),DW=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=QY),Jt.init(e,t)}),IW=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=GY),Jt.init(e,t)}),LW=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=VY),Jt.init(e,t)}),$W=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ZY),Jt.init(e,t)}),UW=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=YY),Jt.init(e,t)}),BW=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=WY),Jt.init(e,t)}),FW=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=dW(t)),Jt.init(e,t)}),qW=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=cW),Jt.init(e,t)}),KW=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=uW(t)),Jt.init(e,t)}),HW=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=XY),Jt.init(e,t)}),GW=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rW),Jt.init(e,t),e._zod.bag.format="ipv4"}),VW=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=iW),Jt.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})}}}),ZW=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=aW),Jt.init(e,t)}),YW=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=sW),Jt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>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 s5(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const WW=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=oW),Jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{s5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function QW(e){if(!JL.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return s5(n)}const XW=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=JL),Jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{QW(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),JW=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=lW),Jt.init(e,t)});function eQ(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 tQ=me("$ZodJWT",(e,t)=>{Jt.init(e,t),e._zod.check=n=>{eQ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),o5=me("$ZodNumber",(e,t)=>{an.init(e,t),e._zod.pattern=e._zod.bag.pattern??n5,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 a=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,...a?{received:a}:{}}),n}}),nQ=me("$ZodNumberFormat",(e,t)=>{vW.init(e,t),o5.init(e,t)}),rQ=me("$ZodBoolean",(e,t)=>{an.init(e,t),e._zod.pattern=pW,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}}),iQ=me("$ZodUnknown",(e,t)=>{an.init(e,t),e._zod.parse=n=>n}),aQ=me("$ZodNever",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function MT(e,t,n){e.issues.length&&t.issues.push(...Hc(n,e.issues)),t.value[n]=e.value}const sQ=me("$ZodArray",(e,t)=>{an.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 a=[];for(let o=0;o<i.length;o++){const c=i[o],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>MT(f,n,o))):MT(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function fg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Hc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function l5(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=kY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function c5(e,t,n,r,i,a){const o=[],c=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(c.has(m))continue;if(f==="never"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>fg(v,n,m,t,p))):fg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const oQ=me("$ZodObject",(e,t)=>{if(an.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Vj(()=>l5(t));Tt(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=dg,a=t.catchall;let o;e._zod.parse=(c,d)=>{o??(o=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],m=o.shape;for(const y of o.keys){const v=m[y],x=v._zod.optout==="optional",w=v._zod.run({value:f[y],issues:[]},d);w instanceof Promise?p.push(w.then(j=>fg(j,c,y,f,x))):fg(w,c,y,f,x)}return a?c5(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),lQ=me("$ZodObjectJIT",(e,t)=>{oQ.init(e,t);const n=e._zod.parse,r=Vj(()=>l5(t)),i=y=>{const v=new AW(["shape","payload","ctx"]),x=r.value,w=_=>{const C=zT(_);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const _ of x.keys)j[_]=`key_${k++}`;v.write("const newResult = {};");for(const _ of x.keys){const C=j[_],P=zT(_),O=y[_]?._zod?.optout==="optional";v.write(`const ${C} = ${w(_)};`),O?v.write(`
60
- if (${C}.issues.length) {
61
- if (${P} in input) {
62
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
63
- ...iss,
64
- path: iss.path ? [${P}, ...iss.path] : [${P}]
65
- })));
66
- }
67
- }
68
-
69
- if (${C}.value === undefined) {
70
- if (${P} in input) {
71
- newResult[${P}] = undefined;
72
- }
73
- } else {
74
- newResult[${P}] = ${C}.value;
75
- }
76
-
77
- `):v.write(`
78
- if (${C}.issues.length) {
79
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
80
- ...iss,
81
- path: iss.path ? [${P}, ...iss.path] : [${P}]
82
- })));
83
- }
84
-
85
- if (${C}.value === undefined) {
86
- if (${P} in input) {
87
- newResult[${P}] = undefined;
88
- }
89
- } else {
90
- newResult[${P}] = ${C}.value;
91
- }
92
-
93
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(_,C)=>A(y,_,C)};let a;const o=dg,c=!GL.jitless,f=c&&jY.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const x=y.value;return o(x)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?c5([],x,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),y)}});function DT(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!Kc(a));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(a=>a.issues.map(o=>ho(o,r,fo())))}),t)}const cQ=me("$ZodUnion",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Tt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Tt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Tt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Yj(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),o=!0;else{if(f.issues.length===0)return f;c.push(f)}}return o?Promise.all(c).then(d=>DT(d,i,e,a)):DT(c,i,e,a)}}),uQ=me("$ZodIntersection",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>IT(n,d,f)):IT(n,a,o)}});function $S(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(du(e)&&du(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=$S(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.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],a=t[r],o=$S(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function IT(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 d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&i&&e.issues.push({...i,keys:a}),Kc(e))return e;const o=$S(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const dQ=me("$ZodRecord",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!du(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const c=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Hc(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Hc(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&n5.test(c)&&d.issues.length){const m=t.keyType._zod.run({value:Number(c),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>ho(m,r,fo())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Hc(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Hc(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),fQ=me("$ZodEnum",(e,t)=>{an.init(e,t);const n=VL(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>NY.has(typeof i)).map(i=>typeof i=="string"?fu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),hQ=me("$ZodLiteral",(e,t)=>{if(an.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"?fu(r):r?fu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),pQ=me("$ZodTransform",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HL(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new tu;return n.value=i,n}});function LT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const u5=me("$ZodOptional",(e,t)=>{an.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Tt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Tt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Yj(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(a=>LT(a,n.value)):LT(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),mQ=me("$ZodExactOptional",(e,t)=>{u5.init(e,t),Tt(e._zod,"values",()=>t.innerType._zod.values),Tt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),gQ=me("$ZodNullable",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.innerType._zod.optin),Tt(e._zod,"optout",()=>t.innerType._zod.optout),Tt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Yj(n.source)}|null)$`):void 0}),Tt(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)}),yQ=me("$ZodDefault",(e,t)=>{an.init(e,t),e._zod.optin="optional",Tt(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(a=>$T(a,t)):$T(i,t)}});function $T(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const vQ=me("$ZodPrefault",(e,t)=>{an.init(e,t),e._zod.optin="optional",Tt(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))}),bQ=me("$ZodNonOptional",(e,t)=>{an.init(e,t),Tt(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(a=>UT(a,e)):UT(i,e)}});function UT(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 xQ=me("$ZodCatch",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.innerType._zod.optin),Tt(e._zod,"optout",()=>t.innerType._zod.optout),Tt(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(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>ho(o,r,fo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ho(a,r,fo()))},input:n.value}),n.issues=[]),n)}}),wQ=me("$ZodPipe",(e,t)=>{an.init(e,t),Tt(e._zod,"values",()=>t.in._zod.values),Tt(e._zod,"optin",()=>t.in._zod.optin),Tt(e._zod,"optout",()=>t.out._zod.optout),Tt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(o=>im(o,t.in,r)):im(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>im(a,t.out,r)):im(i,t.out,r)}});function im(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const SQ=me("$ZodReadonly",(e,t)=>{an.init(e,t),Tt(e._zod,"propValues",()=>t.innerType._zod.propValues),Tt(e._zod,"values",()=>t.innerType._zod.values),Tt(e._zod,"optin",()=>t.innerType?._zod?.optin),Tt(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(BT):BT(i)}});function BT(e){return e.value=Object.freeze(e.value),e}const jQ=me("$ZodCustom",(e,t)=>{Rr.init(e,t),an.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(a=>FT(a,n,r,e));FT(i,n,r,e)}});function FT(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(_f(i))}}var qT;class NQ{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 kQ(){return new NQ}(qT=globalThis).__zod_globalRegistry??(qT.__zod_globalRegistry=kQ());const rf=globalThis.__zod_globalRegistry;function CQ(e,t){return new e({type:"string",...qe(t)})}function _Q(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function KT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function OQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function AQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function EQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function TQ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function PQ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function zQ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function RQ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function MQ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function DQ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function IQ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function LQ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function $Q(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function UQ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function BQ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function FQ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function qQ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function KQ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function HQ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function GQ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function VQ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function ZQ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function YQ(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function WQ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function QQ(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function XQ(e,t){return new e({type:"number",checks:[],...qe(t)})}function JQ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function eX(e,t){return new e({type:"boolean",...qe(t)})}function tX(e){return new e({type:"unknown"})}function nX(e,t){return new e({type:"never",...qe(t)})}function HT(e,t){return new i5({check:"less_than",...qe(t),value:e,inclusive:!1})}function xx(e,t){return new i5({check:"less_than",...qe(t),value:e,inclusive:!0})}function GT(e,t){return new a5({check:"greater_than",...qe(t),value:e,inclusive:!1})}function wx(e,t){return new a5({check:"greater_than",...qe(t),value:e,inclusive:!0})}function VT(e,t){return new yW({check:"multiple_of",...qe(t),value:e})}function d5(e,t){return new bW({check:"max_length",...qe(t),maximum:e})}function hg(e,t){return new xW({check:"min_length",...qe(t),minimum:e})}function f5(e,t){return new wW({check:"length_equals",...qe(t),length:e})}function rX(e,t){return new SW({check:"string_format",format:"regex",...qe(t),pattern:e})}function iX(e){return new jW({check:"string_format",format:"lowercase",...qe(e)})}function aX(e){return new NW({check:"string_format",format:"uppercase",...qe(e)})}function sX(e,t){return new kW({check:"string_format",format:"includes",...qe(t),includes:e})}function oX(e,t){return new CW({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function lX(e,t){return new _W({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function ku(e){return new OW({check:"overwrite",tx:e})}function cX(e){return ku(t=>t.normalize(e))}function uX(){return ku(e=>e.trim())}function dX(){return ku(e=>e.toLowerCase())}function fX(){return ku(e=>e.toUpperCase())}function hX(){return ku(e=>SY(e))}function pX(e,t,n){return new e({type:"array",element:t,...qe(n)})}function mX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function gX(e){const t=yX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(_f(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(_f(i))}},e(n.value,n)));return t}function yX(e,t){const n=new Rr({check:"custom",...qe(t)});return n._zod.check=e,n}function h5(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??rf,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 Cn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),Cn(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&cr(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function p5(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 o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const d=r.get(c);if(d&&d!==o[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,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(x=>x);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${c}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:d,defId:f}=i(o);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
94
-
95
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function m5(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const c=e.seen.get(o);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),o._zod.parent===p)for(const w in d)w==="$ref"||w==="allOf"||w in f||delete d[w];if(v.$ref&&y.def)for(const w in d)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(d[w])===JSON.stringify(y.def[w])&&delete d[w]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:c.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const c=o[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:pg(t,"input",e.processors),output:pg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function cr(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 cr(r.element,n);if(r.type==="set")return cr(r.valueType,n);if(r.type==="lazy")return cr(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 cr(r.innerType,n);if(r.type==="intersection")return cr(r.left,n)||cr(r.right,n);if(r.type==="record"||r.type==="map")return cr(r.keyType,n)||cr(r.valueType,n);if(r.type==="pipe")return cr(r.in,n)||cr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(cr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(cr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(cr(i,n))return!0;return!!(r.rest&&cr(r.rest,n))}return!1}const vX=(e,t={})=>n=>{const r=h5({...n,processors:t});return Cn(e,r),p5(r,e),m5(r,e)},pg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=h5({...i??{},target:a,io:t,processors:n});return Cn(e,o),p5(o,e),m5(o,e)},bX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},xX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),c&&(i.format=bX[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},wX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},SX=(e,t,n,r)=>{n.type="boolean"},jX=(e,t,n,r)=>{n.not={}},NX=(e,t,n,r)=>{},kX=(e,t,n,r)=>{const i=e._zod.def,a=VL(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},CX=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},_X=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},OX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=Cn(a.element,t,{...r,path:[...r.path,"items"]})},EX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=Cn(o[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(o)),d=new Set([...c].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Cn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},TX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((c,d)=>Cn(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},PX=(e,t,n,r)=>{const i=e._zod.def,a=Cn(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Cn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(a)?a.allOf:[a],...c(o)?o.allOf:[o]];n.allOf=d},zX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Cn(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of d)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Cn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Cn(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},RX=(e,t,n,r)=>{const i=e._zod.def,a=Cn(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},MX=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},DX=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},IX=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},LX=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},$X=(e,t,n,r)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Cn(a,t,r);const o=t.seen.get(e);o.ref=a},UX=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},g5=(e,t,n,r)=>{const i=e._zod.def;Cn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},BX=me("ZodISODateTime",(e,t)=>{FW.init(e,t),on.init(e,t)});function FX(e){return ZQ(BX,e)}const qX=me("ZodISODate",(e,t)=>{qW.init(e,t),on.init(e,t)});function KX(e){return YQ(qX,e)}const HX=me("ZodISOTime",(e,t)=>{KW.init(e,t),on.init(e,t)});function GX(e){return WQ(HX,e)}const VX=me("ZodISODuration",(e,t)=>{HW.init(e,t),on.init(e,t)});function ZX(e){return QQ(VX,e)}const YX=(e,t)=>{QL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>MY(e,n)},flatten:{value:n=>RY(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,LS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,LS,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ai=me("ZodError",YX,{Parent:Error}),WX=Qj(Ai),QX=Xj(Ai),XX=Py(Ai),JX=zy(Ai),eJ=LY(Ai),tJ=$Y(Ai),nJ=UY(Ai),rJ=BY(Ai),iJ=FY(Ai),aJ=qY(Ai),sJ=KY(Ai),oJ=HY(Ai),sn=me("ZodType",(e,t)=>(an.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:pg(e,"input"),output:pg(e,"output")}}),e.toJSONSchema=vX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(bo(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)=>xo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>WX(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>XX(e,n,r),e.parseAsync=async(n,r)=>QX(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>JX(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>eJ(e,n,r),e.decode=(n,r)=>tJ(e,n,r),e.encodeAsync=async(n,r)=>nJ(e,n,r),e.decodeAsync=async(n,r)=>rJ(e,n,r),e.safeEncode=(n,r)=>iJ(e,n,r),e.safeDecode=(n,r)=>aJ(e,n,r),e.safeEncodeAsync=async(n,r)=>sJ(e,n,r),e.safeDecodeAsync=async(n,r)=>oJ(e,n,r),e.refine=(n,r)=>e.check(tee(n,r)),e.superRefine=n=>e.check(nee(n)),e.overwrite=n=>e.check(ku(n)),e.optional=()=>WT(e),e.exactOptional=()=>FJ(e),e.nullable=()=>QT(e),e.nullish=()=>WT(QT(e)),e.nonoptional=n=>ZJ(e,n),e.array=()=>Pe(e),e.or=n=>RJ([e,n]),e.and=n=>DJ(e,n),e.transform=n=>XT(e,UJ(n)),e.default=n=>HJ(e,n),e.prefault=n=>VJ(e,n),e.catch=n=>WJ(e,n),e.pipe=n=>XT(e,n),e.readonly=()=>JJ(e),e.describe=n=>{const r=e.clone();return rf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return rf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return rf.get(e);const r=e.clone();return rf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),y5=me("_ZodString",(e,t)=>{Jj.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>xX(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(rX(...r)),e.includes=(...r)=>e.check(sX(...r)),e.startsWith=(...r)=>e.check(oX(...r)),e.endsWith=(...r)=>e.check(lX(...r)),e.min=(...r)=>e.check(hg(...r)),e.max=(...r)=>e.check(d5(...r)),e.length=(...r)=>e.check(f5(...r)),e.nonempty=(...r)=>e.check(hg(1,...r)),e.lowercase=r=>e.check(iX(r)),e.uppercase=r=>e.check(aX(r)),e.trim=()=>e.check(uX()),e.normalize=(...r)=>e.check(cX(...r)),e.toLowerCase=()=>e.check(dX()),e.toUpperCase=()=>e.check(fX()),e.slugify=()=>e.check(hX())}),lJ=me("ZodString",(e,t)=>{Jj.init(e,t),y5.init(e,t),e.email=n=>e.check(_Q(cJ,n)),e.url=n=>e.check(PQ(uJ,n)),e.jwt=n=>e.check(VQ(kJ,n)),e.emoji=n=>e.check(zQ(dJ,n)),e.guid=n=>e.check(KT(ZT,n)),e.uuid=n=>e.check(OQ(am,n)),e.uuidv4=n=>e.check(AQ(am,n)),e.uuidv6=n=>e.check(EQ(am,n)),e.uuidv7=n=>e.check(TQ(am,n)),e.nanoid=n=>e.check(RQ(fJ,n)),e.guid=n=>e.check(KT(ZT,n)),e.cuid=n=>e.check(MQ(hJ,n)),e.cuid2=n=>e.check(DQ(pJ,n)),e.ulid=n=>e.check(IQ(mJ,n)),e.base64=n=>e.check(KQ(SJ,n)),e.base64url=n=>e.check(HQ(jJ,n)),e.xid=n=>e.check(LQ(gJ,n)),e.ksuid=n=>e.check($Q(yJ,n)),e.ipv4=n=>e.check(UQ(vJ,n)),e.ipv6=n=>e.check(BQ(bJ,n)),e.cidrv4=n=>e.check(FQ(xJ,n)),e.cidrv6=n=>e.check(qQ(wJ,n)),e.e164=n=>e.check(GQ(NJ,n)),e.datetime=n=>e.check(FX(n)),e.date=n=>e.check(KX(n)),e.time=n=>e.check(GX(n)),e.duration=n=>e.check(ZX(n))});function q(e){return CQ(lJ,e)}const on=me("ZodStringFormat",(e,t)=>{Jt.init(e,t),y5.init(e,t)}),cJ=me("ZodEmail",(e,t)=>{zW.init(e,t),on.init(e,t)}),ZT=me("ZodGUID",(e,t)=>{TW.init(e,t),on.init(e,t)}),am=me("ZodUUID",(e,t)=>{PW.init(e,t),on.init(e,t)}),uJ=me("ZodURL",(e,t)=>{RW.init(e,t),on.init(e,t)}),dJ=me("ZodEmoji",(e,t)=>{MW.init(e,t),on.init(e,t)}),fJ=me("ZodNanoID",(e,t)=>{DW.init(e,t),on.init(e,t)}),hJ=me("ZodCUID",(e,t)=>{IW.init(e,t),on.init(e,t)}),pJ=me("ZodCUID2",(e,t)=>{LW.init(e,t),on.init(e,t)}),mJ=me("ZodULID",(e,t)=>{$W.init(e,t),on.init(e,t)}),gJ=me("ZodXID",(e,t)=>{UW.init(e,t),on.init(e,t)}),yJ=me("ZodKSUID",(e,t)=>{BW.init(e,t),on.init(e,t)}),vJ=me("ZodIPv4",(e,t)=>{GW.init(e,t),on.init(e,t)}),bJ=me("ZodIPv6",(e,t)=>{VW.init(e,t),on.init(e,t)}),xJ=me("ZodCIDRv4",(e,t)=>{ZW.init(e,t),on.init(e,t)}),wJ=me("ZodCIDRv6",(e,t)=>{YW.init(e,t),on.init(e,t)}),SJ=me("ZodBase64",(e,t)=>{WW.init(e,t),on.init(e,t)}),jJ=me("ZodBase64URL",(e,t)=>{XW.init(e,t),on.init(e,t)}),NJ=me("ZodE164",(e,t)=>{JW.init(e,t),on.init(e,t)}),kJ=me("ZodJWT",(e,t)=>{tQ.init(e,t),on.init(e,t)}),v5=me("ZodNumber",(e,t)=>{o5.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>wX(e,r,i),e.gt=(r,i)=>e.check(GT(r,i)),e.gte=(r,i)=>e.check(wx(r,i)),e.min=(r,i)=>e.check(wx(r,i)),e.lt=(r,i)=>e.check(HT(r,i)),e.lte=(r,i)=>e.check(xx(r,i)),e.max=(r,i)=>e.check(xx(r,i)),e.int=r=>e.check(YT(r)),e.safe=r=>e.check(YT(r)),e.positive=r=>e.check(GT(0,r)),e.nonnegative=r=>e.check(wx(0,r)),e.negative=r=>e.check(HT(0,r)),e.nonpositive=r=>e.check(xx(0,r)),e.multipleOf=(r,i)=>e.check(VT(r,i)),e.step=(r,i)=>e.check(VT(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 Te(e){return XQ(v5,e)}const CJ=me("ZodNumberFormat",(e,t)=>{nQ.init(e,t),v5.init(e,t)});function YT(e){return JQ(CJ,e)}const _J=me("ZodBoolean",(e,t)=>{rQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SX(e,n,r)});function rn(e){return eX(_J,e)}const OJ=me("ZodUnknown",(e,t)=>{iQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NX()});function mg(){return tX(OJ)}const AJ=me("ZodNever",(e,t)=>{aQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jX(e,n,r)});function EJ(e){return nX(AJ,e)}const TJ=me("ZodArray",(e,t)=>{sQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(hg(n,r)),e.nonempty=n=>e.check(hg(1,n)),e.max=(n,r)=>e.check(d5(n,r)),e.length=(n,r)=>e.check(f5(n,r)),e.unwrap=()=>e.element});function Pe(e,t){return pX(TJ,e,t)}const PJ=me("ZodObject",(e,t)=>{lQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EX(e,n,r,i),Tt(e,"shape",()=>t.shape),e.keyof=()=>It(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mg()}),e.loose=()=>e.clone({...e._zod.def,catchall:mg()}),e.strict=()=>e.clone({...e._zod.def,catchall:EJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>AY(e,n),e.safeExtend=n=>EY(e,n),e.merge=n=>TY(e,n),e.pick=n=>_Y(e,n),e.omit=n=>OY(e,n),e.partial=(...n)=>PY(b5,e,n[0]),e.required=(...n)=>zY(x5,e,n[0])});function Oe(e,t){const n={type:"object",shape:e??{},...qe(t)};return new PJ(n)}const zJ=me("ZodUnion",(e,t)=>{cQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TX(e,n,r,i),e.options=t.options});function RJ(e,t){return new zJ({type:"union",options:e,...qe(t)})}const MJ=me("ZodIntersection",(e,t)=>{uQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PX(e,n,r,i)});function DJ(e,t){return new MJ({type:"intersection",left:e,right:t})}const IJ=me("ZodRecord",(e,t)=>{dQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Qf(e,t,n){return new IJ({type:"record",keyType:e,valueType:t,...qe(n)})}const US=me("ZodEnum",(e,t)=>{fQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>kX(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 a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new US({...t,checks:[],...qe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new US({...t,checks:[],...qe(i),entries:a})}});function It(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new US({type:"enum",entries:n,...qe(t)})}const LJ=me("ZodLiteral",(e,t)=>{hQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CX(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 Of(e,t){return new LJ({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const $J=me("ZodTransform",(e,t)=>{pQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HL(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(_f(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(_f(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function UJ(e){return new $J({type:"transform",transform:e})}const b5=me("ZodOptional",(e,t)=>{u5.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>g5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function WT(e){return new b5({type:"optional",innerType:e})}const BJ=me("ZodExactOptional",(e,t)=>{mQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>g5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function FJ(e){return new BJ({type:"optional",innerType:e})}const qJ=me("ZodNullable",(e,t)=>{gQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function QT(e){return new qJ({type:"nullable",innerType:e})}const KJ=me("ZodDefault",(e,t)=>{yQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function HJ(e,t){return new KJ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():YL(t)}})}const GJ=me("ZodPrefault",(e,t)=>{vQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function VJ(e,t){return new GJ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():YL(t)}})}const x5=me("ZodNonOptional",(e,t)=>{bQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ZJ(e,t){return new x5({type:"nonoptional",innerType:e,...qe(t)})}const YJ=me("ZodCatch",(e,t)=>{xQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function WJ(e,t){return new YJ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const QJ=me("ZodPipe",(e,t)=>{wQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$X(e,n,r,i),e.in=t.in,e.out=t.out});function XT(e,t){return new QJ({type:"pipe",in:e,out:t})}const XJ=me("ZodReadonly",(e,t)=>{SQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function JJ(e){return new XJ({type:"readonly",innerType:e})}const eee=me("ZodCustom",(e,t)=>{jQ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_X(e,n)});function tee(e,t={}){return mX(eee,e,t)}function nee(e){return gX(e)}Oe({maxConcurrency:Te().int().positive(),maxRequestsPerMinute:Te().int().positive(),maxRequestsPerDay:Te().int().positive()});const Cu=q().min(1);q().min(1);const eN=Oe({label:q().min(1),city:q().min(1),region:q().min(1),country:q().length(2),timezone:q().optional()}),w5=It(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);Oe({id:q(),projectId:q(),channel:Of("webhook"),url:q().url(),urlDisplay:q(),urlHost:q(),events:Pe(w5),enabled:rn().default(!0),source:q().optional(),webhookSecret:q().optional(),createdAt:q(),updatedAt:q()});const S5=It(["cli","api","config-file"]);function ree(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 iee(e,t){return t?e.some(n=>n.label===t):!0}Oe({displayName:q().min(1),canonicalDomain:q().min(1),ownedDomains:Pe(q().min(1)).optional(),country:q().length(2),language:q().min(2),tags:Pe(q()).optional(),labels:Qf(q(),q()).optional(),providers:Pe(Cu).optional(),locations:Pe(eN).optional(),defaultLocation:q().nullable().optional(),configSource:S5.optional()});Oe({id:q(),name:q(),displayName:q().optional(),canonicalDomain:q(),ownedDomains:Pe(q()).default([]),country:q().length(2),language:q().min(2),tags:Pe(q()).default([]),labels:Qf(q(),q()).default({}),locations:Pe(eN).default([]),defaultLocation:q().nullable().optional(),configSource:S5.default("cli"),configRevision:Te().int().positive().default(1),createdAt:q().optional(),updatedAt:q().optional()});function BS(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function aee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=BS(a);n.has(o)||(n.add(o),r.push(a))}return r}const see=Oe({name:q().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:Qf(q(),q()).optional().default({})}),oee=Oe({preset:q().optional(),cron:q().optional(),timezone:q().optional().default("UTC"),providers:Pe(Cu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),lee=Oe({channel:Of("webhook"),url:q().url(),events:Pe(w5).min(1)}),cee=Oe({gsc:Oe({propertyUrl:q()}).optional(),syncSchedule:Oe({preset:q().optional(),cron:q().optional()}).optional()}).optional(),uee=Oe({displayName:q().min(1),canonicalDomain:q().min(1),ownedDomains:Pe(q().min(1)).optional().default([]),country:q().length(2),language:q().min(2),keywords:Pe(q().min(1)).optional().default([]),competitors:Pe(q().min(1)).optional().default([]),providers:Pe(Cu).optional().default([]),locations:Pe(eN).optional().default([]),defaultLocation:q().optional(),schedule:oee,notifications:Pe(lee).optional().default([]),google:cee}).superRefine((e,t)=>{const n=ree(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),iee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Oe({apiVersion:Of("canonry/v1"),kind:Of("Project"),metadata:see,spec:uee});const dee=It(["gsc","ga4"]);Oe({id:q(),domain:q(),connectionType:dee,propertyId:q().nullable().optional(),sitemapUrl:q().nullable().optional(),scopes:Pe(q()).default([]),createdAt:q(),updatedAt:q()});Oe({date:q(),query:q(),page:q(),country:q().nullable().optional(),device:q().nullable().optional(),clicks:Te(),impressions:Te(),ctr:Te(),position:Te()});const FS=Oe({id:q(),url:q(),indexingState:q().nullable().optional(),verdict:q().nullable().optional(),coverageState:q().nullable().optional(),pageFetchState:q().nullable().optional(),robotsTxtState:q().nullable().optional(),crawlTime:q().nullable().optional(),lastCrawlResult:q().nullable().optional(),isMobileFriendly:rn().nullable().optional(),richResults:Pe(q()).default([]),inspectedAt:q()});It(["stable","reindexed","deindexed","still-missing","new"]);const fee=Oe({url:q(),previousState:q().nullable(),currentState:q().nullable(),transitionDate:q()}),hee=Oe({reason:q(),count:Te(),urls:Pe(FS).default([])});Oe({summary:Oe({total:Te(),indexed:Te(),notIndexed:Te(),deindexed:Te(),percentage:Te()}),lastInspectedAt:q().nullable(),indexed:Pe(FS).default([]),notIndexed:Pe(FS).default([]),deindexed:Pe(fee).default([]),reasonGroups:Pe(hee).default([])});Oe({url:q(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:q()});Oe({url:q(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:q(),status:It(["success","error"]),error:q().optional()});Oe({date:q(),indexed:Te(),notIndexed:Te(),reasonBreakdown:Qf(q(),Te()).default({})});Oe({id:q(),domain:q(),siteUrl:q().nullable().optional(),createdAt:q(),updatedAt:q()});const Sx=Oe({id:q(),url:q(),httpCode:Te().nullable().optional(),inIndex:rn().nullable().optional(),lastCrawledDate:q().nullable().optional(),inIndexDate:q().nullable().optional(),inspectedAt:q(),documentSize:Te().nullable().optional(),anchorCount:Te().nullable().optional(),discoveryDate:q().nullable().optional()});Oe({summary:Oe({total:Te(),indexed:Te(),notIndexed:Te(),unknown:Te().optional(),percentage:Te()}),lastInspectedAt:q().nullable(),indexed:Pe(Sx).default([]),notIndexed:Pe(Sx).default([]),unknown:Pe(Sx).default([]).optional()});Oe({query:q(),impressions:Te(),clicks:Te(),ctr:Te(),averagePosition:Te()});Oe({date:q(),indexed:Te(),notIndexed:Te(),unknown:Te()});Oe({url:q(),status:It(["success","error"]),submittedAt:q(),error:q().optional()});const _u=It(["live","staging"]);Oe({projectName:q(),url:q(),stagingUrl:q().optional(),username:q(),defaultEnv:_u,createdAt:q(),updatedAt:q()});const JT=Oe({url:q(),reachable:rn(),pageCount:Te().nullable().optional(),version:q().nullable().optional(),error:q().nullable().optional(),plugins:Pe(q()).optional(),authenticatedUser:Oe({id:Te(),slug:q()}).nullable().optional()});Oe({connected:rn(),projectName:q(),defaultEnv:_u,live:JT.nullable(),staging:JT.nullable(),adminUrl:q().nullable().optional()});const pee=Oe({id:Te(),slug:q(),title:q(),status:q(),modifiedAt:q().nullable().optional(),link:q().nullable().optional()}),j5=Oe({title:q().nullable(),description:q().nullable(),noindex:rn().nullable(),writable:rn().default(!1),writeTargets:Pe(q()).default([])}),mee=Oe({type:q(),json:Qf(q(),mg())}),gee=pee.extend({env:_u,content:q(),seo:j5,schemaBlocks:Pe(mee).default([])}),e2=gee.extend({contentHash:q(),contentSnippet:q()}),N5=Oe({manualRequired:Of(!0),targetUrl:q(),adminUrl:q().nullable().optional(),content:q(),nextSteps:Pe(q()).default([])}),yee=Oe({slug:q(),severity:It(["high","medium","low"]),code:It(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:q()});Oe({slug:q(),title:q(),status:q(),wordCount:Te(),seo:j5,schemaPresent:rn(),issues:Pe(yee).default([])});const vee=Oe({slug:q(),status:It(["applied","skipped","manual"]),error:q().optional(),manualAssist:N5.optional()});Oe({env:_u,strategy:It(["plugin","manual"]),results:Pe(vee)});const bee=Oe({slug:q(),status:It(["deployed","stripped","skipped","failed"]),schemasInjected:Pe(q()).optional(),manualAssist:N5.optional(),error:q().optional()});Oe({env:_u,results:Pe(bee)});const xee=Oe({slug:q(),title:q(),canonrySchemas:Pe(q()),thirdPartySchemas:Pe(q()),hasCanonrySchema:rn()});Oe({env:_u,pages:Pe(xee)});const wee=Oe({name:q(),status:It(["completed","skipped","failed"]),summary:q().optional(),error:q().optional()});Oe({projectName:q(),steps:Pe(wee)});Oe({slug:q(),live:e2,staging:e2,hasDifferences:rn(),differences:Oe({title:rn(),slug:rn(),content:rn(),seoTitle:rn(),seoDescription:rn(),noindex:rn(),schema:rn()})});const k5=It(["queued","running","completed","partial","failed","cancelled"]),fn=k5.enum,C5=It(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect"]),Cr=C5.enum,_5=It(["manual","scheduled","config-apply"]),$m=_5.enum,O5=It(["cited","not-cited"]);O5.enum;const A5=It(["visible","not-visible"]);A5.enum;const E5=It(["new","cited","lost","emerging","not-cited"]);E5.enum;const See=Oe({id:q(),projectId:q(),kind:C5,status:k5,trigger:_5.default("manual"),location:q().nullable().optional(),startedAt:q().nullable().optional(),finishedAt:q().nullable().optional(),error:q().nullable().optional(),createdAt:q()}),T5=Oe({uri:q(),title:q()}),jee=Oe({id:q(),runId:q(),keywordId:q(),keyword:q().optional(),provider:Cu,citationState:O5,answerMentioned:rn().optional(),visibilityState:A5.optional(),transition:E5.optional(),answerText:q().nullable().optional(),citedDomains:Pe(q()).default([]),competitorOverlap:Pe(q()).default([]),recommendedCompetitors:Pe(q()).default([]),matchedTerms:Pe(q()).default([]),groundingSources:Pe(T5).default([]),searchQueries:Pe(q()).default([]),model:q().nullable().optional(),location:q().nullable().optional(),createdAt:q()}),Nee=See.extend({snapshots:Pe(jee).optional()});Oe({totalRuns:Te().int().nonnegative(),run:Nee.nullable()});Oe({id:q(),projectId:q().nullable().optional(),actor:q(),action:q(),entityType:q(),entityId:q().nullable().optional(),diff:mg().optional(),createdAt:q()});const kee=It(["yes","no","unknown","not-mentioned"]);Oe({companyName:q().min(1),domain:q().min(1),phrases:Pe(q().min(1)).optional().default([]),competitors:Pe(q().min(1)).optional().default([])});const Cee=Oe({name:q(),count:Te().int().nonnegative()}),_ee=Oe({id:q(),name:q(),weight:Te(),score:Te(),grade:q(),status:It(["pass","partial","fail"]),findings:Pe(Oe({type:q(),message:q()})).default([]),recommendations:Pe(q()).default([])}),Oee=Oe({url:q(),finalUrl:q(),auditedAt:q(),overallScore:Te(),overallGrade:q(),summary:q(),factors:Pe(_ee).default([])}),Aee=Oe({industry:q(),summary:q(),services:Pe(q()).default([]),categoryTerms:Pe(q()).default([])}),Eee=Oe({provider:q(),displayName:q(),model:q().nullable().optional(),mentioned:rn(),cited:rn(),describedAccurately:kee,accuracyNotes:q().nullable().optional(),incorrectClaims:Pe(q()).default([]),recommendedCompetitors:Pe(q()).default([]),citedDomains:Pe(q()).default([]),groundingSources:Pe(T5).default([]),searchQueries:Pe(q()).default([]),answerText:q(),error:q().nullable().optional()}),Tee=Oe({phrase:q(),providerResults:Pe(Eee).default([])}),Pee=Oe({totalQueries:Te().int().nonnegative(),totalProviders:Te().int().nonnegative(),totalComparisons:Te().int().nonnegative(),mentionCount:Te().int().nonnegative(),citationCount:Te().int().nonnegative(),topCompetitors:Pe(Cee).default([]),visibilityGap:q(),whatThisMeans:Pe(q()).default([]),recommendedActions:Pe(q()).default([])});Oe({companyName:q(),domain:q(),homepageUrl:q(),generatedAt:q(),phrases:Pe(q()).default([]),competitors:Pe(q()).default([]),profile:Aee,audit:Oee,queryResults:Pe(Tee).default([]),summary:Pee});Oe({id:q(),projectId:q(),cronExpr:q(),preset:q().nullable().optional(),timezone:q().default("UTC"),enabled:rn().default(!0),providers:Pe(Cu).default([]),lastRunAt:q().nullable().optional(),nextRunAt:q().nullable().optional(),createdAt:q(),updatedAt:q()});Oe({preset:q().optional(),cron:q().optional(),timezone:q().optional().default("UTC"),enabled:rn().optional().default(!0),providers:Pe(Cu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const zee=It(["answer","citation"]),eo=zee.enum;Oe({id:q(),projectId:q(),propertyId:q(),clientEmail:q(),connected:rn(),createdAt:q(),updatedAt:q()});Oe({date:q(),landingPage:q(),sessions:Te(),organicSessions:Te(),users:Te()});const P5=It(["session","first_user","manual_utm"]),Ree=Oe({source:q(),medium:q(),sessions:Te(),users:Te(),sourceDimension:P5}),Mee=Oe({source:q(),medium:q(),sessions:Te(),users:Te(),channelGroup:q()});Oe({totalSessions:Te(),totalOrganicSessions:Te(),totalUsers:Te(),topPages:Pe(Oe({landingPage:q(),sessions:Te(),organicSessions:Te(),users:Te()})),aiReferrals:Pe(Ree),aiSessionsDeduped:Te(),aiUsersDeduped:Te(),socialReferrals:Pe(Mee),socialSessions:Te(),socialUsers:Te(),organicSharePct:Te(),aiSharePct:Te(),socialSharePct:Te(),lastSyncedAt:q().nullable()});Oe({date:q(),source:q(),medium:q(),sessions:Te(),users:Te(),sourceDimension:P5});Oe({date:q(),source:q(),medium:q(),sessions:Te(),users:Te(),channelGroup:q()});Oe({date:q(),sessions:Te(),organicSessions:Te(),users:Te()});function t2(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const Dee=It(["aero","user","compaction"]);Dee.enum;const z5=128;Oe({key:q().min(1).max(z5),value:q().min(1)});Oe({key:q().min(1).max(z5)});function Yn({text:e}){const[t,n]=S.useState(null),r=S.useRef(null),i=S.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=S.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,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&&Dl.createPortal(u.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}function n2(e,t){const n=Iee(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(f=>f.startsWith("**")&&f.endsWith("**")?{type:"bold",value:f.slice(2,-2)}:{type:"text",value:f}),i=n.flatMap(f=>f.terms).filter(f=>f.trim().length>1);if(i.length===0)return r.map((f,p)=>f.type==="bold"?Bi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=p.toLowerCase();d.has(m)||d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const w=d.get(y.toLowerCase())??"answer-highlight";return f.type==="bold"?Bi.createElement("mark",{key:`hl-${p}-${v}`,className:w},Bi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Bi.createElement("mark",{key:`hl-${p}-${v}`,className:w},y)}return f.type==="bold"?Bi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Iee(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function jx(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 Lee({evidence:e,project:t,onClose:n}){const[r,i]=S.useState(!1),[a,o]=S.useState("mentions"),[c,d]=S.useState(-1),[f,p]=S.useState(null),[m,y]=S.useState(!1),[v,x]=S.useState({}),w=aee(t.project),j=new Set(w.map(BS)),k=e.runHistory,A=k.length>1,[_,C]=S.useState(null),P=S.useRef(!1);S.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const V=k.at(-1);V&&(P.current=!0,uu(V.runId).then(se=>{const ie=se.snapshots.find(he=>he.keyword===e.keyword&&he.provider===e.provider);ie&&C({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:V.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,k]);const T=c>=0&&f!==null,O=T?f:_||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.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=O.visibilityState==="pending"||O.citationState==="pending",I=z?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState==="cited"||O.citationState==="emerging",F=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,$=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,L=t.project.displayName||t.project.name,J=[...w.map(BS),L,L.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(V=>V.trim().length>2),ae=[...O.competitorDomains.flatMap(V=>{const se=V.split(".")[0];return se&&se.length>=4?[se]:[]}),...O.recommendedCompetitors].filter(V=>V.trim().length>2),Q=[{terms:J,className:"answer-highlight-brand"},...ae.length>0?[{terms:ae,className:"answer-highlight-competitor"}]:[]],K=z?"pending":O.visibilityTransition==="lost"?"lost":I?"cited":"not-cited",X=S.useRef(0),ye=S.useCallback(async V=>{const se=++X.current;if(V===-1||V===k.length-1){d(-1),p(null),i(!1);return}d(V),i(!1);const ie=k[V],he=`${ie.runId}::${e.keyword}::${e.provider}`;if(v[he]){p(v[he]);return}y(!0);try{const je=await uu(ie.runId);if(se!==X.current)return;const ee=je.snapshots.find(Ce=>Ce.keyword===e.keyword&&Ce.provider===e.provider)??je.snapshots.find(Ce=>Ce.keyword===e.keyword),de=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ie.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:jx(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:jx(ie.visibilityTransition,ie.visibilityState),summary:"Snapshot data not available for this run."};x(Ce=>({...Ce,[he]:de})),p(de)}catch{if(se!==X.current)return;p({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:jx(ie.visibilityTransition,ie.visibilityState),summary:"Failed to load historical run data."})}finally{se===X.current&&y(!1)}},[k,e.keyword,e.provider,v]),R=(T||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,B=!T&&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(" · "):"",U=I?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:R}:O.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:R}: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:R},M=()=>{if(!O.answerSnippet)return null;const V=O.answerSnippet.split(`
96
- `),se=[];let ie=[],he=0;const je=()=>{if(ie.length===0)return;const ee=ie.join(" ").trim();ee&&se.push(u.jsx("p",{className:se.length>0?"mt-2.5":"",children:n2(ee,Q)},he++)),ie=[]};for(const ee of V){const de=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(de)){je(),se.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},he++));continue}const Ce=de.match(/^(#{1,3})\s+(.+)$/);if(Ce){je();const Y=Ce[1].length,Ke=Ce[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ce[2],Me=Y===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Y===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(u.jsx("p",{className:Me,children:n2(Ke,Q)},he++));continue}if(de===""){je();continue}ie.push(de)}return je(),se};return u.jsx(IL,{open:!0,onOpenChange:V=>{V||n()},children:u.jsxs(LL,{children:[u.jsx(Kj,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(Hj,{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," ","·"," ",O.provider||"All providers"]}),u.jsx(Gj,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(UL,{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(Wf,{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:k.map((V,se)=>{const ie=c===-1&&se===k.length-1||c===se,he=V.visibilityState??(V.answerMentioned?"visible":"not-visible"),je=V.visibilityTransition??he,ee=he==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",Ce=new Date(V.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Y=!!(V.model&&se>0&&k[se-1]?.model&&k[se-1].model!==V.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${ie?"evidence-run-dot--selected":""}`,onClick:()=>ye(se===k.length-1?-1:se),"aria-label":[`Run ${Ce}: ${he}`,V.model?`model ${V.model}`:null,Y?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ie,children:[u.jsx("span",{className:`size-2 rounded-full ${ee} ${Y?"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:Ce})]},se)})}),c>=0&&c<k.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:k[c].visibilityState??(k[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ye(-1),children:["←"," Back to latest"]})]}),!T&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(V=>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:`${V.fromModel??"unknown"} -> ${V.toModel??"unknown"} on ${new Date(V.createdAt).toLocaleDateString()}`},`${V.runId}:${V.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[m&&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","…"]}),!m&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${K}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${K}`,children:U.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${K}`,children:U.title}),u.jsx("p",{className:"evidence-position-meta",children:U.meta}),B&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:B})]}),O.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:M()}),O.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"})]}),!O.answerSnippet&&!m&&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"}),!T&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:I?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((V,se)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${I?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:I?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:V})]},se))})]}),O.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||$)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("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 ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="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(Yn,{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--${I?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:z?"…":I?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:z?"Pending":I?"Visible":"Not visible"})]}),O.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:O.matchedTerms.map(V=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:V},V))})]}),!z&&!I&&O.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:J.map(V=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:V},V))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.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(Yn,{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 V=O.competitorDomains.map(he=>he.replace(/^www\./,"")),se=new Set(V.map(he=>t2(he.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(he=>!se.has(t2(he))),...V].map(he=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:he},he))})()})]})]}),a==="sources"&&u.jsxs(u.Fragment,{children:[O.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(Yn,{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:O.citedDomains.map((V,se)=>{const ie=V.toLowerCase().replace(/^www\./,""),he=j.has(ie),je=!he&&O.competitorDomains.some(de=>de.toLowerCase().replace(/^www\./,"")===ie),ee=he?"you":je?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:V}),he&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},V)})})]}),O.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 (",O.groundingSources.length,")"]}),u.jsx(Yn,{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:O.groundingSources.map((V,se)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:V.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V.title||V.uri})},se))})]}),O.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:O.evidenceUrls.map(V=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V})},V))})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",T?"for this run":"yet"]})]}),!F&&!$&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",T?"for this run":"yet"]})]})]})]})]})]})})}function $i(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 Nx=[{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 My(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 $ee=My({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"}),Uee=My({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"}),Bee=My({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"}),Fee=My({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"}),qee=[{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:$i(["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:$i(["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:$i(["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:$i(["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:$i(["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:$i(["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:$i(["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:$i(["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:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Nx[0],Nx[1],$i(["cited","cited","cited","cited","cited"]),Nx[2],2/7,$i(["not-cited","not-cited","not-cited","cited"]);function Kee(e,t){return e.projects.find(n=>n.project.id===t)}function Hee(e,t){return e.runs.find(n=>n.id===t)}function Gee(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}const Vee={regression:"negative",gain:"positive",opportunity:"caution"},Zee={regression:"lost",gain:"emerging",opportunity:"not-cited"},Yee={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function Wee(e){return{id:e.id,tone:Vee[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??Yee[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:Zee[e.type]}]}}function Qee(e){return e.filter(t=>!t.dismissed).map(Wee)}function R5(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 qS(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Xee(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),a=r%60;return`${i}m ${a}s`}function tN(e){switch(e){case Cr["answer-visibility"]:return"Answer visibility sweep";case Cr["gsc-sync"]:return"GSC sync";case Cr["inspect-sitemap"]:return"Sitemap inspection";case Cr["ga-sync"]:return"GA sync";case Cr["bing-inspect"]:return"Bing URL inspection";case Cr["site-audit"]:return"Site audit"}}function Jee(e){return e===$m.manual?"Manual":e===$m.scheduled?"Scheduled":e===$m["config-apply"]?"Config apply":e}function nN(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:tN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?qS(e.startedAt):qS(e.createdAt),duration:Xee(e.startedAt,e.finishedAt),statusDetail:e.error?M5(e.error):ete(e),summary:tte(e),triggerLabel:Jee(e.trigger)}}function M5(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 ete(e){switch(e.status){case fn.queued:return"Waiting for execution slot.";case fn.running:return"Provider queries in progress.";case fn.completed:return"All key phrases checked.";case fn.partial:return"Run completed with some key phrases skipped.";case fn.failed:return e.error?M5(e.error):"Run failed.";case fn.cancelled:return"Run was cancelled.";default:return""}}function tte(e){const t=tN(e.kind);switch(e.status){case fn.queued:return`${t} queued`;case fn.running:return`${t} in progress`;case fn.completed:return`${t} completed`;case fn.partial:return`${t} partially completed`;case fn.failed:return`${t} failed`;case fn.cancelled:return`${t} cancelled`;default:return e.status}}function D5(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.keyword??a.id;t.has(o)||t.set(o,!1),a.citationState==="cited"&&t.set(o,!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 I5(e){return e>=70?"positive":e>=40?"caution":"negative"}function nte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function rte(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function ite(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 a of e){const o=a.keywordId,c=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState==="cited"&&(c.cited=!0);for(const d of a.competitorOverlap)c.competitorOverlap.add(d);t.set(o,c)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.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:rte(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 ate(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 ste(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function ote(e,t){const n=ate(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:ste(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 L5(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const a of e)a.competitorOverlap.some(o=>n.has(o))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function lte(e,t,n,r){const i=[];let a=0;const o=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 d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.keyword);const v=y.runs.at(-1),x=v?.transition??"not-cited";for(const w of m){const j=c.get(`${y.keyword}::${w}`),k=(y.providerRuns?.[w]?.length??0)>0;if(!j&&!k)continue;const A=j?.model??null,_=A?`${w}:${A}`:null,C=_?y.modelRuns?.[_]:void 0,P=y.providerRuns?.[w],T=(P?.length?P:null)??(C?.length?C:null),O=P?.length?"provider":C?.length?"model":"keyword",z=T?T.at(-1).transition:x,I=T?T.at(-1).visibilityTransition??(T.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=T?.at(-1)?.citationState,$=T?.at(-1)?.visibilityState,L=j?z==="lost"?"lost":z==="emerging"?"emerging":j.citationState==="cited"?"cited":"not-cited":F==="cited"?"cited":"not-cited",J=j?.visibilityState??($==="visible"?"visible":$==="pending"?"pending":"not-visible"),ae=KS(T||y.runs),Q=r2(T||y.runs),K=cte(y,w),X=(T??y.runs).map(B=>({runId:B.runId,citationState:B.citationState,createdAt:B.createdAt,model:K.get(B.runId)??null,answerMentioned:B.answerMentioned,visibilityState:B.visibilityState,visibilityTransition:B.visibilityTransition})),ye=ute(X),Se=O==="provider"&&ye.length<=1?"model":O,R=dte(X);i.push({id:`evidence_${e}_${a++}`,keyword:y.keyword,provider:j?.provider??w,model:j?.model??null,location:j?.location??null,citationState:L,answerMentioned:j?.answerMentioned,visibilityState:J,visibilityChangeLabel:i2(I,Q,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:i2(z,ae),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:fte(J,I,y.keyword),runHistory:X,historyScope:Se,modelsSeen:ye,modelTransitions:R})}}}for(const c of r)o.has(c.keyword)||i.push({id:`evidence_${e}_${a++}`,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 cte(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),c=o==="unknown"?null:o;for(const d of a)n.set(d.runId,c)}return n}function ute(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function dte(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 KS(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 r2(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 i2(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?`${Ud(r.positive)} in latest run`:`${Ud(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Ud(r.first);case"not-cited":case"not-visible":return t<=1?`${Ud(r.negative)} in latest run`:`${Ud(r.negative)} across ${t} runs`;default:return e}}function Ud(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fte(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 a2(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.keyword),r.set(a,o)}return r}const kx=3;function hte(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],c=[],d=new Set;for(const k of t)k.citationState==="lost"&&(d.has(k.keyword)||(d.add(k.keyword),c.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));c.length>0&&o.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 f=a2(r,a),p=a2(i,a);for(const k of a){const A=f.get(k)??new Set,_=p.get(k)??new Set,C=[...A].filter(P=>!_.has(P));C.length>0&&o.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const T=t.find(O=>O.keyword===P);return{keyword:P,evidenceId:T?.id??"",citationState:"cited"}})})}const m=new Map;for(const k of n){const A=k.runs.at(-1);A&&m.set(k.keyword,{transition:A.transition,citationState:A.citationState})}const y=[],v=[],x=new Set;for(const[k,{transition:A,citationState:_}]of m){if(!(A==="emerging"||A==="new"&&_==="cited"))continue;x.add(k);const P=t.find(T=>T.keyword===k&&(T.citationState==="emerging"||T.citationState==="cited"));y.push({keyword:k,evidenceId:P?.id??"",provider:P?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(x.has(k.keyword)||v.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(v.length>0){const k=new Set(v.map(A=>A.keyword)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${x.size} key phrase${x.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const w=new Set(t.map(k=>k.keyword)),j=[];for(const k of n){if(!w.has(k.keyword)||k.runs.length<kx||k.runs.at(-1)?.citationState!=="not-cited")continue;if(KS(k.runs)>=kx){const C=t.find(P=>P.keyword===k.keyword);j.push({keyword:k.keyword,evidenceId:C?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} key phrase${j.length>1?"s":""} uncited for ${kx}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:j});for(const k of a){const A=f.get(k)??new Set,C=[...p.get(k)??new Set].filter(P=>!A.has(P));C.length>0&&o.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const T=t.find(O=>O.keyword===P);return{keyword:P,evidenceId:T?.id??"",citationState:"not-cited"}})})}return o.length===0&&o.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),o}function pte(e,t){const n=e.filter(i=>i.id!=="insight_lost"&&i.id!=="insight_stable"),r=[...t,...n];return r.length===0?[{id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}]:r}function mte(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState==="cited").map(f=>f.keyword)).size;return{gained:d,lost:0,tone:d>0?"positive":"neutral",hasPreviousRun:!1}}const n=d=>{const f=new Set;for(const p of d)p.citationState==="cited"&&p.keyword&&f.add(p.keyword);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const c=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:c,hasPreviousRun:!0}}function gte(e){if(e.length===0)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=e.find(d=>d.kind===Cr["answer-visibility"])??e[0],r=n.status===fn.completed?"Healthy":n.status===fn.running?"Running":n.status===fn.queued?"Queued":n.status===fn.partial?"Partial":"Failed",i=n.status===fn.completed?"positive":n.status===fn.failed?"negative":n.status===fn.partial?"caution":"neutral",a=e.filter(d=>d.kind===Cr["answer-visibility"]).length,o=e.length-a,c=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${tN(n.kind)} — ${n.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function yte(e){const t=R5(e.project),n=lte(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(O=>O.kind===Cr["answer-visibility"]).sort((O,z)=>z.createdAt.localeCompare(O.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=D5(i),o=ite(i),c=ote(e.gscCoverage,e.bingCoverage),d=L5(i,e.competitors.map(O=>O.domain)),f=hte({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(O=>O.domain)}),p=e.dbInsights!=null?Qee(e.dbInsights):null,m=p!=null?pte(f,p):f,y=[...e.runs].sort((O,z)=>z.createdAt.localeCompare(O.createdAt)),v=y.find(O=>O.kind===Cr["answer-visibility"]),x=y.find(O=>O.kind!==Cr["answer-visibility"]);if(v&&x){const O=new Date(x.createdAt).getTime()-new Date(v.createdAt).getTime(),z=1440*60*1e3;O>z&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${qS(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const w=y.map(O=>nN(O,e.project.displayName||e.project.name)),j=new Map;for(const O of i){const z=O.provider||"gemini",I=O.model??null,F=`${z}::${I??"unknown"}`,$=j.get(F)??{provider:z,model:I,cited:0,total:0};$.total++,O.citationState==="cited"&&$.cited++,j.set(F,$)}const k=[...j.values()].sort((O,z)=>O.provider.localeCompare(z.provider)||(O.model??"").localeCompare(z.model??"")).map(({provider:O,model:z,cited:I,total:F})=>({provider:O,model:z,score:F>0?Math.round(I/F*100):0,cited:I,total:F})),A=e.project.providers.filter(O=>!O.startsWith("cdp:")),_=new Set(i.map(O=>O.provider)),C=A.filter(O=>_.has(O)).length,P=i.length>0&&A.length>1&&C<A.length,T=P?`${C} of ${A.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${a.score}`:"No data",delta:i.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?P?"caution":I5(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.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:[],providerCoverage:T},keywordCounts:{cited:a.citedCount,total:a.totalCount},gapKeyPhrases:o,indexCoverage:c,providerScores:k,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:nte(d.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:gte(y),movementSummary:mte(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((O,z)=>{const I=new Set;for(const ae of i)(ae.competitorOverlap.includes(O.domain)||ae.citedDomains.includes(O.domain))&&ae.keyword&&I.add(ae.keyword);const F=[...I],$=new Set(i.map(ae=>ae.keyword).filter(Boolean)),L=$.size>0?F.length/$.size:0,J=L>=.5?"High":L>=.2?"Moderate":F.length>0?"Low":"None";return{id:O.id||`comp_${z}`,domain:O.domain,citationCount:F.length,totalKeywords:$.size,pressureLabel:J,citedKeywords:F,movement:"",notes:""}}),recentRuns:w.slice(0,5)}}function vte(e){const t=R5(e.project),n=e.runs.filter(x=>x.kind===Cr["answer-visibility"]).sort((x,w)=>w.createdAt.localeCompare(x.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=D5(r),a=L5(r,e.competitors.map(x=>x.domain)),o=[...e.runs].sort((x,w)=>w.createdAt.localeCompare(x.createdAt)),c=o.find(x=>x.kind===Cr["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=c?nN(c,d):{id:"none",projectId:e.project.id,projectName:d,kind:Cr["answer-visibility"],kindLabel:"No runs yet",status:fn.queued,trigger:$m.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(x=>!x.startsWith("cdp:")),m=new Set(r.map(x=>x.provider)),y=p.filter(x=>m.has(x)).length,v=r.length>0&&p.length>1&&y<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?v?"caution":I5(i.score):"neutral",providerCoverage:v?`${y} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(x=>x.provider)).size} provider${new Set(r.map(x=>x.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:a.label}}function bte(e,t){const n=[],r=[],i=[];for(const o of e){r.push(yte(o)),i.push(vte(o));const c=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(nN(d,o.project.displayName||o.project.name))}n.sort((o,c)=>c.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?xte(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"}),...a?{}:{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:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.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 xte(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.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(a=>a.status===fn.running||a.status===fn.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 Or={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"],agent:{providers:e=>["agent",e,"providers"]}},$5=S.createContext(null);$5.Provider;function Xf(){return S.useContext($5)}function Ul(e){const n=Xf()?.dashboard??null,r=es({queryKey:Or.projects.all,queryFn:zj,enabled:!n}),i=es({queryKey:Or.runs.all,queryFn:jI,enabled:!n,refetchInterval:x=>x.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),a=es({queryKey:Or.settings,queryFn:()=>Rj().catch(()=>null),enabled:!n}),o=r.data??[],c=i.data??[],d=uq({queries:o.map(x=>{const w=c.filter(k=>k.projectId===x.id),j=w.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,A)=>A.createdAt.localeCompare(k.createdAt));return{queryKey:Or.projects.detail(x.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[A,_,C,P,T,O,z,I]=await Promise.all([vH(x.name).catch(()=>[]),NI(x.name).catch(()=>[]),kI(x.name).catch(()=>[]),k?uu(k).catch(()=>null):Promise.resolve(null),j[1]?uu(j[1].id).catch(()=>null):Promise.resolve(null),Mj(x.name).catch(()=>null),Dj(x.name).catch(()=>null),k?h7(x.name,k).catch(()=>null):Promise.resolve(null)]);return{project:x,runs:w,keywords:A,competitors:_,timeline:C,latestRunDetail:P,previousRunDetail:T,gscCoverage:O,bingCoverage:z,dbInsights:I}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),f=d.every(x=>x.isSuccess),p=S.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const x=d.map(w=>w.data).filter(w=>w!=null);return bte(x,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=S.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function wte(){const e=await p7("/health","API"),t=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:t}}function Dy(e,t){return es({queryKey:Or.health,queryFn:wte,enabled:e,refetchInterval:15e3,initialData:t})}function Ste(e){return es({queryKey:Or.runs.detail(e??""),queryFn:()=>uu(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Ou(){const e=yo(),t=jy({strict:!1}),n=Tr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Hi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Hi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Hi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const jte={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Nte(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function kte(){const e=S.useSyncExternalStore(x7,nT,nT),t=yo(),{openRun:n}=Ou(),r=S.useCallback(a=>{PS(a)},[]),i=S.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),PS(a.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>u.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${jte[a.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:a.title}),a.detail?u.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Nte(a),children:a.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(Wf,{className:"size-3.5"})})]},a.id))})}function Cte(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _te=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ote=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ate={};function s2(e,t){return(Ate.jsx?Ote:_te).test(e)}const Ete=/[ \t\n\f\r]/g;function Tte(e){return typeof e=="object"?e.type==="text"?o2(e.value):!1:o2(e)}function o2(e){return e.replace(Ete,"")===""}let Jf=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Jf.prototype.normal={};Jf.prototype.property={};Jf.prototype.space=void 0;function U5(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jf(n,r,t)}function HS(e){return e.toLowerCase()}class Mr{constructor(t,n){this.attribute=n,this.property=t}}Mr.prototype.attribute="";Mr.prototype.booleanish=!1;Mr.prototype.boolean=!1;Mr.prototype.commaOrSpaceSeparated=!1;Mr.prototype.commaSeparated=!1;Mr.prototype.defined=!1;Mr.prototype.mustUseProperty=!1;Mr.prototype.number=!1;Mr.prototype.overloadedBoolean=!1;Mr.prototype.property="";Mr.prototype.spaceSeparated=!1;Mr.prototype.space=void 0;let Pte=0;const ot=Bl(),kn=Bl(),GS=Bl(),ke=Bl(),Ut=Bl(),nu=Bl(),Hr=Bl();function Bl(){return 2**++Pte}const VS=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:kn,commaOrSpaceSeparated:Hr,commaSeparated:nu,number:ke,overloadedBoolean:GS,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Cx=Object.keys(VS);class rN extends Mr{constructor(t,n,r,i){let a=-1;if(super(t,n),l2(this,"space",i),typeof r=="number")for(;++a<Cx.length;){const o=Cx[a];l2(this,Cx[a],(r&VS[o])===VS[o])}}}rN.prototype.defined=!0;function l2(e,t,n){n&&(e[t]=n)}function Au(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new rN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[HS(r)]=r,n[HS(a.attribute)]=r}return new Jf(t,n,e.space)}const B5=Au({properties:{ariaActiveDescendant:null,ariaAtomic:kn,ariaAutoComplete:null,ariaBusy:kn,ariaChecked:kn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:kn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:kn,ariaFlowTo:Ut,ariaGrabbed:kn,ariaHasPopup:null,ariaHidden:kn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ke,ariaLive:null,ariaModal:kn,ariaMultiLine:kn,ariaMultiSelectable:kn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:kn,ariaReadOnly:kn,ariaRelevant:null,ariaRequired:kn,ariaRoleDescription:Ut,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:kn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function F5(e,t){return t in e?e[t]:t}function q5(e,t){return F5(e,t.toLowerCase())}const zte=Au({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nu,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Ut,autoFocus:ot,autoPlay:ot,blocking:Ut,capture:null,charSet:null,checked:ot,cite:null,className:Ut,cols:ke,colSpan:null,content:null,contentEditable:kn,controls:ot,controlsList:Ut,coords:ke|nu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:GS,draggable:kn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Ut,height:ke,hidden:GS,high:ke,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:ot,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:ke,pattern:null,ping:Ut,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Ut,required:ot,reversed:ot,rows:ke,rowSpan:ke,sandbox:Ut,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:kn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:kn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:kn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:q5}),Rte=Au({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Hr,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:nu,g2:nu,glyphName:nu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Hr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hr,rev:Hr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hr,requiredFeatures:Hr,requiredFonts:Hr,requiredFormats:Hr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Hr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hr,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F5}),K5=Au({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),H5=Au({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q5}),G5=Au({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Mte={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Dte=/[A-Z]/g,c2=/-[a-z]/g,Ite=/^data[-\w.:]+$/i;function Lte(e,t){const n=HS(t);let r=t,i=Mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ite.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(c2,Ute);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!c2.test(a)){let o=a.replace(Dte,$te);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=rN}return new i(r,t)}function $te(e){return"-"+e.toLowerCase()}function Ute(e){return e.charAt(1).toUpperCase()}const Bte=U5([B5,zte,K5,H5,G5],"html"),iN=U5([B5,Rte,K5,H5,G5],"svg");function Fte(e){return e.join(" ").trim()}var Tc={},_x,u2;function qte(){if(u2)return _x;u2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
97
- `,f="/",p="*",m="",y="comment",v="declaration";function x(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var A=1,_=1;function C(ae){var Q=ae.match(t);Q&&(A+=Q.length);var K=ae.lastIndexOf(d);_=~K?ae.length-K:_+ae.length}function P(){var ae={line:A,column:_};return function(Q){return Q.position=new T(ae),I(),Q}}function T(ae){this.start=ae,this.end={line:A,column:_},this.source=k.source}T.prototype.content=j;function O(ae){var Q=new Error(k.source+":"+A+":"+_+": "+ae);if(Q.reason=ae,Q.filename=k.source,Q.line=A,Q.column=_,Q.source=j,!k.silent)throw Q}function z(ae){var Q=ae.exec(j);if(Q){var K=Q[0];return C(K),j=j.slice(K.length),Q}}function I(){z(n)}function F(ae){var Q;for(ae=ae||[];Q=$();)Q!==!1&&ae.push(Q);return ae}function $(){var ae=P();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Q=2;m!=j.charAt(Q)&&(p!=j.charAt(Q)||f!=j.charAt(Q+1));)++Q;if(Q+=2,m===j.charAt(Q-1))return O("End of comment missing");var K=j.slice(2,Q-2);return _+=2,C(K),j=j.slice(Q),_+=2,ae({type:y,comment:K})}}function L(){var ae=P(),Q=z(r);if(Q){if($(),!z(i))return O("property missing ':'");var K=z(a),X=ae({type:v,property:w(Q[0].replace(e,m)),value:K?w(K[0].replace(e,m)):m});return z(o),X}}function J(){var ae=[];F(ae);for(var Q;Q=L();)Q!==!1&&(ae.push(Q),F(ae));return ae}return I(),J()}function w(j){return j?j.replace(c,m):m}return _x=x,_x}var d2;function Kte(){if(d2)return Tc;d2=1;var e=Tc&&Tc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=n;const t=e(qte());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return Tc}var Bd={},f2;function Hte(){if(f2)return Bd;f2=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,o))};return Bd.camelCase=d,Bd}var Fd,h2;function Gte(){if(h2)return Fd;h2=1;var e=Fd&&Fd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Kte()),n=Hte();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,a)]=d)}),o}return r.default=r,Fd=r,Fd}var Vte=Gte();const Zte=wa(Vte),V5=Z5("end"),aN=Z5("start");function Z5(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Yte(e){const t=aN(e),n=V5(e);if(t&&n)return{start:t,end:n}}function ff(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?p2(e.position):"start"in e||"end"in e?p2(e):"line"in e||"column"in e?ZS(e):""}function ZS(e){return m2(e&&e.line)+":"+m2(e&&e.column)}function p2(e){return ZS(e&&e.start)+"-"+ZS(e&&e.end)}function m2(e){return e&&typeof e=="number"?e:1}class ar extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=ff(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ar.prototype.file="";ar.prototype.name="";ar.prototype.reason="";ar.prototype.message="";ar.prototype.stack="";ar.prototype.column=void 0;ar.prototype.line=void 0;ar.prototype.ancestors=void 0;ar.prototype.cause=void 0;ar.prototype.fatal=void 0;ar.prototype.place=void 0;ar.prototype.ruleId=void 0;ar.prototype.source=void 0;const sN={}.hasOwnProperty,Wte=new Map,Qte=/[A-Z]/g,Xte=new Set(["table","tbody","thead","tfoot","tr"]),Jte=new Set(["td","th"]),Y5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ene(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=lne(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=one(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?iN:Bte,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=W5(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function W5(e,t,n){if(t.type==="element")return tne(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nne(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ine(e,t,n);if(t.type==="mdxjsEsm")return rne(e,t);if(t.type==="root")return ane(e,t,n);if(t.type==="text")return sne(e,t)}function tne(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=iN,e.schema=i),e.ancestors.push(t);const a=X5(e,t.tagName,!1),o=cne(e,t);let c=lN(e,t);return Xte.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Tte(d):!0})),Q5(e,o,a,t),oN(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nne(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Af(e,t.position)}function rne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Af(e,t.position)}function ine(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=iN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:X5(e,t.name,!0),o=une(e,t),c=lN(e,t);return Q5(e,o,a,t),oN(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ane(e,t,n){const r={};return oN(r,lN(e,t)),e.create(t,e.Fragment,r,n)}function sne(e,t){return t.value}function Q5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function one(e,t,n){return r;function r(i,a,o,c){const f=Array.isArray(o.children)?n:t;return c?f(a,o,c):f(a,o)}}function lne(e,t){return n;function n(r,i,a,o){const c=Array.isArray(a.children),d=aN(r);return t(i,a,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function cne(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&sN.call(t.properties,i)){const a=dne(e,i,t.properties[i]);if(a){const[o,c]=a;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&Jte.has(t.tagName)?r=c:n[o]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function une(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Af(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Af(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function lN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Wte;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const c=W5(e,a,o);c!==void 0&&n.push(c)}return n}function dne(e,t,n){const r=Lte(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cte(n):Fte(n)),r.property==="style"){let i=typeof n=="object"?n:fne(e,String(n));return e.stylePropertyNameCase==="css"&&(i=hne(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Mte[r.property]||r.property:r.attribute,n]}}function fne(e,t){try{return Zte(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Y5+"#cannot-parse-style-attribute",i}}function X5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const c=s2(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=o}else r=s2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return sN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Af(e)}function Af(e,t){const n=new ar("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Y5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hne(e){const t={};let n;for(n in e)sN.call(e,n)&&(t[pne(n)]=e[n]);return t}function pne(e){let t=e.replace(Qte,mne);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mne(e){return"-"+e.toLowerCase()}const Ox={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},gne={};function yne(e,t){const n=gne,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return J5(e,r,i)}function J5(e,t,n){if(vne(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return g2(e.children,t,n)}return Array.isArray(e)?g2(e,t,n):""}function g2(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=J5(e[i],t,n);return r.join("")}function vne(e){return!!(e&&typeof e=="object")}const y2=document.createElement("i");function cN(e){const t="&"+e+";";y2.innerHTML=t;const n=y2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ma(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function yi(e,t){return e.length>0?(ma(e,e.length,0,t),e):t}const v2={}.hasOwnProperty;function bne(e){const t={};let n=-1;for(;++n<e.length;)xne(t,e[n]);return t}function xne(e,t){let n;for(n in t){const i=(v2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){v2.call(i,o)||(i[o]=[]);const c=a[o];wne(i[o],Array.isArray(c)?c:c?[c]:[])}}}function wne(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ma(e,0,0,r)}function e$(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ru(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ua=wo(/[A-Za-z]/),Vr=wo(/[\dA-Za-z]/),Sne=wo(/[#-'*+\--9=?A-Z^-~]/);function YS(e){return e!==null&&(e<32||e===127)}const WS=wo(/\d/),jne=wo(/[\dA-Fa-f]/),Nne=wo(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function Pr(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const kne=wo(new RegExp("\\p{P}|\\p{S}","u")),Cne=wo(/\s/);function wo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Vr(e.charCodeAt(n+1))&&Vr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(o=String.fromCharCode(a,c),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ft(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return jt(d)?(e.enter(n),c(d)):t(d)}function c(d){return jt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const _ne={tokenize:One};function One(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ft(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ye(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),o)}}const Ane={tokenize:Ene},b2={tokenize:Tne};function Ene(e){const t=this,n=[];let r=0,i,a,o;return c;function c(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&A();const C=t.events.length;let P=C,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}k(r);let O=C;for(;O<t.events.length;)t.events[O][1].end={...T},O++;return ma(t.events,P+1,0,t.events.slice(C)),t.events.length=O,f(_)}return c(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return x(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(b2,p,m)(_)}function p(_){return i&&A(),k(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(_)}function y(_){return t.containerState={},e.attempt(b2,v,x)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function x(_){if(_===null){i&&A(),k(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(_)}function w(_){if(_===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Ye(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),w)}function j(_,C){const P=t.sliceStream(_);if(C&&P.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(P),t.parser.lazy[_.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<o&&(!i.events[T][1].end||i.events[T][1].end.offset>o))return;const O=t.events.length;let z=O,I,F;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(I){F=t.events[z][1].end;break}I=!0}for(k(r),T=O;T<t.events.length;)t.events[T][1].end={...F},T++;ma(t.events,z+1,0,t.events.slice(O)),t.events.length=T}}function k(_){let C=n.length;for(;C-- >_;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=_}function A(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Tne(e,t,n){return Ft(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function x2(e){if(e===null||Pr(e)||Cne(e))return 1;if(kne(e))return 2}function uN(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const QS={name:"attention",resolveAll:Pne,tokenize:zne};function Pne(e,t){let n=-1,r,i,a,o,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};w2(m,-d),w2(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=yi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=yi(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=yi(f,uN(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=yi(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=yi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ma(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function zne(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=x2(r);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=x2(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function w2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Rne={name:"autolink",tokenize:Mne};function Mne(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return ua(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Vr(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||Vr(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||YS(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Sne(v)?(e.consume(v),f):n(v)}function p(v){return Vr(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Vr(v))&&r++<63){const x=v===45?y:m;return e.consume(v),x}return n(v)}}const Iy={partial:!0,tokenize:Dne};function Dne(e,t,n){return r;function r(a){return jt(a)?Ft(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ye(a)?t(a):n(a)}}const t$={continuation:{tokenize:Lne},exit:$ne,name:"blockQuote",tokenize:Ine};function Ine(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return jt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Lne(e,t,n){const r=this;return i;function i(o){return jt(o)?Ft(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(t$,t,n)(o)}}function $ne(e){e.exit("blockQuote")}const n$={name:"characterEscape",tokenize:Une};function Une(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Nne(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const r$={name:"characterReference",tokenize:Bne};function Bne(e,t,n){const r=this;let i=0,a,o;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Vr,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=jne,p):(e.enter("characterReferenceValue"),a=7,o=WS,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Vr&&!cN(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const S2={partial:!0,tokenize:qne},j2={concrete:!0,name:"codeFenced",tokenize:Fne};function Fne(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,o=0,c;return d;function d(T){return f(T)}function f(T){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===c?(o++,e.consume(T),p):o<3?n(T):(e.exit("codeFencedFenceSequence"),jt(T)?Ft(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Ye(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(S2,w,C)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Ye(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):jt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ft(e,v,"whitespace")(T)):T===96&&T===c?n(T):(e.consume(T),y)}function v(T){return T===null||Ye(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Ye(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===c?n(T):(e.consume(T),x)}function w(T){return e.attempt(i,C,j)(T)}function j(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return a>0&&jt(T)?Ft(e,A,"linePrefix",a+1)(T):A(T)}function A(T){return T===null||Ye(T)?e.check(S2,w,C)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||Ye(T)?(e.exit("codeFlowValue"),A(T)):(e.consume(T),_)}function C(T){return e.exit("codeFenced"),t(T)}function P(T,O,z){let I=0;return F;function F(Q){return T.enter("lineEnding"),T.consume(Q),T.exit("lineEnding"),$}function $(Q){return T.enter("codeFencedFence"),jt(Q)?Ft(T,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):L(Q)}function L(Q){return Q===c?(T.enter("codeFencedFenceSequence"),J(Q)):z(Q)}function J(Q){return Q===c?(I++,T.consume(Q),J):I>=o?(T.exit("codeFencedFenceSequence"),jt(Q)?Ft(T,ae,"whitespace")(Q):ae(Q)):z(Q)}function ae(Q){return Q===null||Ye(Q)?(T.exit("codeFencedFence"),O(Q)):z(Q)}}}function qne(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Ax={name:"codeIndented",tokenize:Hne},Kne={partial:!0,tokenize:Gne};function Hne(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Ft(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):Ye(f)?e.attempt(Kne,o,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function Gne(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ft(e,a,"linePrefix",5)(o)}function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ye(o)?i(o):n(o)}}const Vne={name:"codeText",previous:Yne,resolve:Zne,tokenize:Wne};function Zne(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Yne(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wne(e,t,n){let r=0,i,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):Ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ye(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class Qne{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qd(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qd(this.left,n.reverse())}}}function qd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function i$(e){const t={};let n=-1,r,i,a,o,c,d,f;const p=new Qne(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Xne(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return ma(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Xne(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],f={};let p,m,y=-1,v=n,x=0,w=0;const j=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(w=y+1,j.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=c.slice(j[y],j[y+1]),A=a.pop();d.push([A,A+k.length-1]),e.splice(A,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[x+d[y][0]]=x+d[y][1],x+=d[y][1]-d[y][0]-1;return f}const Jne={resolve:tre,tokenize:nre},ere={partial:!0,tokenize:rre};function tre(e){return i$(e),e}function nre(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):Ye(c)?e.check(ere,o,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function rre(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ft(e,a,"linePrefix")}function a(o){if(o===null||Ye(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function a$(e,t,n,r,i,a,o,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),y):k===null||k===32||k===41||YS(k)?n(k):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),y(k)):k===null||k===60||Ye(k)?n(k):(e.consume(k),k===92?x:v)}function x(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function w(k){return!p&&(k===null||k===41||Pr(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||YS(k)?n(k):(e.consume(k),k===92?j:w)}function j(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function s$(e,t,n,r,i,a){const o=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ye(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ye(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!jt(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function o$(e,t,n,r,i,a){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ft(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Ye(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function hf(e,t){let n;return r;function r(i){return Ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):jt(i)?Ft(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ire={name:"definition",tokenize:sre},are={partial:!0,tokenize:ore};function sre(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return s$.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Pr(v)?hf(e,f)(v):f(v)}function f(v){return a$(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(are,m,m)(v)}function m(v){return jt(v)?Ft(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ye(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function ore(e,t,n){return r;function r(c){return Pr(c)?hf(e,i)(c):n(c)}function i(c){return o$(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return jt(c)?Ft(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ye(c)?t(c):n(c)}}const lre={name:"hardBreakEscape",tokenize:cre};function cre(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ye(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const ure={name:"headingAtx",resolve:dre,tokenize:fre};function dre(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ma(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function fre(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||Pr(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):jt(p)?Ft(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Pr(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const hre=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],N2=["pre","script","style","textarea"],pre={concrete:!0,name:"htmlFlow",resolveTo:yre,tokenize:vre},mre={partial:!0,tokenize:xre},gre={partial:!0,tokenize:bre};function yre(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function vre(e,t,n){const r=this;let i,a,o,c,d;return f;function f(M){return p(M)}function p(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),a=!0,w):M===63?(e.consume(M),i=3,r.interrupt?t:R):ua(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function y(M){return M===45?(e.consume(M),i=2,v):M===91?(e.consume(M),i=5,c=0,x):ua(M)?(e.consume(M),i=4,r.interrupt?t:R):n(M)}function v(M){return M===45?(e.consume(M),r.interrupt?t:R):n(M)}function x(M){const V="CDATA[";return M===V.charCodeAt(c++)?(e.consume(M),c===V.length?r.interrupt?t:L:x):n(M)}function w(M){return ua(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function j(M){if(M===null||M===47||M===62||Pr(M)){const V=M===47,se=o.toLowerCase();return!V&&!a&&N2.includes(se)?(i=1,r.interrupt?t(M):L(M)):hre.includes(o.toLowerCase())?(i=6,V?(e.consume(M),k):r.interrupt?t(M):L(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?A(M):_(M))}return M===45||Vr(M)?(e.consume(M),o+=String.fromCharCode(M),j):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:L):n(M)}function A(M){return jt(M)?(e.consume(M),A):F(M)}function _(M){return M===47?(e.consume(M),F):M===58||M===95||ua(M)?(e.consume(M),C):jt(M)?(e.consume(M),_):F(M)}function C(M){return M===45||M===46||M===58||M===95||Vr(M)?(e.consume(M),C):P(M)}function P(M){return M===61?(e.consume(M),T):jt(M)?(e.consume(M),P):_(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,O):jt(M)?(e.consume(M),T):z(M)}function O(M){return M===d?(e.consume(M),d=null,I):M===null||Ye(M)?n(M):(e.consume(M),O)}function z(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Pr(M)?P(M):(e.consume(M),z)}function I(M){return M===47||M===62||jt(M)?_(M):n(M)}function F(M){return M===62?(e.consume(M),$):n(M)}function $(M){return M===null||Ye(M)?L(M):jt(M)?(e.consume(M),$):n(M)}function L(M){return M===45&&i===2?(e.consume(M),K):M===60&&i===1?(e.consume(M),X):M===62&&i===4?(e.consume(M),B):M===63&&i===3?(e.consume(M),R):M===93&&i===5?(e.consume(M),Se):Ye(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(mre,U,J)(M)):M===null||Ye(M)?(e.exit("htmlFlowData"),J(M)):(e.consume(M),L)}function J(M){return e.check(gre,ae,U)(M)}function ae(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Q}function Q(M){return M===null||Ye(M)?J(M):(e.enter("htmlFlowData"),L(M))}function K(M){return M===45?(e.consume(M),R):L(M)}function X(M){return M===47?(e.consume(M),o="",ye):L(M)}function ye(M){if(M===62){const V=o.toLowerCase();return N2.includes(V)?(e.consume(M),B):L(M)}return ua(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),ye):L(M)}function Se(M){return M===93?(e.consume(M),R):L(M)}function R(M){return M===62?(e.consume(M),B):M===45&&i===2?(e.consume(M),R):L(M)}function B(M){return M===null||Ye(M)?(e.exit("htmlFlowData"),U(M)):(e.consume(M),B)}function U(M){return e.exit("htmlFlow"),t(M)}}function bre(e,t,n){const r=this;return i;function i(o){return Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function xre(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Iy,t,n)}}const wre={name:"htmlText",tokenize:Sre};function Sre(e,t,n){const r=this;let i,a,o;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),P):R===63?(e.consume(R),_):ua(R)?(e.consume(R),z):n(R)}function f(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),a=0,x):ua(R)?(e.consume(R),A):n(R)}function p(R){return R===45?(e.consume(R),v):n(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),y):Ye(R)?(o=m,X(R)):(e.consume(R),m)}function y(R){return R===45?(e.consume(R),v):m(R)}function v(R){return R===62?K(R):R===45?y(R):m(R)}function x(R){const B="CDATA[";return R===B.charCodeAt(a++)?(e.consume(R),a===B.length?w:x):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),j):Ye(R)?(o=w,X(R)):(e.consume(R),w)}function j(R){return R===93?(e.consume(R),k):w(R)}function k(R){return R===62?K(R):R===93?(e.consume(R),k):w(R)}function A(R){return R===null||R===62?K(R):Ye(R)?(o=A,X(R)):(e.consume(R),A)}function _(R){return R===null?n(R):R===63?(e.consume(R),C):Ye(R)?(o=_,X(R)):(e.consume(R),_)}function C(R){return R===62?K(R):_(R)}function P(R){return ua(R)?(e.consume(R),T):n(R)}function T(R){return R===45||Vr(R)?(e.consume(R),T):O(R)}function O(R){return Ye(R)?(o=O,X(R)):jt(R)?(e.consume(R),O):K(R)}function z(R){return R===45||Vr(R)?(e.consume(R),z):R===47||R===62||Pr(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),K):R===58||R===95||ua(R)?(e.consume(R),F):Ye(R)?(o=I,X(R)):jt(R)?(e.consume(R),I):K(R)}function F(R){return R===45||R===46||R===58||R===95||Vr(R)?(e.consume(R),F):$(R)}function $(R){return R===61?(e.consume(R),L):Ye(R)?(o=$,X(R)):jt(R)?(e.consume(R),$):I(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,J):Ye(R)?(o=L,X(R)):jt(R)?(e.consume(R),L):(e.consume(R),ae)}function J(R){return R===i?(e.consume(R),i=void 0,Q):R===null?n(R):Ye(R)?(o=J,X(R)):(e.consume(R),J)}function ae(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Pr(R)?I(R):(e.consume(R),ae)}function Q(R){return R===47||R===62||Pr(R)?I(R):n(R)}function K(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function X(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ye}function ye(R){return jt(R)?Ft(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Se(R)}function Se(R){return e.enter("htmlTextData"),o(R)}}const dN={name:"labelEnd",resolveAll:Cre,resolveTo:_re,tokenize:Ore},jre={tokenize:Are},Nre={tokenize:Ere},kre={tokenize:Tre};function Cre(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ma(e,0,e.length,n),e}function _re(e,t){let n=e.length,r=0,i,a,o,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=yi(c,e.slice(a+1,a+r+3)),c=yi(c,[["enter",p,t]]),c=yi(c,uN(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),c=yi(c,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),c=yi(c,e.slice(o+1)),c=yi(c,[["exit",d,t]]),ma(e,a,e.length,c),e}function Ore(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(ru(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(jre,p,o?p:m)(y):y===91?e.attempt(Nre,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(kre,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Are(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Pr(m)?hf(e,a)(m):a(m)}function a(m){return m===41?p(m):a$(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Pr(m)?hf(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?o$(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Pr(m)?hf(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function Ere(e,t,n){const r=this;return i;function i(c){return s$.call(r,e,a,o,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function Tre(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Pre={name:"labelStartImage",resolveAll:dN.resolveAll,tokenize:zre};function zre(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Rre={name:"labelStartLink",resolveAll:dN.resolveAll,tokenize:Mre};function Mre(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ex={name:"lineEnding",tokenize:Dre};function Dre(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ft(e,t,"linePrefix")}}const Um={name:"thematicBreak",tokenize:Ire};function Ire(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),jt(f)?Ft(e,c,"whitespace")(f):c(f))}}const kr={continuation:{tokenize:Bre},exit:qre,name:"list",tokenize:Ure},Lre={partial:!0,tokenize:Kre},$re={partial:!0,tokenize:Fre};function Ure(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(v){const x=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:WS(v)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Um,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return WS(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Iy,r.interrupt?n:p,e.attempt(Lre,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return jt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Bre(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Iy,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ft(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!jt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($re,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ft(e,e.attempt(kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Fre(e,t,n){const r=this;return Ft(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function qre(e){e.exit(this.containerState.type)}function Kre(e,t,n){const r=this;return Ft(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!jt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const k2={name:"setextUnderline",resolveTo:Hre,tokenize:Gre};function Hre(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Gre(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),jt(f)?Ft(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Vre={tokenize:Zre};function Zre(e){const t=this,n=e.attempt(Iy,r,e.attempt(this.parser.constructs.flowInitial,i,Ft(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Jne,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Yre={resolveAll:c$()},Wre=l$("string"),Qre=l$("text");function l$(e){return{resolveAll:c$(e==="text"?Xre:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,c);return o;function o(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function c$(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Xre(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const Jre={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:t$},eie={91:ire},tie={[-2]:Ax,[-1]:Ax,32:Ax},nie={35:ure,42:Um,45:[k2,Um],60:pre,61:k2,95:Um,96:j2,126:j2},rie={38:r$,92:n$},iie={[-5]:Ex,[-4]:Ex,[-3]:Ex,33:Pre,38:r$,42:QS,60:[Rne,wre],91:Rre,92:[lre,n$],93:dN,95:QS,96:Vne},aie={null:[QS,Yre]},sie={null:[42,95]},oie={null:[]},lie=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sie,contentInitial:eie,disable:oie,document:Jre,flow:nie,flowInitial:tie,insideSpan:aie,string:rie,text:iie},Symbol.toStringTag,{value:"Module"}));function cie(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],c=[];const d={attempt:O(P),check:O(T),consume:A,enter:_,exit:C,interrupt:O(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m($){return o=yi(o,$),j(),o[o.length-1]!==null?[]:(z(t,0),f.events=uN(a,f.events,f),f.events)}function y($,L){return die(v($),L)}function v($){return uie(o,$)}function x(){const{_bufferIndex:$,_index:L,line:J,column:ae,offset:Q}=r;return{_bufferIndex:$,_index:L,line:J,column:ae,offset:Q}}function w($){i[$.line]=$.column,F()}function j(){let $;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<L.length;)k(L.charCodeAt(r._bufferIndex));else k(L)}}function k($){p=p($)}function A($){Ye($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,F()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=$}function _($,L){const J=L||{};return J.type=$,J.start=x(),f.events.push(["enter",J,f]),c.push(J),J}function C($){const L=c.pop();return L.end=x(),f.events.push(["exit",L,f]),L}function P($,L){z($,L.from)}function T($,L){L.restore()}function O($,L){return J;function J(ae,Q,K){let X,ye,Se,R;return Array.isArray(ae)?U(ae):"tokenize"in ae?U([ae]):B(ae);function B(ie){return he;function he(je){const ee=je!==null&&ie[je],de=je!==null&&ie.null,Ce=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(de)?de:de?[de]:[]];return U(Ce)(je)}}function U(ie){return X=ie,ye=0,ie.length===0?K:M(ie[ye])}function M(ie){return he;function he(je){return R=I(),Se=ie,ie.partial||(f.currentConstruct=ie),ie.name&&f.parser.constructs.disable.null.includes(ie.name)?se():ie.tokenize.call(L?Object.assign(Object.create(f),L):f,d,V,se)(je)}}function V(ie){return $(Se,R),Q}function se(ie){return R.restore(),++ye<X.length?M(X[ye]):K}}}function z($,L){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&ma(f.events,L,f.events.length-L,$.resolve(f.events.slice(L),f)),$.resolveTo&&(f.events=$.resolveTo(f.events,f))}function I(){const $=x(),L=f.previous,J=f.currentConstruct,ae=f.events.length,Q=Array.from(c);return{from:ae,restore:K};function K(){r=$,f.previous=L,f.currentConstruct=J,f.events.length=ae,c=Q,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function uie(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function die(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
98
- `;break}case-3:{o=`\r
99
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function fie(e){const r={constructs:bne([lie,...(e||{}).extensions||[]]),content:i(_ne),defined:[],document:i(Ane),flow:i(Vre),lazy:{},string:i(Wre),text:i(Qre)};return r;function i(a){return o;function o(c){return cie(r,a,c)}}}function hie(e){for(;!i$(e););return e}const C2=/[\0\t\n\r]/g;function pie(){let e=1,t="",n=!0,r;return i;function i(a,o,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(C2.lastIndex=m,f=C2.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const mie=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gie(e){return e.replace(mie,yie)}function yie(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return e$(n.slice(a?2:1),a?16:10)}return cN(n)||e}const u$={}.hasOwnProperty;function vie(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),bie(n)(hie(fie(n).document().write(pie()(e,t,!0))))}function bie(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(bn),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(rt),blockQuote:a(de),characterEscape:I,characterReference:I,codeFenced:a(Ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Ce,o),codeText:a(Y,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(Ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Me),hardBreakEscape:a(it),hardBreakTrailing:a(it),htmlFlow:a(Nt,o),htmlFlowData:I,htmlText:a(Nt,o),htmlTextData:I,image:a(Lt),label:o,link:a(bn),listItem:a(Ve),listItemValue:y,listOrdered:a(ve,m),listUnordered:a(ve),paragraph:a(be),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(rt),strong:a(ze),thematicBreak:a(_e)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ie,characterReference:he,codeFenced:d(j),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:d(k),codeText:d(Q),codeTextData:F,data:F,definition:d(),definitionDestinationString:C,definitionLabelString:A,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(L),hardBreakTrailing:d(L),htmlFlow:d(J),htmlFlowData:F,htmlText:d(ae),htmlTextData:F,image:d(X),label:Se,labelText:ye,lineEnding:$,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:V,resourceDestinationString:R,resourceTitleString:B,resource:U,setextHeading:d(z),setextHeadingLineSequence:O,setextHeadingText:T,strong:d(),thematicBreak:d()}};d$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let xe={type:"root",children:[]};const Ae={stack:[xe],tokenStack:[],config:t,enter:c,exit:f,buffer:o,resume:p,data:n},Ge=[];let Je=-1;for(;++Je<te.length;)if(te[Je][1].type==="listOrdered"||te[Je][1].type==="listUnordered")if(te[Je][0]==="enter")Ge.push(Je);else{const tn=Ge.pop();Je=i(te,tn,Je)}for(Je=-1;++Je<te.length;){const tn=t[te[Je][0]];u$.call(tn,te[Je][1].type)&&tn[te[Je][1].type].call(Object.assign({sliceSerialize:te[Je][2].sliceSerialize},Ae),te[Je][1])}if(Ae.tokenStack.length>0){const tn=Ae.tokenStack[Ae.tokenStack.length-1];(tn[1]||_2).call(Ae,void 0,tn[0])}for(xe.position={start:Fs(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Fs(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)xe=t.transforms[Je](xe)||xe;return xe}function i(te,xe,Ae){let Ge=xe-1,Je=-1,tn=!1,xn,Qe,kt,$t;for(;++Ge<=Ae;){const ue=te[Ge];switch(ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ue[0]==="enter"?Je++:Je--,$t=void 0;break}case"lineEndingBlank":{ue[0]==="enter"&&(xn&&!$t&&!Je&&!kt&&(kt=Ge),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!Je&&ue[0]==="enter"&&ue[1].type==="listItemPrefix"||Je===-1&&ue[0]==="exit"&&(ue[1].type==="listUnordered"||ue[1].type==="listOrdered")){if(xn){let Mn=Ge;for(Qe=void 0;Mn--;){const or=te[Mn];if(or[1].type==="lineEnding"||or[1].type==="lineEndingBlank"){if(or[0]==="exit")continue;Qe&&(te[Qe][1].type="lineEndingBlank",tn=!0),or[1].type="lineEnding",Qe=Mn}else if(!(or[1].type==="linePrefix"||or[1].type==="blockQuotePrefix"||or[1].type==="blockQuotePrefixWhitespace"||or[1].type==="blockQuoteMarker"||or[1].type==="listItemIndent"))break}kt&&(!Qe||kt<Qe)&&(xn._spread=!0),xn.end=Object.assign({},Qe?te[Qe][1].start:ue[1].end),te.splice(Qe||Ge,0,["exit",xn,ue[2]]),Ge++,Ae++}if(ue[1].type==="listItemPrefix"){const Mn={type:"listItem",_spread:!1,start:Object.assign({},ue[1].start),end:void 0};xn=Mn,te.splice(Ge,0,["enter",Mn,ue[2]]),Ge++,Ae++,kt=void 0,$t=!0}}}return te[xe][1]._spread=tn,Ae}function a(te,xe){return Ae;function Ae(Ge){c.call(this,te(Ge),Ge),xe&&xe.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(te,xe,Ae){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([xe,Ae||void 0]),te.position={start:Fs(xe.start),end:void 0}}function d(te){return xe;function xe(Ae){te&&te.call(this,Ae),f.call(this,Ae)}}function f(te,xe){const Ae=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==te.type&&(xe?xe.call(this,te,Ge[0]):(Ge[1]||_2).call(this,te,Ge[0]));else throw new Error("Cannot close `"+te.type+"` ("+ff({start:te.start,end:te.end})+"): it’s not open");Ae.position.end=Fs(te.end)}function p(){return yne(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(te){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=te}function x(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=te}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te.replace(/(\r?\n|\r)$/g,"")}function A(te){const xe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=xe,Ae.identifier=ru(this.sliceSerialize(te)).toLowerCase()}function _(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.title=te}function C(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.url=te}function P(te){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Ae=this.sliceSerialize(te).length;xe.depth=Ae}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function O(te){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function I(te){const Ae=this.stack[this.stack.length-1].children;let Ge=Ae[Ae.length-1];(!Ge||Ge.type!=="text")&&(Ge=Re(),Ge.position={start:Fs(te.start),end:void 0},Ae.push(Ge)),this.stack.push(Ge)}function F(te){const xe=this.stack.pop();xe.value+=this.sliceSerialize(te),xe.position.end=Fs(te.end)}function $(te){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=xe.children[xe.children.length-1];Ae.position.end=Fs(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(I.call(this,te),F.call(this,te))}function L(){this.data.atHardBreak=!0}function J(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function ae(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function Q(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function K(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=xe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function X(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=xe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ye(te){const xe=this.sliceSerialize(te),Ae=this.stack[this.stack.length-2];Ae.label=gie(xe),Ae.identifier=ru(xe).toLowerCase()}function Se(){const te=this.stack[this.stack.length-1],xe=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Ge=te.children;Ae.children=Ge}else Ae.alt=xe}function R(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.url=te}function B(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.title=te}function U(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function V(te){const xe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=xe,Ae.identifier=ru(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function se(te){this.data.characterReferenceType=te.type}function ie(te){const xe=this.sliceSerialize(te),Ae=this.data.characterReferenceType;let Ge;Ae?(Ge=e$(xe,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=cN(xe);const Je=this.stack[this.stack.length-1];Je.value+=Ge}function he(te){const xe=this.stack.pop();xe.position.end=Fs(te.end)}function je(te){F.call(this,te);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(te)}function ee(te){F.call(this,te);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(te)}function de(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function rt(){return{type:"heading",depth:0,children:[]}}function it(){return{type:"break"}}function Nt(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function bn(){return{type:"link",title:null,url:"",children:[]}}function ve(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Ve(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function be(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function Re(){return{type:"text",value:""}}function _e(){return{type:"thematicBreak"}}}function Fs(e){return{line:e.line,column:e.column,offset:e.offset}}function d$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?d$(e,r):xie(e,r)}}function xie(e,t){let n;for(n in t)if(u$.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function _2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ff({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ff({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ff({start:t.start,end:t.end})+") is still open")}function wie(e){const t=this;t.parser=n;function n(r){return vie(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Sie(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jie(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
100
- `}]}function Nie(e,t){const n=t.value?t.value+`
101
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function kie(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cie(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _ie(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Eu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Oie(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Aie(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function f$(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Eie(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return f$(e,t);const i={src:Eu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Tie(e,t){const n={src:Eu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Pie(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zie(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return f$(e,t);const i={href:Eu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Rie(e,t){const n={href:Eu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Mie(e,t,n){const r=e.all(t),i=n?Die(n):h$(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
102
- `}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
103
- `});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function Die(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=h$(n[r])}return t}function h$(e){const t=e.spread;return t??e.children.length>1}function Iie(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Lie(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $ie(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Uie(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bie(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=aN(t.children[1]),d=V5(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Fie(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let x={type:"element",tagName:a,properties:y,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),f.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function qie(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const O2=9,A2=32;function Kie(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(E2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(E2(t.slice(i),i>0,!1)),a.join("")}function E2(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===O2||a===A2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===O2||a===A2;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Hie(e,t){const n={type:"text",value:Kie(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Gie(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Vie={blockquote:Sie,break:jie,code:Nie,delete:kie,emphasis:Cie,footnoteReference:_ie,heading:Oie,html:Aie,imageReference:Eie,image:Tie,inlineCode:Pie,linkReference:zie,link:Rie,listItem:Mie,list:Iie,paragraph:Lie,root:$ie,strong:Uie,table:Bie,tableCell:qie,tableRow:Fie,text:Hie,thematicBreak:Gie,toml:sm,yaml:sm,definition:sm,footnoteDefinition:sm};function sm(){}const p$=-1,Ly=0,pf=1,gg=2,fN=3,hN=4,pN=5,mN=6,m$=7,g$=8,T2=typeof self=="object"?self:globalThis,Zie=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Ly:case p$:return n(o,i);case pf:{const c=n([],i);for(const d of o)c.push(r(d));return c}case gg:{const c=n({},i);for(const[d,f]of o)c[r(d)]=r(f);return c}case fN:return n(new Date(o),i);case hN:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case pN:{const c=n(new Map,i);for(const[d,f]of o)c.set(r(d),r(f));return c}case mN:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case m$:{const{name:c,message:d}=o;return n(new T2[c](d),i)}case g$:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new T2[a](o),i)};return r},P2=e=>Zie(new Map,e)(0),Pc="",{toString:Yie}={},{keys:Wie}=Object,Kd=e=>{const t=typeof e;if(t!=="object"||!e)return[Ly,t];const n=Yie.call(e).slice(8,-1);switch(n){case"Array":return[pf,Pc];case"Object":return[gg,Pc];case"Date":return[fN,Pc];case"RegExp":return[hN,Pc];case"Map":return[pN,Pc];case"Set":return[mN,Pc];case"DataView":return[pf,n]}return n.includes("Array")?[pf,n]:n.includes("Error")?[m$,n]:[gg,n]},om=([e,t])=>e===Ly&&(t==="function"||t==="symbol"),Qie=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},a=o=>{if(n.has(o))return n.get(o);let[c,d]=Kd(o);switch(c){case Ly:{let p=o;switch(d){case"bigint":c=g$,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([p$],o)}return i([c,p],o)}case pf:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([c,p],o);for(const y of o)p.push(a(y));return m}case gg:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([c,p],o);for(const y of Wie(o))(e||!om(Kd(o[y])))&&p.push([a(y),a(o[y])]);return m}case fN:return i([c,o.toISOString()],o);case hN:{const{source:p,flags:m}=o;return i([c,{source:p,flags:m}],o)}case pN:{const p=[],m=i([c,p],o);for(const[y,v]of o)(e||!(om(Kd(y))||om(Kd(v))))&&p.push([a(y),a(v)]);return m}case mN:{const p=[],m=i([c,p],o);for(const y of o)(e||!om(Kd(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([c,{name:d,message:f}],o)};return a},z2=(e,{json:t,lossy:n}={})=>{const r=[];return Qie(!(t||n),!!t,new Map,r)(e),r},yg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?P2(z2(e,t)):structuredClone(e):(e,t)=>P2(z2(e,t));function Xie(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Jie(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eae(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Xie,r=e.options.footnoteBackLabel||Jie,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),y=Eu(m.toLowerCase());let v=0;const x=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++v<=w;){x.length>0&&x.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,v);typeof A=="string"&&(A={type:"text",value:A}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const A=j.children[j.children.length-1];A&&A.type==="text"?A.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...x)}else p.push(...x);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...yg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
104
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
105
- `}]}}const y$=(function(e){if(e==null)return iae;if(typeof e=="function")return $y(e);if(typeof e=="object")return Array.isArray(e)?tae(e):nae(e);if(typeof e=="string")return rae(e);throw new Error("Expected function, string, or object as test")});function tae(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=y$(e[n]);return $y(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function nae(e){const t=e;return $y(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function rae(e){return $y(t);function t(n){return n&&n.type===e}}function $y(e){return t;function t(n,r,i){return!!(aae(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function iae(){return!0}function aae(e){return e!==null&&typeof e=="object"&&"type"in e}const v$=[],sae=!0,R2=!1,oae="skip";function lae(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=y$(i),o=r?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=v$,x,w,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=cae(n(d,p)),v[0]===R2))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==oae)for(w=(r?k.children.length:-1)+o,j=p.concat(k);w>-1&&w<k.children.length;){const A=k.children[w];if(x=c(A,w,j)(),x[0]===R2)return x;w=typeof x[1]=="number"?x[1]:w+o}}return v}}}function cae(e){return Array.isArray(e)?e:typeof e=="number"?[sae,e]:e==null?v$:[e]}function b$(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),lae(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const XS={}.hasOwnProperty,uae={};function dae(e,t){const n=t||uae,r=new Map,i=new Map,a=new Map,o={...Vie,...n.handlers},c={all:f,applyData:hae,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:fae,wrap:mae};return b$(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function d(p,m){const y=p.type,v=c.handlers[y];if(XS.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:w,...j}=p,k=yg(j);return k.children=c.all(p),k}return yg(p)}return(c.options.unknownHandler||pae)(c,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const x=c.one(y[v],p);if(x){if(v&&y[v-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=M2(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=M2(w.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function fae(e,t){e.position&&(t.position=Yte(e))}function hae(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,yg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function pae(e,t){const n=t.data||{},r="value"in t&&!(XS.call(n,"hProperties")||XS.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mae(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
106
- `});++r<e.length;)r&&n.push({type:"text",value:`
107
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
108
- `}),n}function M2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function D2(e,t){const n=dae(e,t),r=n.one(e,void 0),i=eae(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
109
- `},i),a}function gae(e,t){return e&&"run"in e?async function(n,r){const i=D2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return D2(n,{file:r,...e||t})}}function I2(e){if(e)throw e}var Tx,L2;function yae(){if(L2)return Tx;L2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Tx=function d(){var f,p,m,y,v,x,w=arguments[0],j=1,k=arguments.length,A=!1;for(typeof w=="boolean"&&(A=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=c(w,p),y=c(f,p),w!==y&&(A&&y&&(a(y)||(v=i(y)))?(v?(v=!1,x=m&&i(m)?m:[]):x=m&&a(m)?m:{},o(w,{name:p,newValue:d(A,x,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},Tx}var vae=yae();const Px=wa(vae);function JS(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bae(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?xae(p,c)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function xae(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(o,...c){n||(n=!0,t(o,...c))}function a(o){i(null,o)}}const sa={basename:wae,dirname:Sae,extname:jae,join:Nae,sep:"/"};function wae(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');eh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Sae(e){if(eh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jae(e){eh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Nae(...e){let t=-1,n;for(;++t<e.length;)eh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":kae(n)}function kae(e){eh(e);const t=e.codePointAt(0)===47;let n=Cae(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Cae(e,t){let n="",r=0,i=-1,a=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else c===46&&a>-1?a++:a=-1}return n}function eh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _ae={cwd:Oae};function Oae(){return"/"}function e1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Aae(e){if(typeof e=="string")e=new URL(e);else if(!e1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Eae(e)}function Eae(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const zx=["history","path","basename","stem","extname","dirname"];class x${constructor(t){let n;t?e1(t)?n={path:t}:typeof t=="string"||Tae(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_ae.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zx.length;){const a=zx[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)zx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?sa.basename(this.path):void 0}set basename(t){Mx(t,"basename"),Rx(t,"basename"),this.path=sa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?sa.dirname(this.path):void 0}set dirname(t){$2(this.basename,"dirname"),this.path=sa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?sa.extname(this.path):void 0}set extname(t){if(Rx(t,"extname"),$2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=sa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){e1(t)&&(t=Aae(t)),Mx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?sa.basename(this.path,this.extname):void 0}set stem(t){Mx(t,"stem"),Rx(t,"stem"),this.path=sa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ar(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rx(e,t){if(e&&e.includes(sa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+sa.sep+"`")}function Mx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Tae(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Pae=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),zae={}.hasOwnProperty;class gN extends Pae{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=bae()}copy(){const t=new gN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Px(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lx("data",this.frozen),this.namespace[t]=n,this):zae.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=lm(t),r=this.parser||this.Parser;return Dx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Dx("process",this.parser||this.Parser),Ix("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const c=lm(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,x=r.stringify(v,y);Dae(x)?y.value=x:y.result=x,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Dx("processSync",this.parser||this.Parser),Ix("processSync",this.compiler||this.Compiler),this.process(t,i),B2("processSync","process",n),r;function i(a,o){n=!0,I2(a),r=o}}run(t,n,r){U2(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,c){const d=lm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),B2("runSync","run",r),i;function a(o,c){I2(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=lm(n),i=this.compiler||this.Compiler;return Ix("stringify",i),U2(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Lx("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=Px(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...x]=p;const w=r[y][1];JS(w)&&JS(v)&&(v=Px(!0,w,v)),r[y]=[f,v,...x]}}}}const Rae=new gN().freeze();function Dx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ix(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function U2(e){if(!JS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function B2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lm(e){return Mae(e)?e:new x$(e)}function Mae(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Dae(e){return typeof e=="string"||Iae(e)}function Iae(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lae="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",F2=[],q2={allowDangerousHtml:!0},$ae=/^(https?|ircs?|mailto|xmpp)$/i,Uae=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Bae(e){const t=Fae(e),n=qae(e);return Kae(t.runSync(t.parse(n),n),e)}function Fae(e){const t=e.rehypePlugins||F2,n=e.remarkPlugins||F2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...q2}:q2;return Rae().use(wie).use(n).use(gae,r).use(t)}function qae(e){const t=e.children||"",n=new x$;return typeof t=="string"&&(n.value=t),n}function Kae(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Hae;for(const p of Uae)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Lae+p.id,void 0);return b$(e,f),ene(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Ox)if(Object.hasOwn(Ox,v)&&Object.hasOwn(p.properties,v)){const x=p.properties[v],w=Ox[v];(w===null||w.includes(p.tagName))&&(p.properties[v]=d(String(x||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Hae(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||$ae.test(e.slice(0,t))?e:""}function Gae(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Uy=Gae();async function K2(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Vae(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Zae(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Yae({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new is(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:x}=await f.read();if(x)break;m+=p.decode(v,{stream:!0});let w=m.indexOf(`
110
-
111
- `);for(;w!==-1;){const j=m.slice(0,w);m=m.slice(w+2);for(const k of j.split(`
112
- `)){if(!k.startsWith("data:"))continue;const A=k.slice(5).trim();if(A)try{o(JSON.parse(A))}catch{}}w=m.indexOf(`
113
-
114
- `)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function w$(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Wae=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],Qae=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/keywords",label:"Keywords",hint:"List tracked keywords",prompt:"List the tracked keywords for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."}],cm=e=>`canonry:aero:provider:${e}`,H2=e=>`canonry:aero:scope:${e}`;function Xae({projectName:e}){const[t,n]=S.useState(!1),[r,i]=S.useState(!1),[a,o]=S.useState([]),[c,d]=S.useState(""),[f,p]=S.useState(!1),[m,y]=S.useState([]),[v,x]=S.useState(""),[w,j]=S.useState(null),[k,A]=S.useState(()=>typeof window>"u"?null:window.localStorage.getItem(cm(e))??null),[_,C]=S.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(H2(e))==="all"?"all":"read-only"),P=S.useRef(null),T=S.useRef(null),O=S.useRef(null),[z,I]=S.useState(0),F=S.useMemo(()=>{const U=c.trimStart();if(!U.startsWith("/"))return[];if(/\s/.test(U))return[];const M=U.toLowerCase();return Qae.filter(V=>V.command.startsWith(M)||V.label.toLowerCase().includes(M.slice(1)))},[c]);S.useEffect(()=>{I(U=>F.length===0?0:Math.min(U,F.length-1))},[F.length]);const $=es({queryKey:Or.agent.providers(e),queryFn:()=>Vae(e),enabled:t,staleTime:6e4}),L=S.useMemo(()=>{const U=$.data?.providers??[];if(k){const V=U.find(se=>se.id===k&&se.configured);if(V)return V}const M=$.data?.defaultProvider;return M?U.find(V=>V.id===M)??null:null},[k,$.data]);S.useEffect(()=>{if(!$.data||!k)return;$.data.providers.find(M=>M.id===k&&M.configured)||(A(null),window.localStorage.removeItem(cm(e)))},[$.data,k,e]);const J=S.useCallback(U=>{A(U),!(typeof window>"u")&&(U?window.localStorage.setItem(cm(e),U):window.localStorage.removeItem(cm(e)))},[e]),ae=S.useCallback(()=>{C(U=>{const M=U==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(H2(e),M),M})},[e]);S.useEffect(()=>{if(!t)return;const U=M=>{M.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,r]),S.useEffect(()=>{if(!t)return;let U=!1;j(null);const M=()=>{U||f||K2(e).then(ie=>{U||o(ie.messages)}).catch(ie=>{U||j(ie instanceof Error?ie.message:"Failed to load transcript")})};M();const se=window.setInterval(M,15e3);return()=>{U=!0,window.clearInterval(se)}},[t,e,f]),S.useEffect(()=>()=>{P.current?.abort()},[e]),S.useEffect(()=>{const U=T.current;U&&(U.scrollTop=U.scrollHeight)},[a,v,m]);async function Q(U){const M=U.trim();if(!M||f)return;j(null),d(""),p(!0),x(""),y([]);const V={role:"user",content:M,timestamp:Date.now()};o(ie=>[...ie,V]);const se=new AbortController;P.current=se;try{await Yae({project:e,prompt:M,provider:k??void 0,scope:_,signal:se.signal,onEvent:K});const ie=await K2(e);o(ie.messages)}catch(ie){ie.name!=="AbortError"&&j(ie instanceof Error?ie.message:"Prompt failed")}finally{p(!1),x(""),P.current=null}}function K(U){switch(U.type){case"message_update":x(w$(U.message));break;case"message_end":U.message.role==="assistant"&&x("");break;case"tool_execution_start":y(M=>[...M,{id:U.toolCallId,name:U.toolName,args:U.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(M=>M.map(V=>V.id===U.toolCallId?{...V,endedAt:Date.now(),isError:U.isError,result:U.result}:V));break;case"error":j(U.message);break}}async function X(){P.current?.abort();try{await Zae(e),o([]),j(null)}catch(U){j(U instanceof Error?U.message:"Reset failed")}}const ye=a.length===0,Se=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",R=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",B=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return u.jsx("div",{className:Se,onClick:U=>{r&&U.target===U.currentTarget&&i(!1)},children:u.jsx("div",{className:R,children:t?u.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(sT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),u.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),u.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Jae,{providers:$.data?.providers??[],active:L,override:k,onPick:J,disabled:f}),u.jsx("button",{type:"button",onClick:X,className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:u.jsx(DI,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),u.jsx("button",{type:"button",onClick:()=>i(U=>!U),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?u.jsx(W7,{className:"h-3.5 w-3.5","aria-hidden":"true"}):u.jsx(G7,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),u.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:u.jsx(Wf,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),u.jsxs("div",{ref:T,className:B,children:[w&&u.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:w}),ye&&!f&&u.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",u.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:Wae.map(U=>u.jsx("button",{type:"button",onClick:()=>Q(U.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:U.label},U.label))})]}),ise(a,e,k,_),m.length>0&&u.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(U=>u.jsx(S$,{trail:U},U.id))}),f&&v&&u.jsxs("div",{className:"mt-3",children:[u.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsx(j$,{content:v})]}),f&&!v&&m.every(U=>U.endedAt!==void 0)&&u.jsx(lse,{})]}),u.jsx(ese,{projectName:e,activeProvider:L,scope:_,onToggleScope:ae,disabled:f}),u.jsxs("div",{className:"relative",children:[F.length>0&&u.jsx(tse,{matches:F,selectedIndex:z,onHover:I,onPick:U=>{d(""),O.current?.focus(),Q(U.prompt)}}),u.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:U=>{if(U.preventDefault(),F.length>0){const M=F[z];d(""),Q(M.prompt);return}Q(c)},children:[u.jsx("textarea",{ref:O,value:c,onChange:U=>d(U.target.value),onKeyDown:U=>{if(F.length>0){if(U.key==="ArrowDown"){U.preventDefault(),I(M=>(M+1)%F.length);return}if(U.key==="ArrowUp"){U.preventDefault(),I(M=>(M-1+F.length)%F.length);return}if(U.key==="Tab"){U.preventDefault();const M=F[z];d(`${M.command} `);return}if(U.key==="Escape"){U.preventDefault(),d("");return}}if(U.key==="Enter"&&!U.shiftKey)if(U.preventDefault(),F.length>0){const M=F[z];d(""),Q(M.prompt)}else Q(c)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),u.jsx("button",{type:"submit",disabled:f||!c.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:u.jsx(O7,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):u.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx(sT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),u.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Jae({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=S.useState(!1),c=S.useRef(null);if(S.useEffect(()=>{if(!a)return;const p=y=>{c.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return u.jsxs("div",{ref:c,className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>o(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[u.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&u.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),u.jsx(T7,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&u.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[u.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),u.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,y=n===p.id;return u.jsx("li",{children:u.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[u.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?u.jsx(MI,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),u.jsxs("span",{className:"flex-1",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&u.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!p.configured&&u.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),u.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&u.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&u.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",u.jsx("code",{className:"font-mono text-zinc-400",children:nse(p.id)})]})]})]})},p.id)})}),n&&u.jsx("button",{type:"button",onClick:()=>{r(null),o(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function ese({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[u.jsx("span",{className:"text-zinc-600",children:"project"}),u.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[u.jsx("span",{className:"text-zinc-600",children:"model"}),u.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),u.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${o?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:o?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[u.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),u.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function tse({matches:e,selectedIndex:t,onHover:n,onPick:r}){return u.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[u.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),u.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return u.jsx("li",{children:u.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[u.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),u.jsx("span",{className:"font-medium",children:i.label}),u.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),u.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[u.jsx("span",{className:"mr-3",children:"↑↓ to select"}),u.jsx("span",{className:"mr-3",children:"Enter to run"}),u.jsx("span",{children:"Tab to autocomplete"})]})]})}function nse(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function rse(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function ise(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=rse(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(u.jsx(ase,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=ose(o,d,o.timestamp??0),m=w$(o);i.push(u.jsxs(S.Fragment,{children:[p.length>0&&u.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>u.jsx(S$,{trail:y},y.id))}),m.trim()&&u.jsxs("div",{className:"mt-3",children:[u.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsx(j$,{content:m})]})]},c)),a=f-1;continue}}return i}function ase({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=S.useState(!1),o=S.useMemo(()=>sse(t,e,n,r),[t,e,n,r]);async function c(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return u.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),u.jsx("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:o,children:i?u.jsxs(u.Fragment,{children:[u.jsx(MI,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):u.jsxs(u.Fragment,{children:[u.jsx(R7,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),u.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function sse(e,t,n,r){const i=["canonry","agent","ask",G2(e),G2(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function G2(e){return`'${e.replace(/'/g,"'\\''")}'`}function ose(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function S$({trail:e}){const[t,n]=S.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,c=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return u.jsxs("div",{className:`rounded-md border ${c} ${d} font-mono`,children:[u.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":t,children:[u.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?u.jsx(K7,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?u.jsx(II,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):u.jsx(mG,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),u.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),u.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?u.jsx("span",{className:"text-emerald-400",children:"running…"}):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:i?"failed":"ok"}),o&&u.jsx("span",{children:o})]}),u.jsx(Yf,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&u.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[u.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),u.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:V2(e.args)}),!r&&e.result!==void 0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:V2(e.result)})]})]})]})}function V2(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
115
- … (${t.length-2e3} more chars)`:t}catch{return String(e)}}function j$({content:e}){return u.jsx("div",{className:"aero-markdown text-zinc-100",children:u.jsx(Bae,{components:{h1:t=>u.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>u.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>u.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>u.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>u.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>u.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>u.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>u.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>u.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>u.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>u.jsx("code",{...n,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:t}),pre:t=>u.jsx("pre",{...t,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:t=>u.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>u.jsx("div",{className:"mb-2 overflow-x-auto",children:u.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>u.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>u.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>u.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>u.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>u.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>u.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function lse(){return u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[u.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),u.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),u.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function cse(){const e=wI(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=es({queryKey:Or.projects.all,queryFn:zj,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?u.jsx(Xae,{projectName:a.name},a.name):null}const Z2=[{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"}],Y2=e=>({label:e,state:"checking",detail:"Checking service health"}),use={apiStatus:Y2("API"),workerStatus:Y2("Worker")};function dse(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function fse(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function hse(e){const t=dse(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function pse(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function mse(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function gse(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 yse(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function vse(){const e=S.useSyncExternalStore(TG,Nl,Nl),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=es({queryKey:Or.runs.all,queryFn:jI,enabled:t}),r=es({queryKey:Or.projects.all,queryFn:zj,enabled:t}),i=S.useRef({}),a=S.useCallback(()=>{n.refetch()},[n.refetch]);return S.useEffect(()=>{t&&a()},[t,a]),S.useEffect(()=>{if(!t||typeof window>"u")return;const o=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",o)}},[t,a]),S.useEffect(()=>{const o=n.data??[],c=r.data??[],d=Object.fromEntries(o.map(p=>[p.id,p])),f=Object.fromEntries(o.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const m=d[p.runId];if(!m||!RG(m.status)||(i.current[m.id]??p.lastAnnouncedStatus)===m.status)continue;if(p.sourceAction==="run-all"){cT(m.id);continue}const v=mse(m.projectId,p.projectLabel,c);ft({title:hse(m),detail:pse(m,v),tone:fse(m.status),dedupeKey:`run:${m.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:m.id}}),cT(m.id)}for(const p of Object.values(e.batches)){const m=MG(p.runIds,d);m.finished&&(ft({title:"Run-all batch finished",detail:gse(m,p.skippedCount),tone:yse(m),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),zG(p.batchId))}i.current=f},[r.data,n.data,e]),null}function bse(){const e=Xf(),{dashboard:t,isLoading:n,refetch:r}=Ul(),o=Dy(!e,e?.health).data??e?.health??use,c=wI(),{runId:d,evidenceId:f,closeDrawer:p}=Ou(),[m,y]=S.useState(!1),v=Ste(d),x=v.data??null,w=v.isLoading;S.useEffect(()=>{x&&x.status!=="running"&&x.status!=="queued"&&r()},[x?.status,r]),S.useEffect(()=>{y(!1)},[c.pathname]),S.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?Hee(j,d):void 0,A=f&&j?Gee(j,f):void 0,_=(()=>{const C=c.pathname;if(C==="/")return"Portfolio";if(C==="/projects")return"Projects";if(C==="/runs")return"Runs";if(C==="/settings")return"Settings";if(C==="/setup")return"Setup";if(C.startsWith("/projects/")){const T=C.split("/").filter(Boolean)[1];if(T&&j){const O=j.projects.find(z=>z.project.id===T);if(O)return O.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(bT,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Wt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(F7,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Wt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(U7,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Wt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(X7,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Wt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(aG,{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(C=>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+C*15}%`}})]},C))]}):j&&j.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const P=C.visibilitySummary.tone;return u.jsxs(Wt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[u.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),u.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Wt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(nG,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:Z2.map(C=>u.jsx("a",{className:"sidebar-footer-link",href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.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(bT,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Wt,{to:"/",children:"Home"}),u.jsx(Yf,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:_})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:uo(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:uo(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),u.jsxs(we,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[u.jsx(Z7,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[u.jsxs(we,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[u.jsx(Wf,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Wt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Wt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Wt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Wt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),j&&j.projects.length>0?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(C=>u.jsx(Wt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.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(C=>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"})]},C))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>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(P=>u.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},C))})]}):u.jsx(Pj,{})}),u.jsxs("footer",{className:"footer",children:[u.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noopener noreferrer",className:"footer-brand",children:[u.jsx(L7,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:Z2.map(C=>u.jsx("a",{href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]})]}),k?u.jsxs(xY,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(Oy,{status:k.status}),u.jsx("span",{className:"text-zinc-400",children:k.startedAt}),u.jsx("span",{className:"text-zinc-500",children:k.duration}),u.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.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"}),w?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):x&&x.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[x.snapshots.map(C=>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:C.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Nf,{provider:C.provider}),u.jsx(aL,{variant:C.citationState==="cited"?"success":"neutral",children:C.citationState})]})]}),C.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.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:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((P,T)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},T))})]}),C.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:C.answerText})]})]},C.id)),x.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..."]})]}):x&&x.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..."]}):x&&x.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..."]}):x&&x.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:vG(x.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?u.jsx(Lee,{evidence:A.evidence,project:A.project,onClose:p}):null,u.jsx(vse,{}),u.jsx(kte,{}),u.jsx(cse,{})]})}class xse extends S.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(II,{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(we,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(DI,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(we,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const We=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("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}));We.displayName="Card";const t1=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("flex flex-col gap-1.5 p-5",e),...t}));t1.displayName="CardHeader";const n1=S.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:Oi("font-medium tracking-tight text-zinc-50",e),...t}));n1.displayName="CardTitle";const r1=S.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:Oi("text-sm text-zinc-500",e),...t}));r1.displayName="CardDescription";const Bm=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("p-5 pt-0",e),...t}));Bm.displayName="CardContent";function wse({points:e,tone:t}){const n=S.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const x=a+v/Math.max(e.length-1,1)*f,w=a+(1-(y-o)/d)*p;return`${x},${w}`}).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:a,y:a,width:f,height:p,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),u.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function Sse({project:e}){return u.jsxs(Wt,{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 ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),u.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&u.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),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," · ",ky(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(wse,{points:e.trend,tone:LI(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(Yf,{className:"h-4 w-4 text-zinc-500"})})]})}function jse(){const e=Xf(),{dashboard:t,isLoading:n}=Ul(),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(p=>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"})]},p))})]});const i=r.portfolioOverview,c=Dy(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=NG(i.systemHealth,c,r.settings),{openRun:f}=Ou();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(p=>u.jsx(Sse,{project:p},p.project.id))}):u.jsxs(We,{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(we,{size:"sm",asChild:!0,children:u.jsx(Wt,{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(p=>u.jsxs(Wt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[u.jsxs("div",{children:[u.jsx("p",{className:"attention-title",children:p.title}),u.jsx("p",{className:"attention-detail",children:p.detail})]}),u.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.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(p=>u.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[u.jsxs("div",{children:[u.jsx("p",{className:"compact-run-title",children:p.projectName}),u.jsx("p",{className:"compact-run-detail",children:p.summary})]}),u.jsx(Oy,{status:p.status})]},p.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:d.map(p=>u.jsxs(We,{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:p.label}),u.jsx("h3",{children:p.detail})]}),u.jsx(Et,{tone:p.tone,title:p.id==="api"?uo(c.apiStatus):p.id==="worker"?uo(c.workerStatus):void 0,children:p.label})]}),u.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const yN=Symbol.for("yaml.alias"),i1=Symbol.for("yaml.document"),so=Symbol.for("yaml.map"),N$=Symbol.for("yaml.pair"),ga=Symbol.for("yaml.scalar"),Tu=Symbol.for("yaml.seq"),ji=Symbol.for("yaml.node.type"),Fl=e=>!!e&&typeof e=="object"&&e[ji]===yN,By=e=>!!e&&typeof e=="object"&&e[ji]===i1,th=e=>!!e&&typeof e=="object"&&e[ji]===so,vn=e=>!!e&&typeof e=="object"&&e[ji]===N$,qt=e=>!!e&&typeof e=="object"&&e[ji]===ga,nh=e=>!!e&&typeof e=="object"&&e[ji]===Tu;function gn(e){if(e&&typeof e=="object")switch(e[ji]){case so:case Tu:return!0}return!1}function yn(e){if(e&&typeof e=="object")switch(e[ji]){case yN:case so:case ga:case Tu:return!0}return!1}const k$=e=>(qt(e)||gn(e))&&!!e.anchor,el=Symbol("break visit"),Nse=Symbol("skip children"),mf=Symbol("remove node");function Pu(e,t){const n=kse(t);By(e)?Gc(null,e.contents,n,Object.freeze([e]))===mf&&(e.contents=null):Gc(null,e,n,Object.freeze([]))}Pu.BREAK=el;Pu.SKIP=Nse;Pu.REMOVE=mf;function Gc(e,t,n,r){const i=Cse(e,t,n,r);if(yn(i)||vn(i))return _se(e,r,i),Gc(e,i,n,r);if(typeof i!="symbol"){if(gn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Gc(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===el)return el;o===mf&&(t.items.splice(a,1),a-=1)}}}else if(vn(t)){r=Object.freeze(r.concat(t));const a=Gc("key",t.key,n,r);if(a===el)return el;a===mf&&(t.key=null);const o=Gc("value",t.value,n,r);if(o===el)return el;o===mf&&(t.value=null)}}return i}function kse(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 Cse(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(th(t))return n.Map?.(e,t,r);if(nh(t))return n.Seq?.(e,t,r);if(vn(t))return n.Pair?.(e,t,r);if(qt(t))return n.Scalar?.(e,t,r);if(Fl(t))return n.Alias?.(e,t,r)}function _se(e,t,n){const r=t[t.length-1];if(gn(r))r.items[e]=n;else if(vn(r))e==="key"?r.key=n:r.value=n;else if(By(r))r.contents=n;else{const i=Fl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Ose={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ase=e=>e.replace(/[!,[\]{}]/g,t=>Ose[t]);class ur{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ur.defaultYaml,t),this.tags=Object.assign({},ur.defaultTags,n)}clone(){const t=new ur(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ur(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ur.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ur.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ur.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ur.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[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!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 o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(o){return n(String(o)),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+Ase(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&&yn(t.contents)){const a={};Pu(t.contents,(o,c)=>{yn(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
116
- `)}}ur.defaultYaml={explicit:!1,version:"1.2"};ur.defaultTags={"!!":"tag:yaml.org,2002:"};function C$(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 _$(e){const t=new Set;return Pu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function O$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Ese(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=_$(e));const o=O$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(qt(o.node)||gn(o.node)))o.node.anchor=o.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Vc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],c=Vc(e,r,String(i),o);c===void 0?delete r[i]:c!==o&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Vc(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Vc(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=Vc(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function Si(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Si(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!k$(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,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 vN{constructor(t){Object.defineProperty(this,ji,{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:a}={}){if(!By(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Si(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?Vc(a,{"":c},"",c):c}}class bN extends vN{constructor(t){super(yN),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=[],Pu(t,{Node:(a,o)=>{(Fl(o)||k$(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(o);if(c||(Si(o,null,n),c=r.get(o)),c?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Fm(i,o,r)),c.count*c.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(C$(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function Fm(e,t,n){if(Fl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(gn(t)){let r=0;for(const i of t.items){const a=Fm(e,i,n);a>r&&(r=a)}return r}else if(vn(t)){const r=Fm(e,t.key,n),i=Fm(e,t.value,n);return Math.max(r,i)}return 1}const A$=e=>!e||typeof e!="function"&&typeof e!="object";class et extends vN{constructor(t){super(ga),this.value=t}toJSON(t,n){return n?.keep?this.value:Si(this.value,t,n)}toString(){return String(this.value)}}et.BLOCK_FOLDED="BLOCK_FOLDED";et.BLOCK_LITERAL="BLOCK_LITERAL";et.PLAIN="PLAIN";et.QUOTE_DOUBLE="QUOTE_DOUBLE";et.QUOTE_SINGLE="QUOTE_SINGLE";const Tse="tag:yaml.org,2002:";function Pse(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Ef(e,t,n){if(By(e)&&(e=e.contents),yn(e))return e;if(vn(e)){const m=n.schema[so].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new bN(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=Tse+t.slice(2));let f=Pse(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new et(e);return d&&(d.node=m),m}f=e instanceof Map?o[so]:Symbol.iterator in Object(e)?o[Tu]:o[so]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new et(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function vg(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Ef(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 af=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class E$ extends vN{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=>yn(r)||vn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(af(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(gn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,vg(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(gn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&qt(a)?a.value:a:gn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!vn(n))return!1;const r=n.value;return r==null||t&&qt(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 gn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(gn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,vg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const zse=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Qa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ll=(e,t,n)=>e.endsWith(`
117
- `)?Qa(n,t):n.includes(`
118
- `)?`
119
- `+Qa(n,t):(e.endsWith(" ")?"":" ")+n,T$="flow",a1="block",qm="quoted";function Fy(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:c}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let y,v,x=!1,w=-1,j=-1,k=-1;n===a1&&(w=W2(e,w,t.length),w!==-1&&(m=w+d));for(let _;_=e[w+=1];){if(n===qm&&_==="\\"){switch(j=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(_===`
120
- `)n===a1&&(w=W2(e,w,t.length)),m=w+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
121
- `&&v!==" "){const C=e[w+1];C&&C!==" "&&C!==`
122
- `&&C!==" "&&(y=w)}if(w>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===qm){for(;v===" "||v===" ";)v=_,_=e[w+=1],x=!0;const C=w>k+1?w-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else x=!0}v=_}if(x&&c&&c(),f.length===0)return e;o&&o();let A=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const C=f[_],P=f[_+1]||e.length;C===0?A=`
123
- ${t}${e.slice(0,P)}`:(n===qm&&p[C]&&(A+=`${e[C]}\\`),A+=`
124
- ${t}${e.slice(C+1,P)}`)}return A}function W2(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
125
- `);r=t,i=t+1,a=e[i]}return r}const qy=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ky=e=>/^(%|---|\.\.\.)/m.test(e);function Rse(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;a<i;++a)if(e[a]===`
126
- `){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function gf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Ky(e)?" ":"");let o="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(c,d)+`
127
-
128
- `;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
129
- `,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,c=d+1}break;default:d+=1}return o=c?o+n.slice(c):n,r?o:Fy(o,a,qm,qy(t,!1))}function s1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
130
- `)||/[ \t]\n|\n[ \t]/.test(e))return gf(e,t);const n=t.indent||(Ky(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
131
- ${n}`)+"'";return t.implicitKey?r:Fy(r,n,T$,qy(t,!1))}function Zc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=gf;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=s1:a&&!i?r=gf:r=n?s1:gf}return r(e,t)}let o1;try{o1=new RegExp(`(^|(?<!
132
- ))
133
- +(?!
134
- |$)`,"g")}catch{o1=/\n+(?!\n|$)/g}function Km({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:c,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return Zc(n,r);const f=r.indent||(r.forceBlockIndent||Ky(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===et.BLOCK_FOLDED?!1:t===et.BLOCK_LITERAL?!0:!Rse(n,d,f.length);if(!n)return p?`|
135
- `:`>
136
- `;let m,y;for(y=n.length;y>0;--y){const P=n[y-1];if(P!==`
137
- `&&P!==" "&&P!==" ")break}let v=n.substring(y);const x=v.indexOf(`
138
- `);x===-1?m="-":n===v||x!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
139
- `&&(v=v.slice(0,-1)),v=v.replace(o1,`$&${f}`));let w=!1,j,k=-1;for(j=0;j<n.length;++j){const P=n[j];if(P===" ")w=!0;else if(P===`
140
- `)k=j;else break}let A=n.substring(0,k<j?k+1:j);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${f}`));let C=(w?f?"2":"1":"")+m;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
141
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let T=!1;const O=qy(r,!0);o!=="folded"&&t!==et.BLOCK_FOLDED&&(O.onOverflow=()=>{T=!0});const z=Fy(`${A}${P}${v}`,f,a1,O);if(!T)return`>${C}
142
- ${f}${z}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
143
- ${f}${A}${n}${v}`}function Mse(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
144
- `)||p&&/[[\]{},]/.test(a))return Zc(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
145
- `)?Zc(a,t):Km(e,t,n,r);if(!c&&!p&&i!==et.PLAIN&&a.includes(`
146
- `))return Km(e,t,n,r);if(Ky(a)){if(d==="")return t.forceBlockIndent=!0,Km(e,t,n,r);if(c&&d===f)return Zc(a,t)}const m=a.replace(/\n+/g,`$&
147
- ${d}`);if(o){const y=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(m),{compat:v,tags:x}=t.doc.schema;if(x.some(y)||v?.some(y))return Zc(a,t)}return c?m:Fy(m,d,T$,qy(t,!1))}function xN(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==et.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(c=et.QUOTE_DOUBLE);const d=p=>{switch(p){case et.BLOCK_FOLDED:case et.BLOCK_LITERAL:return i||a?Zc(o.value,t):Km(o,t,n,r);case et.QUOTE_DOUBLE:return gf(o.value,t);case et.QUOTE_SINGLE:return s1(o.value,t);case et.PLAIN:return Mse(o,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function P$(e,t){const n=Object.assign({blockQuote:!0,commentString:zse,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 Dse(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(qt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.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 Ise(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(qt(e)||gn(e))&&e.anchor;a&&C$(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function hu(e,t,n,r){if(vn(e))return e.toString(t,n,r);if(Fl(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 a=yn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Dse(t.doc.schema.tags,a));const o=Ise(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):qt(a)?xN(a,t,n,r):a.toString(t,n,r);return o?qt(a)||c[0]==="{"||c[0]==="["?`${o} ${c}`:`${o}
148
- ${t.indent}${c}`:c}function Lse({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=yn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(gn(e)||!yn(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||gn(e)||(qt(e)?e.type===et.BLOCK_FOLDED||e.type===et.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let x=!1,w=!1,j=hu(e,n,()=>x=!0,()=>w=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return x&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!x?j+=ll(j,n.indent,f(y)):w&&i&&i(),j;x&&(y=null),v?(y&&(j+=ll(j,n.indent,f(y))),j=`? ${j}
149
- ${c}:`):(j=`${j}:`,y&&(j+=ll(j,n.indent,f(y))));let k,A,_;yn(t)?(k=!!t.spaceBefore,A=t.commentBefore,_=t.comment):(k=!1,A=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&qt(t)&&(n.indentAtStart=j.length+1),w=!1,!p&&d.length>=2&&!n.inFlow&&!v&&nh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const P=hu(t,n,()=>C=!0,()=>w=!0);let T=" ";if(y||k||A){if(T=k?`
150
- `:"",A){const O=f(A);T+=`
151
- ${Qa(O,n.indent)}`}P===""&&!n.inFlow?T===`
152
- `&&_&&(T=`
153
-
154
- `):T+=`
155
- ${n.indent}`}else if(!v&&gn(t)){const O=P[0],z=P.indexOf(`
156
- `),I=z!==-1,F=n.inFlow??t.flow??t.items.length===0;if(I||!F){let $=!1;if(I&&(O==="&"||O==="!")){let L=P.indexOf(" ");O==="&"&&L!==-1&&L<z&&P[L+1]==="!"&&(L=P.indexOf(" ",L+1)),(L===-1||z<L)&&($=!0)}$||(T=`
157
- ${n.indent}`)}}else(P===""||P[0]===`
158
- `)&&(T="");return j+=T+P,n.inFlow?C&&r&&r():_&&!C?j+=ll(j,n.indent,f(_)):w&&i&&i(),j}function $se(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const um="<<",ts={identify:e=>e===um||typeof e=="symbol"&&e.description===um,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new et(Symbol(um)),{addToJSMap:z$}),stringify:()=>um},Use=(e,t)=>(ts.identify(t)||qt(t)&&(!t.type||t.type===et.PLAIN)&&ts.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===ts.tag&&n.default);function z$(e,t,n){if(n=e&&Fl(n)?n.resolve(e.doc):n,nh(n))for(const r of n.items)$x(e,t,r);else if(Array.isArray(n))for(const r of n)$x(e,t,r);else $x(e,t,n)}function $x(e,t,n){const r=e&&Fl(n)?n.resolve(e.doc):n;if(!th(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function R$(e,t,{key:n,value:r}){if(yn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Use(e,n))z$(e,t,r);else{const i=Si(n,"",e);if(t instanceof Map)t.set(i,Si(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Bse(n,i,e),o=Si(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Bse(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(yn(e)&&n?.doc){const r=P$(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),$se(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function wN(e,t,n){const r=Ef(e,void 0,n),i=Ef(t,void 0,n);return new hr(r,i)}class hr{constructor(t,n=null){Object.defineProperty(this,ji,{value:N$}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return yn(n)&&(n=n.clone(t)),yn(r)&&(r=r.clone(t)),new hr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return R$(n,r,this)}toString(t,n,r){return t?.doc?Lse(this,t,n,r):JSON.stringify(this)}}function M$(e,t,n){return(t.inFlow??e.flow?qse:Fse)(e,t,n)}function Fse({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let x=0;x<t.length;++x){const w=t[x];let j=null;if(yn(w))!m&&w.spaceBefore&&y.push(""),bg(n,y,w.commentBefore,m),w.comment&&(j=w.comment);else if(vn(w)){const A=yn(w.key)?w.key:null;A&&(!m&&A.spaceBefore&&y.push(""),bg(n,y,A.commentBefore,m))}m=!1;let k=hu(w,p,()=>j=null,()=>m=!0);j&&(k+=ll(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let x=1;x<y.length;++x){const w=y[x];v+=w?`
159
- ${d}${w}`:`
160
- `}}return e?(v+=`
161
- `+Qa(f(e),d),c&&c()):m&&o&&o(),v}function qse({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:c}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let x=0;x<e.length;++x){const w=e[x];let j=null;if(yn(w))w.spaceBefore&&m.push(""),bg(t,m,w.commentBefore,!1),w.comment&&(j=w.comment);else if(vn(w)){const A=yn(w.key)?w.key:null;A&&(A.spaceBefore&&m.push(""),bg(t,m,A.commentBefore,!1),A.comment&&(f=!0));const _=yn(w.value)?w.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):w.value==null&&A?.comment&&(j=A.comment)}j&&(f=!0);let k=hu(w,d,()=>j=null);x<e.length-1&&(k+=","),j&&(k+=ll(k,r,c(j))),!f&&(m.length>p||k.includes(`
162
- `))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const x=m.reduce((w,j)=>w+j.length+2,2);f=t.options.lineWidth>0&&x>t.options.lineWidth}if(f){let x=y;for(const w of m)x+=w?`
163
- ${a}${i}${w}`:`
164
- `;return`${x}
165
- ${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function bg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Qa(t(r),e);n.push(a.trimStart())}}function cl(e,t){const n=qt(t)?t.value:t;for(const r of e)if(vn(r)&&(r.key===t||r.key===n||qt(r.key)&&r.key.value===n))return r}class vi extends E${static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(so,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),c=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&o.items.push(wN(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;vn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new hr(t,t?.value):r=new hr(t.key,t.value);const i=cl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);qt(i.value)&&A$(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(c=>a(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=cl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=cl(this.items,t)?.value;return(!n&&qt(i)?i.value:i)??void 0}has(t){return!!cl(this.items,t)}set(t,n){this.add(new hr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)R$(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!vn(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})),M$(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const zu={collection:"map",default:!0,nodeClass:vi,tag:"tag:yaml.org,2002:map",resolve(e,t){return th(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>vi.from(e,t,n)};class Cl extends E${static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Tu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=dm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=dm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&qt(i)?i.value:i}has(t){const n=dm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=dm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];qt(i)&&A$(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push(Si(a,String(i++),n));return r}toString(t,n,r){return t?M$(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,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(o++);c=i.call(n,d,c)}a.items.push(Ef(c,void 0,r))}}return a}}function dm(e){let t=qt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ru={collection:"seq",default:!0,nodeClass:Cl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Cl.from(e,t,n)},Hy={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),xN(e,t,n,r)}},Gy={identify:e=>e==null,createNode:()=>new et(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new et(null),stringify:({source:e},t)=>typeof e=="string"&&Gy.test.test(e)?e:t.options.nullStr},SN={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new et(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&SN.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 a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let c=t-(a.length-o-1);for(;c-- >0;)a+="0"}return a}const D$={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},I$={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)}},L$={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 et(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Wi},Vy=e=>typeof e=="bigint"||Number.isInteger(e),jN=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function $$(e,t,n){const{value:r}=e;return Vy(r)&&r>=0?n+r.toString(t):Wi(e)}const U$={identify:e=>Vy(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>jN(e,2,8,n),stringify:e=>$$(e,8,"0o")},B$={identify:Vy,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>jN(e,0,10,n),stringify:Wi},F$={identify:e=>Vy(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>jN(e,2,16,n),stringify:e=>$$(e,16,"0x")},Kse=[zu,Ru,Hy,Gy,SN,U$,B$,F$,D$,I$,L$];function Q2(e){return typeof e=="bigint"||Number.isInteger(e)}const fm=({value:e})=>JSON.stringify(e),Hse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:fm},{identify:e=>e==null,createNode:()=>new et(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:fm},{identify:Q2,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})=>Q2(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:fm}],Gse={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Vse=[zu,Ru].concat(Hse,Gse),NN={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,a){if(!n)return"";const o=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=et.BLOCK_LITERAL),t!==et.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=c.substr(y,d);c=p.join(t===et.BLOCK_LITERAL?`
166
- `:" ")}return xN({comment:e,type:t,value:c},r,i,a)}};function q$(e,t){if(nh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!vn(r)){if(th(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new hr(new et(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
167
- ${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
168
- ${a.comment}`:r.comment}r=i}e.items[n]=vn(r)?r:new hr(r)}}else t("Expected a sequence for this tag");return e}function K$(e,t,n){const{replacer:r}=n,i=new Cl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let c,d;if(Array.isArray(o))if(o.length===2)c=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)c=f[0],d=o[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=o;i.items.push(wN(c,d,n))}return i}const kN={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q$,createNode:K$};class iu extends Cl{constructor(){super(),this.add=vi.prototype.add.bind(this),this.delete=vi.prototype.delete.bind(this),this.get=vi.prototype.get.bind(this),this.has=vi.prototype.has.bind(this),this.set=vi.prototype.set.bind(this),this.tag=iu.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 a,o;if(vn(i)?(a=Si(i.key,"",n),o=Si(i.value,a,n)):a=Si(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=K$(t,n,r),a=new this;return a.items=i.items,a}}iu.tag="tag:yaml.org,2002:omap";const CN={collection:"seq",identify:e=>e instanceof Map,nodeClass:iu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=q$(e,t),r=[];for(const{key:i}of n.items)qt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new iu,n)},createNode:(e,t,n)=>iu.from(e,t,n)};function H$({value:e,source:t},n){return t&&(e?G$:V$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const G$={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 et(!0),stringify:H$},V$={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 et(!1),stringify:H$},Zse={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},Yse={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)}},Wse={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 et(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},rh=e=>typeof e=="bigint"||Number.isInteger(e);function Zy(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 o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function _N(e,t,n){const{value:r}=e;if(rh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Wi(e)}const Qse={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zy(e,2,2,n),stringify:e=>_N(e,2,"0b")},Xse={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zy(e,1,8,n),stringify:e=>_N(e,8,"0")},Jse={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zy(e,0,10,n),stringify:Wi},eoe={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zy(e,2,16,n),stringify:e=>_N(e,16,"0x")};class au extends vi{constructor(t){super(t),this.tag=au.tag}add(t){let n;vn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new hr(t.key,null):n=new hr(t,null),cl(this.items,n.key)||this.items.push(n)}get(t,n){const r=cl(this.items,t);return!n&&vn(r)?qt(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=cl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new hr(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,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(wN(o,null,r));return a}}au.tag="tag:yaml.org,2002:set";const ON={collection:"map",identify:e=>e instanceof Set,nodeClass:au,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>au.from(e,t,n),resolve(e,t){if(th(e)){if(e.hasAllNullValues(!0))return Object.assign(new au,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function AN(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,c)=>o*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function Z$(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Wi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Y$={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})=>AN(e,n),stringify:Z$},W$={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=>AN(e,!1),stringify:Z$},Yy={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(Yy.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,o||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=AN(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},X2=[zu,Ru,Hy,Gy,G$,V$,Qse,Xse,Jse,eoe,Zse,Yse,Wse,NN,ts,CN,kN,ON,Y$,W$,Yy],J2=new Map([["core",Kse],["failsafe",[zu,Ru,Hy]],["json",Vse],["yaml11",X2],["yaml-1.1",X2]]),eP={binary:NN,bool:SN,float:L$,floatExp:I$,floatNaN:D$,floatTime:W$,int:B$,intHex:F$,intOct:U$,intTime:Y$,map:zu,merge:ts,null:Gy,omap:CN,pairs:kN,seq:Ru,set:ON,timestamp:Yy},toe={"tag:yaml.org,2002:binary":NN,"tag:yaml.org,2002:merge":ts,"tag:yaml.org,2002:omap":CN,"tag:yaml.org,2002:pairs":kN,"tag:yaml.org,2002:set":ON,"tag:yaml.org,2002:timestamp":Yy};function Ux(e,t,n){const r=J2.get(t);if(r&&!e)return n&&!r.includes(ts)?r.concat(ts):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(J2.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(ts)),i.reduce((a,o)=>{const c=typeof o=="string"?eP[o]:o;if(!c){const d=JSON.stringify(o),f=Object.keys(eP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(c)||a.push(c),a},[])}const noe=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class EN{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:c}){this.compat=Array.isArray(t)?Ux(t,"compat"):t?Ux(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?toe:{},this.tags=Ux(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,so,{value:zu}),Object.defineProperty(this,ga,{value:Hy}),Object.defineProperty(this,Tu,{value:Ru}),this.sortMapEntries=typeof o=="function"?o:o===!0?noe:null}clone(){const t=Object.create(EN.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function roe(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=P$(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Qa(d,""))}let o=!1,c=null;if(e.contents){if(yn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Qa(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>o=!0;let f=hu(e.contents,i,()=>c=null,d);c&&(f+=ll(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(hu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
169
- `)?(n.push("..."),n.push(Qa(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||c)&&n[n.length-1]!==""&&n.push(""),n.push(Qa(a(d),"")))}return n.join(`
170
- `)+`
171
- `}class Wy{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ji,{value:i1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ur({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Wy.prototype,{[ji]:{value:i1}});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=yn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){zc(this.contents)&&this.contents.add(t)}addIn(t,n){zc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=_$(this);t.anchor=!n||r.has(n)?O$(n||"a",r):n}return new bN(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 j=A=>typeof A=="number"||A instanceof String||A instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=Ese(this,o||"a"),x={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},w=Ef(t,p,x);return c&&gn(w)&&(w.flow=!0),y(),w}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new hr(i,a)}delete(t){return zc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return af(t)?this.contents==null?!1:(this.contents=null,!0):zc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return gn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return af(t)?!n&&qt(this.contents)?this.contents.value:this.contents:gn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return gn(this.contents)?this.contents.has(t):!1}hasIn(t){return af(t)?this.contents!==void 0:gn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=vg(this.schema,[t],n):zc(this.contents)&&this.contents.set(t,n)}setIn(t,n){af(t)?this.contents=n:this.contents==null?this.contents=vg(this.schema,Array.from(t),n):zc(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 ur({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 ur({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 EN(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:a,reviver:o}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Si(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof o=="function"?Vc(o,{"":d},"",d):d}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 roe(this,t)}}function zc(e){if(gn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Q$ extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class hm extends Q${constructor(t,n,r){super("YAMLParseError",t,n,r)}}class ioe extends Q${constructor(t,n,r){super("YAMLWarning",t,n,r)}}const tP=(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 a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const c=Math.min(a-39,o.length-79);o="…"+o.substring(c),a-=c-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
172
- `),o=c+o}if(/[^ ]/.test(o)){let c=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(c=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(c);n.message+=`:
173
-
174
- ${o}
175
- ${f}
176
- `}};function pu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:c}){let d=!1,f=c,p=c,m="",y="",v=!1,x=!1,w=null,j=null,k=null,A=null,_=null,C=null,P=null;for(const z of e)switch(x&&(z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&a(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),w&&(f&&z.type!=="comment"&&z.type!=="newline"&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),z.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&z.source.includes(" ")&&(w=z),p=!0;break;case"comment":{p||a(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=z.source.substring(1)||" ";m?m+=y+I:m=I,y="",f=!1;break}case"newline":f?m?m+=z.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=z.source,f=!0,v=!0,(j||k)&&(A=z),p=!0;break;case"anchor":j&&a(z,"MULTIPLE_ANCHORS","A node can have at most one anchor"),z.source.endsWith(":")&&a(z.offset+z.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=z,P??(P=z.offset),f=!1,p=!1,x=!0;break;case"tag":{k&&a(z,"MULTIPLE_TAGS","A node can have at most one tag"),k=z,P??(P=z.offset),f=!1,p=!1,x=!0;break}case n:(j||k)&&a(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),C&&a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),C=z,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=z,f=!1,p=!1;break}default:a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),f=!1,p=!1}const T=e[e.length-1],O=T?T.offset+T.source.length:i;return x&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(f&&w.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:A,end:O,start:P??O}}function Tf(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
177
- `))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(Tf(t.key)||Tf(t.value))return!0}return!1;default:return!0}}function l1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Tf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function X$(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||qt(a)&&qt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const nP="All mapping items must start at the same column";function aoe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??vi,c=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:x}=p,w=pu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!w.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",nP)),!w.anchor&&!w.tag&&!v){f=w.end,w.comment&&(c.comment?c.comment+=`
178
- `+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||Tf(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&i(d,"BAD_INDENT",nP);n.atKey=!0;const k=w.end,A=y?e(n,y,w,i):t(n,k,m,null,w,i);n.schema.compat&&l1(r.indent,y,i),n.atKey=!1,X$(n,c.items,A)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const _=pu(v??[],{indicator:"map-value-ind",next:x,offset:A.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(x?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.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 C=x?e(n,x,_,i):t(n,d,v,null,_,i);n.schema.compat&&l1(r.indent,x,i),d=C.range[2];const P=new hr(A,C);n.options.keepSourceTokens&&(P.srcToken=p),c.items.push(P)}else{j&&i(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(A.comment?A.comment+=`
179
- `+_.comment:A.comment=_.comment);const C=new hr(A);n.options.keepSourceTokens&&(C.srcToken=p),c.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function soe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Cl,c=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=pu(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(c.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&l1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function ih(e,t,n,r){let i="";if(e){let a=!1,o="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Bx="Block collections are not allowed within flow collections",Fx=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ooe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",c=o?"flow map":"flow sequence",d=a?.nodeClass??(o?vi:Cl),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:A,key:_,sep:C,value:P}=k,T=pu(A,{flow:c,indicator:"explicit-key-ind",next:_??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!C&&!P){j===0&&T.comma?i(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),T.comment&&(f.comment?f.comment+=`
180
- `+T.comment:f.comment=T.comment),m=T.end;continue}!o&&n.options.strict&&Tf(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)T.comma&&i(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(T.comma||i(T.start,"MISSING_CHAR",`Missing , between ${c} items`),T.comment){let O="";e:for(const z of A)switch(z.type){case"comma":case"space":break;case"comment":O=z.source.substring(1);break e;default:break e}if(O){let z=f.items[f.items.length-1];vn(z)&&(z=z.value??z.key),z.comment?z.comment+=`
181
- `+O:z.comment=O,T.comment=T.comment.substring(O.length+1)}}if(!o&&!C&&!T.found){const O=P?e(n,P,T,i):t(n,T.end,C,null,T,i);f.items.push(O),m=O.range[2],Fx(P)&&i(O.range,"BLOCK_IN_FLOW",Bx)}else{n.atKey=!0;const O=T.end,z=_?e(n,_,T,i):t(n,O,A,null,T,i);Fx(_)&&i(z.range,"BLOCK_IN_FLOW",Bx),n.atKey=!1;const I=pu(C??[],{flow:c,indicator:"map-value-ind",next:P,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(I.found){if(!o&&!T.found&&n.options.strict){if(C)for(const L of C){if(L===I.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<I.found.offset-1024&&i(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${c}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=P?e(n,P,I,i):I.found?t(n,I.end,C,null,I,i):null;F?Fx(P)&&i(F.range,"BLOCK_IN_FLOW",Bx):I.comment&&(z.comment?z.comment+=`
182
- `+I.comment:z.comment=I.comment);const $=new hr(z,F);if(n.options.keepSourceTokens&&($.srcToken=k),o){const L=f;X$(n,L.items,z)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),L.items.push($)}else{const L=new vi(n.schema);L.flow=!0,L.items.push($);const J=(F??z).range;L.range=[z.range[0],J[1],J[2]],f.items.push(L)}m=F?F.range[2]:I.end}}const y=o?"}":"]",[v,...x]=r.end;let w=m;if(v?.source===y)w=v.offset+v.source.length;else{const j=c[0].toUpperCase()+c.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&x.unshift(v)}if(x.length>0){const j=ih(x,w,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
183
- `+j.comment:f.comment=j.comment),f.range=[r.offset,w,j.offset]}else f.range=[r.offset,w,w];return f}function qx(e,t,n,r,i,a){const o=n.type==="block-map"?aoe(e,t,n,r,a):n.type==="block-seq"?soe(e,t,n,r,a):ooe(e,t,n,r,a),c=o.constructor;return i==="!"||i===c.tagName?(o.tag=c.tagName,o):(i&&(o.tag=i),o)}function loe(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,x=y&&a?y.offset>a.offset?y:a:y??a;x&&(!v||v.offset<x.offset)&&i(x,"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(!a||!o||o==="!"||o===vi.tagName&&c==="map"||o===Cl.tagName&&c==="seq")return qx(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===c);if(!d){const y=t.schema.knownTags[o];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),qx(e,t,n,i,o)}const f=qx(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=yn(p)?p:new et(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function coe(e,t,n){const r=t.offset,i=uoe(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?et.BLOCK_FOLDED:et.BLOCK_LITERAL,o=t.source?doe(t.source):[];let c=o.length;for(let w=o.length-1;w>=0;--w){const j=o[w][1];if(j===""||j==="\r")c=w;else break}if(c===0){const w=i.chomp==="+"&&o.length>0?`
184
- `.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:w,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let w=0;w<c;++w){const[j,k]=o[w];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=w,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let w=o.length-1;w>=c;--w)o[w][0].length>d&&(c=w+1);let m="",y="",v=!1;for(let w=0;w<p;++w)m+=o[w][0].slice(d)+`
185
- `;for(let w=p;w<c;++w){let[j,k]=o[w];f+=j.length+k.length+1;const A=k[k.length-1]==="\r";if(A&&(k=k.slice(0,-1)),k&&j.length<d){const C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(A?2:1),"BAD_INDENT",C),j=""}a===et.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
186
- `):j.length>d||k[0]===" "?(y===" "?y=`
187
- `:!v&&y===`
188
- `&&(y=`
189
-
190
- `),m+=y+j.slice(d)+k,y=`
191
- `,v=!0):k===""?y===`
192
- `?m+=`
193
- `:y=`
194
- `:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let w=c;w<o.length;++w)m+=`
195
- `+o[w][0].slice(d);m[m.length-1]!==`
196
- `&&(m+=`
197
- `);break;default:m+=`
198
- `}const x=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,x,x]}}function uoe({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],a=i[0];let o=0,c="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const x=Number(v);!o&&x?o=x:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const x=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",x);const w=v.source;w&&typeof w=="string"&&(m+=w.length)}}}return{mode:a,indent:o,chomp:c,comment:p,length:m}}function doe(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function foe(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let c,d;const f=(y,v,x)=>n(r+y,v,x);switch(i){case"scalar":c=et.PLAIN,d=hoe(a,f);break;case"single-quoted-scalar":c=et.QUOTE_SINGLE,d=poe(a,f);break;case"double-quoted-scalar":c=et.QUOTE_DOUBLE,d=moe(a,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const p=r+a.length,m=ih(o,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function hoe(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}`),J$(e)}function poe(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),J$(e.slice(1,-1)).replace(/''/g,"'")}function J$(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
199
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
200
- `,"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],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
201
- `?i+=a:a=`
202
- `:(i+=a+r[1],a=" "),o=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=o,r=c.exec(e),i+a+(r?.[1]??"")}function moe(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
203
- `))if(i===`
204
- `){const{fold:a,offset:o}=goe(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=yoe[a];if(o)n+=o;else if(a===`
205
- `)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
206
- `)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const c={x:2,u:4,U:8}[a];n+=voe(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 a=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
207
- `&&!(o==="\r"&&e[r+2]===`
208
- `)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function goe(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
209
- `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
210
- `);)r===`
211
- `&&(n+=`
212
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const yoe={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
213
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function voe(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(o)}function e3(e,t,n,r){const{value:i,type:a,comment:o,range:c}=t.type==="block-scalar"?coe(e,t,r):foe(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[ga]:d?f=boe(e.schema,i,d,n,r):t.type==="scalar"?f=xoe(e,i,t,r):f=e.schema[ga];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=qt(m)?m:new et(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new et(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function boe(e,t,n,r,i){if(n==="!")return e[ga];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if(c.test?.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ga])}function xoe({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[ga];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[ga];if(o.tag!==c.tag){const d=t.tagString(o.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function woe(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 Soe={composeNode:t3,composeEmptyNode:TN};function t3(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=joe(e,t,r),(c||d)&&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":f=e3(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=loe(Soe,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=TN(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!qt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function TN(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:c,end:d},f){const p={type:"scalar",offset:woe(t,n,r),indent:-1,source:""},m=e3(e,p,c,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function joe({options:e},{offset:t,source:n,end:r},i){const a=new bN(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,c=ih(r,o,e.strict,i);return a.range=[t,o,c.offset],c.comment&&(a.comment=c.comment),a}function Noe(e,t,{offset:n,start:r,value:i,end:a},o){const c=Object.assign({_directives:t},e),d=new Wy(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=pu(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?t3(f,i,p,o):TN(f,p.end,r,null,p,o);const m=d.contents.range[2],y=ih(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Hd(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 rP(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
214
-
215
- `:`
216
- `)+(a.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 koe{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Hd(n);a?this.warnings.push(new ioe(o,r,i)):this.errors.push(new hm(o,r,i))},this.directives=new ur({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=rP(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
217
- ${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(gn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];vn(o)&&(o=o.key);const c=o.commentBefore;o.commentBefore=c?`${r}
218
- ${c}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
219
- ${o}`: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:rP(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 a=Hd(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Noe(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 hm(Hd(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 hm(Hd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=ih(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}
220
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new hm(Hd(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 Wy(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 n3="\uFEFF",r3="",i3="",c1="";function Coe(e){switch(e){case n3:return"byte-order-mark";case r3:return"doc-mode";case i3:return"flow-error-end";case c1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
221
- `:case`\r
222
- `: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 Li(e){switch(e){case void 0:case" ":case`
223
- `:case"\r":case" ":return!0;default:return!1}}const iP=new Set("0123456789ABCDEFabcdef"),_oe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pm=new Set(",[]{}"),Ooe=new Set(` ,[]{}
224
- \r `),Kx=e=>!e||Ooe.has(e);class Aoe{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===`
225
- `?!0:n==="\r"?this.buffer[t+1]===`
226
- `:!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===`
227
- `||!i&&!this.atEnd)return t+r+1}return n===`
228
- `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Li(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(`
229
- `,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]===n3&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const a=t[r-1];if(a===" "||a===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")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 r3,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==="...")&&Li(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&&!Li(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===":")&&Li(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(Kx),"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("..."))&&Li(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield i3,yield*this.parseLineStart();let a=0;for(;i[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"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(Kx),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Li(o)||o===",")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 a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
230
- `,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
231
- `,a)}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=>Li(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
232
- `:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
233
- `)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 a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
234
- `,a)}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===`
235
- `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const c=a;for(;o===" ";)o=this.buffer[--a];if(o===`
236
- `&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield c1,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 a=this.buffer[r+1];if(Li(a)||t&&pm.has(a))break;n=r}else if(Li(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
237
- `?(r+=1,i=`
238
- `,a=this.buffer[r+1]):n=r),a==="#"||t&&pm.has(a))break;if(i===`
239
- `){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&pm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield c1,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(Kx))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Li(n)||t&&pm.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(;!Li(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(_oe.has(n))n=this.buffer[++t];else if(n==="%"&&iP.has(this.buffer[t+1])&&iP.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===`
240
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
241
- `?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 Eoe{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const a=n+r>>1;this.lineStarts[a]<t?n=a+1:r=a}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 Vs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function aP(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 a3(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 mm(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 Rc(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 sP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Vs(t.start,"explicit-key-ind")&&!Vs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,a3(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 Toe{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 Aoe,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=Coe(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"&&sP(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&&aP(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.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":{aP(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=mm(this.peek(2)),r=Rc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={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]=a}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(`
242
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
243
- `,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 a=[];if(i&&n.sep&&!n.value){const o=[];for(let c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":o.push(c);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),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?(a.push(this.sourceToken),t.items.push({start:a,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(Vs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(a3(n.key)&&!Vs(n.sep,"newline")){const o=Rc(n.start),c=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Vs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Rc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Vs(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 o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Vs(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:a});this.stack.push(o);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||Vs(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=mm(r),a=Rc(i);sP(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};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(`
244
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
245
- `,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=mm(t),r=Rc(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=mm(t),r=Rc(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 Poe(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Eoe||null,prettyErrors:t}}function zoe(e,t={}){const{lineCounter:n,prettyErrors:r}=Poe(t),i=new Toe(n?.addNewLine),a=new koe(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of o)c.errors.forEach(tP(e,n)),c.warnings.forEach(tP(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Roe({onApplied:e}){const[t,n]=S.useState(""),[r,i]=S.useState(!1),[a,o]=S.useState([]),[c,d]=S.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=zoe(t),m=[],y=[];for(let v=0;v<p.length;v++){const x=p[v];if(x.errors.length>0){m.push(`Document ${v+1}: ${x.errors[0]?.message}`);continue}const w=x.toJSON();if(!(!w||typeof w!="object"))try{const j=await UH(w);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(ft({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.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
246
- kind: Project
247
- metadata:
248
- name: my-project
249
- spec:
250
- canonicalDomain: example.com
251
- country: US
252
- language: en
253
- keywords: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>u.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),u.jsx("div",{className:"mt-3",children:u.jsx(we,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Moe(){const{dashboard:e,isLoading:t,refetch:n}=Ul();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(O=>u.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>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"})]},O))]})]});const r=e.projects,i=yo(),[a,o]=S.useState(!1),[c,d]=S.useState(""),[f,p]=S.useState(""),[m,y]=S.useState(""),[v,x]=S.useState("US"),[w,j]=S.useState("en"),[k,A]=S.useState(!1),[_,C]=S.useState(null),P=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),T=async()=>{if(!(!P||!m)){A(!0),C(null);try{const O=await Ny(P,{displayName:f||c,canonicalDomain:m,country:v,language:w});ft({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),x("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){C(O instanceof Error?O.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(we,{type:"button",onClick:()=>o(O=>!O),children:[u.jsx(iT,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?u.jsxs(We,{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:O=>d(O.target.value)}),P&&P!==c?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):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:f,onChange:O=>p(O.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:m,onChange:O=>y(O.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:O=>x(O.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:w,onChange:O=>j(O.target.value.toLowerCase())})]})]})]}),_?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:_}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(we,{type:"button",disabled:!P||!m||k,onClick:T,children:k?"Creating...":"Create project"}),u.jsx(we,{type:"button",variant:"ghost",onClick:()=>o(!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(O=>{const z=O.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:O.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Wt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:I=>I.stopPropagation(),children:O.project.displayName||O.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),u.jsx("td",{children:u.jsx(Et,{tone:O.visibilitySummary.tone,children:O.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:z?u.jsx(Oy,{status:z.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):a?null:u.jsxs(We,{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(we,{type:"button",onClick:()=>o(!0),children:[u.jsx(iT,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(Roe,{onApplied:()=>{n()}})]})}function u1({state:e}){return u.jsx(Et,{tone:wG(e),children:ky(e)})}function s3({run:e}){const{openRun:t}=Ou();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(Oy,{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(we,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function o3({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:c,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):o&&!Number.isNaN(y)?Math.min(y/100,1):.5,x=m*(1-v);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:x,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,a&&u.jsx(Yn,{text:a})]}),u.jsx("p",{className:"gauge-delta",children:n}),d&&u.jsx("p",{className:"gauge-provider-coverage",children:d}),u.jsx("p",{className:"gauge-description",children:i})]})}function oP({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"}),a=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((o,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Doe(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const a=t.get(i.createdAt);a?a.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:a}])=>({runId:a,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function Ioe({evidence:e}){const{openEvidence:t}=Ou(),[n,r]=S.useState(new Set),i=S.useMemo(()=>{const o=new Map;for(const c of e){const d=o.get(c.keyword)??[];o.set(c.keyword,[...d,c])}return[...o.entries()].map(([c,d])=>({phrase:c,items:d}))},[e]),a=o=>{r(c=>{const d=new Set(c);return d.has(o)?d.delete(o):d.add(o),d})};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:o,items:c})=>{const d=n.has(o),f=c.map(x=>x.citationState),p=f.includes("cited")?"cited":f.includes("emerging")?"emerging":f.includes("lost")?"lost":f.every(x=>x==="pending")?"pending":"not-cited",m=Doe(c),y=c.filter(x=>x.citationState==="cited"||x.citationState==="emerging").length,v=(()=>{if(m.length===0)return"Awaiting first run";if(m.length===1)return"First observation";const x=m[m.length-1].citationState,w=m[m.length-2].citationState;if(w!=="cited"&&x==="cited")return"Newly cited";if(w==="cited"&&x!=="cited")return"Lost since last run";let j=0;for(let k=m.length-1;k>=0&&m[k].citationState===x;k--)j++;return x==="cited"?j<=1?"Cited in latest run":`Cited for ${j} runs`:j<=1?"Not cited in latest run":`Not cited across ${j} runs`})();return u.jsxs(S.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>a(o),"aria-expanded":d,children:[u.jsx("td",{children:u.jsx(Yf,{size:14,className:`transition-transform duration-150 text-zinc-500 ${d?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:o}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(x=>u.jsx(Nf,{provider:x.provider},x.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(u1,{state:p}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(oP,{history:m})}),u.jsx("td",{className:"evidence-change-cell",children:v}),u.jsx("td",{})]}),d&&c.map(x=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Nf,{provider:x.provider})}),u.jsx("td",{children:u.jsx(u1,{state:x.citationState})}),u.jsx("td",{children:u.jsx(oP,{history:x.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:x.changeLabel}),u.jsx("td",{children:u.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(x.id)},children:"View"})})]},x.id))]},o)})})]})})}function Loe({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(Et,{tone:SG(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))})]})})}function lP({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:c,updatedAt:d,active:f,onClick:p}){return u.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${f?"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(Et,{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:a})]}),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:o})]})]}),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:d?`Updated ${Ui(d)}`:"No recent sync yet"})]})]})}function gm({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})]})}var $oe=["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 PN(e){if(typeof e!="string")return!1;var t=$oe;return t.includes(e)}var Uoe=["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"],Boe=new Set(Uoe);function l3(e){return typeof e!="string"?!1:Boe.has(e)}function c3(e){return typeof e=="string"&&e.startsWith("data-")}function Gi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(l3(n)||c3(n))&&(t[n]=e[n]);return t}function Qy(e){if(e==null)return null;if(S.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Gi(t)}return typeof e=="object"&&!Array.isArray(e)?Gi(e):null}function zr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(l3(n)||c3(n)||PN(n))&&(t[n]=e[n]);return t}function Foe(e){return e==null?null:S.isValidElement(e)?zr(e.props):typeof e=="object"&&!Array.isArray(e)?zr(e):null}var qoe=["children","width","height","viewBox","className","style","title","desc"];function d1(){return d1=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},d1.apply(null,arguments)}function Koe(e,t){if(e==null)return{};var n,r,i=Hoe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hoe(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 zN=S.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:c,title:d,desc:f}=e,p=Koe(e,qoe),m=a||{width:r,height:i,x:0,y:0},y=Ct("recharts-surface",o);return S.createElement("svg",d1({},zr(p),{className:y,width:r,height:i,style:c,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,f),n)}),Goe=["children","className"];function f1(){return f1=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},f1.apply(null,arguments)}function Voe(e,t){if(e==null)return{};var n,r,i=Zoe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zoe(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 Vi=S.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Voe(e,Goe),a=Ct("recharts-layer",r);return S.createElement("g",f1({className:a},zr(i),{ref:t}),n)}),u3=S.createContext(null),Yoe=()=>S.useContext(u3);function Bt(e){return function(){return e}}const d3=Math.cos,xg=Math.sin,Qi=Math.sqrt,wg=Math.PI,Xy=2*wg,h1=Math.PI,p1=2*h1,tl=1e-6,Woe=p1-tl;function f3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Qoe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return f3;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Xoe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?f3:Qoe(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,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,c=this._y1,d=r-t,f=i-n,p=o-t,m=c-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>tl)if(!(Math.abs(m*d-f*p)>tl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,x=i-c,w=d*d+f*f,j=v*v+x*x,k=Math.sqrt(w),A=Math.sqrt(y),_=a*Math.tan((h1-Math.acos((w+y-j)/(2*k*A)))/2),C=_/A,P=_/k;Math.abs(C-1)>tl&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*x)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>tl||Math.abs(this._y1-p)>tl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%p1+p1),y>Woe?this._append`A${r},${r},0,1,${m},${t-c},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>tl&&this._append`A${r},${r},0,${+(y>=h1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 RN(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 Xoe(t)}function MN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function h3(e){this._context=e}h3.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 Jy(e){return new h3(e)}function p3(e){return e[0]}function m3(e){return e[1]}function g3(e,t){var n=Bt(!0),r=null,i=Jy,a=null,o=RN(c);e=typeof e=="function"?e:e===void 0?p3:Bt(e),t=typeof t=="function"?t:t===void 0?m3:Bt(t);function c(d){var f,p=(d=MN(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Bt(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Bt(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Bt(!!d),c):n},c.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),c):i},c.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),c):r},c}function ym(e,t,n){var r=null,i=Bt(!0),a=null,o=Jy,c=null,d=RN(f);e=typeof e=="function"?e:e===void 0?p3:Bt(+e),t=typeof t=="function"?t:Bt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?m3:Bt(+n);function f(m){var y,v,x,w=(m=MN(m)).length,j,k=!1,A,_=new Array(w),C=new Array(w);for(a==null&&(c=o(A=d())),y=0;y<=w;++y){if(!(y<w&&i(j=m[y],y,m))===k)if(k=!k)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=y-1;x>=v;--x)c.point(_[x],C[x]);c.lineEnd(),c.areaEnd()}k&&(_[y]=+e(j,y,m),C[y]=+t(j,y,m),c.point(r?+r(j,y,m):_[y],n?+n(j,y,m):C[y]))}if(A)return c=null,A+""||null}function p(){return g3().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Bt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Bt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Bt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Bt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Bt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Bt(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Bt(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(c=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=c=null:c=o(a=m),f):a},f}class y3{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 Joe(e){return new y3(e,!0)}function ele(e){return new y3(e,!1)}const DN={draw(e,t){const n=Qi(t/wg);e.moveTo(n,0),e.arc(0,0,n,0,Xy)}},tle={draw(e,t){const n=Qi(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()}},v3=Qi(1/3),nle=v3*2,rle={draw(e,t){const n=Qi(t/nle),r=n*v3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ile={draw(e,t){const n=Qi(t),r=-n/2;e.rect(r,r,n,n)}},ale=.8908130915292852,b3=xg(wg/10)/xg(7*wg/10),sle=xg(Xy/10)*b3,ole=-d3(Xy/10)*b3,lle={draw(e,t){const n=Qi(t*ale),r=sle*n,i=ole*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Xy*a/5,c=d3(o),d=xg(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},Hx=Qi(3),cle={draw(e,t){const n=-Qi(t/(Hx*3));e.moveTo(0,n*2),e.lineTo(-Hx*n,-n),e.lineTo(Hx*n,-n),e.closePath()}},ui=-.5,di=Qi(3)/2,m1=1/Qi(12),ule=(m1/2+1)*3,dle={draw(e,t){const n=Qi(t/ule),r=n/2,i=n*m1,a=r,o=n*m1+n,c=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(c,d),e.lineTo(ui*r-di*i,di*r+ui*i),e.lineTo(ui*a-di*o,di*a+ui*o),e.lineTo(ui*c-di*d,di*c+ui*d),e.lineTo(ui*r+di*i,ui*i-di*r),e.lineTo(ui*a+di*o,ui*o-di*a),e.lineTo(ui*c+di*d,ui*d-di*c),e.closePath()}};function fle(e,t){let n=null,r=RN(i);e=typeof e=="function"?e:Bt(e||DN),t=typeof t=="function"?t:Bt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Bt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Bt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Sg(){}function jg(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 x3(e){this._context=e}x3.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:jg(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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hle(e){return new x3(e)}function w3(e){this._context=e}w3.prototype={areaStart:Sg,areaEnd:Sg,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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ple(e){return new w3(e)}function S3(e){this._context=e}S3.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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mle(e){return new S3(e)}function j3(e){this._context=e}j3.prototype={areaStart:Sg,areaEnd:Sg,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 gle(e){return new j3(e)}function cP(e){return e<0?-1:1}function uP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),c=(a*i+o*r)/(r+i);return(cP(a)+cP(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function dP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gx(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,o-c*n,a,o)}function Ng(e){this._context=e}Ng.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:Gx(this,this._t0,dP(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,Gx(this,dP(this,n=uP(this,e,t)),n);break;default:Gx(this,this._t0,n=uP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function N3(e){this._context=new k3(e)}(N3.prototype=Object.create(Ng.prototype)).point=function(e,t){Ng.prototype.point.call(this,t,e)};function k3(e){this._context=e}k3.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function yle(e){return new Ng(e)}function vle(e){return new N3(e)}function C3(e){this._context=e}C3.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=fP(e),i=fP(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(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 fP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function ble(e){return new C3(e)}function ev(e,t){this._context=e,this._t=t}ev.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 xle(e){return new ev(e,.5)}function wle(e){return new ev(e,0)}function Sle(e){return new ev(e,1)}function _l(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,c=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<c;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function g1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function jle(e,t){return e[t]}function Nle(e){const t=[];return t.key=e,t}function kle(){var e=Bt([]),t=g1,n=_l,r=jle;function i(a){var o=Array.from(e.apply(this,arguments),Nle),c,d=o.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(m,o[c].key,f,a)]).data=m;for(c=0,p=MN(t(o));c<d;++c)o[p[c]].index=c;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Bt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Bt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?g1:typeof a=="function"?a:Bt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??_l,i):n},i}function Cle(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}_l(e,t)}}function _le(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,c=0;o<i;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}_l(e,t)}}function Ole(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var c=0,d=0,f=0;c<o;++c){for(var p=e[t[c]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,x=0;x<c;++x){var w=e[t[x]],j=w[r][1]||0,k=w[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,_l(e,t)}}var Vx={},Zx={},hP;function Ale(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Zx)),Zx}var Yx={},pP;function _3(){return pP||(pP=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})(Yx)),Yx}var Wx={},mP;function IN(){return mP||(mP=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})(Wx)),Wx}var Qx={},Xx={},gP;function Ele(){return gP||(gP=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})(Xx)),Xx}var yP;function LN(){return yP||(yP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ele(),n=IN();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<o;){const m=i[c];f?m==="\\"&&c+1<o?(c++,d+=i[c]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,c++}return d&&a.push(d),a}e.toPath=r})(Qx)),Qx}var vP;function $N(){return vP||(vP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ale(),n=_3(),r=IN(),i=LN();function a(c,d,f){if(c==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?n.isDeepKey(d)?a(c,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=c[d];return p===void 0?f:p}default:{if(Array.isArray(d))return o(c,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?f:p}}}function o(c,d,f){if(d.length===0)return f;let p=c;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(Vx)),Vx}var Jx,bP;function Tle(){return bP||(bP=1,Jx=$N().get),Jx}var Ple=Tle();const tv=wa(Ple);var zle=4;function to(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zle,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Vn(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,a,o)=>{var c=n[o-1];return typeof c=="string"?i+c+a:c!==void 0?i+to(c)+a:i+a},"")}var bi=e=>e===0?0:e>0?1:-1,ya=e=>typeof e=="number"&&e!=+e,Ol=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ue=e=>(typeof e=="number"||e instanceof Number)&&!ya(e),Ni=e=>Ue(e)||typeof e=="string",Rle=0,Pf=e=>{var t=++Rle;return"".concat(e||"").concat(t)},po=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(!Ue(t)&&typeof t!="string")return r;var a;if(Ol(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ya(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},O3=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 la(e,t,n){return Ue(e)&&Ue(t)?to(e+n*(t-e)):t}function A3(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):tv(r,t))===n)}var Qn=e=>e===null||typeof e>"u",ah=e=>Qn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ar(e){return e!=null}function Mu(){}var Mle=["type","size","sizeType"];function y1(){return y1=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},y1.apply(null,arguments)}function xP(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?xP(Object(n),!0).forEach(function(r){Dle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dle(e,t,n){return(t=Ile(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ile(e){var t=Lle(e,"string");return typeof t=="symbol"?t:t+""}function Lle(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 $le(e,t){if(e==null)return{};var n,r,i=Ule(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ule(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 E3={symbolCircle:DN,symbolCross:tle,symbolDiamond:rle,symbolSquare:ile,symbolStar:lle,symbolTriangle:cle,symbolWye:dle},Ble=Math.PI/180,Fle=e=>{var t="symbol".concat(ah(e));return E3[t]||DN},qle=(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*Ble;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}},Kle=(e,t)=>{E3["symbol".concat(ah(e))]=t},T3=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=$le(e,Mle),a=wP(wP({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var c=()=>{var y=Fle(o),v=fle().type(y).size(qle(n,r,o)),x=v();if(x!==null)return x},{className:d,cx:f,cy:p}=a,m=zr(a);return Ue(f)&&Ue(p)&&Ue(n)?S.createElement("path",y1({},m,{className:Ct("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};T3.registerSymbol=Kle;var P3=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,UN=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{PN(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Hle=(e,t,n)=>r=>(e(t,n,r),null),z3=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];PN(i)&&typeof a=="function"&&(r||(r={}),r[i]=Hle(a,t,n))}),r};function SP(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 Gle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){Vle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vle(e,t,n){return(t=Zle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zle(e){var t=Yle(e,"string");return typeof t=="symbol"?t:t+""}function Yle(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 mr(e,t){var n=Gle({},e),r=t,i=Object.keys(t),a=i.reduce((o,c)=>(o[c]===void 0&&r[c]!==void 0&&(o[c]=r[c]),o),n);return a}function kg(){return kg=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},kg.apply(null,arguments)}function jP(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 R3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jP(Object(n),!0).forEach(function(r){Wle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wle(e,t,n){return(t=Qle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qle(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 mi=32,Jle={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function ece(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function tce(e){var{data:t,iconType:n,inactiveColor:r}=e,i=mi/2,a=mi/6,o=mi/3,c=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return S.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:ece(t.payload),x1:0,y1:i,x2:mi,y2:i,className:"recharts-legend-icon"});if(d==="line")return S.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(o,`
254
- A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
255
- H`).concat(mi,"M").concat(2*o,",").concat(i,`
256
- A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return S.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(mi/8,"h").concat(mi,"v").concat(mi*3/4,"h").concat(-mi,"z"),className:"recharts-legend-icon"});if(S.isValidElement(t.legendIcon)){var f=R3({},t);return delete f.legendIcon,S.cloneElement(t.legendIcon,f)}return S.createElement(T3,{fill:c,cx:i,cy:i,size:mi,sizeType:"diameter",type:d})}function nce(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:c}=e,d={x:0,y:0,width:mi,height:mi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,x=Ct({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var w=typeof c=="object"?R3({},c):{};w.color=m.inactive?a:w.color||m.color;var j=v?v(m.value,m,y):m.value;return S.createElement("li",kg({className:x,style:f,key:"legend-item-".concat(y)},z3(e,m,y)),S.createElement(zN,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},S.createElement(tce,{data:m,iconType:o,inactiveColor:a})),S.createElement("span",{className:"recharts-legend-item-text",style:w},j))})}var rce=e=>{var t=mr(e,Jle),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:a},S.createElement(nce,kg({},t,{payload:n})))},ew={},tw={},NP;function ice(){return NP||(NP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],c=r(o,a,n);i.has(c)||i.set(c,o)}return Array.from(i.values())}e.uniqBy=t})(tw)),tw}var nw={},kP;function ace(){return kP||(kP=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})(nw)),nw}var rw={},CP;function M3(){return CP||(CP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(rw)),rw}var iw={},aw={},sw={},_P;function sce(){return _P||(_P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(sw)),sw}var OP;function D3(){return OP||(OP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sce();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(aw)),aw}var ow={},AP;function oce(){return AP||(AP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(ow)),ow}var EP;function lce(){return EP||(EP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D3(),n=oce();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(iw)),iw}var lw={},cw={},TP;function cce(){return TP||(TP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$N();function n(r){return function(i){return t.get(i,r)}}e.property=n})(cw)),cw}var uw={},dw={},fw={},hw={},PP;function I3(){return PP||(PP=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})(hw)),hw}var pw={},zP;function L3(){return zP||(zP=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})(pw)),pw}var mw={},RP;function $3(){return RP||(RP=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})(mw)),mw}var MP;function uce(){return MP||(MP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I3(),n=L3(),r=$3();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(x,w,j,k,A,_){const C=y(x,w,j,k,A,_);return C!==void 0?!!C:a(x,w,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return c(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const x=Object.keys(m);if(p==null||n.isPrimitive(p))return x.length===0;if(x.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let w=0;w<x.length;w++){const j=x[w];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function c(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[x,w]of m.entries()){const j=p.get(x);if(y(j,w,x,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const x=new Set;for(let w=0;w<m.length;w++){const j=m[w];let k=!1;for(let A=0;A<p.length;A++){if(x.has(A))continue;const _=p[A];let C=!1;if(y(_,j,w,p,m,v)&&(C=!0),C){x.add(A),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(fw)),fw}var DP;function U3(){return DP||(DP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uce();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(dw)),dw}var gw={},yw={},vw={},IP;function dce(){return IP||(IP=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})(vw)),vw}var bw={},LP;function BN(){return LP||(LP=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})(bw)),bw}var xw={},$P;function B3(){return $P||($P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",c="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",x="[object Error]",w="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",A="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",P="[object Int8Array]",T="[object Int16Array]",O="[object Int32Array]",z="[object BigInt64Array]",I="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=w,e.dateTag=c,e.errorTag=x,e.float32ArrayTag=I,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=T,e.int32ArrayTag=O,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=A,e.uint32ArrayTag=_,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(xw)),xw}var ww={},UP;function fce(){return UP||(UP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ww)),ww}var BP;function F3(){return BP||(BP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dce(),n=BN(),r=B3(),i=L3(),a=fce();function o(p,m){return c(p,void 0,p,new Map,m)}function c(p,m,y,v=new Map,x=void 0){const w=x?.(p,m,y,v);if(w!==void 0)return w;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,x);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,A]of p)j.set(k,c(A,k,y,v,x));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(c(k,void 0,y,v,x));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,x);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,x),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,x),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,x),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,x),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,x),j}return p}function d(p,m,y=p,v,x){const w=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<w.length;j++){const k=w[j],A=Object.getOwnPropertyDescriptor(p,k);(A==null||A.writable)&&(p[k]=c(m[k],k,y,v,x))}}function f(p){switch(n.getTag(p)){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=o,e.cloneDeepWithImpl=c,e.copyProperties=d})(yw)),yw}var FP;function hce(){return FP||(FP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F3();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(gw)),gw}var qP;function pce(){return qP||(qP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U3(),n=hce();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(uw)),uw}var Sw={},jw={},Nw={},KP;function mce(){return KP||(KP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F3(),n=BN(),r=B3();function i(a,o){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=o?.(c,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Nw)),Nw}var HP;function gce(){return HP||(HP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mce();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(jw)),jw}var kw={},Cw={},GP;function q3(){return GP||(GP=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})(Cw)),Cw}var _w={},VP;function yce(){return VP||(VP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BN();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(_w)),_w}var ZP;function vce(){return ZP||(ZP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_3(),n=q3(),r=yce(),i=LN();function a(o,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&o?.[c]==null?d=i.toPath(c):d=[c],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(kw)),kw}var YP;function bce(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=U3(),n=IN(),r=gce(),i=$N(),a=vce();function o(c,d){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,c);return p===void 0?a.has(f,c):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=o})(Sw)),Sw}var WP;function xce(){return WP||(WP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M3(),n=cce(),r=pce(),i=bce();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(lw)),lw}var QP;function wce(){return QP||(QP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ice(),n=ace(),r=M3(),i=lce(),a=xce();function o(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(ew)),ew}var Ow,XP;function Sce(){return XP||(XP=1,Ow=wce().uniqBy),Ow}var jce=Sce();const JP=wa(jce);function K3(e,t,n){return t===!0?JP(e,n):typeof t=="function"?JP(e,t):e}var FN=S.createContext(null),Nce=e=>e,ln=()=>{var e=S.useContext(FN);return e?e.store.dispatch:Nce},Hm=()=>{},kce=()=>Hm,Cce=(e,t)=>e===t;function Fe(e){var t=S.useContext(FN),n=S.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Hm,[t,e]);return vI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:kce,t?t.store.getState:Hm,t?t.store.getState:Hm,n,Cce)}function _ce(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Oce(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ace(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 ez=e=>Array.isArray(e)?e:[e];function Ece(e){const t=Array.isArray(e[0])?e[0]:e;return Ace(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Tce(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Pce=class{constructor(e){this.value=e}deref(){return this.value}},zce=typeof WeakRef<"u"?WeakRef:Pce,Rce=0,tz=1;function vm(){return{s:Rce,v:void 0,o:null,p:null}}function H3(e,t={}){let n=vm();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let c=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let x=c.o;x===null&&(c.o=x=new WeakMap);const w=x.get(v);w===void 0?(c=vm(),x.set(v,c)):c=w}else{let x=c.p;x===null&&(c.p=x=new Map);const w=x.get(v);w===void 0?(c=vm(),x.set(v,c)):c=w}}const f=c;let p;if(c.s===tz)p=c.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new zce(p):p}return f.s=tz,f.v=p,p}return o.clearCache=()=>{n=vm(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Mce(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),_ce(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=H3,argsMemoizeOptions:x=[]}=p,w=ez(y),j=ez(x),k=Ece(i),A=m(function(){return a++,f.apply(null,arguments)},...w),_=v(function(){o++;const P=Tce(k,arguments);return c=A.apply(null,P),c},...j);return Object.assign(_,{resultFunc:f,memoizedResultFunc:A,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Mce(H3),Dce=Object.assign((e,t=le)=>{Oce(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(a=>e[a]);return t(r,(...a)=>a.reduce((o,c,d)=>(o[n[d]]=c,o),{}))},{withTypes:()=>Dce}),Aw={},Ew={},Tw={},nz;function Ice(){return nz||(nz=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,a)=>{if(r!==i){const o=t(r),c=t(i);if(o===c&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-o:o-c}return 0};e.compareValues=n})(Tw)),Tw}var Pw={},zw={},rz;function G3(){return rz||(rz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(zw)),zw}var iz;function Lce(){return iz||(iz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=G3(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(Pw)),Pw}var az;function $ce(){return az||(az=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ice(),n=Lce(),r=LN();function i(a,o,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const f=(v,x)=>{let w=v;for(let j=0;j<x.length&&w!=null;++j)w=w[x[j]];return w},p=(v,x)=>x==null||v==null?x:typeof v=="object"&&"key"in v?Object.hasOwn(x,v.key)?x[v.key]:f(x,v.path):typeof v=="function"?v(x):Array.isArray(v)?f(x,v):typeof x=="object"?x[v]:x,m=o.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 a.map(v=>({original:v,criteria:m.map(x=>p(x,v))})).slice().sort((v,x)=>{for(let w=0;w<m.length;w++){const j=t.compareValues(v.criteria[w],x.criteria[w],c[w]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(Ew)),Ew}var Rw={},sz;function Uce(){return sz||(sz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(Rw)),Rw}var Mw={},oz;function V3(){return oz||(oz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q3(),n=D3(),r=I3(),i=$3();function a(o,c,d){return r.isObject(d)&&(typeof c=="number"&&n.isArrayLike(d)&&t.isIndex(c)&&c<d.length||typeof c=="string"&&c in d)?i.isEqualsSameValueZero(d[c],o):!1}e.isIterateeCall=a})(Mw)),Mw}var lz;function Bce(){return lz||(lz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$ce(),n=Uce(),r=V3();function i(a,...o){const c=o.length;return c>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:c>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(Aw)),Aw}var Dw,cz;function Fce(){return cz||(cz=1,Dw=Bce().sortBy),Dw}var qce=Fce();const nv=wa(qce);var Z3=e=>e.legend.settings,Kce=e=>e.legend.size,Hce=e=>e.legend.payload,Gce=le([Hce,Z3],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?nv(r,n):r});function Vce(){return Fe(Gce)}var bm=1;function Y3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),r=S.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>bm||Math.abs(o.left-t.left)>bm||Math.abs(o.top-t.top)>bm||Math.abs(o.width-t.width)>bm)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Gn(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 Zce=typeof Symbol=="function"&&Symbol.observable||"@@observable",uz=Zce,Iw=()=>Math.random().toString(36).substring(7).split("").join("."),Yce={INIT:`@@redux/INIT${Iw()}`,REPLACE:`@@redux/REPLACE${Iw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Iw()}`},Cg=Yce;function qN(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 W3(e,t,n){if(typeof e!="function")throw new Error(Gn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Gn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Gn(1));return n(W3)(e,t)}let r=e,i=t,a=new Map,o=a,c=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(Gn(3));return i}function m(j){if(typeof j!="function")throw new Error(Gn(4));if(d)throw new Error(Gn(5));let k=!0;f();const A=c++;return o.set(A,j),function(){if(k){if(d)throw new Error(Gn(6));k=!1,f(),o.delete(A),a=null}}}function y(j){if(!qN(j))throw new Error(Gn(7));if(typeof j.type>"u")throw new Error(Gn(8));if(typeof j.type!="string")throw new Error(Gn(17));if(d)throw new Error(Gn(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(A=>{A()}),j}function v(j){if(typeof j!="function")throw new Error(Gn(10));r=j,y({type:Cg.REPLACE})}function x(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Gn(11));function A(){const C=k;C.next&&C.next(p())}return A(),{unsubscribe:j(A)}},[uz](){return this}}}return y({type:Cg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[uz]:x}}function Wce(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Cg.INIT})>"u")throw new Error(Gn(12));if(typeof n(void 0,{type:Cg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Gn(13))})}function Q3(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Wce(n)}catch(a){i=a}return function(o={},c){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],x=y(v,c);if(typeof x>"u")throw c&&c.type,new Error(Gn(14));f[m]=x,d=d||x!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function _g(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Qce(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Gn(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(o));return a=_g(...c)(i.dispatch),{...i,dispatch:a}}}function X3(e){return qN(e)&&"type"in e&&typeof e.type=="string"}var J3=Symbol.for("immer-nothing"),dz=Symbol.for("immer-draftable"),pr=Symbol.for("immer-state");function Fi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zr=Object,mu=Zr.getPrototypeOf,Og="constructor",rv="prototype",v1="configurable",Ag="enumerable",Gm="writable",zf="value",as=e=>!!e&&!!e[pr];function Zi(e){return e?e4(e)||av(e)||!!e[dz]||!!e[Og]?.[dz]||sv(e)||ov(e):!1}var Xce=Zr[rv][Og].toString(),fz=new WeakMap;function e4(e){if(!e||!KN(e))return!1;const t=mu(e);if(t===null||t===Zr[rv])return!0;const n=Zr.hasOwnProperty.call(t,Og)&&t[Og];if(n===Object)return!0;if(!qc(n))return!1;let r=fz.get(n);return r===void 0&&(r=Function.toString.call(n),fz.set(n,r)),r===Xce}function iv(e,t,n=!0){sh(e)===0?(n?Reflect.ownKeys(e):Zr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function sh(e){const t=e[pr];return t?t.type_:av(e)?1:sv(e)?2:ov(e)?3:0}var hz=(e,t,n=sh(e))=>n===2?e.has(t):Zr[rv].hasOwnProperty.call(e,t),b1=(e,t,n=sh(e))=>n===2?e.get(t):e[t],Eg=(e,t,n,r=sh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Jce(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var av=Array.isArray,sv=e=>e instanceof Map,ov=e=>e instanceof Set,KN=e=>typeof e=="object",qc=e=>typeof e=="function",Lw=e=>typeof e=="boolean";function eue(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Za=e=>e.copy_||e.base_,HN=e=>e.modified_?e.copy_:e.base_;function x1(e,t){if(sv(e))return new Map(e);if(ov(e))return new Set(e);if(av(e))return Array[rv].slice.call(e);const n=e4(e);if(t===!0||t==="class_only"&&!n){const r=Zr.getOwnPropertyDescriptors(e);delete r[pr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c[Gm]===!1&&(c[Gm]=!0,c[v1]=!0),(c.get||c.set)&&(r[o]={[v1]:!0,[Gm]:!0,[Ag]:c[Ag],[zf]:e[o]})}return Zr.create(mu(e),r)}else{const r=mu(e);if(r!==null&&n)return{...e};const i=Zr.create(r);return Zr.assign(i,e)}}function GN(e,t=!1){return lv(e)||as(e)||!Zi(e)||(sh(e)>1&&Zr.defineProperties(e,{set:xm,add:xm,clear:xm,delete:xm}),Zr.freeze(e),t&&iv(e,(n,r)=>{GN(r,!0)},!1)),e}function tue(){Fi(2)}var xm={[zf]:tue};function lv(e){return e===null||!KN(e)?!0:Zr.isFrozen(e)}var Tg="MapSet",w1="Patches",pz="ArrayMethods",t4={};function Al(e){const t=t4[e];return t||Fi(0,e),t}var mz=e=>!!t4[e],Rf,n4=()=>Rf,nue=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:mz(Tg)?Al(Tg):void 0,arrayMethodsPlugin_:mz(pz)?Al(pz):void 0});function gz(e,t){t&&(e.patchPlugin_=Al(w1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function S1(e){j1(e),e.drafts_.forEach(rue),e.drafts_=null}function j1(e){e===Rf&&(Rf=e.parent_)}var yz=e=>Rf=nue(Rf,e);function rue(e){const t=e[pr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vz(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[pr].modified_&&(S1(t),Fi(4)),Zi(e)&&(e=bz(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[pr].base_,e,t)}else e=bz(t,n);return iue(t,e,!0),S1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==J3?e:void 0}function bz(e,t){if(lv(t))return t;const n=t[pr];if(!n)return Pg(t,e.handledSet_,e);if(!cv(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);a4(n,e)}return n.copy_}function iue(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&GN(t,n)}function r4(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cv=(e,t)=>e.scope_===t,aue=[];function i4(e,t,n,r){const i=Za(e),a=e.type_;if(r!==void 0&&b1(i,r,a)===t){Eg(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;iv(i,(d,f)=>{if(as(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const o=e.draftLocations_.get(t)??aue;for(const c of o)Eg(i,c,n,a)}function sue(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!cv(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=HN(a);i4(e,a.draft_??a,o,n),a4(a,i)})}function a4(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)}r4(e)}}function oue(e,t,n){const{scope_:r}=e;if(as(n)){const i=n[pr];cv(i,r)&&i.callbacks_.push(function(){Vm(e);const o=HN(i);i4(e,n,o,t)})}else Zi(n)&&e.callbacks_.push(function(){const a=Za(e);e.type_===3?a.has(n)&&Pg(n,r.handledSet_,r):b1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Pg(b1(e.copy_,t,e.type_),r.handledSet_,r)})}function Pg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||as(e)||t.has(e)||!Zi(e)||lv(e)||(t.add(e),iv(e,(r,i)=>{if(as(i)){const a=i[pr];if(cv(a,n)){const o=HN(a);Eg(e,r,o,e.type_),r4(a)}}else Zi(i)&&Pg(i,t,n)})),e}function lue(e,t){const n=av(e),r={type_:n?1:0,scope_:t?t.scope_:n4(),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,a=zg;n&&(i=[r],a=Mf);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,[c,r]}var zg={get(e,t){if(t===pr)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=Za(e);if(!hz(i,t,e.type_))return cue(e,i,t);const a=i[t];if(e.finalized_||!Zi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&eue(t))return a;if(a===$w(e.base_,t)){Vm(e);const o=e.type_===1?+t:t,c=k1(e.scope_,a,e,o);return e.copy_[o]=c}return a},has(e,t){return t in Za(e)},ownKeys(e){return Reflect.ownKeys(Za(e))},set(e,t,n){const r=s4(Za(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=$w(Za(e),t),a=i?.[pr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Jce(n,i)&&(n!==void 0||hz(e.base_,t,e.type_)))return!0;Vm(e),N1(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),oue(e,t,n)),!0},deleteProperty(e,t){return Vm(e),$w(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),N1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Za(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Gm]:!0,[v1]:e.type_!==1||t!=="length",[Ag]:r[Ag],[zf]:n[t]}},defineProperty(){Fi(11)},getPrototypeOf(e){return mu(e.base_)},setPrototypeOf(){Fi(12)}},Mf={};for(let e in zg){let t=zg[e];Mf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Mf.deleteProperty=function(e,t){return Mf.set.call(this,e,t,void 0)};Mf.set=function(e,t,n){return zg.set.call(this,e[0],t,n,e[0])};function $w(e,t){const n=e[pr];return(n?Za(n):e)[t]}function cue(e,t,n){const r=s4(t,n);return r?zf in r?r[zf]:r.get?.call(e.draft_):void 0}function s4(e,t){if(!(t in e))return;let n=mu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=mu(n)}}function N1(e){e.modified_||(e.modified_=!0,e.parent_&&N1(e.parent_))}function Vm(e){e.copy_||(e.assigned_=new Map,e.copy_=x1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var uue=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(qc(n)&&!qc(r)){const o=r;r=n;const c=this;return function(f=o,...p){return c.produce(f,m=>r.call(this,m,...p))}}qc(r)||Fi(6),i!==void 0&&!qc(i)&&Fi(7);let a;if(Zi(n)){const o=yz(this),c=k1(o,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?S1(o):j1(o)}return gz(o,i),vz(a,o)}else if(!n||!KN(n)){if(a=r(n),a===void 0&&(a=n),a===J3&&(a=void 0),this.autoFreeze_&&GN(a,!0),i){const o=[],c=[];Al(w1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:c}),i(o,c)}return a}else Fi(1,n)},this.produceWithPatches=(n,r)=>{if(qc(n))return(c,...d)=>this.produceWithPatches(c,f=>n(f,...d));let i,a;return[this.produce(n,r,(c,d)=>{i=c,a=d}),i,a]},Lw(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Lw(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Lw(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Zi(t)||Fi(8),as(t)&&(t=xi(t));const n=yz(this),r=k1(n,t,void 0);return r[pr].isManual_=!0,j1(n),r}finishDraft(t,n){const r=t&&t[pr];(!r||!r.isManual_)&&Fi(9);const{scope_:i}=r;return gz(i,n),vz(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 a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Al(w1).applyPatches_;return as(t)?i(t,n):this.produce(t,a=>i(a,n))}};function k1(e,t,n,r){const[i,a]=sv(t)?Al(Tg).proxyMap_(t,n):ov(t)?Al(Tg).proxySet_(t,n):lue(t,n);return(n?.scope_??n4()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?sue(n,a,r):a.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function xi(e){return as(e)||Fi(10,e),o4(e)}function o4(e){if(!Zi(e)||lv(e))return e;const t=e[pr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=x1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=x1(e,!0);return iv(n,(i,a)=>{Eg(n,i,o4(a))},r),t&&(t.finalized_=!1),n}var due=new uue,l4=due.produce;function c4(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var fue=c4(),hue=c4,pue=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_g:_g.apply(null,arguments)};function Wr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Yr(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=>X3(r)&&r.type===e,n}var u4=class sf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sf.prototype)}static get[Symbol.species](){return sf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sf(...t[0].concat(this)):new sf(...t.concat(this))}};function xz(e){return Zi(e)?l4(e,()=>{}):e}function wm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function mue(e){return typeof e=="boolean"}var gue=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new u4;return n&&(mue(n)?o.push(fue):o.push(hue(n.extraArgument))),o},d4="RTK_autoBatch",Vt=()=>e=>({payload:e,meta:{[d4]:!0}}),wz=e=>t=>{setTimeout(t,e)},f4=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:wz(10):e.type==="callback"?e.queueNotification:wz(e.timeout),f=()=>{o=!1,a&&(a=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return c.add(p),()=>{y(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[d4],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},yue=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new u4(e);return r&&i.push(f4(typeof r=="object"?r:void 0)),i};function vue(e){const t=gue(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(qN(n))c=Q3(n);else throw new Error(Yr(1));let d;typeof r=="function"?d=r(t):d=t();let f=_g;i&&(f=pue({trace:!1,...typeof i=="object"&&i}));const p=Qce(...d),m=yue(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return W3(c,a,v)}function h4(e){const t={},n=[];let r;const i={addCase(a,o){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(Yr(28));if(c in t)throw new Error(Yr(29));return t[c]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function bue(e){return typeof e=="function"}function xue(e,t){let[n,r,i]=h4(t),a;if(bue(e))a=()=>xz(e());else{const c=xz(e);a=()=>c}function o(c=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(as(p)){const v=m(p,d);return v===void 0?p:v}else{if(Zi(p))return l4(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},c)}return o.getInitialState=a,o}var wue="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Sue=(e=21)=>{let t="",n=e;for(;n--;)t+=wue[Math.random()*64|0];return t},jue=Symbol.for("rtk-slice-createasyncthunk");function Nue(e,t){return`${e}/${t}`}function kue({creators:e}={}){const t=e?.asyncThunk?.[jue];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Yr(11));const o=(typeof r.reducers=="function"?r.reducers(_ue()):r.reducers)||{},c=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,C){const P=typeof _=="string"?_:_.type;if(!P)throw new Error(Yr(12));if(P in d.sliceCaseReducersByType)throw new Error(Yr(13));return d.sliceCaseReducersByType[P]=C,f},addMatcher(_,C){return d.sliceMatchers.push({matcher:_,reducer:C}),f},exposeAction(_,C){return d.actionCreators[_]=C,f},exposeCaseReducer(_,C){return d.sliceCaseReducersByName[_]=C,f}};c.forEach(_=>{const C=o[_],P={reducerName:_,type:Nue(i,_),createNotation:typeof r.reducers=="function"};Aue(C)?Tue(P,C,f,t):Oue(P,C,f)});function p(){const[_={},C=[],P=void 0]=typeof r.extraReducers=="function"?h4(r.extraReducers):[r.extraReducers],T={..._,...d.sliceCaseReducersByType};return xue(r.initialState,O=>{for(let z in T)O.addCase(z,T[z]);for(let z of d.sliceMatchers)O.addMatcher(z.matcher,z.reducer);for(let z of C)O.addMatcher(z.matcher,z.reducer);P&&O.addDefaultCase(P)})}const m=_=>_,y=new Map,v=new WeakMap;let x;function w(_,C){return x||(x=p()),x(_,C)}function j(){return x||(x=p()),x.getInitialState()}function k(_,C=!1){function P(O){let z=O[_];return typeof z>"u"&&C&&(z=wm(v,P,j)),z}function T(O=m){const z=wm(y,C,()=>new WeakMap);return wm(z,O,()=>{const I={};for(const[F,$]of Object.entries(r.selectors??{}))I[F]=Cue($,O,()=>wm(v,O,j),C);return I})}return{reducerPath:_,getSelectors:T,get selectors(){return T(P)},selectSlice:P}}const A={name:i,reducer:w,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(_,{reducerPath:C,...P}={}){const T=C??a;return _.inject({reducerPath:T,reducer:w},P),{...A,...k(T,!0)}}};return A}}function Cue(e,t,n,r){function i(a,...o){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...o)}return i.unwrapped=e,i}var sr=kue();function _ue(){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 Oue({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Eue(r))throw new Error(Yr(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Wr(e,o):Wr(e))}function Aue(e){return e._reducerDefinitionType==="asyncThunk"}function Eue(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Tue({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Yr(18));const{payloadCreator:a,fulfilled:o,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Sm,pending:c||Sm,rejected:d||Sm,settled:f||Sm})}function Sm(){}var Pue="task",p4="listener",m4="completed",VN="cancelled",zue=`task-${VN}`,Rue=`task-${m4}`,C1=`${p4}-${VN}`,Mue=`${p4}-${m4}`,uv=class{constructor(e){this.code=e,this.message=`${Pue} ${VN} (reason: ${e})`}name="TaskAbortError";message},ZN=(e,t)=>{if(typeof e!="function")throw new TypeError(Yr(32))},Rg=()=>{},g4=(e,t=Rg)=>(e.catch(t),e),y4=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),vl=e=>{if(e.aborted)throw new uv(e.reason)};function v4(e,t){let n=Rg;return new Promise((r,i)=>{const a=()=>i(new uv(e.reason));if(e.aborted){a();return}n=y4(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Rg})}var Due=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof uv?"cancelled":"rejected",error:n}}finally{t?.()}},Mg=e=>t=>g4(v4(e,t).then(n=>(vl(e),n))),b4=e=>{const t=Mg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:su}=Object,Sz={},dv="listenerMiddleware",Iue=(e,t)=>{const n=r=>y4(e,()=>r.abort(e.reason));return(r,i)=>{ZN(r);const a=new AbortController;n(a);const o=Due(async()=>{vl(e),vl(a.signal);const c=await r({pause:Mg(a.signal),delay:b4(a.signal),signal:a.signal});return vl(a.signal),c},()=>a.abort(Rue));return i?.autoJoin&&t.push(o.catch(Rg)),{result:Mg(e)(o),cancel(){a.abort(zue)}}}},Lue=(e,t)=>{const n=async(r,i)=>{vl(t);let a=()=>{};const c=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&c.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await v4(t,Promise.race(c));return vl(t),d}finally{a()}};return(r,i)=>g4(n(r,i))},x4=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Wr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Yr(21));return ZN(a),{predicate:i,type:t,effect:a}},w4=su(e=>{const{type:t,predicate:n,effect:r}=x4(e);return{id:Sue(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Yr(22))}}},{withTypes:()=>w4}),jz=(e,t)=>{const{type:n,effect:r,predicate:i}=x4(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},_1=e=>{e.pending.forEach(t=>{t.abort(C1)})},$ue=(e,t)=>()=>{for(const n of t.keys())_1(n);e.clear()},Nz=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},S4=su(Wr(`${dv}/add`),{withTypes:()=>S4}),Uue=Wr(`${dv}/removeAll`),j4=su(Wr(`${dv}/remove`),{withTypes:()=>j4}),Bue=(...e)=>{console.error(`${dv}/error`,...e)},oh=(e={})=>{const t=new Map,n=new Map,r=v=>{const x=n.get(v)??0;n.set(v,x+1)},i=v=>{const x=n.get(v)??1;x===1?n.delete(v):n.set(v,x-1)},{extra:a,onError:o=Bue}=e;ZN(o);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),x=>{v.unsubscribe(),x?.cancelActive&&_1(v)}),d=v=>{const x=jz(t,v)??w4(v);return c(x)};su(d,{withTypes:()=>d});const f=v=>{const x=jz(t,v);return x&&(x.unsubscribe(),v.cancelActive&&_1(x)),!!x};su(f,{withTypes:()=>f});const p=async(v,x,w,j)=>{const k=new AbortController,A=Lue(d,k.signal),_=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(x,su({},w,{getOriginalState:j,condition:(C,P)=>A(C,P).then(Boolean),take:A,delay:b4(k.signal),pause:Mg(k.signal),extra:a,signal:k.signal,fork:Iue(k.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,P,T)=>{C!==k&&(C.abort(C1),T.delete(C))})},cancel:()=>{k.abort(C1),v.pending.delete(k)},throwIfCancelled:()=>{vl(k.signal)}})))}catch(C){C instanceof uv||Nz(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),k.abort(Mue),i(v),v.pending.delete(k)}},m=$ue(t,n);return{middleware:v=>x=>w=>{if(!X3(w))return x(w);if(S4.match(w))return d(w.payload);if(Uue.match(w)){m();return}if(j4.match(w))return f(w.payload);let j=v.getState();const k=()=>{if(j===Sz)throw new Error(Yr(23));return j};let A;try{if(A=x(w),t.size>0){const _=v.getState(),C=Array.from(t.values());for(const P of C){let T=!1;try{T=P.predicate(w,_,j)}catch(O){T=!1,Nz(o,O,{raisedBy:"predicate"})}T&&p(P,w,v,k)}}}finally{j=Sz}return A},startListening:d,stopListening:f,clearListeners:m}};function Yr(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 Fue={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},N4=sr({name:"chartLayout",initialState:Fue,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,a;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=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:que,setLayout:Kue,setChartSize:Hue,setScale:Gue}=N4.actions,Vue=N4.reducer;function k4(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function nt(e){return Number.isFinite(e)}function va(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 Yc(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){Zue(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 Zue(e,t,n){return(t=Yue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yue(e){var t=Wue(e,"string");return typeof t=="symbol"?t:t+""}function Wue(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 Ln(e,t,n){return Qn(e)||Qn(t)?n:Ni(t)?tv(e,t,n):typeof t=="function"?t(e):n}var Que=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:c}=t;if((c==="vertical"||c==="horizontal"&&o==="middle")&&a!=="center"&&Ue(e[a]))return Yc(Yc({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&o!=="middle"&&Ue(e[o]))return Yc(Yc({},e),{},{[o]:e[o]+(i||0)})}return e},Sa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",C4=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,o=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||o.push(t),a||o.push(n),o},_4=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var x=c==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=i==="category"&&o.bandwidth?o.bandwidth()/x:0;if(w=v==="angleAxis"&&a&&a.length>=2?bi(a[0]-a[1])*2*w:w,m||y){var j=(m||y||[]).map((k,A)=>{var _=r?r.indexOf(k):k,C=o.map(_);return nt(C)?{coordinate:C+w,value:k,offset:w,index:A}:null}).filter(Ar);return j}return d&&f?f.map((k,A)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:k,index:A,offset:w}:null}).filter(Ar):o.ticks&&p!=null?o.ticks(p).map((k,A)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:k,index:A,offset:w}:null}).filter(Ar):o.domain().map((k,A)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:r?r[k]:k,index:A,offset:w}:null}).filter(Ar)},Xue=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 a=0,o=0,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=ya(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},Jue=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 a=0,o=0;o<n;++o){var c=e[o],d=c?.[i];if(d!=null){var f=ya(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},ede={sign:Xue,expand:Cle,none:_l,silhouette:_le,wiggle:Ole,positive:Jue},tde=(e,t,n)=>{var r,i=(r=ede[n])!==null&&r!==void 0?r:_l,a=kle().keys(t).value((c,d)=>Number(Ln(c,d,0))).order(g1).offset(i),o=a(e);return o.forEach((c,d)=>{c.forEach((f,p)=>{var m=Ln(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Ue(m[0])&&Ue(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function nde(e){return e==null?void 0:String(e)}function Cz(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qn(i[t.dataKey])){var c=A3(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=Ln(i,Qn(o)?t.dataKey:o),f=t.scale.map(d);return Ue(f)?f:null}var rde=e=>{var t=e.flat(2).filter(Ue);return[Math.min(...t),Math.max(...t)]},ide=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ade=(e,t,n)=>{if(e!=null)return ide(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,c=o.reduce((d,f)=>{var p=k4(f,t,n),m=rde(p);return!nt(m[0])||!nt(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},_z=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Oz=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dg=(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=nv(t,p=>p.coordinate),a=1/0,o=1,c=i.length;o<c;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function Az(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Yc(Yc({},t),{},{dataKey:n,payload:r,value:i,name:a})}function O4(e,t){if(e)return String(e);if(typeof t=="string")return t}var sde=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},ode=(e,t)=>t==="centric"?e.angle:e.radius,us=e=>e.layout.width,ds=e=>e.layout.height,lde=e=>e.layout.scale,A4=e=>e.layout.margin,fv=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),hv=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),cde="data-recharts-item-index",ude="data-recharts-item-id",lh=60;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 jm(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){dde(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 dde(e,t,n){return(t=fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fde(e){var t=hde(e,"string");return typeof t=="symbol"?t:t+""}function hde(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 pde=e=>e.brush.height;function mde(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lh;return n+i}return n},0)}function gde(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lh;return n+i}return n},0)}function yde(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function vde(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Xn=le([us,ds,A4,pde,mde,gde,yde,vde,Z3,Kce],(e,t,n,r,i,a,o,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+c},y=jm(jm({},m),p),v=y.bottom;y.bottom+=r,y=Que(y,d,f);var x=e-y.left-y.right,w=t-y.top-y.bottom;return jm(jm({brushBottom:v},y),{},{width:Math.max(x,0),height:Math.max(w,0)})}),bde=le(Xn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),E4=le(us,ds,(e,t)=>({x:0,y:0,width:e,height:t})),xde=S.createContext(null),gr=()=>S.useContext(xde)!=null,pv=e=>e.brush,mv=le([pv,Xn,A4],(e,t,n)=>({height:e.height,x:Ue(e.x)?e.x:t.left,y:Ue(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Ue(e.width)?e.width:t.width})),Uw={},Bw={},Fw={},Tz;function wde(){return Tz||(Tz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(o,c),o=void 0,c=null)},m=()=>{f&&p(),w()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},x=()=>{y!==null&&(clearTimeout(y),y=null)},w=()=>{x(),o=void 0,c=null},j=()=>{p()},k=function(...A){if(i?.aborted)return;o=this,c=A;const _=y==null;v(),d&&_&&p()};return k.schedule=v,k.cancel=w,k.flush=j,i?.addEventListener("abort",w,{once:!0}),k}e.debounce=t})(Fw)),Fw}var Pz;function Sde(){return Pz||(Pz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wde();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),c&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...w){p=r.apply(this,w),m=null},i,{edges:f}),v=function(...w){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,w),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,w),p)},x=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=x,v}e.debounce=n})(Bw)),Bw}var zz;function jde(){return zz||(zz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sde();function n(r,i=0,a={}){const{leading:o=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:c})}e.throttle=n})(Uw)),Uw}var qw,Rz;function Nde(){return Rz||(Rz=1,qw=jde().throttle),qw}var kde=Nde();const Cde=wa(kde);var Ig=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];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 o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},da={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},T4=(e,t,n)=>{var{width:r=da.width,height:i=da.height,aspect:a,maxHeight:o}=n,c=Ol(r)?e:Number(r),d=Ol(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:c,calculatedHeight:d}},_de={width:0,height:0,overflow:"visible"},Ode={width:0,overflowX:"visible"},Ade={height:0,overflowY:"visible"},Ede={},Tde=e=>{var{width:t,height:n}=e,r=Ol(t),i=Ol(n);return r&&i?_de:r?Ode:i?Ade:Ede};function Pde(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=da.width,a=da.height):i===void 0?i=r&&r>0?void 0:da.width:a===void 0&&(a=r&&r>0?void 0:da.height),{width:i,height:a}}function O1(){return O1=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},O1.apply(null,arguments)}function Mz(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 Dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mz(Object(n),!0).forEach(function(r){zde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zde(e,t,n){return(t=Rde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rde(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)}var P4=S.createContext(da.initialDimension);function Dde(e){return va(e.width)&&va(e.height)}function z4(e){var{children:t,width:n,height:r}=e,i=S.useMemo(()=>({width:n,height:r}),[n,r]);return Dde(i)?S.createElement(P4.Provider,{value:i},t):null}var YN=()=>S.useContext(P4),Ide=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=da.initialDimension,width:i,height:a,minWidth:o=da.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=da.debounce,id:m,className:y,onResize:v,style:x={}}=e,w=S.useRef(null),j=S.useRef();j.current=v,S.useImperativeHandle(t,()=>w.current);var[k,A]=S.useState({containerWidth:r.width,containerHeight:r.height}),_=S.useCallback((z,I)=>{A(F=>{var $=Math.round(z),L=Math.round(I);return F.containerWidth===$&&F.containerHeight===L?F:{containerWidth:$,containerHeight:L}})},[]);S.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Mu;var z=L=>{var J,ae=L[0];if(ae!=null){var{width:Q,height:K}=ae.contentRect;_(Q,K),(J=j.current)===null||J===void 0||J.call(j,Q,K)}};p>0&&(z=Cde(z,p,{trailing:!0,leading:!1}));var I=new ResizeObserver(z),{width:F,height:$}=w.current.getBoundingClientRect();return _(F,$),I.observe(w.current),()=>{I.disconnect()}},[_,p]);var{containerWidth:C,containerHeight:P}=k;Ig(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:T,calculatedHeight:O}=T4(C,P,{width:i,height:a,aspect:n,maxHeight:d});return Ig(T!=null&&T>0||O!=null&&O>0,`The width(%s) and height(%s) of chart should be greater than 0,
257
- please check the style of container, or the props width(%s) and height(%s),
258
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
259
- height and width.`,T,O,i,a,o,c,n),S.createElement("div",{id:m?"".concat(m):void 0,className:Ct("recharts-responsive-container",y),style:Dz(Dz({},x),{},{width:i,height:a,minWidth:o,minHeight:c,maxHeight:d}),ref:w},S.createElement("div",{style:Tde({width:i,height:a})},S.createElement(z4,{width:T,height:O},f)))}),A1=S.forwardRef((e,t)=>{var n=YN();if(va(n.width)&&va(n.height))return e.children;var{width:r,height:i}=Pde({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=T4(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ue(a)&&Ue(o)?S.createElement(z4,{width:a,height:o},e.children):S.createElement(Ide,O1({},e,{width:r,height:i,ref:t}))});function WN(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 ch=()=>{var e,t=gr(),n=Fe(bde),r=Fe(mv),i=(e=Fe(pv))===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}},Lde={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},R4=()=>{var e;return(e=Fe(Xn))!==null&&e!==void 0?e:Lde},QN=()=>Fe(us),XN=()=>Fe(ds),$de=()=>Fe(e=>e.layout.margin),en=e=>e.layout.layoutType,Du=()=>Fe(en),JN=()=>{var e=Du();if(e==="horizontal"||e==="vertical")return e},M4=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Ude=()=>{var e=Du();return e!==void 0},uh=e=>{var t=ln(),n=gr(),{width:r,height:i}=e,a=YN(),o=r,c=i;return a&&(o=a.width>0?a.width:r,c=a.height>0?a.height:i),S.useEffect(()=>{!n&&va(o)&&va(c)&&t(Hue({width:o,height:c}))},[t,n,o,c]),null},D4=Symbol.for("immer-nothing"),Iz=Symbol.for("immer-draftable"),Qr=Symbol.for("immer-state");function qi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Df=Object.getPrototypeOf;function gu(e){return!!e&&!!e[Qr]}function El(e){return e?I4(e)||Array.isArray(e)||!!e[Iz]||!!e.constructor?.[Iz]||dh(e)||yv(e):!1}var Bde=Object.prototype.constructor.toString(),Lz=new WeakMap;function I4(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=Lz.get(n);return r===void 0&&(r=Function.toString.call(n),Lz.set(n,r)),r===Bde}function Lg(e,t,n=!0){gv(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 gv(e){const t=e[Qr];return t?t.type_:Array.isArray(e)?1:dh(e)?2:yv(e)?3:0}function E1(e,t){return gv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function L4(e,t,n){const r=gv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Fde(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function dh(e){return e instanceof Map}function yv(e){return e instanceof Set}function nl(e){return e.copy_||e.base_}function T1(e,t){if(dh(e))return new Map(e);if(yv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=I4(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Qr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[o]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[o]})}return Object.create(Df(e),r)}else{const r=Df(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function ek(e,t=!1){return vv(e)||gu(e)||!El(e)||(gv(e)>1&&Object.defineProperties(e,{set:Nm,add:Nm,clear:Nm,delete:Nm}),Object.freeze(e),t&&Object.values(e).forEach(n=>ek(n,!0))),e}function qde(){qi(2)}var Nm={value:qde};function vv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Kde={};function Tl(e){const t=Kde[e];return t||qi(0,e),t}var If;function $4(){return If}function Hde(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $z(e,t){t&&(Tl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function P1(e){z1(e),e.drafts_.forEach(Gde),e.drafts_=null}function z1(e){e===If&&(If=e.parent_)}function Uz(e){return If=Hde(If,e)}function Gde(e){const t=e[Qr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Bz(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Qr].modified_&&(P1(t),qi(4)),El(e)&&(e=$g(t,e),t.parent_||Ug(t,e)),t.patches_&&Tl("Patches").generateReplacementPatches_(n[Qr].base_,e,t.patches_,t.inversePatches_)):e=$g(t,n,[]),P1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==D4?e:void 0}function $g(e,t,n){if(vv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Qr];if(!i)return Lg(t,(a,o)=>Fz(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Ug(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,c=!1;i.type_===3&&(o=new Set(a),a.clear(),c=!0),Lg(o,(d,f)=>Fz(e,i,a,d,f,n,c),r),Ug(e,a,!1),n&&e.patches_&&Tl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function Fz(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const c=vv(i);if(!(c&&!o)){if(gu(i)){const d=a&&t&&t.type_!==3&&!E1(t.assigned_,r)?a.concat(r):void 0,f=$g(e,i,d);if(L4(n,r,f),gu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(El(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;$g(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(dh(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Ug(e,i)}}}function Ug(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ek(t,n)}function Vde(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:$4(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=tk;n&&(i=[r],a=Lf);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,c}var tk={get(e,t){if(t===Qr)return e;const n=nl(e);if(!E1(n,t))return Zde(e,n,t);const r=n[t];return e.finalized_||!El(r)?r:r===Kw(e.base_,t)?(Hw(e),e.copy_[t]=M1(r,e)):r},has(e,t){return t in nl(e)},ownKeys(e){return Reflect.ownKeys(nl(e))},set(e,t,n){const r=U4(nl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Kw(nl(e),t),a=i?.[Qr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Fde(n,i)&&(n!==void 0||E1(e.base_,t)))return!0;Hw(e),R1(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 Kw(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hw(e),R1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=nl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){qi(11)},getPrototypeOf(e){return Df(e.base_)},setPrototypeOf(){qi(12)}},Lf={};Lg(tk,(e,t)=>{Lf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Lf.deleteProperty=function(e,t){return Lf.set.call(this,e,t,void 0)};Lf.set=function(e,t,n){return tk.set.call(this,e[0],t,n,e[0])};function Kw(e,t){const n=e[Qr];return(n?nl(n):e)[t]}function Zde(e,t,n){const r=U4(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function U4(e,t){if(!(t in e))return;let n=Df(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Df(n)}}function R1(e){e.modified_||(e.modified_=!0,e.parent_&&R1(e.parent_))}function Hw(e){e.copy_||(e.copy_=T1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Yde=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 a=n;n=t;const o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&qi(6),r!==void 0&&typeof r!="function"&&qi(7);let i;if(El(t)){const a=Uz(this),o=M1(t,void 0);let c=!0;try{i=n(o),c=!1}finally{c?P1(a):z1(a)}return $z(a,r),Bz(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===D4&&(i=void 0),this.autoFreeze_&&ek(i,!0),r){const a=[],o=[];Tl("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else qi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...c)=>this.produceWithPatches(o,d=>t(d,...c));let r,i;return[this.produce(t,n,(o,c)=>{r=o,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){El(e)||qi(8),gu(e)&&(e=Wde(e));const t=Uz(this),n=M1(e,void 0);return n[Qr].isManual_=!0,z1(t),n}finishDraft(e,t){const n=e&&e[Qr];(!n||!n.isManual_)&&qi(9);const{scope_:r}=n;return $z(r,t),Bz(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=Tl("Patches").applyPatches_;return gu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function M1(e,t){const n=dh(e)?Tl("MapSet").proxyMap_(e,t):yv(e)?Tl("MapSet").proxySet_(e,t):Vde(e,t);return(t?t.scope_:$4()).drafts_.push(n),n}function Wde(e){return gu(e)||qi(10,e),B4(e)}function B4(e){if(!El(e)||vv(e))return e;const t=e[Qr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=T1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=T1(e,!0);return Lg(n,(i,a)=>{L4(n,i,B4(a))},r),t&&(t.finalized_=!1),n}var Qde=new Yde;Qde.produce;var Xde={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},F4=sr({name:"legend",initialState:Xde,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:Vt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Vt()},removeLegendPayload:{reducer(e,t){var n=xi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Vt()}}}),{setLegendSize:qz,setLegendSettings:Jde,addLegendPayload:efe,replaceLegendPayload:tfe,removeLegendPayload:nfe}=F4.actions,rfe=F4.reducer,Gw={exports:{}},Vw={};var Kz;function ife(){if(Kz)return Vw;Kz=1;var e=Nu();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Vw.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=o(function(){function j(P){if(!k){if(k=!0,A=P,P=m(P),y!==void 0&&x.hasValue){var T=x.value;if(y(T,P))return _=T}return _=P}if(T=_,n(A,P))return T;var O=m(P);return y!==void 0&&y(T,O)?(A=P,T):(A=P,_=O)}var k=!1,A,_,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var w=r(d,v[0],v[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},Vw}var Hz;function afe(){return Hz||(Hz=1,Gw.exports=ife()),Gw.exports}afe();function sfe(e){e()}function ofe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){sfe(()=>{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 Gz={notify(){},get:()=>[]};function lfe(e,t){let n,r=Gz,i=0,a=!1;function o(w){p();const j=r.subscribe(w);let k=!1;return()=>{k||(k=!0,j(),m())}}function c(){r.notify()}function d(){x.onStateChange&&x.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=ofe())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Gz)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const x={addNestedSub:o,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return x}var cfe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ufe=cfe(),dfe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ffe=dfe(),hfe=()=>ufe||ffe?S.useLayoutEffect:S.useEffect,pfe=hfe();function Vz(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function mfe(e,t){if(Vz(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])||!Vz(e[n[i]],t[n[i]]))return!1;return!0}var gfe=Symbol.for("react-redux-context"),yfe=typeof globalThis<"u"?globalThis:{};function vfe(){if(!S.createContext)return{};const e=yfe[gfe]??=new Map;let t=e.get(S.createContext);return t||(t=S.createContext(null),e.set(S.createContext,t)),t}var bfe=vfe();function xfe(e){const{children:t,context:n,serverState:r,store:i}=e,a=S.useMemo(()=>{const d=lfe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=S.useMemo(()=>i.getState(),[i]);pfe(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const c=n||bfe;return S.createElement(c.Provider,{value:a},t)}var wfe=xfe,Sfe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function jfe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function fh(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Sfe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!mfe(e[r],t[r]))return!1}else if(!jfe(e[r],t[r]))return!1;return!0}var Nfe=["contextPayload"];function D1(){return D1=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},D1.apply(null,arguments)}function Zz(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 yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zz(Object(n),!0).forEach(function(r){kfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kfe(e,t,n){return(t=Cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cfe(e){var t=_fe(e,"string");return typeof t=="symbol"?t:t+""}function _fe(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 Ofe(e,t){if(e==null)return{};var n,r,i=Afe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Afe(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 Efe(e){return e.value}function Tfe(e){var{contextPayload:t}=e,n=Ofe(e,Nfe),r=K3(t,e.payloadUniqBy,Efe),i=yu(yu({},n),{},{payload:r});return S.isValidElement(e.content)?S.cloneElement(e.content,i):typeof e.content=="function"?S.createElement(e.content,i):S.createElement(rce,i)}function Pfe(e,t,n,r,i,a){var{layout:o,align:c,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=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))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),yu(yu({},f),p)}function zfe(e){var t=ln();return S.useEffect(()=>{t(Jde(e))},[t,e]),null}function Rfe(e){var t=ln();return S.useEffect(()=>(t(qz(e)),()=>{t(qz({width:0,height:0}))}),[t,e]),null}function Mfe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Dfe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Ife(e){var t=mr(e,Dfe),n=Vce(),r=Yoe(),i=$de(),{width:a,height:o,wrapperStyle:c,portal:d}=t,[f,p]=Y3([n]),m=QN(),y=XN();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),x=Mfe(t.layout,o,a,v),w=d?c:yu(yu({position:"absolute",width:x?.width||a||"auto",height:x?.height||o||"auto"},Pfe(c,t,i,m,y,f)),c),j=d??r;if(j==null||n==null)return null;var k=S.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},S.createElement(zfe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(Rfe,{width:f.width,height:f.height}),S.createElement(Tfe,D1({},t,x,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return Dl.createPortal(k,j)}var I1=S.memo(Ife,fh);I1.displayName="Legend";function L1(){return L1=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},L1.apply(null,arguments)}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 Gd(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){Lfe(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 Lfe(e,t,n){return(t=$fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $fe(e){var t=Ufe(e,"string");return typeof t=="symbol"?t:t+""}function Ufe(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 Bfe(e){return Array.isArray(e)&&Ni(e[0])&&Ni(e[1])?e.join(" ~ "):e}var Mc={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 Ffe(e,t){return t==null?e:nv(e,t)}var qfe=e=>{var{separator:t=Mc.separator,contentStyle:n,itemStyle:r,labelStyle:i=Mc.labelStyle,payload:a,formatter:o,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Mc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},T=Ffe(a,c),O=T.map((z,I)=>{if(!z||z.type==="none")return null;var F=z.formatter||o||Bfe,{value:$,name:L}=z,J=$,ae=L;if(F){var Q=F($,L,z,I,a);if(Array.isArray(Q))[J,ae]=Q;else if(Q!=null)J=Q;else return null}var K=Gd(Gd({},Mc.itemStyle),{},{color:z.color||Mc.itemStyle.color},r);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:K},Ni(ae)?S.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,Ni(ae)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},J),S.createElement("span",{className:"recharts-tooltip-item-unit"},z.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:P},O)}return null},x=Gd(Gd({},Mc.contentStyle),n),w=Gd({margin:0},i),j=!Qn(p),k=j?p:"",A=Ct("recharts-default-tooltip",d),_=Ct("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",L1({className:A,style:x},C),S.createElement("p",{className:_,style:w},S.isValidElement(k)?k:"".concat(k)),v())},Vd="recharts-tooltip-wrapper",Kfe={visibility:"hidden"};function Hfe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ct(Vd,{["".concat(Vd,"-right")]:Ue(n)&&t&&Ue(t.x)&&n>=t.x,["".concat(Vd,"-left")]:Ue(n)&&t&&Ue(t.x)&&n<t.x,["".concat(Vd,"-bottom")]:Ue(r)&&t&&Ue(t.y)&&r>=t.y,["".concat(Vd,"-top")]:Ue(r)&&t&&Ue(t.y)&&r<t.y})}function Wz(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&Ue(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,x=y;return v<x?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var w=m+c,j=y+f;return w>j?Math.max(p,y):Math.max(m,y)}function Gfe(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 Vfe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,y;return c.height>0&&c.width>0&&n?(m=Wz({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),y=Wz({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=Gfe({translateX:m,translateY:y,useTranslate3d:d})):p=Kfe,{cssProperties:p,cssClasses:Hfe({translateX:m,translateY:y,coordinate:n})}}var Zfe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),hh={isSsr:Zfe()};function q4(){var[e,t]=S.useState(()=>hh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return S.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 Qz(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 Dc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qz(Object(n),!0).forEach(function(r){Yfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yfe(e,t,n){return(t=Wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wfe(e){var t=Qfe(e,"string");return typeof t=="symbol"?t:t+""}function Qfe(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 Xfe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Jfe(e){var t,n,r,i,a,o,c=q4(),[d,f]=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));S.useEffect(()=>{var x=w=>{if(w.key==="Escape"){var j,k,A,_;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(A=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&A!==void 0?A:0}})}};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Dc(Dc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Vfe({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?{}:Dc(Dc({transition:Xfe({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Dc(Dc({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var ehe=S.memo(Jfe),K4=()=>{var e;return(e=Fe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function $1(){return $1=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},$1.apply(null,arguments)}function Xz(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 Jz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(r){the(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function the(e,t,n){return(t=nhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nhe(e){var t=rhe(e,"string");return typeof t=="symbol"?t:t+""}function rhe(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 eR={curveBasisClosed:ple,curveBasisOpen:mle,curveBasis:hle,curveBumpX:Joe,curveBumpY:ele,curveLinearClosed:gle,curveLinear:Jy,curveMonotoneX:yle,curveMonotoneY:vle,curveNatural:ble,curveStep:xle,curveStepAfter:Sle,curveStepBefore:wle},Bg=e=>nt(e.x)&&nt(e.y),tR=e=>e.base!=null&&Bg(e.base)&&Bg(e),Zd=e=>e.x,Yd=e=>e.y,ihe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ah(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=eR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return eR[n]||Jy},nR={connectNulls:!1,type:"linear"},ahe=e=>{var{type:t=nR.type,points:n=[],baseLine:r,layout:i,connectNulls:a=nR.connectNulls}=e,o=ihe(t,i),c=a?n.filter(Bg):n;if(Array.isArray(r)){var d,f=n.map((x,w)=>Jz(Jz({},x),{},{base:r[w]}));i==="vertical"?d=ym().y(Yd).x1(Zd).x0(x=>x.base.x):d=ym().x(Zd).y1(Yd).y0(x=>x.base.y);var p=d.defined(tR).curve(o),m=a?f.filter(tR):f;return p(m)}var y;i==="vertical"&&Ue(r)?y=ym().y(Yd).x1(Zd).x0(r):Ue(r)?y=ym().x(Zd).y1(Yd).y0(r):y=g3().x(Zd).y(Yd);var v=y.defined(Bg).curve(o);return v(c)},Zm=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Du();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},c=n&&n.length?ahe(o):r;return S.createElement("path",$1({},Gi(e),UN(e),{className:Ct("recharts-curve",t),d:c===null?void 0:c,ref:i}))},she=["x","y","top","left","width","height","className"];function U1(){return U1=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},U1.apply(null,arguments)}function rR(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 ohe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rR(Object(n),!0).forEach(function(r){lhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lhe(e,t,n){return(t=che(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function che(e){var t=uhe(e,"string");return typeof t=="symbol"?t:t+""}function uhe(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 dhe(e,t){if(e==null)return{};var n,r,i=fhe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fhe(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 hhe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),phe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:c}=e,d=dhe(e,she),f=ohe({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Ue(t)||!Ue(n)||!Ue(a)||!Ue(o)||!Ue(r)||!Ue(i)?null:S.createElement("path",U1({},zr(f),{className:Ct("recharts-cross",c),d:hhe(t,n,a,o,r,i)}))};function mhe(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 iR(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 aR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(n),!0).forEach(function(r){ghe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ghe(e,t,n){return(t=yhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yhe(e){var t=vhe(e,"string");return typeof t=="symbol"?t:t+""}function vhe(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 bhe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),xhe=(e,t,n)=>e.map(r=>"".concat(bhe(r)," ").concat(t,"ms ").concat(n)).join(","),whe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),$f=(e,t)=>Object.keys(t).reduce((n,r)=>aR(aR({},n),{},{[r]:e(r,t[r])}),{});function sR(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 Pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){She(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function She(e,t,n){return(t=jhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jhe(e){var t=Nhe(e,"string");return typeof t=="symbol"?t:t+""}function Nhe(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 Fg=(e,t,n)=>e+(t-e)*n,B1=e=>{var{from:t,to:n}=e;return t!==n},H4=(e,t,n)=>{var r=$f((i,a)=>{if(B1(a)){var[o,c]=e(a.from,a.to,a.velocity);return Pn(Pn({},a),{},{from:o,velocity:c})}return a},t);return n<1?$f((i,a)=>B1(a)&&r[i]!=null?Pn(Pn({},a),{},{velocity:Fg(a.velocity,r[i].velocity,n),from:Fg(a.from,r[i].from,n)}):a,t):H4(e,r,n-1)};function khe(e,t,n,r,i,a){var o,c=r.reduce((y,v)=>Pn(Pn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>$f((y,v)=>v.from,c),f=()=>!Object.values(c).filter(B1).length,p=null,m=y=>{o||(o=y);var v=y-o,x=v/n.dt;c=H4(n,c,x),i(Pn(Pn(Pn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function Che(e,t,n,r,i,a,o){var c=null,d=i.reduce((m,y)=>{var v=e[y],x=t[y];return v==null||x==null?m:Pn(Pn({},m),{},{[y]:[v,x]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=$f((w,j)=>Fg(...j,n(y)),d);if(a(Pn(Pn(Pn({},e),t),v)),y<1)c=o.setTimeout(p);else{var x=$f((w,j)=>Fg(...j,n(1)),d);a(Pn(Pn(Pn({},e),t),x))}};return()=>(c=o.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const _he=(e,t,n,r,i,a)=>{var o=whe(e,t);return n==null?()=>(i(Pn(Pn({},e),t)),()=>{}):n.isStepper===!0?khe(e,t,n,o,i,a):Che(e,t,n,r,o,i,a)};var qg=1e-4,G4=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],V4=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),oR=(e,t)=>n=>{var r=G4(e,t);return V4(r,n)},Ohe=(e,t)=>n=>{var r=G4(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return V4(i,n)},Ahe=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(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},Ehe=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=Ahe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},The=(e,t,n,r)=>{var i=oR(e,n),a=oR(t,r),o=Ohe(e,n),c=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,x=o(m);if(Math.abs(v-p)<qg||x<qg)return a(m);m=c(m-v/x)}return a(m)};return d.isStepper=!1,d},lR=function(){return The(...Ehe(...arguments))},Phe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,c,d)=>{var f=-(o-c)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-c)<qg&&Math.abs(m)<qg?[c,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},zhe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return lR(e);case"spring":return Phe();default:if(e.split("(")[0]==="cubic-bezier")return lR(e)}return typeof e=="function"?e:null};function Rhe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var c=o,[d,...f]=c;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class Mhe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Dhe(){return Rhe(new Mhe)}var Ihe=S.createContext(Dhe);function Lhe(e,t){var n=S.useContext(Ihe);return S.useMemo(()=>t??n(e),[e,t,n])}var $he={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},cR={t:0},Zw={t:1};function Z4(e){var t=mr(e,$he),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=q4(),m=n==="auto"?!hh.isSsr&&!p:n,y=Lhe(t.animationId,t.animationManager),[v,x]=S.useState(m?cR:Zw),w=S.useRef(null);return S.useEffect(()=>{m||x(Zw)},[m]),S.useEffect(()=>{if(!m||!r)return Mu;var j=_he(cR,Zw,zhe(a),i,x,y.getTimeoutController()),k=()=>{w.current=j()};return y.start([d,o,k,i,c]),()=>{y.stop(),w.current&&w.current(),c()}},[m,r,i,a,o,d,c,y]),f(v.t)}function Y4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(Pf(t)),r=S.useRef(e);return r.current!==e&&(n.current=Pf(t),r.current=e),n.current}var Uhe=["radius"],Bhe=["radius"],uR,dR,fR,hR,pR,mR,gR,yR,vR,bR;function xR(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 wR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){Fhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fhe(e,t,n){return(t=qhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qhe(e){var t=Khe(e,"string");return typeof t=="symbol"?t:t+""}function Khe(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 Kg(){return Kg=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},Kg.apply(null,arguments)}function SR(e,t){if(e==null)return{};var n,r,i=Hhe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hhe(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 ra(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var jR=(e,t,n,r,i)=>{var a=to(n),o=to(r),c=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,x=4;v<x;v++){var w,j=(w=i[v])!==null&&w!==void 0?w:0;y[v]=j>c?c:j}m=Vn(uR||(uR=ra(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Vn(dR||(dR=ra(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Vn(fR||(fR=ra(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Vn(hR||(hR=ra(["A ",",",",0,0,",`,
260
- `,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Vn(pR||(pR=ra(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Vn(mR||(mR=ra(["A ",",",",0,0,",`,
261
- `,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Vn(gR||(gR=ra(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Vn(yR||(yR=ra(["A ",",",",0,0,",`,
262
- `,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(c>0&&i===+i&&i>0){var k=Math.min(c,i);m=Vn(vR||(vR=ra(["M ",",",`
263
- A `,",",",0,0,",",",",",`
264
- L `,",",`
265
- A `,",",",0,0,",",",",",`
266
- L `,",",`
267
- A `,",",",0,0,",",",",",`
268
- L `,",",`
269
- A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=Vn(bR||(bR=ra(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},NR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ghe=e=>{var t=mr(e,NR),n=S.useRef(null),[r,i]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var X=n.current.getTotalLength();X&&i(X)}catch{}},[]);var{x:a,y:o,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:x,isUpdateAnimationActive:w}=t,j=S.useRef(c),k=S.useRef(d),A=S.useRef(a),_=S.useRef(o),C=S.useMemo(()=>({x:a,y:o,width:c,height:d,radius:f}),[a,o,c,d,f]),P=Y4(C,"rectangle-");if(a!==+a||o!==+o||c!==+c||d!==+d||c===0||d===0)return null;var T=Ct("recharts-rectangle",p);if(!w){var O=zr(t),{radius:z}=O,I=SR(O,Uhe);return S.createElement("path",Kg({},I,{x:to(a),y:to(o),width:to(c),height:to(d),radius:typeof f=="number"?f:void 0,className:T,d:jR(a,o,c,d,f)}))}var F=j.current,$=k.current,L=A.current,J=_.current,ae="0px ".concat(r===-1?1:r,"px"),Q="".concat(r,"px ").concat(r,"px"),K=xhe(["strokeDasharray"],y,typeof m=="string"?m:NR.animationEasing);return S.createElement(Z4,{animationId:P,key:P,canBegin:r>0,duration:y,easing:m,isActive:w,begin:v},X=>{var ye=la(F,c,X),Se=la($,d,X),R=la(L,a,X),B=la(J,o,X);n.current&&(j.current=ye,k.current=Se,A.current=R,_.current=B);var U;x?X>0?U={transition:K,strokeDasharray:Q}:U={strokeDasharray:ae}:U={strokeDasharray:Q};var M=zr(t),{radius:V}=M,se=SR(M,Bhe);return S.createElement("path",Kg({},se,{radius:typeof f=="number"?f:void 0,className:T,d:jR(R,B,ye,Se,f),ref:n,style:wR(wR({},U),t.style)}))})};function kR(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 CR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Vhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vhe(e,t,n){return(t=Zhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zhe(e){var t=Yhe(e,"string");return typeof t=="symbol"?t:t+""}function Yhe(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 Hg=Math.PI/180,Whe=e=>e*180/Math.PI,Wn=(e,t,n,r)=>({x:e+Math.cos(-Hg*r)*n,y:t+Math.sin(-Hg*r)*n}),Qhe=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},Xhe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Jhe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Xhe({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var c=(n-i)/o,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:o,angle:Whe(d),angleInRadian:d}},epe=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},tpe=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},npe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Jhe({x:n,y:r},t),{innerRadius:o,outerRadius:c}=t;if(i<o||i>c||i===0)return null;var{startAngle:d,endAngle:f}=epe(t),p=a,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?CR(CR({},t),{},{radius:i,angle:tpe(p,t)}):null};function W4(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Wn(t,n,r,i),c=Wn(t,n,r,a);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var _R,OR,AR,ER,TR,PR,zR;function F1(){return F1=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},F1.apply(null,arguments)}function ul(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rpe=(e,t)=>{var n=bi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},km=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:c,cornerIsExternal:d}=e,f=c*(o?1:-1)+r,p=Math.asin(c/f)/Hg,m=d?i:i+a*p,y=Wn(t,n,f,m),v=Wn(t,n,r,m),x=d?i-a*p:i,w=Wn(t,n,f*Math.cos(p*Hg),x);return{center:y,circleTangency:v,lineTangency:w,theta:p}},Q4=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,c=rpe(a,o),d=a+c,f=Wn(t,n,i,a),p=Wn(t,n,i,d),m=Vn(_R||(_R=ul(["M ",",",`
270
- A `,",",`,0,
271
- `,",",`,
272
- `,",",`
273
- `])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var y=Wn(t,n,r,a),v=Wn(t,n,r,d);m+=Vn(OR||(OR=ul(["L ",",",`
274
- A `,",",`,0,
275
- `,",",`,
276
- `,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),y.x,y.y)}else m+=Vn(AR||(AR=ul(["L ",","," Z"])),t,n);return m},ipe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=bi(f-d),{circleTangency:m,lineTangency:y,theta:v}=km({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:x,lineTangency:w,theta:j}=km({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:c}),k=c?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return o?Vn(ER||(ER=ul(["M ",",",`
277
- a`,",",",0,0,1,",`,0
278
- a`,",",",0,0,1,",`,0
279
- `])),y.x,y.y,a,a,a*2,a,a,-a*2):Q4({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var A=Vn(TR||(TR=ul(["M ",",",`
280
- A`,",",",0,0,",",",",",`
281
- A`,",",",0,",",",",",",",`
282
- A`,",",",0,0,",",",",",`
283
- `])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),x.x,x.y,a,a,+(p<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:C,theta:P}=km({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:T,lineTangency:O,theta:z}=km({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),I=c?Math.abs(d-f):Math.abs(d-f)-P-z;if(I<0&&a===0)return"".concat(A,"L").concat(t,",").concat(n,"Z");A+=Vn(PR||(PR=ul(["L",",",`
284
- A`,",",",0,0,",",",",",`
285
- A`,",",",0,",",",",",",",`
286
- A`,",",",0,0,",",",",","Z"])),O.x,O.y,a,a,+(p<0),T.x,T.y,r,r,+(I>180),+(p>0),_.x,_.y,a,a,+(p<0),C.x,C.y)}else A+=Vn(zR||(zR=ul(["L",",","Z"])),t,n);return A},ape={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},spe=e=>{var t=mr(e,ape),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Ct("recharts-sector",m),v=a-i,x=po(o,v,0,!0),w;return x>0&&Math.abs(f-p)<360?w=ipe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(x,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):w=Q4({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),S.createElement("path",F1({},zr(t),{className:y,d:w}))};function ope(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(P3(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:c}=t,d=Wn(r,i,a,c),f=Wn(r,i,o,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return W4(t)}}var Yw={},Ww={},Qw={},RR;function lpe(){return RR||(RR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=G3();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Qw)),Qw}var MR;function cpe(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lpe();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})(Ww)),Ww}var DR;function upe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V3(),n=cpe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const c=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=o;return d}e.range=r})(Yw)),Yw}var Xw,IR;function dpe(){return IR||(IR=1,Xw=upe().range),Xw}var fpe=dpe();const X4=wa(fpe);var Xi=e=>e.chartData,nk=le([Xi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),bv=(e,t,n,r)=>r?nk(e):Xi(e),hpe=(e,t,n)=>n?nk(e):Xi(e),ppe=le([bv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});le([nk],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var mpe=le([Xi],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ha(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(nt(t)&&nt(n))return!0}return!1}function LR(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function J4(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(nt(n))i=n;else if(typeof n=="function")return;if(nt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ha(o))return o}}function gpe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ha(r))return LR(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,c;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Ue(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&_z.test(i)){var d=_z.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(c=Math.max(...t));else if(Ue(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&Oz.test(a)){var p=Oz.exec(a);if(p==null||p[1]==null||t==null)c=void 0;else{var m=+p[1];c=t[1]+m}}else c=t?.[1];var y=[o,c];if(ha(y))return t==null?y:LR(y,t,n)}}}var Iu=1e9,ype={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ik,Xt=!0,ki="[DecimalError] ",bl=ki+"Invalid argument: ",rk=ki+"Exponent out of range: ",Lu=Math.floor,rl=Math.pow,vpe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Gr,In=1e7,Zt=7,eU=9007199254740991,Gg=Lu(eU/Zt),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};De.decimalPlaces=De.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};De.dividedBy=De.div=function(e){return ns(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return Dt(ns(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return _n(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Gr))throw Error(ki+"NaN");if(n.s<1)throw Error(ki+(n.s?"NaN":"-Infinity"));return n.eq(Gr)?new r(0):(Xt=!1,t=ns(Uf(n,a),Uf(e,a),a),Xt=!0,Dt(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rU(t,e):tU(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ki+"NaN");return n.s?(Xt=!1,t=ns(n,e,0,1).times(e),Xt=!0,n.minus(t)):Dt(new r(n),i)};De.naturalExponential=De.exp=function(){return nU(this)};De.naturalLogarithm=De.ln=function(){return Uf(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?tU(t,e):rU(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bl+e);if(t=_n(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};De.squareRoot=De.sqrt=function(){var e,t,n,r,i,a,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(ki+"NaN")}for(e=_n(c),Xt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=fa(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Lu((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 d(t)):r=new d(i.toString()),n=d.precision,i=o=n+3;;)if(a=r,r=a.plus(ns(c,a,o+2)).times(.5),fa(a.d).slice(0,o)===(t=fa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Dt(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;o+=4}return Xt=!0,Dt(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,c,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)c=a[i]+v[r]*y[i-r-1]+t,a[i--]=c%In|0,t=c/In|0;a[i]=(a[i]+t)%In|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Xt?Dt(e,m.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ba(e,0,Iu),t===void 0?t=r.rounding:ba(t,0,8),Dt(n,e+_n(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Pl(r,!0):(ba(e,0,Iu),t===void 0?t=i.rounding:ba(t,0,8),r=Dt(new i(r),e+1,t),n=Pl(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Pl(i):(ba(e,0,Iu),t===void 0?t=a.rounding:ba(t,0,8),r=Dt(new a(i),e+_n(i)+1,t),n=Pl(r.abs(),!1,e+_n(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return Dt(new t(e),_n(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Gr);if(c=new d(c),!c.s){if(e.s<1)throw Error(ki+"Infinity");return c}if(c.eq(Gr))return c;if(r=d.precision,e.eq(Gr))return Dt(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=c.s,o){if((n=p<0?-p:p)<=eU){for(i=new d(Gr),t=Math.ceil(r/Zt+4),Xt=!1;n%2&&(i=i.times(c),UR(i.d,t)),n=Lu(n/2),n!==0;)c=c.times(c),UR(c.d,t);return Xt=!0,e.s<0?new d(Gr).div(i):Dt(i,r)}}else if(a<0)throw Error(ki+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Xt=!1,i=e.times(Uf(c,r+f)),Xt=!0,i=nU(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=_n(i),r=Pl(i,n<=a.toExpNeg||n>=a.toExpPos)):(ba(e,1,Iu),t===void 0?t=a.rounding:ba(t,0,8),i=Dt(new a(i),e,t),n=_n(i),r=Pl(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ba(e,1,Iu),t===void 0?t=r.rounding:ba(t,0,8)),Dt(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=_n(e),n=e.constructor;return Pl(e,t<=n.toExpNeg||t>=n.toExpPos)};function tU(e,t){var n,r,i,a,o,c,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Xt?Dt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,c=f.length):(r=f,i=o,c=d.length),o=Math.ceil(m/Zt),c=o>c?o+1:c+1,a>c&&(a=c,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(c=d.length,a=f.length,c-a<0&&(a=c,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/In|0,d[a]%=In;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,Xt?Dt(t,m):t}function ba(e,t,n){if(e!==~~e||e<t||e>n)throw Error(bl+e)}function fa(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=Zt-r.length,n&&(a+=Zs(n)),a+=r;o=e[t],r=o+"",n=Zt-r.length,n&&(a+=Zs(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ns=(function(){function e(r,i){var a,o=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+o,r[c]=a%In|0,o=a/In|0;return o&&r.unshift(o),r}function t(r,i,a,o){var c,d;if(a!=o)d=a>o?1:-1;else for(c=d=0;c<a;c++)if(r[c]!=i[c]){d=r[c]>i[c]?1:-1;break}return d}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*In+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var c,d,f,p,m,y,v,x,w,j,k,A,_,C,P,T,O,z,I=r.constructor,F=r.s==i.s?1:-1,$=r.d,L=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(ki+"Division by zero");for(d=r.e-i.e,O=L.length,P=$.length,v=new I(F),x=v.d=[],f=0;L[f]==($[f]||0);)++f;if(L[f]>($[f]||0)&&--d,a==null?A=a=I.precision:o?A=a+(_n(r)-_n(i))+1:A=a,A<0)return new I(0);if(A=A/Zt+2|0,f=0,O==1)for(p=0,L=L[0],A++;(f<P||p)&&A--;f++)_=p*In+($[f]||0),x[f]=_/L|0,p=_%L|0;else{for(p=In/(L[0]+1)|0,p>1&&(L=e(L,p),$=e($,p),O=L.length,P=$.length),C=O,w=$.slice(0,O),j=w.length;j<O;)w[j++]=0;z=L.slice(),z.unshift(0),T=L[0],L[1]>=In/2&&++T;do p=0,c=t(L,w,O,j),c<0?(k=w[0],O!=j&&(k=k*In+(w[1]||0)),p=k/T|0,p>1?(p>=In&&(p=In-1),m=e(L,p),y=m.length,j=w.length,c=t(m,w,y,j),c==1&&(p--,n(m,O<y?z:L,y))):(p==0&&(c=p=1),m=L.slice()),y=m.length,y<j&&m.unshift(0),n(w,m,j),c==-1&&(j=w.length,c=t(L,w,O,j),c<1&&(p++,n(w,O<j?z:L,j))),j=w.length):c===0&&(p++,w=[0]),x[f++]=p,c&&w[0]?w[j++]=$[C]||0:(w=[$[C]],j=1);while((C++<P||w[0]!==void 0)&&A--)}return x[0]||x.shift(),v.e=d,Dt(v,o?a+_n(v)+1:a)}})();function nU(e,t){var n,r,i,a,o,c,d=0,f=0,p=e.constructor,m=p.precision;if(_n(e)>16)throw Error(rk+_n(e));if(!e.s)return new p(Gr);for(Xt=!1,c=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(rl(2,f))/Math.LN10*2+5|0,c+=r,n=i=a=new p(Gr),p.precision=c;;){if(i=Dt(i.times(e),c),n=n.times(++d),o=a.plus(ns(i,n,c)),fa(o.d).slice(0,c)===fa(a.d).slice(0,c)){for(;f--;)a=Dt(a.times(a),c);return p.precision=m,t==null?(Xt=!0,Dt(a,m)):a}a=o}}function _n(e){for(var t=e.e*Zt,n=e.d[0];n>=10;n/=10)t++;return t}function Jw(e,t,n){if(t>e.LN10.sd())throw Xt=!0,n&&(e.precision=n),Error(ki+"LN10 precision limit exceeded");return Dt(new e(e.LN10),t)}function Zs(e){for(var t="";e--;)t+="0";return t}function Uf(e,t){var n,r,i,a,o,c,d,f,p,m=1,y=10,v=e,x=v.d,w=v.constructor,j=w.precision;if(v.s<1)throw Error(ki+(v.s?"NaN":"-Infinity"));if(v.eq(Gr))return new w(0);if(t==null?(Xt=!1,f=j):f=t,v.eq(10))return t==null&&(Xt=!0),Jw(w,f);if(f+=y,w.precision=f,n=fa(x),r=n.charAt(0),a=_n(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=fa(v.d),r=n.charAt(0),m++;a=_n(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return d=Jw(w,f+2,j).times(a+""),v=Uf(new w(r+"."+n.slice(1)),f-y).plus(d),w.precision=j,t==null?(Xt=!0,Dt(v,j)):v;for(c=o=v=ns(v.minus(Gr),v.plus(Gr),f),p=Dt(v.times(v),f),i=3;;){if(o=Dt(o.times(p),f),d=c.plus(ns(o,new w(i),f)),fa(d.d).slice(0,f)===fa(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(Jw(w,f+2,j).times(a+""))),c=ns(c,new w(m),f),w.precision=j,t==null?(Xt=!0,Dt(c,j)):c;c=d,i+=2}}function $R(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=Lu(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),Xt&&(e.e>Gg||e.e<-Gg))throw Error(rk+n)}else e.s=0,e.e=0,e.d=[0];return e}function Dt(e,t,n){var r,i,a,o,c,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Zt,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/Zt),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=Zt,i=r-Zt+o}if(n!==void 0&&(a=rl(10,o-i-1),c=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?i>0?f/rl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=_n(e),m.length=1,t=t-a-1,m[0]=rl(10,(Zt-t%Zt)%Zt),e.e=Lu(-t/Zt)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=rl(10,Zt-r),m[p]=i>0?(f/rl(10,o-i)%rl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==In&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=In)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(Xt&&(e.e>Gg||e.e<-Gg))throw Error(rk+_n(e));return e}function rU(e,t){var n,r,i,a,o,c,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),Xt?Dt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/Zt),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=d.length,c=m.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}o=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),c=d.length,i=m.length-c;i>0;--i)d[c++]=0;for(i=m.length;i>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=In-1;--d[a],d[i]+=In}d[i]-=m[i]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,Xt?Dt(t,v):t):new y(0)}function Pl(e,t,n){var r,i=_n(e),a=fa(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Zs(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Zs(-i-1)+a,n&&(r=n-o)>0&&(a+=Zs(r))):i>=o?(a+=Zs(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Zs(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Zs(r))),e.s<0?"-"+a:a}function UR(e,t){if(e.length>t)return e.length=t,!0}function iU(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(bl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return $R(o,a.toString())}else if(typeof a!="string")throw Error(bl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,vpe.test(a))$R(o,a);else throw Error(bl+a)}if(i.prototype=De,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=iU,i.config=i.set=bpe,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 bpe(e){if(!e||typeof e!="object")throw Error(ki+"Object expected");var t,n,r,i=["precision",1,Iu,"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(Lu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(bl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(bl+n+": "+r);return this}var ik=iU(ype);Gr=new ik(1);const gt=ik;function aU(e){var t;return e===0?t=1:t=Math.floor(new gt(e).abs().log(10).toNumber())+1,t}function sU(e,t,n){for(var r=new gt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var oU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},ak=(e,t,n)=>{if(e.lte(0))return new gt(0);var r=aU(e.toNumber()),i=new gt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,c=new gt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=c.mul(i);return t?new gt(d.toNumber()):new gt(Math.ceil(d.toNumber()))},lU=(e,t,n)=>{var r;if(e.lte(0))return new gt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new gt(a).abs().log(10).toNumber()),c=new gt(10).pow(o),d=e.div(c).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(c=c.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,c=c.mul(new gt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new gt(m).mul(c);return t?y:new gt(Math.ceil(y.toNumber()))},xpe=(e,t,n)=>{var r=new gt(1),i=new gt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new gt(10).pow(aU(e)-1),i=new gt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new gt(Math.floor(e)))}else e===0?i=new gt(Math.floor((t-1)/2)):n||(i=new gt(Math.floor(e)));for(var o=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new gt(d-o).mul(r)).toNumber());return c},cU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:ak;if(!Number.isFinite((n-t)/(r-1)))return{step:new gt(0),tickMin:new gt(0),tickMax:new gt(0)};var c=o(new gt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new gt(0):(d=new gt(t).add(n).div(2),d=d.sub(new gt(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new gt(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?cU(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new gt(f).mul(c)),tickMax:d.add(new gt(p).mul(c))})},BR=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[d,f]=oU([n,r]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?p.reverse():p}if(d===f)return xpe(d,i,a);var m=o==="snap125"?lU:ak,{step:y,tickMin:v,tickMax:x}=cU(d,f,c,a,0,m),w=sU(v,x.add(new gt(.1).mul(y)),y);return n>r?w.reverse():w},FR=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,d]=oU([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=o==="snap125"?lU:ak,p=Math.max(n,2),m=f(new gt(d).sub(c).div(p-1),a,0),y=[...sU(new gt(c),new gt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},wpe=e=>e.rootProps.barCategoryGap,xv=e=>e.rootProps.stackOffset,uU=e=>e.rootProps.reverseStackOrder,sk=e=>e.options.chartName,ok=e=>e.rootProps.syncId,dU=e=>e.rootProps.syncMethod,lk=e=>e.options.eventEmitter,Spe=e=>e.rootProps.baseValue,ir={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Wo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ia={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},wv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Sv(e,t,n){if(n!=="auto")return n;if(e!=null)return Sa(e,t)?"category":"number"}function qR(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 Vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(r){jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=kpe(e,"string");return typeof t=="symbol"?t:t+""}function kpe(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 KR={allowDataOverflow:Wo.allowDataOverflow,allowDecimals:Wo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Wo.angleAxisId,includeHidden:!1,name:void 0,reversed:Wo.reversed,scale:Wo.scale,tick:Wo.tick,tickCount:void 0,ticks:void 0,type:Wo.type,unit:void 0,niceTicks:"auto"},HR={allowDataOverflow:ia.allowDataOverflow,allowDecimals:ia.allowDecimals,allowDuplicatedCategory:ia.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ia.radiusAxisId,includeHidden:ia.includeHidden,name:void 0,reversed:ia.reversed,scale:ia.scale,tick:ia.tick,tickCount:ia.tickCount,ticks:void 0,type:ia.type,unit:void 0,niceTicks:"auto"},Cpe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ck=le([Cpe,M4],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"angleAxis",KR.type))!==null&&n!==void 0?n:"category";return Vg(Vg({},KR),{},{type:r})}),_pe=(e,t)=>e.polarAxis.radiusAxis[t],uk=le([_pe,M4],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"radiusAxis",HR.type))!==null&&n!==void 0?n:"category";return Vg(Vg({},HR),{},{type:r})}),jv=e=>e.polarOptions,dk=le([us,ds,Xn],Qhe),fU=le([jv,dk],(e,t)=>{if(e!=null)return po(e.innerRadius,t,0)}),hU=le([jv,dk],(e,t)=>{if(e!=null)return po(e.outerRadius,t,t*.8)}),Ope=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},pU=le([jv],Ope);le([ck,pU],wv);var mU=le([dk,fU,hU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([uk,mU],wv);var gU=le([en,jv,fU,hU,us,ds],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:c,startAngle:d,endAngle:f}=t;return{cx:po(o,i,i/2),cy:po(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),$n=(e,t)=>t,Nv=(e,t,n)=>n;function fk(e){return e?.id}function yU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(c=>{var d,f=(d=c.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=fk(c);f.forEach((m,y)=>{var v=a==null||i?y:String(Ln(m,a,null)),x=Ln(m,c.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[p]:x}),o.set(v,w)})}}),Array.from(o.values())}function hk(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var kv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Cv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ape(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 Un=e=>{var t=en(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$u=e=>e.tooltip.settings.axisId;function pk(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(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],c=i[1];return o<=c?a>=o&&a<=c:a>=c&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var c=e(a);if(c!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var Epe=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ha(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];nt(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function oo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Tpe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mk(e){let t,n,r;e.length!==2?(t=oo,n=(c,d)=>oo(e(c),d),r=(c,d)=>e(c)-d):(t=e===oo||e===Tpe?e:Ppe,n=e,r=e);function i(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function o(c,d,f=0,p=c.length){const m=i(c,d,f,p-1);return m>f&&r(c[m-1],d)>-r(c[m],d)?m-1:m}return{left:i,center:o,right:a}}function Ppe(){return 0}function vU(e){return e===null?NaN:+e}function*zpe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Rpe=mk(oo),ph=Rpe.right;mk(vU).center;class GR extends Map{constructor(t,n=Ipe){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(VR(this,t))}has(t){return super.has(VR(this,t))}set(t,n){return super.set(Mpe(this,t),n)}delete(t){return super.delete(Dpe(this,t))}}function VR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Mpe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Dpe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Ipe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Lpe(e=oo){if(e===oo)return bU;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 bU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const $pe=Math.sqrt(50),Upe=Math.sqrt(10),Bpe=Math.sqrt(2);function Zg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=$pe?10:a>=Upe?5:a>=Bpe?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Zg(e,t,n*2):[c,d,f]}function q1(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Zg(t,e,n):Zg(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(a-f)/-o;else for(let f=0;f<c;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(i+f)/-o;else for(let f=0;f<c;++f)d[f]=(i+f)*o;return d}function K1(e,t,n){return t=+t,e=+e,n=+n,Zg(e,t,n)[2]}function H1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?K1(t,e,n):K1(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ZR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function YR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function xU(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?bU:Lpe(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),x=Math.min(r,Math.floor(t+(d-f)*m/d+y));xU(e,t,v,x,i)}const a=e[t];let o=n,c=r;for(Wd(e,n,t),i(e[r],a)>0&&Wd(e,n,r);o<c;){for(Wd(e,o,c),++o,--c;i(e[o],a)<0;)++o;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?Wd(e,n,c):(++c,Wd(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Wd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Fpe(e,t,n){if(e=Float64Array.from(zpe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return YR(e);if(t>=1)return ZR(e);var r,i=(r-1)*t,a=Math.floor(i),o=ZR(xU(e,a).subarray(0,a+1)),c=YR(e.subarray(a+1));return o+(c-o)*(i-a)}}function qpe(e,t,n=vU){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,a=Math.floor(i),o=+n(e[a],a,e),c=+n(e[a+1],a+1,e);return o+(c-o)*(i-a)}}function Kpe(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,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Ei(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function fs(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 G1=Symbol("implicit");function gk(){var e=new GR,t=[],n=[],r=G1;function i(a){let o=e.get(a);if(o===void 0){if(r!==G1)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new GR;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return gk(t,n).unknown(r)},Ei.apply(i,arguments),i}function yk(){var e=gk().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,c=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,x=v?i:r,w=v?r:i;a=(w-x)/Math.max(1,y-d+f*2),c&&(a=Math.floor(a)),x+=(w-x-a*(y-d))*p,o=a*(1-d),c&&(x=Math.round(x),o=Math.round(o));var j=Kpe(y).map(function(k){return x+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,c=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(c=!!y,m()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return yk(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},Ei.apply(m(),arguments)}function wU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return wU(t())},e}function Hpe(){return wU(yk.apply(null,arguments).paddingInner(1))}function vk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function SU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mh(){}var Bf=.7,Yg=1/Bf,ou="\\s*([+-]?\\d+)\\s*",Ff="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gpe=/^#([0-9a-f]{3,8})$/,Vpe=new RegExp(`^rgb\\(${ou},${ou},${ou}\\)$`),Zpe=new RegExp(`^rgb\\(${pa},${pa},${pa}\\)$`),Ype=new RegExp(`^rgba\\(${ou},${ou},${ou},${Ff}\\)$`),Wpe=new RegExp(`^rgba\\(${pa},${pa},${pa},${Ff}\\)$`),Qpe=new RegExp(`^hsl\\(${Ff},${pa},${pa}\\)$`),Xpe=new RegExp(`^hsla\\(${Ff},${pa},${pa},${Ff}\\)$`),WR={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};vk(mh,qf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:QR,formatHex:QR,formatHex8:Jpe,formatHsl:eme,formatRgb:XR,toString:XR});function QR(){return this.rgb().formatHex()}function Jpe(){return this.rgb().formatHex8()}function eme(){return jU(this).formatHsl()}function XR(){return this.rgb().formatRgb()}function qf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Gpe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?JR(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cm(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=Vpe.exec(e))?new Er(t[1],t[2],t[3],1):(t=Zpe.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ype.exec(e))?Cm(t[1],t[2],t[3],t[4]):(t=Wpe.exec(e))?Cm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Qpe.exec(e))?nM(t[1],t[2]/100,t[3]/100,1):(t=Xpe.exec(e))?nM(t[1],t[2]/100,t[3]/100,t[4]):WR.hasOwnProperty(e)?JR(WR[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function JR(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Cm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function tme(e){return e instanceof mh||(e=qf(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function V1(e,t,n,r){return arguments.length===1?tme(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vk(Er,V1,SU(mh,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(xl(this.r),xl(this.g),xl(this.b),Wg(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:eM,formatHex:eM,formatHex8:nme,formatRgb:tM,toString:tM}));function eM(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}`}function nme(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}${dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=Wg(this.opacity);return`${e===1?"rgb(":"rgba("}${xl(this.r)}, ${xl(this.g)}, ${xl(this.b)}${e===1?")":`, ${e})`}`}function Wg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dl(e){return e=xl(e),(e<16?"0":"")+e.toString(16)}function nM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ki(e,t,n,r)}function jU(e){if(e instanceof Ki)return new Ki(e.h,e.s,e.l,e.opacity);if(e instanceof mh||(e=qf(e)),!e)return new Ki;if(e instanceof Ki)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,c=a-i,d=(a+i)/2;return c?(t===a?o=(n-r)/c+(n<r)*6:n===a?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?a+i:2-a-i,o*=60):c=d>0&&d<1?0:o,new Ki(o,c,d,e.opacity)}function rme(e,t,n,r){return arguments.length===1?jU(e):new Ki(e,t,n,r??1)}function Ki(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vk(Ki,rme,SU(mh,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new Ki(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new Ki(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 Er(eS(e>=240?e-240:e+120,i,r),eS(e,i,r),eS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ki(rM(this.h),_m(this.s),_m(this.l),Wg(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=Wg(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${_m(this.s)*100}%, ${_m(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function _m(e){return Math.max(0,Math.min(1,e||0))}function eS(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 bk=e=>()=>e;function ime(e,t){return function(n){return e+n*t}}function ame(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 sme(e){return(e=+e)==1?NU:function(t,n){return n-t?ame(t,n,e):bk(isNaN(t)?n:t)}}function NU(e,t){var n=t-e;return n?ime(e,n):bk(isNaN(e)?t:e)}const iM=(function e(t){var n=sme(t);function r(i,a){var o=n((i=V1(i)).r,(a=V1(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=NU(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function ome(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function lme(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cme(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Uu(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(c){for(o=0;o<r;++o)a[o]=i[o](c);return a}}function ume(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Qg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dme(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]=Uu(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Z1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tS=new RegExp(Z1.source,"g");function fme(e){return function(){return e}}function hme(e){return function(t){return e(t)+""}}function pme(e,t){var n=Z1.lastIndex=tS.lastIndex=0,r,i,a,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=Z1.exec(e))&&(i=tS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[o]?c[o]+=a:c[++o]=a),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,d.push({i:o,x:Qg(r,i)})),n=tS.lastIndex;return n<t.length&&(a=t.slice(n),c[o]?c[o]+=a:c[++o]=a),c.length<2?d[0]?hme(d[0].x):fme(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)c[(m=d[p]).i]=m.x(f);return c.join("")})}function Uu(e,t){var n=typeof t,r;return t==null||n==="boolean"?bk(t):(n==="number"?Qg:n==="string"?(r=qf(t))?(t=r,iM):pme:t instanceof qf?iM:t instanceof Date?ume:lme(t)?ome:Array.isArray(t)?cme:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dme:Qg)(e,t)}function xk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function mme(e,t){t===void 0&&(t=e,e=Uu);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[c](o-c)}}function gme(e){return function(){return e}}function Xg(e){return+e}var aM=[0,1];function dr(e){return e}function Y1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:gme(isNaN(t)?NaN:.5)}function yme(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function vme(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Y1(i,r),a=n(o,a)):(r=Y1(r,i),a=n(a,o)),function(c){return a(r(c))}}function bme(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Y1(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(c){var d=ph(e,c,1,r)-1;return a[d](i[d](c))}}function gh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _v(){var e=aM,t=aM,n=Uu,r,i,a,o=dr,c,d,f;function p(){var y=Math.min(e.length,t.length);return o!==dr&&(o=yme(e[0],e[y-1])),c=y>2?bme:vme,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=c(t,e.map(r),Qg)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Xg),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=xk,p()},m.clamp=function(y){return arguments.length?(o=y?!0:dr,p()):o!==dr},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function wk(){return _v()(dr,dr)}function xme(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jg(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 vu(e){return e=Jg(Math.abs(e)),e?e[1]:NaN}function wme(e,t){return function(n,r){for(var i=n.length,a=[],o=0,c=e[0],d=0;i>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),a.push(n.substring(i-=c,i+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Sme(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jme=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kf(e){if(!(t=jme.exec(e)))throw new Error("invalid format: "+e);var t;return new Sk({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]})}Kf.prototype=Sk.prototype;function Sk(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+""}Sk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Nme(e){e:for(var t=e.length,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 ey;function kme(e,t){var n=Jg(e,t);if(!n)return ey=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(ey=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Jg(e,Math.max(0,t+a-1))[0]}function sM(e,t){var n=Jg(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 oM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:xme,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)=>sM(e*100,t),r:sM,s:kme,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lM(e){return e}var cM=Array.prototype.map,uM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Cme(e){var t=e.grouping===void 0||e.thousands===void 0?lM:wme(cM.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+"",a=e.numerals===void 0?lM:Sme(cM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Kf(m);var v=m.fill,x=m.align,w=m.sign,j=m.symbol,k=m.zero,A=m.width,_=m.comma,C=m.precision,P=m.trim,T=m.type;T==="n"?(_=!0,T="g"):oM[T]||(C===void 0&&(C=12),P=!0,T="g"),(k||v==="0"&&x==="=")&&(k=!0,v="0",x="=");var O=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),z=(j==="$"?r:/[%p]/.test(T)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),I=oM[T],F=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function $(L){var J=O,ae=z,Q,K,X;if(T==="c")ae=I(L)+ae,L="";else{L=+L;var ye=L<0||1/L<0;if(L=isNaN(L)?d:I(Math.abs(L),C),P&&(L=Nme(L)),ye&&+L==0&&w!=="+"&&(ye=!1),J=(ye?w==="("?w:c:w==="-"||w==="("?"":w)+J,ae=(T==="s"&&!isNaN(L)&&ey!==void 0?uM[8+ey/3]:"")+ae+(ye&&w==="("?")":""),F){for(Q=-1,K=L.length;++Q<K;)if(X=L.charCodeAt(Q),48>X||X>57){ae=(X===46?i+L.slice(Q+1):L.slice(Q))+ae,L=L.slice(0,Q);break}}}_&&!k&&(L=t(L,1/0));var Se=J.length+L.length+ae.length,R=Se<A?new Array(A-Se+1).join(v):"";switch(_&&k&&(L=t(R+L,R.length?A-ae.length:1/0),R=""),x){case"<":L=J+L+ae+R;break;case"=":L=J+R+L+ae;break;case"^":L=R.slice(0,Se=R.length>>1)+J+L+ae+R.slice(Se);break;default:L=R+J+L+ae;break}return a(L)}return $.toString=function(){return m+""},$}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(vu(y)/3)))*3,x=Math.pow(10,-v),w=f((m=Kf(m),m.type="f",m),{suffix:uM[8+v/3]});return function(j){return w(x*j)}}return{format:f,formatPrefix:p}}var Om,jk,kU;_me({thousands:",",grouping:[3],currency:["$",""]});function _me(e){return Om=Cme(e),jk=Om.format,kU=Om.formatPrefix,Om}function Ome(e){return Math.max(0,-vu(Math.abs(e)))}function Ame(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vu(t)/3)))*3-vu(Math.abs(e)))}function Eme(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vu(t)-vu(e))+1}function CU(e,t,n,r){var i=H1(e,t,n),a;switch(r=Kf(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ame(i,o))&&(r.precision=a),kU(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Eme(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Ome(i))&&(r.precision=a-(r.type==="%")*2);break}}return jk(r)}function So(e){var t=e.domain;return e.ticks=function(n){var r=t();return q1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return CU(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],c=r[a],d,f,p=10;for(c<o&&(f=o,o=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=K1(o,c,n),f===d)return r[i]=o,r[a]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function _U(){var e=wk();return e.copy=function(){return gh(e,_U())},Ei.apply(e,arguments),So(e)}function OU(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,Xg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return OU(e).unknown(t)},e=arguments.length?Array.from(e,Xg):[0,1],So(n)}function AU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function dM(e){return Math.log(e)}function fM(e){return Math.exp(e)}function Tme(e){return-Math.log(-e)}function Pme(e){return-Math.exp(-e)}function zme(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Rme(e){return e===10?zme:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Mme(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 hM(e){return(t,n)=>-e(-t,n)}function Nk(e){const t=e(dM,fM),n=t.domain;let r=10,i,a;function o(){return i=Mme(r),a=Rme(r),n()[0]<0?(i=hM(i),a=hM(a),e(Tme,Pme)):e(dM,fM),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let y=i(f),v=i(p),x,w;const j=c==null?10:+c;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(x=1;x<r;++x)if(w=y<0?x/a(-y):x*a(y),!(w<f)){if(w>p)break;k.push(w)}}else for(;y<=v;++y)for(x=r-1;x>=1;--x)if(w=y>0?x/a(-y):x*a(y),!(w<f)){if(w>p)break;k.push(w)}k.length*2<j&&(k=q1(f,p,j))}else k=q1(y,v,Math.min(v-y,j)).map(a);return m?k.reverse():k},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Kf(d)).precision==null&&(d.trim=!0),d=jk(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(AU(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function EU(){const e=Nk(_v()).domain([1,10]);return e.copy=()=>gh(e,EU()).base(e.base()),Ei.apply(e,arguments),e}function pM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kk(e){var t=1,n=e(pM(t),mM(t));return n.constant=function(r){return arguments.length?e(pM(t=+r),mM(t)):t},So(n)}function TU(){var e=kk(_v());return e.copy=function(){return gh(e,TU()).constant(e.constant())},Ei.apply(e,arguments)}function gM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Dme(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ime(e){return e<0?-e*e:e*e}function Ck(e){var t=e(dr,dr),n=1;function r(){return n===1?e(dr,dr):n===.5?e(Dme,Ime):e(gM(n),gM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},So(t)}function _k(){var e=Ck(_v());return e.copy=function(){return gh(e,_k()).exponent(e.exponent())},Ei.apply(e,arguments),e}function Lme(){return _k.apply(null,arguments).exponent(.5)}function yM(e){return Math.sign(e)*e*e}function $me(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function PU(){var e=wk(),t=[0,1],n=!1,r;function i(a){var o=$me(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(yM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Xg)).map(yM)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return PU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ei.apply(i,arguments),So(i)}function zU(){var e=[],t=[],n=[],r;function i(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=qpe(e,o/c);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ph(n,o)]}return a.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(oo),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return zU().domain(e).range(t).unknown(r)},Ei.apply(a,arguments)}function RU(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[ph(r,d,0,n)]:a}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return RU().domain([e,t]).range(i).unknown(a)},Ei.apply(So(o),arguments)}function MU(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ph(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return MU().domain(e).range(t).unknown(n)},Ei.apply(i,arguments)}const nS=new Date,rS=new Date;function zn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<o);return d},i.filter=a=>zn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!a(o););else for(;--c>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(nS.setTime(+a),rS.setTime(+o),e(nS),e(rS),Math.floor(n(nS,rS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ty=zn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ty.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ty);ty.range;const Xa=1e3,wi=Xa*60,Ja=wi*60,ss=Ja*24,Ok=ss*7,vM=ss*30,iS=ss*365,fl=zn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getUTCSeconds());fl.range;const Ak=zn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xa)},(e,t)=>{e.setTime(+e+t*wi)},(e,t)=>(t-e)/wi,e=>e.getMinutes());Ak.range;const Ek=zn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wi)},(e,t)=>(t-e)/wi,e=>e.getUTCMinutes());Ek.range;const Tk=zn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xa-e.getMinutes()*wi)},(e,t)=>{e.setTime(+e+t*Ja)},(e,t)=>(t-e)/Ja,e=>e.getHours());Tk.range;const Pk=zn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ja)},(e,t)=>(t-e)/Ja,e=>e.getUTCHours());Pk.range;const yh=zn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wi)/ss,e=>e.getDate()-1);yh.range;const Ov=zn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ss,e=>e.getUTCDate()-1);Ov.range;const DU=zn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ss,e=>Math.floor(e/ss));DU.range;function ql(e){return zn(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())*wi)/Ok)}const Av=ql(0),ny=ql(1),Ume=ql(2),Bme=ql(3),bu=ql(4),Fme=ql(5),qme=ql(6);Av.range;ny.range;Ume.range;Bme.range;bu.range;Fme.range;qme.range;function Kl(e){return zn(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)/Ok)}const Ev=Kl(0),ry=Kl(1),Kme=Kl(2),Hme=Kl(3),xu=Kl(4),Gme=Kl(5),Vme=Kl(6);Ev.range;ry.range;Kme.range;Hme.range;xu.range;Gme.range;Vme.range;const zk=zn(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());zk.range;const Rk=zn(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());Rk.range;const os=zn(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());os.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zn(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)});os.range;const ls=zn(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());ls.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zn(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)});ls.range;function IU(e,t,n,r,i,a){const o=[[fl,1,Xa],[fl,5,5*Xa],[fl,15,15*Xa],[fl,30,30*Xa],[a,1,wi],[a,5,5*wi],[a,15,15*wi],[a,30,30*wi],[i,1,Ja],[i,3,3*Ja],[i,6,6*Ja],[i,12,12*Ja],[r,1,ss],[r,2,2*ss],[n,1,Ok],[t,1,vM],[t,3,3*vM],[e,1,iS]];function c(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),x=v?v.range(f,+p+1):[];return y?x.reverse():x}function d(f,p,m){const y=Math.abs(p-f)/m,v=mk(([,,j])=>j).right(o,y);if(v===o.length)return e.every(H1(f/iS,p/iS,m));if(v===0)return ty.every(Math.max(H1(f,p,m),1));const[x,w]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return x.every(w)}return[c,d]}const[Zme,Yme]=IU(ls,Rk,Ev,DU,Pk,Ek),[Wme,Qme]=IU(os,zk,Av,yh,Tk,Ak);function aS(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 sS(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 Qd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Xme(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Xd(i),p=Jd(i),m=Xd(a),y=Jd(a),v=Xd(o),x=Jd(o),w=Xd(c),j=Jd(c),k=Xd(d),A=Jd(d),_={a:X,A:ye,b:Se,B:R,c:null,d:NM,e:NM,f:wge,g:Tge,G:zge,H:vge,I:bge,j:xge,L:LU,m:Sge,M:jge,p:B,q:U,Q:_M,s:OM,S:Nge,u:kge,U:Cge,V:_ge,w:Oge,W:Age,x:null,X:null,y:Ege,Y:Pge,Z:Rge,"%":CM},C={a:M,A:V,b:se,B:ie,c:null,d:kM,e:kM,f:Lge,g:Zge,G:Wge,H:Mge,I:Dge,j:Ige,L:UU,m:$ge,M:Uge,p:he,q:je,Q:_M,s:OM,S:Bge,u:Fge,U:qge,V:Kge,w:Hge,W:Gge,x:null,X:null,y:Vge,Y:Yge,Z:Qge,"%":CM},P={a:F,A:$,b:L,B:J,c:ae,d:SM,e:SM,f:pge,g:wM,G:xM,H:jM,I:jM,j:uge,L:hge,m:cge,M:dge,p:I,q:lge,Q:gge,s:yge,S:fge,u:rge,U:ige,V:age,w:nge,W:sge,x:Q,X:K,y:wM,Y:xM,Z:oge,"%":mge};_.x=T(n,_),_.X=T(r,_),_.c=T(t,_),C.x=T(n,C),C.X=T(r,C),C.c=T(t,C);function T(ee,de){return function(Ce){var Y=[],Ke=-1,Me=0,rt=ee.length,it,Nt,Lt;for(Ce instanceof Date||(Ce=new Date(+Ce));++Ke<rt;)ee.charCodeAt(Ke)===37&&(Y.push(ee.slice(Me,Ke)),(Nt=bM[it=ee.charAt(++Ke)])!=null?it=ee.charAt(++Ke):Nt=it==="e"?" ":"0",(Lt=de[it])&&(it=Lt(Ce,Nt)),Y.push(it),Me=Ke+1);return Y.push(ee.slice(Me,Ke)),Y.join("")}}function O(ee,de){return function(Ce){var Y=Qd(1900,void 0,1),Ke=z(Y,ee,Ce+="",0),Me,rt;if(Ke!=Ce.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(de&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Me=sS(Qd(Y.y,0,1)),rt=Me.getUTCDay(),Me=rt>4||rt===0?ry.ceil(Me):ry(Me),Me=Ov.offset(Me,(Y.V-1)*7),Y.y=Me.getUTCFullYear(),Y.m=Me.getUTCMonth(),Y.d=Me.getUTCDate()+(Y.w+6)%7):(Me=aS(Qd(Y.y,0,1)),rt=Me.getDay(),Me=rt>4||rt===0?ny.ceil(Me):ny(Me),Me=yh.offset(Me,(Y.V-1)*7),Y.y=Me.getFullYear(),Y.m=Me.getMonth(),Y.d=Me.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),rt="Z"in Y?sS(Qd(Y.y,0,1)).getUTCDay():aS(Qd(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(rt+5)%7:Y.w+Y.U*7-(rt+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,sS(Y)):aS(Y)}}function z(ee,de,Ce,Y){for(var Ke=0,Me=de.length,rt=Ce.length,it,Nt;Ke<Me;){if(Y>=rt)return-1;if(it=de.charCodeAt(Ke++),it===37){if(it=de.charAt(Ke++),Nt=P[it in bM?de.charAt(Ke++):it],!Nt||(Y=Nt(ee,Ce,Y))<0)return-1}else if(it!=Ce.charCodeAt(Y++))return-1}return Y}function I(ee,de,Ce){var Y=f.exec(de.slice(Ce));return Y?(ee.p=p.get(Y[0].toLowerCase()),Ce+Y[0].length):-1}function F(ee,de,Ce){var Y=v.exec(de.slice(Ce));return Y?(ee.w=x.get(Y[0].toLowerCase()),Ce+Y[0].length):-1}function $(ee,de,Ce){var Y=m.exec(de.slice(Ce));return Y?(ee.w=y.get(Y[0].toLowerCase()),Ce+Y[0].length):-1}function L(ee,de,Ce){var Y=k.exec(de.slice(Ce));return Y?(ee.m=A.get(Y[0].toLowerCase()),Ce+Y[0].length):-1}function J(ee,de,Ce){var Y=w.exec(de.slice(Ce));return Y?(ee.m=j.get(Y[0].toLowerCase()),Ce+Y[0].length):-1}function ae(ee,de,Ce){return z(ee,t,de,Ce)}function Q(ee,de,Ce){return z(ee,n,de,Ce)}function K(ee,de,Ce){return z(ee,r,de,Ce)}function X(ee){return o[ee.getDay()]}function ye(ee){return a[ee.getDay()]}function Se(ee){return d[ee.getMonth()]}function R(ee){return c[ee.getMonth()]}function B(ee){return i[+(ee.getHours()>=12)]}function U(ee){return 1+~~(ee.getMonth()/3)}function M(ee){return o[ee.getUTCDay()]}function V(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ie(ee){return c[ee.getUTCMonth()]}function he(ee){return i[+(ee.getUTCHours()>=12)]}function je(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var de=T(ee+="",_);return de.toString=function(){return ee},de},parse:function(ee){var de=O(ee+="",!1);return de.toString=function(){return ee},de},utcFormat:function(ee){var de=T(ee+="",C);return de.toString=function(){return ee},de},utcParse:function(ee){var de=O(ee+="",!0);return de.toString=function(){return ee},de}}}var bM={"-":"",_:" ",0:"0"},Bn=/^\s*\d+/,Jme=/^%/,ege=/[\\^$*+?|[\]().{}]/g;function wt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function tge(e){return e.replace(ege,"\\$&")}function Xd(e){return new RegExp("^(?:"+e.map(tge).join("|")+")","i")}function Jd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function nge(e,t,n){var r=Bn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function rge(e,t,n){var r=Bn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function ige(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function age(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function sge(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function xM(e,t,n){var r=Bn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wM(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function oge(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 lge(e,t,n){var r=Bn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function cge(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function SM(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function uge(e,t,n){var r=Bn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function jM(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function dge(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function fge(e,t,n){var r=Bn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hge(e,t,n){var r=Bn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function pge(e,t,n){var r=Bn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function mge(e,t,n){var r=Jme.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function gge(e,t,n){var r=Bn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function yge(e,t,n){var r=Bn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function NM(e,t){return wt(e.getDate(),t,2)}function vge(e,t){return wt(e.getHours(),t,2)}function bge(e,t){return wt(e.getHours()%12||12,t,2)}function xge(e,t){return wt(1+yh.count(os(e),e),t,3)}function LU(e,t){return wt(e.getMilliseconds(),t,3)}function wge(e,t){return LU(e,t)+"000"}function Sge(e,t){return wt(e.getMonth()+1,t,2)}function jge(e,t){return wt(e.getMinutes(),t,2)}function Nge(e,t){return wt(e.getSeconds(),t,2)}function kge(e){var t=e.getDay();return t===0?7:t}function Cge(e,t){return wt(Av.count(os(e)-1,e),t,2)}function $U(e){var t=e.getDay();return t>=4||t===0?bu(e):bu.ceil(e)}function _ge(e,t){return e=$U(e),wt(bu.count(os(e),e)+(os(e).getDay()===4),t,2)}function Oge(e){return e.getDay()}function Age(e,t){return wt(ny.count(os(e)-1,e),t,2)}function Ege(e,t){return wt(e.getFullYear()%100,t,2)}function Tge(e,t){return e=$U(e),wt(e.getFullYear()%100,t,2)}function Pge(e,t){return wt(e.getFullYear()%1e4,t,4)}function zge(e,t){var n=e.getDay();return e=n>=4||n===0?bu(e):bu.ceil(e),wt(e.getFullYear()%1e4,t,4)}function Rge(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+wt(t/60|0,"0",2)+wt(t%60,"0",2)}function kM(e,t){return wt(e.getUTCDate(),t,2)}function Mge(e,t){return wt(e.getUTCHours(),t,2)}function Dge(e,t){return wt(e.getUTCHours()%12||12,t,2)}function Ige(e,t){return wt(1+Ov.count(ls(e),e),t,3)}function UU(e,t){return wt(e.getUTCMilliseconds(),t,3)}function Lge(e,t){return UU(e,t)+"000"}function $ge(e,t){return wt(e.getUTCMonth()+1,t,2)}function Uge(e,t){return wt(e.getUTCMinutes(),t,2)}function Bge(e,t){return wt(e.getUTCSeconds(),t,2)}function Fge(e){var t=e.getUTCDay();return t===0?7:t}function qge(e,t){return wt(Ev.count(ls(e)-1,e),t,2)}function BU(e){var t=e.getUTCDay();return t>=4||t===0?xu(e):xu.ceil(e)}function Kge(e,t){return e=BU(e),wt(xu.count(ls(e),e)+(ls(e).getUTCDay()===4),t,2)}function Hge(e){return e.getUTCDay()}function Gge(e,t){return wt(ry.count(ls(e)-1,e),t,2)}function Vge(e,t){return wt(e.getUTCFullYear()%100,t,2)}function Zge(e,t){return e=BU(e),wt(e.getUTCFullYear()%100,t,2)}function Yge(e,t){return wt(e.getUTCFullYear()%1e4,t,4)}function Wge(e,t){var n=e.getUTCDay();return e=n>=4||n===0?xu(e):xu.ceil(e),wt(e.getUTCFullYear()%1e4,t,4)}function Qge(){return"+0000"}function CM(){return"%"}function _M(e){return+e}function OM(e){return Math.floor(+e/1e3)}var Ic,FU,qU;Xge({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 Xge(e){return Ic=Xme(e),FU=Ic.format,Ic.parse,qU=Ic.utcFormat,Ic.utcParse,Ic}function Jge(e){return new Date(e)}function eye(e){return e instanceof Date?+e:+new Date(+e)}function Mk(e,t,n,r,i,a,o,c,d,f){var p=wk(),m=p.invert,y=p.domain,v=f(".%L"),x=f(":%S"),w=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),A=f("%b %d"),_=f("%B"),C=f("%Y");function P(T){return(d(T)<T?v:c(T)<T?x:o(T)<T?w:a(T)<T?j:r(T)<T?i(T)<T?k:A:n(T)<T?_:C)(T)}return p.invert=function(T){return new Date(m(T))},p.domain=function(T){return arguments.length?y(Array.from(T,eye)):y().map(Jge)},p.ticks=function(T){var O=y();return e(O[0],O[O.length-1],T??10)},p.tickFormat=function(T,O){return O==null?P:f(O)},p.nice=function(T){var O=y();return(!T||typeof T.range!="function")&&(T=t(O[0],O[O.length-1],T??10)),T?y(AU(O,T)):p},p.copy=function(){return gh(p,Mk(e,t,n,r,i,a,o,c,d,f))},p}function tye(){return Ei.apply(Mk(Wme,Qme,os,zk,Av,yh,Tk,Ak,fl,FU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function nye(){return Ei.apply(Mk(Zme,Yme,ls,Rk,Ev,Ov,Pk,Ek,fl,qU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Tv(){var e=0,t=1,n,r,i,a,o=dr,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(i===0?.5:(m=(a(m)-n)*i,c?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(c=!!m,f):c},f.interpolator=function(m){return arguments.length?(o=m,f):o};function p(m){return function(y){var v,x;return arguments.length?([v,x]=y,o=m(v,x),f):[o(0),o(1)]}}return f.range=p(Uu),f.rangeRound=p(xk),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function jo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function KU(){var e=So(Tv()(dr));return e.copy=function(){return jo(e,KU())},fs.apply(e,arguments)}function HU(){var e=Nk(Tv()).domain([1,10]);return e.copy=function(){return jo(e,HU()).base(e.base())},fs.apply(e,arguments)}function GU(){var e=kk(Tv());return e.copy=function(){return jo(e,GU()).constant(e.constant())},fs.apply(e,arguments)}function Dk(){var e=Ck(Tv());return e.copy=function(){return jo(e,Dk()).exponent(e.exponent())},fs.apply(e,arguments)}function rye(){return Dk.apply(null,arguments).exponent(.5)}function VU(){var e=[],t=dr;function n(r){if(r!=null&&!isNaN(r=+r))return t((ph(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(oo),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,a)=>Fpe(e,a/r))},n.copy=function(){return VU(t).domain(e)},fs.apply(n,arguments)}function Pv(){var e=0,t=.5,n=1,r=1,i,a,o,c,d,f=dr,p,m=!1,y;function v(w){return isNaN(w=+w)?y:(w=.5+((w=+p(w))-a)*(r*w<r*a?c:d),f(m?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=p(e=+e),a=p(t=+t),o=p(n=+n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(m=!!w,v):m},v.interpolator=function(w){return arguments.length?(f=w,v):f};function x(w){return function(j){var k,A,_;return arguments.length?([k,A,_]=j,f=mme(w,[k,A,_]),v):[f(0),f(.5),f(1)]}}return v.range=x(Uu),v.rangeRound=x(xk),v.unknown=function(w){return arguments.length?(y=w,v):y},function(w){return p=w,i=w(e),a=w(t),o=w(n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function ZU(){var e=So(Pv()(dr));return e.copy=function(){return jo(e,ZU())},fs.apply(e,arguments)}function YU(){var e=Nk(Pv()).domain([.1,1,10]);return e.copy=function(){return jo(e,YU()).base(e.base())},fs.apply(e,arguments)}function WU(){var e=kk(Pv());return e.copy=function(){return jo(e,WU()).constant(e.constant())},fs.apply(e,arguments)}function Ik(){var e=Ck(Pv());return e.copy=function(){return jo(e,Ik()).exponent(e.exponent())},fs.apply(e,arguments)}function iye(){return Ik.apply(null,arguments).exponent(.5)}const QU=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:yk,scaleDiverging:ZU,scaleDivergingLog:YU,scaleDivergingPow:Ik,scaleDivergingSqrt:iye,scaleDivergingSymlog:WU,scaleIdentity:OU,scaleImplicit:G1,scaleLinear:_U,scaleLog:EU,scaleOrdinal:gk,scalePoint:Hpe,scalePow:_k,scaleQuantile:zU,scaleQuantize:RU,scaleRadial:PU,scaleSequential:KU,scaleSequentialLog:HU,scaleSequentialPow:Dk,scaleSequentialQuantile:VU,scaleSequentialSqrt:rye,scaleSequentialSymlog:GU,scaleSqrt:Lme,scaleSymlog:TU,scaleThreshold:MU,scaleTime:tye,scaleUtc:nye,tickFormat:CU},Symbol.toStringTag,{value:"Module"}));function aye(e){var t=QU;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ah(e));if(n in t&&typeof t[n]=="function")return t[n]()}function AM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=aye(e);if(r!=null)return r.domain(t).range(n),r}}function Lk(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?AM(e.scale,n,r):AM(t,n,r)}function sye(e){return"scale".concat(ah(e))}function oye(e){return sye(e)in QU}var XU=(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 oye(r)?r:"point"}};function lye(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function JU(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,c,d=lye(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function cye(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):JU(e,void 0)}function EM(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 iy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EM(Object(n),!0).forEach(function(r){uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uye(e,t,n){return(t=dye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(e){var t=fye(e,"string");return typeof t=="symbol"?t:t+""}function fye(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 W1=[0,"auto"],En={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"},e6=(e,t)=>e.cartesianAxis.xAxis[t],ja=(e,t)=>{var n=e6(e,t);return n??En},Tn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:W1,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:lh},t6=(e,t)=>e.cartesianAxis.yAxis[t],Na=(e,t)=>{var n=t6(e,t);return n??Tn},hye={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:""},$k=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??hye},yr=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"zAxis":return $k(e,n);case"angleAxis":return ck(e,n);case"radiusAxis":return uk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},pye=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vh=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"angleAxis":return ck(e,n);case"radiusAxis":return uk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},n6=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function r6(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 i6=e=>e.graphicalItems.cartesianItems,mye=le([$n,Nv],r6),a6=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Bu=le([i6,yr,mye],a6,{memoizeOptions:{resultEqualityCheck:Cv}}),s6=le([Bu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(hk)),o6=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),gye=le([Bu],o6),l6=e=>e.map(t=>t.data).filter(Boolean).flat(1),yye=le([Bu],e=>e.some(t=>!t.data)),c6=le([Bu],l6,{memoizeOptions:{resultEqualityCheck:Cv}}),u6=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Uk=le([c6,bv],u6),vye=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Ln(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Ln(i,r)}))):e.map(r=>({value:r})),d6=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:c,dataEndIndex:d}=r,f=vye(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(c,d+1),m=p.map(y=>({value:Ln(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},bh=le([Uk,yr,Bu,bv,yye,c6],d6);function lu(e){if(Ni(e)||e instanceof Date){var t=Number(e);if(nt(t))return t}}function TM(e){if(Array.isArray(e)){var t=[lu(e[0]),lu(e[1])];return ha(t)?t:void 0}var n=lu(e);if(n!=null)return[n,n]}function xa(e){return e.map(lu).filter(Ar)}function bye(e,t){var n=lu(e),r=lu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var xye=le([bh],e=>e?.map(t=>t.value).sort(bye));function f6(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function wye(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ya(t))r=t;else if(Array.isArray(t)){var i=xa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:xa(n.flatMap(a=>{var o=Ln(e,a.dataKey),c,d;if(Array.isArray(o)?[c,d]=o:c=d=o,!(!nt(c)||!nt(d)))return[r-c,r+d]}))}var Rn=e=>{var t=Un(e),n=$u(e);return vh(e,t,n)},wu=le([Rn],e=>e?.dataKey),Sye=le([s6,bv,Rn],yU),h6=(e,t,n,r)=>{var i={},a=t.reduce((o,c)=>{if(c.stackId==null)return o;var d=o[c.stackId];return d==null&&(d=[]),d.push(c),o[c.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[c,d]=o,f=r?[...d].reverse():d,p=f.map(fk);return[c,{stackedData:tde(e,p,n),graphicalItems:f}]}))},p6=le([Sye,s6,xv,uU],h6),m6=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=ade(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},jye=le([yr],e=>e.allowDataOverflow),Bk=e=>{var t;if(e==null||!("domain"in e))return W1;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=xa(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:W1},g6=le([yr],Bk),y6=le([g6,jye],J4),Nye=le([p6,Xi,$n,y6],m6,{memoizeOptions:{resultEqualityCheck:kv}}),Fk=e=>e.errorBars,kye=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>f6(n,r)),ay=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 a=i.flat(),o=Math.min(...a),c=Math.max(...a);return[o,c]}},v6=function(t,n,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>f6(a,v));m.forEach(v=>{var x,w=Ln(v,(x=n.dataKey)!==null&&x!==void 0?x:f.dataKey),j=wye(v,w,y);if(j.length>=2){var k=Math.min(...j),A=Math.max(...j);(c==null||k<c)&&(c=k),(d==null||A>d)&&(d=A)}var _=TM(w);_!=null&&(c=c==null?_[0]:Math.min(c,_[0]),d=d==null?_[1]:Math.max(d,_[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=TM(Ln(f,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),nt(c)&&nt(d))return[c,d]},Cye=le([Uk,yr,gye,Fk,$n,ppe],v6,{memoizeOptions:{resultEqualityCheck:kv}});function _ye(e){var{value:t}=e;if(Ni(t)||t instanceof Date)return t}var Oye=(e,t,n)=>{var r=e.map(_ye).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&O3(r))?X4(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},b6=e=>e.referenceElements.dots,Fu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Aye=le([b6,$n,Nv],Fu),x6=e=>e.referenceElements.areas,Eye=le([x6,$n,Nv],Fu),w6=e=>e.referenceElements.lines,Tye=le([w6,$n,Nv],Fu),S6=(e,t)=>{if(e!=null){var n=xa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Pye=le(Aye,$n,S6),j6=(e,t)=>{if(e!=null){var n=xa(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)]}},zye=le([Eye,$n],j6);function Rye(e){var t;if(e.x!=null)return xa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:xa(n)}function Mye(e){var t;if(e.y!=null)return xa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:xa(n)}var N6=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Rye(r):Mye(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Dye=le([Tye,$n],N6),Iye=le(Pye,Dye,zye,(e,t,n)=>ay(e,n,t)),k6=(e,t,n,r,i,a,o,c)=>{if(n!=null)return n;var d=o==="vertical"&&c==="xAxis"||o==="horizontal"&&c==="yAxis",f=d?ay(r,a,i):ay(a,i);return gpe(t,f,e.allowDataOverflow)},Lye=le([yr,g6,y6,Nye,Cye,Iye,en,$n],k6,{memoizeOptions:{resultEqualityCheck:kv}}),$ye=[0,1],C6=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:c,type:d}=e,f=Sa(t,a);if(f&&c==null){var p;return X4(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Oye(r,e,f):i==="expand"&&!f?$ye:o}},qk=le([yr,en,Uk,bh,xv,$n,Lye],C6),qu=le([yr,n6,sk],XU),_6=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Bk(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ha(e)){if(a)return BR(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return FR(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ha(e))return BR(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ha(e))return FR(e,t.tickCount,t.allowDecimals,"adaptive")}}},Kk=le([qk,vh,qu],_6),O6=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ha(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,c),Math.max(d,f)]}return t},Uye=le([yr,qk,Kk,$n],O6),Bye=le(bh,yr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(xa(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var c=0;c<r.length-1;c++){var d=r[c],f=r[c+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/o}}),A6=le(Bye,en,wpe,Xn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!nt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=po(n,e*a),c=e*a/2;return c-o-(c-o)/a*o}return 0}),Fye=(e,t,n)=>{var r=ja(e,t);return r==null||typeof r.padding!="string"?0:A6(e,"xAxis",t,n,r.padding)},qye=(e,t,n)=>{var r=Na(e,t);return r==null||typeof r.padding!="string"?0:A6(e,"yAxis",t,n,r.padding)},Kye=le(ja,Fye,(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}}),Hye=le(Na,qye,(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}}),Gye=le([Xn,Kye,mv,pv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Vye=le([Xn,en,Hye,mv,pv,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),xh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Gye(e,n,r);case"yAxis":return Vye(e,n,r);case"zAxis":return(i=$k(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return pU(e);case"radiusAxis":return mU(e,n);default:return}},E6=le([yr,xh],wv),Zye=le([qu,Uye],Epe),Hk=le([yr,qu,Zye,E6],Lk),T6=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Sa(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},Gk=le([en,bh,vh,$n],T6),Su=le([Hk],pk);le([Hk],cye);le([Hk,xye],JU);le([Bu,Fk,$n],kye);function P6(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var zv=(e,t)=>t,Rv=(e,t,n)=>n,Yye=le(fv,zv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(P6)),Wye=le(hv,zv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(P6)),z6=(e,t)=>({width:e.width,height:t.height}),Qye=(e,t)=>{var n=typeof t.width=="number"?t.width:lh;return{width:n,height:e.height}},Xye=le(Xn,ja,z6),Jye=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},eve=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},tve=le(ds,Xn,Yye,zv,Rv,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=z6(t,c);o==null&&(o=Jye(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),nve=le(us,Xn,Wye,zv,Rv,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=Qye(t,c);o==null&&(o=eve(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),rve=(e,t)=>{var n=ja(e,t);if(n!=null)return tve(e,n.orientation,n.mirror)},ive=le([Xn,ja,rve,(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}}}),ave=(e,t)=>{var n=Na(e,t);if(n!=null)return nve(e,n.orientation,n.mirror)},sve=le([Xn,Na,ave,(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}}}),ove=le(Xn,Na,(e,t)=>{var n=typeof t.width=="number"?t.width:lh;return{width:n,height:e.height}}),R6=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,c=Sa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&c&&a==="category"&&i&&O3(f))return d}},Vk=le([en,bh,yr,$n],R6),PM=le([en,pye,qu,Su,Vk,Gk,xh,Kk,$n],(e,t,n,r,i,a,o,c,d)=>{if(t!=null){var f=Sa(e,d);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:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:c,range:o,realScaleType:n,scale:r}}}),lve=(e,t,n,r,i,a,o,c,d)=>{if(!(t==null||r==null)){var f=Sa(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,x=p==="category"&&r.bandwidth?r.bandwidth()/v:0;x=d==="angleAxis"&&a!=null&&a.length>=2?bi(a[0]-a[1])*2*x:x;var w=m||i;return w?w.map((j,k)=>{var A=o?o.indexOf(j):j,_=r.map(A);return nt(_)?{index:k,coordinate:_+x,value:j,offset:x}:null}).filter(Ar):f&&c?c.map((j,k)=>{var A=r.map(j);return nt(A)?{coordinate:A+x,value:j,index:k,offset:x}:null}).filter(Ar):r.ticks?r.ticks(y).map((j,k)=>{var A=r.map(j);return nt(A)?{coordinate:A+x,value:j,index:k,offset:x}:null}).filter(Ar):r.domain().map((j,k)=>{var A=r.map(j);return nt(A)?{coordinate:A+x,value:o?o[j]:j,index:k,offset:x}:null}).filter(Ar)}},M6=le([en,vh,qu,Su,Kk,xh,Vk,Gk,$n],lve),cve=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Sa(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?bi(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Ar):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Ar):n.domain().map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Ar)}},D6=le([en,vh,Su,xh,Vk,Gk,$n],cve),I6=le(yr,Su,(e,t)=>{if(!(e==null||t==null))return iy(iy({},e),{},{scale:t})}),uve=le([yr,qu,qk,E6],Lk),dve=le([uve],pk);le((e,t,n)=>$k(e,n),dve,(e,t)=>{if(!(e==null||t==null))return iy(iy({},e),{},{scale:t})});var fve=le([en,fv,hv],(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}}),hve=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([hve],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var L6=e=>e.options.defaultTooltipEventType,$6=e=>e.options.validateTooltipEventTypes;function U6(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function wh(e,t){var n=L6(e),r=$6(e);return U6(t,n,r)}function pve(e){return Fe(t=>wh(t,e))}var B6=(e,t)=>{var n,r=Number(t);if(!(ya(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},mve=e=>e.tooltip.settings,Ws={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},gve={itemInteraction:{click:Ws,hover:Ws},axisInteraction:{click:Ws,hover:Ws},keyboardInteraction:Ws,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}},F6=sr({name:"tooltip",initialState:gve,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Vt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Vt()},removeTooltipEntrySettings:{reducer(e,t){var n=xi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Vt()},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:yve,replaceTooltipEntrySettings:vve,removeTooltipEntrySettings:bve,setTooltipSettingsState:xve,setActiveMouseOverItemIndex:wve,mouseLeaveItem:XNe,mouseLeaveChart:q6,setActiveClickItemIndex:JNe,setMouseOverAxisIndex:K6,setMouseClickAxisIndex:Sve,setSyncInteraction:of,setKeyboardInteraction:sy}=F6.actions,jve=F6.reducer;function zM(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 Am(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){Nve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nve(e,t,n){return(t=kve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kve(e){var t=Cve(e,"string");return typeof t=="symbol"?t:t+""}function Cve(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 _ve(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Ove(e){return e.index!=null}var H6=(e,t,n,r)=>{if(t==null)return Ws;var i=_ve(e,t,n);if(i==null)return Ws;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Ove(i)){if(a)return Am(Am({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Am(Am({},Ws),{},{coordinate:i.coordinate})};function Ave(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 Eve(e,t){var n=Ave(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function Tve(e,t,n){if(n==null||t==null)return!0;var r=Ln(e,t);return r==null||!ha(n)?!0:Eve(r,n)}var yf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!nt(a))return i;var o=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(o,Math.min(a,c)),f=t[d];return f==null||Tve(f,n,r)?String(d):null},G6=(e,t,n,r,i,a,o)=>{if(a!=null){var c=o[0],d=c?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},V6=(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 a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var c;return((c=o.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},Z6=e=>e.options.tooltipPayloadSearcher,Ku=e=>e.tooltip;function RM(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 MM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){Pve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pve(e,t,n){return(t=zve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zve(e){var t=Rve(e,"string");return typeof t=="symbol"?t:t+""}function Rve(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 Mve(e){if(typeof e=="string"||typeof e=="number")return e}function Dve(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Ive(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function DM(e){if(typeof e=="string")return e}function Lve(e){if(!(e==null||typeof e!="object")){var t="name"in e?Mve(e.name):void 0,n="unit"in e?Dve(e.unit):void 0,r="dataKey"in e?Ive(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?DM(e.color):void 0,o="fill"in e?DM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function $ve(e,t){return e??t}var Y6=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var x,{dataDefinedOnItem:w,settings:j}=v,k=$ve(w,c),A=Array.isArray(k)?k4(k,f,p):k,_=(x=j?.dataKey)!==null&&x!==void 0?x:r,C=j?.nameKey,P;if(r&&Array.isArray(A)&&!Array.isArray(A[0])&&o==="axis"?P=A3(A,r,i):P=a(A,t,d,C),Array.isArray(P))P.forEach(O=>{var z,I,F=Lve(O),$=F?.name,L=F?.dataKey,J=F?.payload,ae=MM(MM({},j),{},{name:$,unit:F?.unit,color:(z=F?.color)!==null&&z!==void 0?z:j?.color,fill:(I=F?.fill)!==null&&I!==void 0?I:j?.fill});y.push(Az({tooltipEntrySettings:ae,dataKey:L,payload:J,value:Ln(J,L),name:$==null?void 0:String($)}))});else{var T;y.push(Az({tooltipEntrySettings:j,dataKey:_,payload:P,value:Ln(P,_),name:(T=Ln(P,C))!==null&&T!==void 0?T:j?.name}))}return y},m)}},Zk=le([Rn,n6,sk],XU),Uve=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Bve=le([Un,$u],r6),Hl=le([Uve,Rn,Bve],a6,{memoizeOptions:{resultEqualityCheck:Cv}}),Fve=le([Hl],e=>e.filter(hk)),W6=le([Hl],l6,{memoizeOptions:{resultEqualityCheck:Cv}}),qve=le([Hl],e=>e.some(t=>!t.data)),zl=le([W6,Xi],u6),Kve=le([Fve,Xi,Rn],yU),Yk=le([zl,Rn,Hl,Xi,qve,W6],d6),Q6=le([Rn],Bk),Hve=le([Rn],e=>e.allowDataOverflow),X6=le([Q6,Hve],J4),Gve=le([Hl],e=>e.filter(hk)),Vve=le([Kve,Gve,xv,uU],h6),Zve=le([Vve,Xi,Un,X6],m6),Yve=le([Hl],o6),Wve=le([zl,Rn,Yve,Fk,Un,mpe],v6,{memoizeOptions:{resultEqualityCheck:kv}}),Qve=le([b6,Un,$u],Fu),Xve=le([Qve,Un],S6),Jve=le([x6,Un,$u],Fu),e0e=le([Jve,Un],j6),t0e=le([w6,Un,$u],Fu),n0e=le([t0e,Un],N6),r0e=le([Xve,n0e,e0e],ay),i0e=le([Rn,Q6,X6,Zve,Wve,r0e,en,Un],k6),ju=le([Rn,en,zl,Yk,xv,Un,i0e],C6),a0e=le([ju,Rn,Zk],_6),s0e=le([Rn,ju,a0e,Un],O6),J6=e=>{var t=Un(e),n=$u(e),r=!1;return xh(e,t,n,r)},eB=le([Rn,J6],wv),o0e=le([Rn,Zk,s0e,eB],Lk),tB=le([o0e],pk),l0e=le([en,Yk,Rn,Un],R6),c0e=le([en,Yk,Rn,Un],T6),u0e=(e,t,n,r,i,a,o,c)=>{if(t){var{type:d}=t,f=Sa(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=c==="angleAxis"&&i!=null&&i?.length>=2?bi(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var x=r.map(y);return nt(x)?{coordinate:x+m,value:y,index:v,offset:m}:null}).filter(Ar):r.domain().map((y,v)=>{var x=r.map(y);return nt(x)?{coordinate:x+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Ar)}}},hs=le([en,Rn,Zk,tB,J6,l0e,c0e,Un],u0e),Wk=le([L6,$6,mve],(e,t,n)=>U6(n.shared,e,t)),nB=e=>e.tooltip.settings.trigger,Qk=e=>e.tooltip.settings.defaultIndex,Sh=le([Ku,Wk,nB,Qk],H6),Hf=le([Sh,zl,wu,ju],yf),rB=le([hs,Hf],B6),d0e=le([Sh],e=>{if(e)return e.dataKey}),f0e=le([Sh],e=>{if(e)return e.graphicalItemId}),iB=le([Ku,Wk,nB,Qk],V6),h0e=le([us,ds,en,Xn,hs,Qk,iB],G6),p0e=le([Sh,h0e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),m0e=le([Sh],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),g0e=le([iB,Hf,Xi,wu,rB,Z6,Wk],Y6),y0e=le([g0e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function IM(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?IM(Object(n),!0).forEach(function(r){v0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v0e(e,t,n){return(t=b0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b0e(e){var t=x0e(e,"string");return typeof t=="symbol"?t:t+""}function x0e(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 w0e=()=>Fe(Rn),S0e=()=>{var e=w0e(),t=Fe(hs),n=Fe(tB);return Dg(!e||!n?void 0:LM(LM({},e),{},{scale:n}),t)};function $M(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 Lc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){j0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j0e(e,t,n){return(t=N0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N0e(e){var t=k0e(e,"string");return typeof t=="symbol"?t:t+""}function k0e(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 C0e=(e,t,n,r)=>{var i=t.find(a=>a&&a.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}},_0e=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Lc(Lc(Lc({},r),Wn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var c=i.coordinate,{angle:d}=r;return Lc(Lc(Lc({},r),Wn(r.cx,r.cy,c,d)),{},{angle:d,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 O0e(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 aB=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=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<o;c++){var d,f,p,m,y,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,x=(p=n[c])===null||p===void 0?void 0:p.coordinate,w=c>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||x==null||w==null))if(bi(x-v)!==bi(w-x)){var k=[];if(bi(w-x)===bi(i[1]-i[0])){j=w;var A=x+i[1]-i[0];k[0]=Math.min(A,(A+v)/2),k[1]=Math.max(A,(A+v)/2)}else{j=v;var _=w+i[1]-i[0];k[0]=Math.min(x,(_+x)/2),k[1]=Math.max(x,(_+x)/2)}var C=[Math.min(x,(j+x)/2),Math.max(x,(j+x)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[c])===null||P===void 0?void 0:P.index}}else{var T=Math.min(v,w),O=Math.max(v,w);if(e>(T+x)/2&&e<=(O+x)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var I=0;I<o;I++){var F=t[I];if(F!=null){var $=t[I+1],L=t[I-1];if(I===0&&$!=null&&e<=(F.coordinate+$.coordinate)/2||I===o-1&&L!=null&&e>(F.coordinate+L.coordinate)/2||I>0&&I<o-1&&L!=null&&$!=null&&e>(F.coordinate+L.coordinate)/2&&e<=(F.coordinate+$.coordinate)/2)return F.index}}return-1},sB=()=>Fe(sk),Xk=(e,t)=>t,oB=(e,t,n)=>n,Jk=(e,t,n,r)=>r,A0e=le(hs,e=>nv(e,t=>t.coordinate)),eC=le([Ku,Xk,oB,Jk],H6),tC=le([eC,zl,wu,ju],yf),E0e=(e,t,n)=>{if(t!=null){var r=Ku(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},lB=le([Ku,Xk,oB,Jk],V6),oy=le([us,ds,en,Xn,hs,Jk,lB],G6),T0e=le([eC,oy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),cB=le([hs,tC],B6),P0e=le([lB,tC,Xi,wu,cB,Z6,Xk],Y6),z0e=le([eC,tC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),R0e=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&O0e(e,o)){var c=sde(e,t),d=aB(c,a,i,n,r),f=C0e(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},M0e=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var c=npe(e,n);if(c){var d=ode(c,t),f=aB(d,o,a,r,i),p=_0e(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},D0e=(e,t,n,r,i,a,o,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?R0e(e,t,r,i,a,o,c):M0e(e,t,n,r,i,a,o)},I0e=le(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}}),L0e=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(ir)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ape}});function UM(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 BM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UM(Object(n),!0).forEach(function(r){$0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $0e(e,t,n){return(t=U0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U0e(e){var t=B0e(e,"string");return typeof t=="symbol"?t:t+""}function B0e(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 F0e={},q0e={zIndexMap:Object.values(ir).reduce((e,t)=>BM(BM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),F0e)},K0e=new Set(Object.values(ir));function H0e(e){return K0e.has(e)}var uB=sr({name:"zIndex",initialState:q0e,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:Vt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!H0e(n)&&delete e.zIndexMap[n])},prepare:Vt()},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:Vt()},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:Vt()}}}),{registerZIndexPortal:G0e,unregisterZIndexPortal:oS,registerZIndexPortalElement:V0e,unregisterZIndexPortalElement:Z0e}=uB.actions,Y0e=uB.reducer;function ka(e){var{zIndex:t,children:n}=e,r=Ude(),i=r&&t!==void 0&&t!==0,a=gr(),o=S.useRef(void 0),c=S.useRef(new Set),d=ln(),f=Fe(m=>I0e(m,t,a));if(S.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(oS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(c.current.has(t)||(d(G0e({zIndex:t})),c.current.add(t)),f){o.current=f;var y=c.current;y.forEach(v=>{v!==t&&(d(oS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),S.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(y=>{d(oS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?Dl.createPortal(n,p):null}function Q1(){return Q1=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},Q1.apply(null,arguments)}function FM(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 Em(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(n),!0).forEach(function(r){W0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W0e(e,t,n){return(t=Q0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q0e(e){var t=X0e(e,"string");return typeof t=="symbol"?t:t+""}function X0e(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 J0e(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return S.isValidElement(t)?S.cloneElement(t,r):S.createElement(n,r)}function ebe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:c,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var x,w,j;if(p==="ScatterChart")x=m,w=phe,j=ir.cursorLine;else if(p==="BarChart")x=mhe(c,m,a,o),w=Ghe,j=ir.cursorRectangle;else if(c==="radial"&&P3(m)){var{cx:k,cy:A,radius:_,startAngle:C,endAngle:P}=W4(m);x={cx:k,cy:A,startAngle:C,endAngle:P,innerRadius:_,outerRadius:_},w=spe,j=ir.cursorLine}else x={points:ope(c,m,a)},w=Zm,j=ir.cursorLine;var T=typeof d=="object"&&"className"in d?d.className:void 0,O=Em(Em(Em(Em({stroke:"#ccc",pointerEvents:"none"},a),x),Qy(d)),{},{payload:y,payloadIndex:v,className:Ct("recharts-tooltip-cursor",T)});return S.createElement(ka,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},S.createElement(J0e,{cursor:d,cursorComp:w,cursorProps:O}))}function tbe(e){var t=S0e(),n=R4(),r=Du(),i=sB();return t==null||n==null||r==null||i==null?null:S.createElement(ebe,Q1({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var dB=S.createContext(null),nbe=()=>S.useContext(dB),lS={exports:{}},qM;function rbe(){return qM||(qM=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(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),x=n?n+f:f;return d._events[x]?d._events[x].fn?d._events[x]=[d._events[x],v]:d._events[x].push(v):(d._events[x]=v,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,v=m.length,x=new Array(v);y<v;y++)x[y]=m[y].fn;return x},c.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},c.prototype.emit=function(f,p,m,y,v,x){var w=n?n+f:f;if(!this._events[w])return!1;var j=this._events[w],k=arguments.length,A,_;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,x),!0}for(_=1,A=new Array(k-1);_<k;_++)A[_-1]=arguments[_];j.fn.apply(j.context,A)}else{var C=j.length,P;for(_=0;_<C;_++)switch(j[_].once&&this.removeListener(f,j[_].fn,void 0,!0),k){case 1:j[_].fn.call(j[_].context);break;case 2:j[_].fn.call(j[_].context,p);break;case 3:j[_].fn.call(j[_].context,p,m);break;case 4:j[_].fn.call(j[_].context,p,m,y);break;default:if(!A)for(P=1,A=new Array(k-1);P<k;P++)A[P-1]=arguments[P];j[_].fn.apply(j[_].context,A)}}return!0},c.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},c.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},c.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var x=this._events[v];if(x.fn)x.fn===p&&(!y||x.once)&&(!m||x.context===m)&&o(this,v);else{for(var w=0,j=[],k=x.length;w<k;w++)(x[w].fn!==p||y&&!x[w].once||m&&x[w].context!==m)&&j.push(x[w]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},c.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(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})(lS)),lS.exports}var ibe=rbe();const abe=wa(ibe);var Gf=new abe,X1="recharts.syncEvent.tooltip",KM="recharts.syncEvent.brush",sbe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ya(n))return e[n]}},obe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},fB=sr({name:"options",initialState:obe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),lbe=fB.reducer,{createEventEmitter:cbe}=fB.actions;function ube(e){return e.tooltip.syncInteraction}var dbe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},hB=sr({name:"chartData",initialState:dbe,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:HM,setDataStartEndIndexes:fbe,setComputedData:eke}=hB.actions,hbe=hB.reducer,pbe=["x","y"];function GM(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 $c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GM(Object(n),!0).forEach(function(r){mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mbe(e,t,n){return(t=gbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gbe(e){var t=ybe(e,"string");return typeof t=="symbol"?t:t+""}function ybe(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 vbe(e,t){if(e==null)return{};var n,r,i=bbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bbe(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 xbe(){var e=Fe(ok),t=Fe(lk),n=ln(),r=Fe(dU),i=Fe(hs),a=Du(),o=ch(),c=Fe(d=>d.rootProps.className);S.useEffect(()=>{if(e==null)return Mu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(of({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(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x,y:w}=v,j=vbe(v,pbe),{x:k,y:A,width:_,height:C}=p.payload.sourceViewBox,P=$c($c({},j),{},{x:o.x+(_?(x-k)/_:0)*o.width,y:o.y+(C?(w-A)/C:0)*o.height});n($c($c({},p),{},{payload:$c($c({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var T;if(typeof r=="function"){var O={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},z=r(i,O);T=i[z]}else r==="value"&&(T=i.find(K=>String(K.value)===p.payload.label));var{coordinate:I}=p.payload;if(I==null||o==null){n(of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(T==null){n(of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:$}=I,L=Math.min(F,o.x+o.width),J=Math.min($,o.y+o.height),ae={x:a==="horizontal"?T.coordinate:L,y:a==="horizontal"?J:T.coordinate},Q=of({active:p.payload.active,coordinate:ae,dataKey:p.payload.dataKey,index:String(T.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Q)}}};return Gf.on(X1,d),()=>{Gf.off(X1,d)}},[c,n,t,e,r,i,a,o])}function wbe(){var e=Fe(ok),t=Fe(lk),n=ln();S.useEffect(()=>{if(e==null)return Mu;var r=(i,a,o)=>{t!==o&&e===i&&n(fbe(a))};return Gf.on(KM,r),()=>{Gf.off(KM,r)}},[n,t,e])}function Sbe(){var e=ln();S.useEffect(()=>{e(cbe())},[e]),xbe(),wbe()}function jbe(e,t,n,r,i,a){var o=Fe(x=>E0e(x,e,t)),c=Fe(f0e),d=Fe(lk),f=Fe(ok),p=Fe(dU),m=Fe(ube),y=m?.sourceViewBox!=null,v=ch();S.useEffect(()=>{if(!y&&f!=null&&d!=null){var x=of({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Gf.emit(X1,f,x,d)}},[y,n,o,c,i,r,d,f,p,a,v])}function VM(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?VM(Object(n),!0).forEach(function(r){Nbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nbe(e,t,n){return(t=kbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kbe(e){var t=Cbe(e,"string");return typeof t=="symbol"?t:t+""}function Cbe(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 _be(e){return e.dataKey}function Obe(e,t){return S.isValidElement(e)?S.cloneElement(e,t):typeof e=="function"?S.createElement(e,t):S.createElement(qfe,t)}var YM=[],Abe={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 J1(e){var t,n,r=mr(e,Abe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:x,useTranslate3d:w,wrapperStyle:j,cursor:k,shared:A,trigger:_,defaultIndex:C,portal:P,axisId:T}=r,O=ln(),z=typeof C=="number"?String(C):C;S.useEffect(()=>{O(xve({shared:A,trigger:_,axisId:T,active:i,defaultIndex:z}))},[O,A,_,T,i,z]);var I=ch(),F=K4(),$=pve(A),{activeIndex:L,isActive:J}=(t=Fe(je=>z0e(je,$,_,z)))!==null&&t!==void 0?t:{},ae=Fe(je=>P0e(je,$,_,z)),Q=Fe(je=>cB(je,$,_,z)),K=Fe(je=>T0e(je,$,_,z)),X=ae,ye=nbe(),Se=(n=i??J)!==null&&n!==void 0?n:!1,[R,B]=Y3([X,Se]),U=$==="axis"?Q:void 0;jbe($,_,K,U,L,Se);var M=P??ye;if(M==null||I==null||$==null)return null;var V=X??YM;Se||(V=YM),f&&V.length&&(V=K3(V.filter(je=>je.value!=null&&(je.hide!==!0||r.includeHidden)),y,_be));var se=V.length>0,ie=ZM(ZM({},r),{},{payload:V,label:U,active:Se,activeIndex:L,coordinate:K,accessibilityLayer:F}),he=S.createElement(ehe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:p,active:Se,coordinate:K,hasPayload:se,offset:m,position:v,reverseDirection:x,useTranslate3d:w,viewBox:I,wrapperStyle:j,lastBoundingBox:R,innerRef:B,hasPortalFromProps:!!P},Obe(d,ie));return S.createElement(S.Fragment,null,Dl.createPortal(he,M),Se&&S.createElement(tbe,{cursor:k,tooltipEventType:$,coordinate:K,payload:V,index:L}))}function Ebe(e,t,n){return(t=Tbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tbe(e){var t=Pbe(e,"string");return typeof t=="symbol"?t:t+""}function Pbe(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 zbe{constructor(t){Ebe(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 WM(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 Rbe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WM(Object(n),!0).forEach(function(r){Mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mbe(e,t,n){return(t=Dbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dbe(e){var t=Ibe(e,"string");return typeof t=="symbol"?t:t+""}function Ibe(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 Lbe={cacheSize:2e3,enableCache:!0},pB=Rbe({},Lbe),QM=new zbe(pB.cacheSize),$be={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},XM="recharts_measurement_span";function Ube(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(c)}var JM=(e,t)=>{try{var n=document.getElementById(XM);n||(n=document.createElement("span"),n.setAttribute("id",XM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,$be,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},vf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||hh.isSsr)return{width:0,height:0};if(!pB.enableCache)return JM(t,n);var r=Ube(t,n),i=QM.get(r);if(i)return i;var a=JM(t,n);return QM.set(r,a),a},mB;function Bbe(e,t,n){return(t=Fbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fbe(e){var t=qbe(e,"string");return typeof t=="symbol"?t:t+""}function qbe(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 eD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kbe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Hbe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Gbe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Vbe=["cm","mm","pt","pc","in","Q","px"];function Zbe(e){return Vbe.includes(e)}var Wc="NaN";function Ybe(e,t){return e*Gbe[t]}class Zn{static parse(t){var n,[,r,i]=(n=Hbe.exec(t))!==null&&n!==void 0?n:[];return r==null?Zn.NaN:new Zn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ya(t)&&(this.unit=""),n!==""&&!Kbe.test(n)&&(this.num=NaN,this.unit=""),Zbe(n)&&(this.num=Ybe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Zn(NaN,""):new Zn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Zn(NaN,""):new Zn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Zn(NaN,""):new Zn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Zn(NaN,""):new Zn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ya(this.num)}}mB=Zn;Bbe(Zn,"NaN",new mB(NaN,""));function gB(e){if(e==null||e.includes(Wc))return Wc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=eD.exec(t))!==null&&n!==void 0?n:[],o=Zn.parse(r??""),c=Zn.parse(a??""),d=i==="*"?o.multiply(c):o.divide(c);if(d.isNaN())return Wc;t=t.replace(eD,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=tD.exec(t))!==null&&f!==void 0?f:[],v=Zn.parse(p??""),x=Zn.parse(y??""),w=m==="+"?v.add(x):v.subtract(x);if(w.isNaN())return Wc;t=t.replace(tD,w.toString())}return t}var nD=/\(([^()]*)\)/;function Wbe(e){for(var t=e,n;(n=nD.exec(t))!=null;){var[,r]=n;t=t.replace(nD,gB(r))}return t}function Qbe(e){var t=e.replace(/\s+/g,"");return t=Wbe(t),t=gB(t),t}function Xbe(e){try{return Qbe(e)}catch{return Wc}}function cS(e){var t=Xbe(e.slice(5,-1));return t===Wc?"":t}var Jbe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],exe=["dx","dy","angle","className","breakAll"];function ej(){return ej=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},ej.apply(null,arguments)}function rD(e,t){if(e==null)return{};var n,r,i=txe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function txe(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 yB=/[ \f\n\r\t\v\u2028\u2029]+/,vB=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Qn(t)||(n?i=t.toString().split(""):i=t.toString().split(yB));var a=i.map(c=>({word:c,width:vf(c,r).width})),o=n?0:vf(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function bB(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function nxe(e){return Qn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var xB=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(o),d.width+=c+n;else{var f={words:[o],width:c};i.push(f)}return i},[]),wB=e=>e.reduce((t,n)=>t.width>n.width?t:n),rxe="…",iD=(e,t,n,r,i,a,o,c)=>{var d=e.slice(0,t),f=vB({breakAll:n,style:r,children:d+rxe});if(!f)return[!1,[]];var p=xB(f.wordsWithComputedWidth,a,o,c),m=p.length>i||wB(p).width>Number(a);return[m,p]},ixe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:c,breakAll:d}=e,f=Ue(a),p=String(o),m=xB(t,r,n,i);if(!f||i)return m;var y=m.length>a||wB(m).width>Number(r);if(!y)return m;for(var v=0,x=p.length-1,w=0,j;v<=x&&w<=p.length-1;){var k=Math.floor((v+x)/2),A=k-1,[_,C]=iD(p,A,d,c,a,r,n,i),[P]=iD(p,k,d,c,a,r,n,i);if(!_&&!P&&(v=k+1),_&&P&&(x=k-1),!_&&P){j=C;break}w++}return j||m},aD=e=>{var t=Qn(e)?[]:e.toString().split(yB);return[{words:t,width:void 0}]},axe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!hh.isSsr){var c,d,f=vB({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return aD(r);return ixe({breakAll:a,children:r,maxLines:o,style:i},c,d,t,!!n)}return aD(r)},SB="#808080",sxe={angle:0,breakAll:!1,capHeight:"0.71em",fill:SB,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},nC=S.forwardRef((e,t)=>{var n=mr(e,sxe),{x:r,y:i,lineHeight:a,capHeight:o,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=rD(n,Jbe),y=S.useMemo(()=>axe({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:x,angle:w,className:j,breakAll:k}=m,A=rD(m,exe);if(!Ni(r)||!Ni(i)||y.length===0)return null;var _=Number(r)+(Ue(v)?v:0),C=Number(i)+(Ue(x)?x:0);if(!nt(_)||!nt(C))return null;var P;switch(p){case"start":P=cS("calc(".concat(o,")"));break;case"middle":P=cS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:P=cS("calc(".concat(y.length-1," * -").concat(a,")"));break}var T=[],O=y[0];if(d&&O!=null){var z=O.width,{width:I}=m;T.push("scale(".concat(Ue(I)&&Ue(z)?I/z:1,")"))}return w&&T.push("rotate(".concat(w,", ").concat(_,", ").concat(C,")")),T.length&&(A.transform=T.join(" ")),S.createElement("text",ej({},zr(A),{ref:t,x:_,y:C,className:Ct("recharts-text",j),textAnchor:f,fill:c.includes("url")?SB:c}),y.map((F,$)=>{var L=F.words.join(k?"":" ");return S.createElement("tspan",{x:_,dy:$===0?P:a,key:"".concat(L,"-").concat($)},L)}))});nC.displayName="Text";function sD(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 aa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sD(Object(n),!0).forEach(function(r){oxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oxe(e,t,n){return(t=lxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lxe(e){var t=cxe(e,"string");return typeof t=="symbol"?t:t+""}function cxe(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 uxe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:c,upperWidth:d,lowerWidth:f}=WN(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,x=p+d/2,w=c>=0?1:-1,j=w*r,k=w>0?"end":"start",A=w>0?"start":"end",_=d>=0?1:-1,C=_*r,P=_>0?"end":"start",T=_>0?"start":"end",O=i;if(n==="top"){var z={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return O&&(z.height=Math.max(o-O.y,0),z.width=d),z}if(n==="bottom"){var I={x:m+f/2,y:o+c+j,horizontalAnchor:"middle",verticalAnchor:A};return O&&(I.height=Math.max(O.y+O.height-(o+c),0),I.width=f),I}if(n==="left"){var F={x:y-C,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return O&&(F.width=Math.max(F.x-O.x,0),F.height=c),F}if(n==="right"){var $={x:y+v+C,y:o+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return O&&($.width=Math.max(O.x+O.width-$.x,0),$.height=c),$}var L=O?{width:v,height:c}:{};return n==="insideLeft"?aa({x:y+C,y:o+c/2,horizontalAnchor:T,verticalAnchor:"middle"},L):n==="insideRight"?aa({x:y+v-C,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?aa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:A},L):n==="insideBottom"?aa({x:m+f/2,y:o+c-j,horizontalAnchor:"middle",verticalAnchor:k},L):n==="insideTopLeft"?aa({x:p+C,y:o+j,horizontalAnchor:T,verticalAnchor:A},L):n==="insideTopRight"?aa({x:p+d-C,y:o+j,horizontalAnchor:P,verticalAnchor:A},L):n==="insideBottomLeft"?aa({x:m+C,y:o+c-j,horizontalAnchor:T,verticalAnchor:k},L):n==="insideBottomRight"?aa({x:m+f-C,y:o+c-j,horizontalAnchor:P,verticalAnchor:k},L):n&&typeof n=="object"&&(Ue(n.x)||Ol(n.x))&&(Ue(n.y)||Ol(n.y))?aa({x:a+po(n.x,v),y:o+po(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},L):aa({x,y:o+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},dxe=["labelRef"],fxe=["content"];function oD(e,t){if(e==null)return{};var n,r,i=hxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hxe(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 lD(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 lf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lD(Object(n),!0).forEach(function(r){pxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pxe(e,t,n){return(t=mxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mxe(e){var t=gxe(e,"string");return typeof t=="symbol"?t:t+""}function gxe(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 Wa(){return Wa=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},Wa.apply(null,arguments)}var jB=S.createContext(null),NB=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:c}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return S.createElement(jB.Provider,{value:d},c)},kB=()=>{var e=S.useContext(jB),t=ch();return e||(t?WN(t):void 0)},yxe=S.createContext(null),vxe=()=>{var e=S.useContext(yxe),t=Fe(gU);return e||t},bxe=e=>{var{value:t,formatter:n}=e,r=Qn(e.children)?t:e.children;return typeof n=="function"?n(r):r},rC=e=>e!=null&&typeof e=="function",xxe=(e,t)=>{var n=bi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},wxe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,x=(f+p)/2,w=xxe(m,y),j=w>=0?1:-1,k,A;switch(t){case"insideStart":k=m+j*a,A=v;break;case"insideEnd":k=y-j*a,A=!v;break;case"end":k=y+j*a,A=v;break;default:throw new Error("Unsupported position ".concat(t))}A=w<=0?A:!A;var _=Wn(c,d,x,k),C=Wn(c,d,x,k+(A?1:-1)*359),P="M".concat(_.x,",").concat(_.y,`
287
- A`).concat(x,",").concat(x,",0,1,").concat(A?0:1,`,
288
- `).concat(C.x,",").concat(C.y),T=Qn(e.id)?Pf("recharts-radial-line-"):e.id;return S.createElement("text",Wa({},r,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",o)}),S.createElement("defs",null,S.createElement("path",{id:T,d:P})),S.createElement("textPath",{xlinkHref:"#".concat(T)},n))},Sxe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=Wn(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=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=(a+o)/2,{x:v,y:x}=Wn(r,i,y,f);return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Ym=e=>e!=null&&"cx"in e&&Ue(e.cx),jxe={angle:0,offset:5,zIndex:ir.label,position:"middle",textBreakAll:!1};function Nxe(e){if(!Ym(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 Ys(e){var t=mr(e,jxe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=vxe(),y=kB(),v=i==="center"?y:m??y,x,w,j;n==null?x=v:Ym(n)?x=n:x=WN(n);var k=Nxe(x);if(!x||Qn(a)&&Qn(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var A=lf(lf({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:_}=A,C=oD(A,dxe);return S.cloneElement(c,C)}if(typeof c=="function"){var{content:P}=A,T=oD(A,fxe);if(w=S.createElement(c,T),S.isValidElement(w))return w}else w=bxe(t);var O=zr(t);if(Ym(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return wxe(t,i,w,O,x);j=Sxe(x,t.offset,t.position)}else{if(!k)return null;var z=uxe({viewBox:k,position:i,offset:t.offset,parentViewBox:Ym(r)?void 0:r});j=lf(lf({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 S.createElement(ka,{zIndex:t.zIndex},S.createElement(nC,Wa({ref:p,className:Ct("recharts-label",d)},O,j,{textAnchor:bB(O.textAnchor)?O.textAnchor:j.textAnchor,breakAll:f}),w))}Ys.displayName="Label";var kxe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?S.createElement(Ys,Wa({key:"label-implicit"},r)):Ni(e)?S.createElement(Ys,Wa({key:"label-implicit",value:e},r)):S.isValidElement(e)?e.type===Ys?S.cloneElement(e,lf({key:"label-implicit"},r)):S.createElement(Ys,Wa({key:"label-implicit",content:e},r)):rC(e)?S.createElement(Ys,Wa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?S.createElement(Ys,Wa({},e,{key:"label-implicit"},r)):null};function CB(e){var{label:t,labelRef:n}=e,r=kB();return kxe(t,r,n)||null}var Cxe=["valueAccessor"],_xe=["dataKey","clockWise","id","textBreakAll","zIndex"];function ly(){return ly=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},ly.apply(null,arguments)}function cD(e,t){if(e==null)return{};var n,r,i=Oxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Oxe(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 Axe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(nxe(t))return t},_B=S.createContext(void 0),Exe=_B.Provider,OB=S.createContext(void 0);OB.Provider;function Txe(){return S.useContext(_B)}function Pxe(){return S.useContext(OB)}function Wm(e){var{valueAccessor:t=Axe}=e,n=cD(e,Cxe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:c}=n,d=cD(n,_xe),f=Txe(),p=Pxe(),m=f||p;return!m||!m.length?null:S.createElement(ka,{zIndex:c??ir.label},S.createElement(Vi,{className:"recharts-label-list"},m.map((y,v)=>{var x,w=Qn(r)?t(y,v):Ln(y.payload,r),j=Qn(a)?{}:{id:"".concat(a,"-").concat(v)};return S.createElement(Ys,ly({key:"label-".concat(v)},zr(y),d,j,{fill:(x=n.fill)!==null&&x!==void 0?x:y.fill,parentViewBox:y.parentViewBox,value:w,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}Wm.displayName="LabelList";function zxe(e){var{label:t}=e;return t?t===!0?S.createElement(Wm,{key:"labelList-implicit"}):S.isValidElement(t)||rC(t)?S.createElement(Wm,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Wm,ly({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function tj(){return tj=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},tj.apply(null,arguments)}var AB=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ct("recharts-dot",i);return Ue(t)&&Ue(n)&&Ue(r)?S.createElement("circle",tj({},Gi(e),UN(e),{className:a,cx:t,cy:n,r})):null},Rxe={radiusAxis:{},angleAxis:{}},EB=sr({name:"polarAxis",initialState:Rxe,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:tke,removeRadiusAxis:nke,addAngleAxis:rke,removeAngleAxis:ike}=EB.actions,Mxe=EB.reducer;function Dxe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var TB=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Ixe(e){var{tooltipEntrySettings:t}=e,n=ln(),r=gr(),i=S.useRef(null);return S.useLayoutEffect(()=>{r||(i.current===null?n(yve(t)):i.current!==t&&n(vve({prev:i.current,next:t})),i.current=t)},[t,n,r]),S.useLayoutEffect(()=>()=>{i.current&&(n(bve(i.current)),i.current=null)},[n]),null}function Lxe(e){var{legendPayload:t}=e,n=ln(),r=gr(),i=S.useRef(null);return S.useLayoutEffect(()=>{r||(i.current===null?n(efe(t)):i.current!==t&&n(tfe({prev:i.current,next:t})),i.current=t)},[n,r,t]),S.useLayoutEffect(()=>()=>{i.current&&(n(nfe(i.current)),i.current=null)},[n]),null}var uS,$xe=()=>{var[e]=S.useState(()=>Pf("uid-"));return e},Uxe=(uS=yy.useId)!==null&&uS!==void 0?uS:$xe;function Bxe(e,t){var n=Uxe();return t||(e?"".concat(e,"-").concat(n):n)}var Fxe=S.createContext(void 0),qxe=e=>{var{id:t,type:n,children:r}=e,i=Bxe("recharts-".concat(n),t);return S.createElement(Fxe.Provider,{value:i},r(i))},Kxe={cartesianItems:[],polarItems:[]},PB=sr({name:"graphicalItems",initialState:Kxe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Vt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Vt()},removeCartesianGraphicalItem:{reducer(e,t){var n=xi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Vt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Vt()},removePolarGraphicalItem:{reducer(e,t){var n=xi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Vt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Vt()}}}),{addCartesianGraphicalItem:Hxe,replaceCartesianGraphicalItem:Gxe,removeCartesianGraphicalItem:Vxe,addPolarGraphicalItem:ake,removePolarGraphicalItem:ske,replacePolarGraphicalItem:oke}=PB.actions,Zxe=PB.reducer,Yxe=e=>{var t=ln(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(Hxe(e)):n.current!==e&&t(Gxe({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(Vxe(n.current)),n.current=null)},[t]),null},Wxe=S.memo(Yxe),Qxe=["points"];function uD(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 dS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uD(Object(n),!0).forEach(function(r){Xxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xxe(e,t,n){return(t=Jxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jxe(e){var t=ewe(e,"string");return typeof t=="symbol"?t:t+""}function ewe(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 cy(){return cy=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},cy.apply(null,arguments)}function twe(e,t){if(e==null)return{};var n,r,i=nwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nwe(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 rwe(e){var{option:t,dotProps:n,className:r}=e;if(S.isValidElement(t))return S.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Ct(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,c=twe(a,Qxe);return S.createElement(AB,cy({},c,{className:i}))}function iwe(e,t){return e==null?!1:t?!0:e.length===1}function awe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:c,clipPathId:d,zIndex:f=ir.scatter}=e;if(!iwe(t,n))return null;var p=TB(n),m=Foe(n),y=t.map((x,w)=>{var j,k,A=dS(dS(dS({r:3},o),m),{},{index:w,cx:(j=x.x)!==null&&j!==void 0?j:void 0,cy:(k=x.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return S.createElement(rwe,{key:"dot-".concat(w),option:n,dotProps:A,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),S.createElement(ka,{zIndex:f},S.createElement(Vi,cy({className:r},v),y))}function dD(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 fD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dD(Object(n),!0).forEach(function(r){swe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function swe(e,t,n){return(t=owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function owe(e){var t=lwe(e,"string");return typeof t=="symbol"?t:t+""}function lwe(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 zB=0,cwe={xAxis:{},yAxis:{},zAxis:{}},RB=sr({name:"cartesianAxis",initialState:cwe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Vt()},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:Vt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Vt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Vt()},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:Vt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Vt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Vt()},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:Vt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Vt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var c=[...o,r].slice(-3);e.yAxis[n]=fD(fD({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:uwe,replaceXAxis:dwe,removeXAxis:fwe,addYAxis:hwe,replaceYAxis:pwe,removeYAxis:mwe,addZAxis:lke,replaceZAxis:cke,removeZAxis:uke,updateYAxisWidth:gwe}=RB.actions,ywe=RB.reducer,vwe=le([Xn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),bwe=le([vwe,us,ds],(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)}}),iC=()=>Fe(bwe),xwe=()=>Fe(y0e);function hD(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 fS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hD(Object(n),!0).forEach(function(r){wwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wwe(e,t,n){return(t=Swe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Swe(e){var t=jwe(e,"string");return typeof t=="symbol"?t:t+""}function jwe(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 Nwe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=fS(fS(fS({},c),Qy(i)),UN(i)),f;return S.isValidElement(i)?f=S.cloneElement(i,d):typeof i=="function"?f=i(d):f=S.createElement(AB,d),S.createElement(Vi,{className:"recharts-active-dot",clipPath:o},f)};function pD(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=ir.activeDot}=e,c=Fe(Hf),d=xwe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return Qn(f)?null:S.createElement(ka,{zIndex:o},S.createElement(Nwe,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var kwe=e=>{var{chartData:t}=e,n=ln(),r=gr();return S.useEffect(()=>r?()=>{}:(n(HM(t)),()=>{n(HM(void 0))}),[t,n,r]),null},mD={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},MB=sr({name:"brush",initialState:mD,reducers:{setBrushSettings(e,t){return t.payload==null?mD:t.payload}}}),{setBrushSettings:dke}=MB.actions,Cwe=MB.reducer,_we=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},Owe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return _we({x:t,y:n},{x:r,y:i})};function Awe(e){return(e%180+180)%180}var Ewe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Awe(i),o=a*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Twe={dots:[],areas:[],lines:[]},DB=sr({name:"referenceElements",initialState:Twe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=xi(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=xi(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=xi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:fke,removeDot:hke,addArea:pke,removeArea:mke,addLine:Pwe,removeLine:zwe}=DB.actions,Rwe=DB.reducer,IB=S.createContext(void 0),Mwe=e=>{var{children:t}=e,[n]=S.useState("".concat(Pf("recharts"),"-clip")),r=iC();if(r==null)return null;var{x:i,y:a,width:o,height:c}=r;return S.createElement(IB.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:i,y:a,height:c,width:o}))),t)},Dwe=()=>S.useContext(IB);class Iwe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:a}=n;return{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:a,fallback:o}=n,c,d;return o==="rangeMin"?c=this.yAxisScale.rangeMin():o==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,o==="rangeMin"?d=this.xAxisScale.rangeMin():o==="rangeMax"?d=this.xAxisScale.rangeMax():d=0,{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:d,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:c}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),a=r==null||this.yAxisScale.isInRange(r);return i&&a}}function gD(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?gD(Object(n),!0).forEach(function(r){Lwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lwe(e,t,n){return(t=$we(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $we(e){var t=Uwe(e,"string");return typeof t=="symbol"?t:t+""}function Uwe(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 uy(){return uy=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},uy.apply(null,arguments)}var Bwe=(e,t)=>{var n;if(S.isValidElement(e))n=S.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!nt(t.x1)||!nt(t.y1)||!nt(t.x2)||!nt(t.y2))return null;n=S.createElement("line",uy({},t,{className:"recharts-reference-line-line"}))}return n},Fwe=(e,t,n,r,i,a)=>{var{x:o,width:c}=a,d=i.map(e,{position:n});if(!nt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:o+c,y:d},{x:o,y:d}];return r==="left"?f.reverse():f},qwe=(e,t,n,r,i,a)=>{var{y:o,height:c}=a,d=i.map(e,{position:n});if(!nt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:d,y:o+c},{x:d,y:o}];return r==="top"?f.reverse():f},Kwe=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(a=>!r.isInRange(a))?null:i},Hwe=(e,t,n,r,i,a,o)=>{var{x:c,y:d,segment:f,ifOverflow:p}=o,m=Ni(c),y=Ni(d);return y?Fwe(d,p,r,a,t,n):m?qwe(c,p,r,i,e,n):f!=null&&f.length===2?Kwe(f,p,r,new Iwe({x:e,y:t})):null};function Gwe(e){var t=ln();return S.useEffect(()=>(t(Pwe(e)),()=>{t(zwe(e))})),null}function Vwe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:a}=e,o=gr(),c=Dwe(),d=Fe(O=>ja(O,t)),f=Fe(O=>Na(O,n)),p=Fe(O=>Su(O,"xAxis",t,o)),m=Fe(O=>Su(O,"yAxis",n,o)),y=ch();if(!c||!y||d==null||f==null||p==null||m==null)return null;var v=Hwe(p,m,y,e.position,d.orientation,f.orientation,e);if(!v)return null;var x=v[0],w=v[1];if(x==null||w==null)return null;var{x:j,y:k}=x,{x:A,y:_}=w,C=a==="hidden"?"url(#".concat(c,")"):void 0,P=yD(yD({clipPath:C},zr(e)),{},{x1:j,y1:k,x2:A,y2:_}),T=Owe({x1:j,y1:k,x2:A,y2:_});return S.createElement(ka,{zIndex:e.zIndex},S.createElement(Vi,{className:Ct("recharts-reference-line",i)},Bwe(r,P),S.createElement(NB,uy({},T,{lowerWidth:T.width,upperWidth:T.width}),S.createElement(CB,{label:e.label}),e.children)))}var Zwe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ir.line};function LB(e){var t=mr(e,Zwe);return S.createElement(S.Fragment,null,S.createElement(Gwe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),S.createElement(Vwe,t))}LB.displayName="ReferenceLine";function $B(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 Ywe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ewe(r,n)}function Wwe(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:c}=e;return t===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function Vf(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Qwe(e,t){return $B(e,t+1)}function Xwe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:c}=t,d=0,f=1,p=o,m=function(){var x=r?.[d];if(x===void 0)return{v:$B(r,f)};var w=d,j,k=()=>(j===void 0&&(j=n(x,w)),j),A=x.coordinate,_=d===0||Vf(e,A,k,p,c);_||(d=0,p=o,f+=1),_&&(p=A+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function Jwe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:c,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=c,y=!0,v=function(){var C=r[w];if(C==null)return 0;var P=w,T,O=()=>(T===void 0&&(T=n(C,P)),T),z=C.coordinate,I=w===p||Vf(e,z,O,m,d);if(!I)return y=!1,1;I&&(m=z+e*(O()/2+i))},x,w=p;w<o&&(x=v(),!(x!==0&&x===1));w+=f);if(y){for(var j=[],k=p;k<o;k+=f){var A=r[k];A!=null&&j.push(A)}return j}}return[]}function vD(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 er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vD(Object(n),!0).forEach(function(r){eSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eSe(e,t,n){return(t=tSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tSe(e){var t=nSe(e,"string");return typeof t=="symbol"?t:t+""}function nSe(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 rSe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:c}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var x=v,w,j=()=>(w===void 0&&(w=n(v,y)),w);if(y===o-1){var k=e*(x.coordinate+e*j()/2-d);a[y]=x=er(er({},x),{},{tickCoord:k>0?x.coordinate-k*e:x.coordinate})}else a[y]=x=er(er({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var A=Vf(e,x.tickCoord,j,c,d);A&&(d=x.tickCoord-e*(j()/2+i),a[y]=er(er({},x),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function iSe(e,t,n,r,i,a){var o=(r||[]).slice(),c=o.length,{start:d,end:f}=t;if(a){var p=r[c-1];if(p!=null){var m=n(p,c-1),y=e*(p.coordinate+e*m/2-f);if(o[c-1]=p=er(er({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Vf(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[c-1]=er(er({},p),{},{isShow:!0}))}}}for(var x=a?c-1:c,w=function(A){var _=o[A];if(_==null)return 1;var C=_,P,T=()=>(P===void 0&&(P=n(_,A)),P);if(A===0){var O=e*(C.coordinate-e*T()/2-d);o[A]=C=er(er({},C),{},{tickCoord:O<0?C.coordinate-O*e:C.coordinate})}else o[A]=C=er(er({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var z=Vf(e,C.tickCoord,T,d,f);z&&(d=C.tickCoord+e*(T()/2+i),o[A]=er(er({},C),{},{isShow:!0}))}},j=0;j<x;j++)w(j);return o}function aC(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Ue(d)||hh.isSsr){var y;return(y=Qwe(i,Ue(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],x=c==="top"||c==="bottom"?"width":"height",w=p&&x==="width"?vf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,T)=>{var O=typeof f=="function"?f(P.value,T):P.value;return x==="width"?Ywe(vf(O,{fontSize:t,letterSpacing:n}),w,m):vf(O,{fontSize:t,letterSpacing:n})[x]},k=i[0],A=i[1],_=i.length>=2&&k!=null&&A!=null?bi(A.coordinate-k.coordinate):1,C=Wwe(a,_,x);return d==="equidistantPreserveStart"?Xwe(_,C,j,i,o):d==="equidistantPreserveEnd"?Jwe(_,C,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=iSe(_,C,j,i,o,d==="preserveStartEnd"):v=rSe(_,C,j,i,o),v.filter(P=>P.isShow))}var aSe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var c=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+c+(n?r:0);return Math.round(f)}return 0},sSe={xAxis:{},yAxis:{}},UB=sr({name:"renderedTicks",initialState:sSe,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:oSe,removeRenderedTicks:lSe}=UB.actions,cSe=UB.reducer,uSe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function dSe(e,t){if(e==null)return{};var n,r,i=fSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fSe(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 Rl(){return Rl=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},Rl.apply(null,arguments)}function bD(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 dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bD(Object(n),!0).forEach(function(r){hSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hSe(e,t,n){return(t=pSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=mSe(e,"string");return typeof t=="symbol"?t:t+""}function mSe(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 rs={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:ir.axis};function gSe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=dn(dn(dn({},d),Gi(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=dn(dn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=dn(dn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return S.createElement("line",Rl({},f,{className:Ct("recharts-cartesian-axis-line",tv(c,"className"))}))}function ySe(e,t,n,r,i,a,o,c,d){var f,p,m,y,v,x,w=c?-1:1,j=e.tickSize||o,k=Ue(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!c*i,m=y-w*j,x=m-w*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!c*r,f=p-w*j,v=f-w*d,x=k;break;case"right":m=y=e.coordinate,p=t+ +c*r,f=p+w*j,v=f+w*d,x=k;break;default:f=p=e.coordinate,y=n+ +c*i,m=y+w*j,x=m+w*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:x}}}function vSe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function bSe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function xSe(e){var{option:t,tickProps:n,value:r}=e,i,a=Ct(n.className,"recharts-cartesian-axis-tick-value");if(S.isValidElement(t))i=S.cloneElement(t,dn(dn({},n),{},{className:a}));else if(typeof t=="function")i=t(dn(dn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Ct(o,Dxe(t))),i=S.createElement(nC,Rl({},n,{className:o}),r)}return i}function wSe(e){var{ticks:t,axisType:n,axisId:r}=e,i=ln();return S.useEffect(()=>{if(r==null||n==null)return Mu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(oSe({ticks:a,axisId:r,axisType:n})),()=>{i(lSe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var SSe=S.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:x,height:w,tickSize:j,tickMargin:k,fontSize:A,letterSpacing:_,getTicksConfig:C,events:P,axisType:T,axisId:O}=e,z=aC(dn(dn({},C),{},{ticks:n}),A,_),I=Gi(C),F=Qy(r),$=bB(I.textAnchor)?I.textAnchor:vSe(p,m),L=bSe(p,m),J={};typeof i=="object"&&(J=i);var ae=dn(dn({},I),{},{fill:"none"},J),Q=z.map(ye=>dn({entry:ye},ySe(ye,y,v,x,w,p,j,m,k))),K=Q.map(ye=>{var{entry:Se,line:R}=ye;return S.createElement(Vi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Se.value,"-").concat(Se.coordinate,"-").concat(Se.tickCoord)},i&&S.createElement("line",Rl({},ae,R,{className:Ct("recharts-cartesian-axis-tick-line",tv(i,"className"))})))}),X=Q.map((ye,Se)=>{var R,B,{entry:U,tick:M}=ye,V=dn(dn(dn(dn({verticalAnchor:L},I),{},{textAnchor:$,stroke:"none",fill:a},M),{},{index:Se,payload:U,visibleTicksCount:z.length,tickFormatter:o,padding:d},f),{},{angle:(R=(B=f?.angle)!==null&&B!==void 0?B:I.angle)!==null&&R!==void 0?R:0}),se=dn(dn({},V),F);return S.createElement(Vi,Rl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},z3(P,U,Se)),r&&S.createElement(xSe,{option:r,tickProps:se,value:"".concat(typeof o=="function"?o(U.value,Se):U.value).concat(c||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},S.createElement(wSe,{ticks:z,axisId:O,axisType:T}),X.length>0&&S.createElement(ka,{zIndex:ir.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},X)),K.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},K))}),jSe=S.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:c,axisType:d,axisId:f}=e,p=dSe(e,uSe),[m,y]=S.useState(""),[v,x]=S.useState(""),w=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return aSe({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(k=>{if(k){var A=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=A;var _=A[0];if(_){var C=window.getComputedStyle(_),P=C.fontSize,T=C.letterSpacing;(P!==m||T!==v)&&(y(P),x(T))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:S.createElement(ka,{zIndex:e.zIndex},S.createElement(Vi,{className:Ct("recharts-cartesian-axis",a)},S.createElement(gSe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gi(e)}),S.createElement(SSe,{ref:j,axisType:d,events:p,fontSize:m,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:f}),S.createElement(NB,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(CB,{label:e.label,labelRef:e.labelRef}),e.children)))}),sC=S.forwardRef((e,t)=>{var n=mr(e,rs);return S.createElement(jSe,Rl({},n,{ref:t}))});sC.displayName="CartesianAxis";var NSe=["x1","y1","x2","y2","key"],kSe=["offset"],CSe=["xAxisId","yAxisId"],_Se=["xAxisId","yAxisId"];function xD(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 rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xD(Object(n),!0).forEach(function(r){OSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OSe(e,t,n){return(t=ASe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ASe(e){var t=ESe(e,"string");return typeof t=="symbol"?t:t+""}function ESe(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 hl(){return hl=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},hl.apply(null,arguments)}function dy(e,t){if(e==null)return{};var n,r,i=TSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TSe(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 PSe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:c}=e;return S.createElement("rect",{x:r,y:i,ry:c,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function BB(e){var{option:t,lineItemProps:n}=e,r;if(S.isValidElement(t))r=S.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:c,y2:d,key:f}=n,p=dy(n,NSe),m=(i=Gi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=dy(m,kSe);r=S.createElement("line",hl({},v,{x1:a,y1:o,x2:c,y2:d,fill:"none",key:f}))}return r}function zSe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=dy(e,CSe),d=i.map((f,p)=>{var m=rr(rr({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return S.createElement(BB,{key:"line-".concat(p),option:r,lineItemProps:m})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function RSe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=dy(e,_Se),d=i.map((f,p)=>{var m=rr(rr({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return S.createElement(BB,{option:r,lineItemProps:m,key:"line-".concat(p)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function MSe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:c,horizontal:d=!0}=e;if(!d||!t||!t.length||c==null)return null;var f=c.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],x=v==null,w=x?i+o-m:v-m;if(w<=0)return null;var j=y%t.length;return S.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:w,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function DSe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:c,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],x=v==null,w=x?i+o-m:v-m;if(w<=0)return null;var j=y%n.length;return S.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:w,height:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var ISe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return C4(aC(rr(rr(rr({},rs),n),{},{ticks:_4(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},LSe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return C4(aC(rr(rr(rr({},rs),n),{},{ticks:_4(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},$Se={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:ir.grid};function FB(e){var t=QN(),n=XN(),r=R4(),i=rr(rr({},mr(e,$Se)),{},{x:Ue(e.x)?e.x:r.left,y:Ue(e.y)?e.y:r.top,width:Ue(e.width)?e.width:r.width,height:Ue(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,x=gr(),w=Fe(I=>PM(I,"xAxis",a,x)),j=Fe(I=>PM(I,"yAxis",o,x));if(!va(f)||!va(p)||!Ue(c)||!Ue(d))return null;var k=i.verticalCoordinatesGenerator||ISe,A=i.horizontalCoordinatesGenerator||LSe,{horizontalPoints:_,verticalPoints:C}=i;if((!_||!_.length)&&typeof A=="function"){var P=y&&y.length,T=A({yAxis:j?rr(rr({},j),{},{ticks:P?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);Ig(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(_=T)}if((!C||!C.length)&&typeof k=="function"){var O=v&&v.length,z=k({xAxis:w?rr(rr({},w),{},{ticks:O?v:w.ticks}):void 0,width:t??f,height:n??p,offset:r},O?!0:m);Ig(Array.isArray(z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(C=z)}return S.createElement(ka,{zIndex:i.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(PSe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),S.createElement(MSe,hl({},i,{horizontalPoints:_})),S.createElement(DSe,hl({},i,{verticalPoints:C})),S.createElement(zSe,hl({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:j})),S.createElement(RSe,hl({},i,{offset:r,verticalPoints:C,xAxis:w,yAxis:j}))))}FB.displayName="CartesianGrid";var USe={},qB=sr({name:"errorBars",initialState:USe,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(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},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:gke,replaceErrorBar:yke,removeErrorBar:vke}=qB.actions,BSe=qB.reducer;function KB(e,t){var n,r,i=Fe(f=>ja(f,e)),a=Fe(f=>Na(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:En.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Tn.allowDataOverflow,d=o||c;return{needClip:d,needClipX:o,needClipY:c}}function FSe(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=iC(),{needClipX:a,needClipY:o,needClip:c}=KB(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return S.createElement("clipPath",{id:"clipPath-".concat(r)},S.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function qSe(e){var t=Qy(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),c=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(c)||c<0)&&(c=r),{r:o,strokeWidth:c}}return{r:n,strokeWidth:r}}function oC(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:zB}function lC(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:zB}var HB=(e,t,n)=>I6(e,"xAxis",oC(e,t),n),GB=(e,t,n)=>D6(e,"xAxis",oC(e,t),n),VB=(e,t,n)=>I6(e,"yAxis",lC(e,t),n),ZB=(e,t,n)=>D6(e,"yAxis",lC(e,t),n),KSe=le([en,HB,VB,GB,ZB],(e,t,n,r,i)=>Sa(e,"xAxis")?Dg(t,r,!1):Dg(n,i,!1)),HSe=(e,t)=>t,YB=le([i6,HSe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),WB=e=>{var t=en(e),n=Sa(t,"xAxis");return n?"yAxis":"xAxis"},GSe=(e,t)=>{var n=WB(e);return n==="yAxis"?lC(e,t):oC(e,t)},VSe=(e,t,n)=>p6(e,WB(e),GSe(e,t),n),ZSe=le([YB,VSe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=fk(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(c=>c.key===i);if(o!=null)return o.map(c=>[c[0],c[1]])}}}),YSe=le([en,HB,VB,GB,ZB,ZSe,hpe,KSe,YB,Spe],(e,t,n,r,i,a,o,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,x;if(v&&v.length>0?x=v:x=p?.slice(m,y+1),x!=null)return m1e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:x,chartBaseValue:f,bandSize:c})}}),WSe=["id"],QSe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function wl(){return wl=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},wl.apply(null,arguments)}function QB(e,t){if(e==null)return{};var n,r,i=XSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function XSe(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 wD(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 Qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wD(Object(n),!0).forEach(function(r){JSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JSe(e,t,n){return(t=e1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e1e(e){var t=t1e(e,"string");return typeof t=="symbol"?t:t+""}function t1e(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 fy(e,t){return e&&e!=="none"?e:t}var n1e=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:fy(r,i),value:O4(n,t),payload:e}]},r1e=S.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Mu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:O4(o,t),hide:c,type:f,color:fy(r,a),unit:d,graphicalItemId:p}};return S.createElement(Ixe,{tooltipEntrySettings:m})});function i1e(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,c=Gi(r);return S.createElement(awe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:c,needClip:i,clipPathId:t})}function a1e(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,c,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Qc(Qc({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return S.createElement(Exe,{value:t?i:void 0},n)}function SD(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=QB(a,WSe),v=Gi(y),x=zr(y);return S.createElement(S.Fragment,null,t?.length>1&&S.createElement(Vi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},S.createElement(Zm,wl({},x,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&S.createElement(Zm,wl({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&S.createElement(Zm,wl({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:n}))),S.createElement(i1e,{points:t,props:y,clipPathId:i}))}function s1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!nt(c)||!nt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Ue(p)?S.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function o1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!nt(c)||!nt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Ue(p)?S.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function l1e(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?S.createElement(s1e,{alpha:t,points:r,baseLine:i,strokeWidth:a}):S.createElement(o1e,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function c1e(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,x=S.useMemo(()=>({points:o,baseLine:c}),[o,c]),w=Y4(x,"recharts-area-"),j=JN(),[k,A]=S.useState(!1),_=!k,C=S.useCallback(()=>{typeof v=="function"&&v(),A(!1)},[v]),P=S.useCallback(()=>{typeof y=="function"&&y(),A(!0)},[y]);if(j==null)return null;var T=i.current,O=a.current;return S.createElement(a1e,{showLabels:_,points:o},r.children,S.createElement(Z4,{animationId:w,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:P,key:w},z=>{if(T){var I=T.length/o.length,F=z===1?o:o.map((L,J)=>{var ae=Math.floor(J*I);if(T[ae]){var Q=T[ae];return Qc(Qc({},L),{},{x:la(Q.x,L.x,z),y:la(Q.y,L.y,z)})}return L}),$;return Ue(c)?$=la(O,c,z):Qn(c)||ya(c)?$=la(O,0,z):$=c.map((L,J)=>{var ae=Math.floor(J*I);if(Array.isArray(O)&&O[ae]){var Q=O[ae];return Qc(Qc({},L),{},{x:la(Q.x,L.x,z),y:la(Q.y,L.y,z)})}return L}),z>0&&(i.current=F,a.current=$),S.createElement(SD,{points:F,baseLine:$,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=c),S.createElement(Vi,null,d&&S.createElement("defs",null,S.createElement("clipPath",{id:"animationClipPath-".concat(n)},S.createElement(l1e,{alpha:z,points:o,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),S.createElement(Vi,{clipPath:"url(#animationClipPath-".concat(n,")")},S.createElement(SD,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),S.createElement(zxe,{label:r.label}))}function u1e(e){var{needClip:t,clipPathId:n,props:r}=e,i=S.useRef(null),a=S.useRef();return S.createElement(c1e,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class d1e extends S.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:c,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:x}=this.props;if(t)return null;var w=Ct("recharts-area",i),j=y,{r:k,strokeWidth:A}=qSe(n),_=TB(n),C=k*2+A,P=c?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return S.createElement(ka,{zIndex:x},S.createElement(Vi,{className:w},c&&S.createElement("defs",null,S.createElement(FSe,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:o-C/2,y:a-C/2,width:p+C,height:m+C}))),S.createElement(u1e,{needClip:c,clipPathId:j,props:this.props})),S.createElement(pD,{points:r,mainColor:fy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&S.createElement(pD,{points:v,mainColor:fy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var f1e={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:ir.area};function h1e(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:x,yAxisId:w}=e,j=QB(e,QSe),k=Du(),A=sB(),{needClip:_}=KB(x,w),C=gr(),{points:P,isRange:T,baseLine:O}=(t=Fe(J=>YSe(J,e.id,C)))!==null&&t!==void 0?t:{},z=iC();if(k!=="horizontal"&&k!=="vertical"||z==null||A!=="AreaChart"&&A!=="ComposedChart")return null;var{height:I,width:F,x:$,y:L}=z;return!P||!P.length?null:S.createElement(d1e,wl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:O,connectNulls:o,dot:c,fill:d,fillOpacity:f,height:I,hide:p,layout:k,isAnimationActive:m,isRange:T,legendType:y,needClip:_,points:P,stroke:v,width:F,left:$,top:L,xAxisId:x,yAxisId:w}))}var p1e=(e,t,n,r,i)=>{var a=n??t;if(Ue(a))return a;var o=e==="horizontal"?i:r,c=o.scale.domain();if(o.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]};function m1e(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,x=i&&i.length,w=p1e(a,o,n,c,d),j=a==="horizontal",k=!1,A=f.map((C,P)=>{var T,O,z,I;if(x)I=i[p+P];else{var F=Ln(C,r);Array.isArray(F)?(I=F,k=!0):I=[w,F]}var $=(T=(O=I)===null||O===void 0?void 0:O[1])!==null&&T!==void 0?T:null,L=$==null||x&&!t&&Ln(C,r)==null;if(j){var J;return{x:Cz({axis:c,ticks:m,bandSize:v,entry:C,index:P}),y:L?null:(J=d.scale.map($))!==null&&J!==void 0?J:null,value:I,payload:C}}return{x:L?null:(z=c.scale.map($))!==null&&z!==void 0?z:null,y:Cz({axis:d,ticks:y,bandSize:v,entry:C,index:P}),value:I,payload:C}}),_;return x||k?_=A.map(C=>{var P,T=Array.isArray(C.value)?C.value[0]:null;if(j){var O;return{x:C.x,y:T!=null&&C.y!=null&&(O=d.scale.map(T))!==null&&O!==void 0?O:null,payload:C.payload}}return{x:T!=null&&(P=c.scale.map(T))!==null&&P!==void 0?P:null,y:C.y,payload:C.payload}}):_=j?d.scale.map(w):c.scale.map(w),{points:A,baseLine:_??0,isRange:k}}function g1e(e){var t=mr(e,f1e),n=gr();return S.createElement(qxe,{id:t.id,type:"area"},r=>S.createElement(S.Fragment,null,S.createElement(Lxe,{legendPayload:n1e(t)}),S.createElement(r1e,{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}),S.createElement(Wxe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:nde(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),S.createElement(h1e,wl({},t,{id:r}))))}var Xc=S.memo(g1e,fh);Xc.displayName="Area";var y1e=["domain","range"],v1e=["domain","range"];function jD(e,t){if(e==null)return{};var n,r,i=b1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function b1e(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 ND(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 XB(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=jD(e,y1e),{domain:a,range:o}=t,c=jD(t,v1e);return!ND(n,a)||!ND(r,o)?!1:fh(i,c)}var x1e=["type"],w1e=["dangerouslySetInnerHTML","ticks","scale"],S1e=["id","scale"];function nj(){return nj=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},nj.apply(null,arguments)}function kD(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 CD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kD(Object(n),!0).forEach(function(r){j1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j1e(e,t,n){return(t=N1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N1e(e){var t=k1e(e,"string");return typeof t=="symbol"?t:t+""}function k1e(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 rj(e,t){if(e==null)return{};var n,r,i=C1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C1e(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 _1e(e){var t=ln(),n=S.useRef(null),r=JN(),{type:i}=e,a=rj(e,x1e),o=Sv(r,"xAxis",i),c=S.useMemo(()=>{if(o!=null)return CD(CD({},a),{},{type:o})},[a,o]);return S.useLayoutEffect(()=>{c!=null&&(n.current===null?t(uwe(c)):n.current!==c&&t(dwe({prev:n.current,next:c})),n.current=c)},[c,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(fwe(n.current)),n.current=null)},[t]),null}var O1e=e=>{var{xAxisId:t,className:n}=e,r=Fe(E4),i=gr(),a="xAxis",o=Fe(k=>M6(k,a,t,i)),c=Fe(k=>Xye(k,t)),d=Fe(k=>ive(k,t)),f=Fe(k=>e6(k,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=rj(e,w1e),{id:x,scale:w}=f,j=rj(f,S1e);return S.createElement(sC,nj({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:Ct("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},A1e={allowDataOverflow:En.allowDataOverflow,allowDecimals:En.allowDecimals,allowDuplicatedCategory:En.allowDuplicatedCategory,angle:En.angle,axisLine:rs.axisLine,height:En.height,hide:!1,includeHidden:En.includeHidden,interval:En.interval,label:!1,minTickGap:En.minTickGap,mirror:En.mirror,orientation:En.orientation,padding:En.padding,reversed:En.reversed,scale:En.scale,tick:En.tick,tickCount:En.tickCount,tickLine:rs.tickLine,tickSize:rs.tickSize,type:En.type,niceTicks:En.niceTicks,xAxisId:0},E1e=e=>{var t=mr(e,A1e);return S.createElement(S.Fragment,null,S.createElement(_1e,{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}),S.createElement(O1e,t))},hy=S.memo(E1e,XB);hy.displayName="XAxis";var T1e=["type"],P1e=["dangerouslySetInnerHTML","ticks","scale"],z1e=["id","scale"];function ij(){return ij=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},ij.apply(null,arguments)}function _D(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 OD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){R1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R1e(e,t,n){return(t=M1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M1e(e){var t=D1e(e,"string");return typeof t=="symbol"?t:t+""}function D1e(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 aj(e,t){if(e==null)return{};var n,r,i=I1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I1e(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 L1e(e){var t=ln(),n=S.useRef(null),r=JN(),{type:i}=e,a=aj(e,T1e),o=Sv(r,"yAxis",i),c=S.useMemo(()=>{if(o!=null)return OD(OD({},a),{},{type:o})},[o,a]);return S.useLayoutEffect(()=>{c!=null&&(n.current===null?t(hwe(c)):n.current!==c&&t(pwe({prev:n.current,next:c})),n.current=c)},[c,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(mwe(n.current)),n.current=null)},[t]),null}function $1e(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=S.useRef(null),o=S.useRef(null),c=Fe(E4),d=gr(),f=ln(),p="yAxis",m=Fe(T=>ove(T,t)),y=Fe(T=>sve(T,t)),v=Fe(T=>M6(T,p,t,d)),x=Fe(T=>t6(T,t));if(S.useLayoutEffect(()=>{if(!(r!=="auto"||!m||rC(i)||S.isValidElement(i)||x==null)){var T=a.current;if(T){var O=T.getCalculatedWidth();Math.round(m.width)!==Math.round(O)&&f(gwe({id:t,width:O}))}}},[v,m,f,i,t,r,x]),m==null||y==null||x==null)return null;var{dangerouslySetInnerHTML:w,ticks:j,scale:k}=e,A=aj(e,P1e),{id:_,scale:C}=x,P=aj(x,z1e);return S.createElement(sC,ij({},A,P,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Ct("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:v,axisType:p,axisId:t}))}var U1e={allowDataOverflow:Tn.allowDataOverflow,allowDecimals:Tn.allowDecimals,allowDuplicatedCategory:Tn.allowDuplicatedCategory,angle:Tn.angle,axisLine:rs.axisLine,hide:!1,includeHidden:Tn.includeHidden,interval:Tn.interval,label:!1,minTickGap:Tn.minTickGap,mirror:Tn.mirror,orientation:Tn.orientation,padding:Tn.padding,reversed:Tn.reversed,scale:Tn.scale,tick:Tn.tick,tickCount:Tn.tickCount,tickLine:rs.tickLine,tickSize:rs.tickSize,type:Tn.type,niceTicks:Tn.niceTicks,width:Tn.width,yAxisId:0},B1e=e=>{var t=mr(e,U1e);return S.createElement(S.Fragment,null,S.createElement(L1e,{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}),S.createElement($1e,t))},py=S.memo(B1e,XB);py.displayName="YAxis";var F1e=(e,t)=>t,cC=le([F1e,en,gU,Un,eB,hs,A0e,Xn],D0e);function q1e(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function uC(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(q1e(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 a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(c,d)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>o(c.clientX,c.clientY)):o(e.clientX,e.clientY)}var JB=Wr("mouseClick"),e8=oh();e8.startListening({actionCreator:JB,effect:(e,t)=>{var n=e.payload,r=cC(t.getState(),uC(n));r?.activeIndex!=null&&t.dispatch(Sve({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var sj=Wr("mouseMove"),t8=oh(),Uc=null,Qo=null,hS=null;t8.startListening({actionCreator:sj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Uc!==null&&(cancelAnimationFrame(Uc),Uc=null),Qo!==null&&(typeof i!="number"||!o)&&(clearTimeout(Qo),Qo=null),hS=uC(n);var c=()=>{var d=t.getState(),f=wh(d,d.tooltip.settings.shared);if(!hS){Uc=null,Qo=null;return}if(f==="axis"){var p=cC(d,hS);p?.activeIndex!=null?t.dispatch(K6({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(q6())}Uc=null,Qo=null};if(!o){c();return}i==="raf"?Uc=requestAnimationFrame(c):typeof i=="number"&&Qo===null&&(Qo=setTimeout(c,i))}});function K1e(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 AD={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},n8=sr({name:"rootProps",initialState:AD,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:AD.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}}}),H1e=n8.reducer,{updateOptions:G1e}=n8.actions,V1e=null,Z1e={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)},r8=sr({name:"polarOptions",initialState:V1e,reducers:Z1e}),{updatePolarOptions:bke}=r8.actions,Y1e=r8.reducer,i8=Wr("keyDown"),a8=Wr("focus"),s8=Wr("blur"),Mv=oh(),Bc=null,Xo=null,Tm=null;Mv.startListening({actionCreator:i8,effect:(e,t)=>{Tm=e.payload,Bc!==null&&(cancelAnimationFrame(Bc),Bc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Xo!==null&&(typeof r!="number"||!a)&&(clearTimeout(Xo),Xo=null);var o=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=Tm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=yf(f,zl(c),wu(c),ju(c)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,x=hs(c),w=zl(c),j=wh(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=oy(c,j,"hover",String(f.index));t.dispatch(sy({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var A=fve(c),_=A==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,P;if(v){var T=wu(c),O=ju(c),z=C*_,I=ae=>({active:!1,index:String(ae),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,z>0){for(var F=0;F<w.length;F++)if(yf(I(F),w,T,O)!=null){P=F;break}}else for(var $=w.length-1;$>=0;$--)if(yf(I($),w,T,O)!=null){P=$;break}if(P<0)return}else{P=y+C*_;var L=x?.length||w.length;if(L===0||P>=L||P<0)return}var J=oy(c,j,"hover",String(P));t.dispatch(sy({active:!0,activeIndex:P.toString(),activeCoordinate:J}))}finally{Bc=null,Xo=null}};if(!a){o();return}r==="raf"?Bc=requestAnimationFrame(o):typeof r=="number"&&Xo===null&&(o(),Tm=null,Xo=setTimeout(()=>{Tm?o():(Xo=null,Bc=null)},r))}});Mv.startListening({actionCreator:a8,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 a="0",o=wh(n,n.tooltip.settings.shared),c=oy(n,o,"hover",String(a));t.dispatch(sy({active:!0,activeIndex:a,activeCoordinate:c}))}}}});Mv.startListening({actionCreator:s8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sy({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function o8(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 pi=Wr("externalEvent"),l8=oh(),Pm=new Map,ef=new Map,pS=new Map;l8.startListening({actionCreator:pi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=o8(r);pS.set(i,{handler:n,reactEvent:a});var o=Pm.get(i);o!==void 0&&(cancelAnimationFrame(o),Pm.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),y=ef.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),ef.delete(i));var v=()=>{var j=pS.get(i);try{if(!j)return;var{handler:k,reactEvent:A}=j,_=t.getState(),C={activeCoordinate:p0e(_),activeDataKey:d0e(_),activeIndex:Hf(_),activeLabel:rB(_),activeTooltipIndex:Hf(_),isTooltipActive:m0e(_)};k&&k(C,A)}finally{Pm.delete(i),ef.delete(i),pS.delete(i)}};if(!m){v();return}if(d==="raf"){var x=requestAnimationFrame(v);Pm.set(i,x)}else if(typeof d=="number"){if(!ef.has(i)){v();var w=setTimeout(v,d);ef.set(i,w)}}else v()}}});var W1e=le([Ku],e=>e.tooltipItemPayloads),Q1e=le([W1e,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),c8=Wr("touchMove"),u8=oh(),Jo=null,qs=null,ED=null,tf=null;u8.startListening({actionCreator:c8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){tf=o8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Jo!==null&&(cancelAnimationFrame(Jo),Jo=null),qs!==null&&(typeof i!="number"||!o)&&(clearTimeout(qs),qs=null),ED=Array.from(n.touches).map(d=>uC({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(tf!=null){var d=t.getState(),f=wh(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=ED)===null||p===void 0?void 0:p[0];if(m==null){Jo=null,qs=null;return}var y=cC(d,m);y?.activeIndex!=null&&t.dispatch(K6({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,x=tf.touches[0];if(document.elementFromPoint==null||x==null)return;var w=document.elementFromPoint(x.clientX,x.clientY);if(!w||!w.getAttribute)return;var j=w.getAttribute(cde),k=(v=w.getAttribute(ude))!==null&&v!==void 0?v:void 0,A=Hl(d).find(P=>P.id===k);if(j==null||A==null||k==null)return;var{dataKey:_}=A,C=Q1e(d,j,k);t.dispatch(wve({activeDataKey:_,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}Jo=null,qs=null}};if(!o){c();return}i==="raf"?Jo=requestAnimationFrame(c):typeof i=="number"&&qs===null&&(c(),tf=null,qs=setTimeout(()=>{tf?c():(qs=null,Jo=null)},i))}}});var d8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},f8=sr({name:"eventSettings",initialState:d8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:X1e}=f8.actions,J1e=f8.reducer,eje=Q3({brush:Cwe,cartesianAxis:ywe,chartData:hbe,errorBars:BSe,eventSettings:J1e,graphicalItems:Zxe,layout:Vue,legend:rfe,options:lbe,polarAxis:Mxe,polarOptions:Y1e,referenceElements:Rwe,renderedTicks:cSe,rootProps:H1e,tooltip:jve,zIndex:Y0e}),tje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return vue({reducer:eje,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([e8.middleware,t8.middleware,Mv.middleware,l8.middleware,u8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(f4({type:"raf"}))},devTools:{serialize:{replacer:K1e},name:"recharts-".concat(n)}})};function nje(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=gr(),a=S.useRef(null);if(i)return n;a.current==null&&(a.current=tje(t,r));var o=FN;return S.createElement(wfe,{context:o,store:a.current},n)}function rje(e){var{layout:t,margin:n}=e,r=ln(),i=gr();return S.useEffect(()=>{i||(r(Kue(t)),r(que(n)))},[r,i,t,n]),null}var ije=S.memo(rje,fh);function aje(e){var t=ln();return S.useEffect(()=>{t(G1e(e))},[t,e]),null}var sje=e=>{var t=ln();return S.useEffect(()=>{t(X1e(e))},[t,e]),null},oje=S.memo(sje,fh);function TD(e){var{zIndex:t,isPanorama:n}=e,r=S.useRef(null),i=ln();return S.useLayoutEffect(()=>(r.current&&i(V0e({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Z0e({zIndex:t,isPanorama:n}))}),[i,t,n]),S.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function PD(e){var{children:t,isPanorama:n}=e,r=Fe(L0e);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return S.createElement(S.Fragment,null,i.map(o=>S.createElement(TD,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>S.createElement(TD,{key:o,zIndex:o,isPanorama:n})))}var lje=["children"];function cje(e,t){if(e==null)return{};var n,r,i=uje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uje(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 my(){return my=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},my.apply(null,arguments)}var dje={width:"100%",height:"100%",display:"block"},fje=S.forwardRef((e,t)=>{var n=QN(),r=XN(),i=K4();if(!va(n)||!va(r))return null;var{children:a,otherAttributes:o,title:c,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),S.createElement(zN,my({},o,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:dje,ref:t}),a)}),hje=e=>{var{children:t}=e,n=Fe(mv);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return S.createElement(zN,{width:r,height:i,x:o,y:a},t)},zD=S.forwardRef((e,t)=>{var{children:n}=e,r=cje(e,lje),i=gr();return i?S.createElement(hje,null,S.createElement(PD,{isPanorama:!0},n)):S.createElement(fje,my({ref:t},r),S.createElement(PD,{isPanorama:!1},n))});function pje(){var e=ln(),[t,n]=S.useState(null),r=Fe(lde);return S.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;nt(a)&&a!==r&&e(Gue(a))}},[t,e,r]),n}function RD(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 mje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(r){gje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gje(e,t,n){return(t=yje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yje(e){var t=vje(e,"string");return typeof t=="symbol"?t:t+""}function vje(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 lo(){return lo=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},lo.apply(null,arguments)}var bje=()=>(Sbe(),null);function gy(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var xje=S.forwardRef((e,t)=>{var n,r,i=S.useRef(null),[a,o]=S.useState({containerWidth:gy((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:gy((r=e.style)===null||r===void 0?void 0:r.height)}),c=S.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=S.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();c(p,m);var y=x=>{var w=x[0];if(w!=null){var{width:j,height:k}=w.contentRect;c(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,c]);return S.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),S.createElement(S.Fragment,null,S.createElement(uh,{width:a.containerWidth,height:a.containerHeight}),S.createElement("div",lo({ref:d},e)))}),wje=S.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=S.useState({containerWidth:gy(n),containerHeight:gy(r)}),o=S.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),c=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return S.createElement(S.Fragment,null,S.createElement(uh,{width:i.containerWidth,height:i.containerHeight}),S.createElement("div",lo({ref:c},e)))}),Sje=S.forwardRef((e,t)=>{var{width:n,height:r}=e;return S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement("div",lo({ref:t},e)))}),jje=S.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?S.createElement(wje,lo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?S.createElement(Sje,lo({},e,{width:n,height:r,ref:t})):S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement("div",lo({ref:t},e)))});function Nje(e){return e?xje:jje}var kje=S.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:x,onTouchStart:w,style:j,width:k,responsive:A,dispatchTouchEvents:_=!0}=e,C=S.useRef(null),P=ln(),[T,O]=S.useState(null),[z,I]=S.useState(null),F=pje(),$=YN(),L=$?.width>0?$.width:k,J=$?.height>0?$.height:i,ae=S.useCallback(de=>{F(de),typeof t=="function"&&t(de),O(de),I(de),de!=null&&(C.current=de)},[F,t,O,I]),Q=S.useCallback(de=>{P(JB(de)),P(pi({handler:a,reactEvent:de}))},[P,a]),K=S.useCallback(de=>{P(sj(de)),P(pi({handler:f,reactEvent:de}))},[P,f]),X=S.useCallback(de=>{P(q6()),P(pi({handler:p,reactEvent:de}))},[P,p]),ye=S.useCallback(de=>{P(sj(de)),P(pi({handler:m,reactEvent:de}))},[P,m]),Se=S.useCallback(()=>{P(a8())},[P]),R=S.useCallback(()=>{P(s8())},[P]),B=S.useCallback(de=>{P(i8(de.key))},[P]),U=S.useCallback(de=>{P(pi({handler:o,reactEvent:de}))},[P,o]),M=S.useCallback(de=>{P(pi({handler:c,reactEvent:de}))},[P,c]),V=S.useCallback(de=>{P(pi({handler:d,reactEvent:de}))},[P,d]),se=S.useCallback(de=>{P(pi({handler:y,reactEvent:de}))},[P,y]),ie=S.useCallback(de=>{P(pi({handler:w,reactEvent:de}))},[P,w]),he=S.useCallback(de=>{_&&P(c8(de)),P(pi({handler:x,reactEvent:de}))},[P,_,x]),je=S.useCallback(de=>{P(pi({handler:v,reactEvent:de}))},[P,v]),ee=Nje(A);return S.createElement(dB.Provider,{value:T},S.createElement(u3.Provider,{value:z},S.createElement(ee,{width:L??j?.width,height:J??j?.height,className:Ct("recharts-wrapper",r),style:mje({position:"relative",cursor:"default",width:L,height:J},j),onClick:Q,onContextMenu:U,onDoubleClick:M,onFocus:Se,onBlur:R,onKeyDown:B,onMouseDown:V,onMouseEnter:K,onMouseLeave:X,onMouseMove:ye,onMouseUp:se,onTouchEnd:je,onTouchMove:he,onTouchStart:ie,ref:ae},S.createElement(bje,null),n)))}),Cje=["width","height","responsive","children","className","style","compact","title","desc"];function _je(e,t){if(e==null)return{};var n,r,i=Oje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Oje(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 Aje=S.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:c,compact:d,title:f,desc:p}=e,m=_je(e,Cje),y=Gi(m);return d?S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement(zD,{otherAttributes:y,title:f,desc:p},a)):S.createElement(kje,{className:o,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},S.createElement(zD,{otherAttributes:y,title:f,desc:p,ref:t},S.createElement(Mwe,null,a)))});function oj(){return oj=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},oj.apply(null,arguments)}function MD(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 Eje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MD(Object(n),!0).forEach(function(r){Tje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tje(e,t,n){return(t=Pje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pje(e){var t=zje(e,"string");return typeof t=="symbol"?t:t+""}function zje(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 Rje={top:5,right:5,bottom:5,left:5},Mje=Eje({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Rje,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},d8),Dje=S.forwardRef(function(t,n){var r,i=mr(t.categoricalChartProps,Mje),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return S.createElement(nje,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},S.createElement(kwe,{chartData:f.data}),S.createElement(ije,{layout:i.layout,margin:i.margin}),S.createElement(oje,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),S.createElement(aje,{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}),S.createElement(Aje,oj({},i,{ref:n})))}),Ije=["axis"],lj=S.forwardRef((e,t)=>S.createElement(Dje,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ije,tooltipPayloadSearcher:sbe,categoricalChartProps:e,ref:t}));const cj={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Jc={fill:"#71717a",fontSize:11},Lje="#27272a",uj="#27272a",cf=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function h8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function dj(e){return h8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function fj(e){const t=h8(e);return`${t.getMonth()+1}/${t.getDate()}`}const $je=["7d","30d","90d","all"],Uje=["gap","cited","uncited"],p8={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"},Bje={[eo.answer]:"Answer",[eo.citation]:"Sources"};function Fje({projectName:e}){const[t,n]=S.useState("30d"),[r,i]=S.useState(eo.answer),[a,o]=S.useState(null),[c,d]=S.useState(null),[f,p]=S.useState(null),[m,y]=S.useState(null),[v,x]=S.useState(!0);if(S.useEffect(()=>{let z=!1;return x(!0),Promise.all([l7(e,t),c7(e,t),u7(e,t)]).then(([I,F,$])=>{z||(o(I),d(F),p($),x(!1))}).catch(()=>{z||x(!1)}),()=>{z=!0}},[e,t]),S.useEffect(()=>{y(null)},[r]),v&&!a)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const w=r===eo.answer,j=a?w?a.overall.answerRate:a.overall.citationRate:0,k=a?w?a.overall.answerMentionedCount:a.overall.cited:0,A=a?.overall.total??0,_=a?w?a.answerTrend:a.trend:"stable",C=_==="improving"?"positive":_==="declining"?"negative":"neutral",P=c?w?c.mentionedKeywords:c.cited:[],T=c?w?c.mentionGap:c.gap:[],O=c?w?c.notMentioned:c.uncited:[];return u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:w?"Visibility Metrics":"Citation Metrics"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:[w?"Answer Visibility Trends":"Source Citation Trends",u.jsx(Yn,{text:w?"Percentage of queries where your brand is mentioned in the AI-generated answer text. A higher rate means AI engines are actively surfacing your brand when answering user questions.":"Percentage of queries where your domain appears in the AI provider's source/reference links. This measures whether your pages are used as grounding sources, not whether your brand is named in the answer."})]})]}),u.jsx("div",{className:"sidebar-tabs ml-2",children:[eo.answer,eo.citation].map(z=>u.jsx("button",{type:"button",className:`sidebar-tab ${r===z?"sidebar-tab--active":""}`,onClick:()=>i(z),children:Bje[z]},z))})]}),u.jsx("div",{className:"flex gap-1",children:$je.map(z=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===z?"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(z),children:z==="all"?"All":z},z))})]}),a&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(o3,{value:`${Math.round(j*100)}`,label:w?"Answer Rate":"Citation Rate",delta:`${k} / ${A}`,tone:C,description:`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(Et,{tone:C,children:_})]}),Object.keys(a.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:w?"Mentioned / Total":"Cited / Total"})]})}),u.jsx("tbody",{children:Object.entries(a.byProvider).map(([z,I])=>{const F=w?I.answerRate:I.citationRate,$=w?I.answerMentionedCount:I.cited;return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:z}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(F*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[$," / ",I.total]})]},z)})})]})]})]}),a.buckets.length>=1&&u.jsx(qje,{buckets:a.buckets,keywordChanges:a.keywordChanges??[],metricMode:r})]})]}),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(Yn,{text:w?"Classification based on the most recent completed run. Mentioned: your brand was named in the AI answer text. Gap: a competitor was cited but your brand was not mentioned. Not Mentioned: your brand was not mentioned and no competitors were cited.":"Classification based on the most recent completed run. Cited: your domain appeared in the AI provider's source links. Gap: a competitor was cited but you were not. Not Cited: neither your domain nor competitors appeared in sources. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),c&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 mb-4",children:Uje.map(z=>{const I=z==="cited"?P.length:z==="gap"?T.length:O.length,F=m===z,$=z==="gap"?"Gap":z==="cited"?w?"Mentioned":"Cited":w?"Not Mentioned":"Not Cited";return u.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${F?z==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":z==="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:()=>y(F?null:z),children:[$," (",I,")"]},z)})}),u.jsx(Kje,{citedRows:P,gapRows:T,uncitedRows:O,filter:m,metricMode:r})]})]}),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(Yn,{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."})]})]}),f&&f.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(Hje,{categories:f.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:f.overall.map(z=>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 ${p8[z.category]??"bg-zinc-600"}`}),z.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:z.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(z.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:z.topDomains.slice(0,3).map(I=>I.domain).join(", ")})]},z.category))})]})]}),f&&f.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 qje({buckets:e,keywordChanges:t,metricMode:n}){const r=n===eo.answer,i=r?"answerRate":"citationRate",a=r?"Answer Rate":"Citation Rate",o=e.map(d=>({date:d.startDate,answerRate:Math.round(d.answerRate*1e3)/10,citationRate:Math.round(d.citationRate*1e3)/10,keywordCount:d.keywordCount??0})),c=S.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const d=new Date(e[0].startDate).getTime(),f=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const m=new Date(p.date).getTime();return m>=d&&m<=f}).map(p=>{const m=new Date(p.date).getTime();let y=e[0].startDate,v=Math.abs(m-new Date(y).getTime());for(const x of e){const w=Math.abs(m-new Date(x.startDate).getTime());w<v&&(y=x.startDate,v=w)}return{...p,date:y}})},[e,t]);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.jsx("div",{className:"h-40",role:"img","aria-label":`${a} trend chart`,children:u.jsx(A1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:o,margin:{top:8,right:8,bottom:0,left:0},children:[u.jsx(FB,{strokeDasharray:"3 3",stroke:Lje,vertical:!1}),u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:d=>`${d}%`,width:40}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(d,f)=>{const p=typeof d=="number"?d:Number(d??0);return String(f)===i?[`${p.toFixed(1)}%`,a]:[String(p),String(f)]}}),c.map(d=>u.jsx(LB,{x:d.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:d.label,position:"top",fill:"#71717a",fontSize:9}},d.date)),u.jsx(Xc,{type:"monotone",dataKey:i,stroke:cf[0],fill:cf[0],fillOpacity:.15,strokeWidth:2,dot:{fill:cf[0],r:3,strokeWidth:0},activeDot:{fill:cf[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Kje({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const a=i===eo.answer,o=S.useMemo(()=>{const c=[...t.map(d=>({...d,_sort:0})),...e.map(d=>({...d,_sort:1})),...n.map(d=>({...d,_sort:2}))];return r?c.filter(d=>d.category===r):c.sort((d,f)=>d._sort-f._sort)},[e,t,n,r]);return o.length===0?u.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",r?` with status "${r}"`:"","."]}):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:a?"Providers Mentioning":"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:o.map(c=>{const d=c.category==="cited"?"positive":c.category==="gap"?"caution":"neutral",f=c.category==="gap"?"Gap":c.category==="cited"?a?"Mentioned":"Cited":a?"Not Mentioned":"Not Cited",p=a?c.consistency.mentionedRuns:c.consistency.citedRuns;return u.jsxs("tr",{className:`border-t border-zinc-800/40 ${c.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[u.jsx("td",{className:"py-1.5 text-zinc-200",children:c.keyword}),u.jsx("td",{className:"py-1.5",children:u.jsx(Et,{tone:d,children:f})}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:c.providers.length>0?c.providers.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:c.competitorsCiting.length>0?c.competitorsCiting.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:c.consistency.totalRuns>0?`${p}/${c.consistency.totalRuns} runs`:"—"})]},c.keywordId)})})]})}function Hje({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:`${p8[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Gje=["7d","30d","90d","all"],Ks=cf;function nf(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Vje(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 Zje({projectName:e}){const[t,n]=S.useState(null),[r,i]=S.useState(null),[a,o]=S.useState(!0),[c,d]=S.useState(!1),[f,p]=S.useState(!1),[m,y]=S.useState(null),[v,x]=S.useState(null),[w,j]=S.useState("sessions"),[k,A]=S.useState("desc"),[_,C]=S.useState("sessions"),[P,T]=S.useState("desc"),[O,z]=S.useState("sessions"),[I,F]=S.useState("desc"),[$,L]=S.useState([]),[J,ae]=S.useState([]),[Q,K]=S.useState([]),[X,ye]=S.useState("30d");function Se(be){o(!0),WE(e).then(ze=>{if(!be.current)return n(ze),ze.connected?Promise.all([QE(e,void 0,X),XE(e,X).catch(()=>[]),eT(e,X).catch(()=>[]),JE(e,X).catch(()=>[])]):null}).then(ze=>{be.current||(Array.isArray(ze)?(i(ze[0]),L(ze[1]),ae(ze[2]),K(ze[3])):(i(null),L([]),ae([]),K([])),o(!1))}).catch(ze=>{be.current||(y(ze instanceof Error?ze.message:"Failed to load GA4 data"),o(!1))})}S.useEffect(()=>{const be={current:!1};return Se(be),()=>{be.current=!0}},[e,X]);async function R(){d(!0),y(null),x(null);try{const be=await PI(e);x(`Synced ${be.rowCount.toLocaleString()} page rows, ${be.aiReferralCount.toLocaleString()} AI and ${be.socialReferralCount.toLocaleString()} social referral rows (${be.days} days)`);const[ze,Re,_e,te]=await Promise.all([QE(e,void 0,X),XE(e,X).catch(()=>[]),eT(e,X).catch(()=>[]),JE(e,X).catch(()=>[])]);i(ze),L(Re),ae(_e),K(te);const xe=await WE(e);n(xe)}catch(be){y(be instanceof Error?be.message:"Sync failed")}finally{d(!1)}}async function B(){p(!0),y(null),x(null);try{await f7(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),x("GA4 disconnected")}catch(be){y(be instanceof Error?be.message:"Disconnect failed")}finally{p(!1)}}function U(be){w===be?A(ze=>ze==="desc"?"asc":"desc"):(j(be),A("desc"))}function M(be){_===be?T(ze=>ze==="desc"?"asc":"desc"):(C(be),T("desc"))}function V(be){O===be?F(ze=>ze==="desc"?"asc":"desc"):(z(be),F("desc"))}const se=S.useMemo(()=>r?.topPages?[...r.topPages].sort((be,ze)=>{const Re=be[w],_e=ze[w];return typeof Re=="string"&&typeof _e=="string"?k==="asc"?Re.localeCompare(_e):_e.localeCompare(Re):k==="asc"?Re-_e:_e-Re}):[],[r?.topPages,w,k]),ie=S.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((be,ze)=>{const Re=be[_],_e=ze[_];return typeof Re=="string"&&typeof _e=="string"?P==="asc"?Re.localeCompare(_e):_e.localeCompare(Re):P==="asc"?Re-_e:_e-Re}):[],[r?.aiReferrals,_,P]),he=S.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((be,ze)=>{const Re=be[O],_e=ze[O];return typeof Re=="string"&&typeof _e=="string"?I==="asc"?Re.localeCompare(_e):_e.localeCompare(Re):I==="asc"?Re-_e:_e-Re}):[],[r?.socialReferrals,O,I]),{socialChartData:je,socialChartSources:ee}=S.useMemo(()=>{const be=[...new Set(Q.map(_e=>_e.source))],ze=new Map;for(const _e of Q){let te=ze.get(_e.date);te||(te={_socialTotal:0},ze.set(_e.date,te)),te[_e.source]=(te[_e.source]??0)+_e.sessions,te._socialTotal=(te._socialTotal??0)+_e.sessions}return{socialChartData:[...ze.entries()].sort(([_e],[te])=>_e.localeCompare(te)).map(([_e,te])=>({date:_e,...te})),socialChartSources:be}},[Q]),{chartData:de,chartSources:Ce,dateRange:Y}=S.useMemo(()=>{const be=[...new Set($.map(Ae=>Ae.source))],ze=new Map;for(const Ae of J)ze.set(Ae.date,{_totalSessions:Ae.sessions,_organicSessions:Ae.organicSessions});const Re=new Map;for(const Ae of $){const Ge=`${Ae.date}::${Ae.source}`,Je=Re.get(Ge)??0;Re.set(Ge,Math.max(Je,Ae.sessions))}for(const[Ae,Ge]of Re){const[Je,tn]=Ae.split("::");let xn=ze.get(Je);xn||(xn={_totalSessions:0,_organicSessions:0},ze.set(Je,xn)),xn[tn]=(xn[tn]??0)+Ge}const _e=[...ze.entries()].sort(([Ae],[Ge])=>Ae.localeCompare(Ge)).map(([Ae,Ge])=>({date:Ae,...Ge})),te=_e.map(Ae=>Ae.date),xe=te.length>0?{start:te[0],end:te[te.length-1]}:null;return{chartData:_e,chartSources:be,dateRange:xe}},[$,J]);if(a&&!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(Yje,{projectName:e,onConnected:()=>Se({current:!1})});const Ke=r?.organicSharePct??0,Me=r?.aiSessionsDeduped??0,rt=r?.aiSharePct??0,it=r?new Set(r.aiReferrals.map(be=>be.source.toLowerCase())).size:0,Nt=ie[0]??null,Lt=r?.socialSessions??0,bn=r?.socialSharePct??0,ve=r?new Set(r.socialReferrals.map(be=>be.source.toLowerCase())).size:0,Ve=he[0]??null;return u.jsxs(u.Fragment,{children:[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}),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(we,{variant:"outline",size:"sm",disabled:c,onClick:R,children:[u.jsx(aT,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(we,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:f,onClick:B,children:[u.jsx(dG,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[u.jsxs("div",{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(Yn,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${r?.periodStart&&r?.periodEnd?` Data available: ${new Date(r.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(r.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),u.jsx("div",{className:"flex gap-1",children:Gje.map(be=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${X===be?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>ye(be),children:be==="all"?"All":be},be))})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(mS,{value:nf(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(mS,{value:nf(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Ke}% of total`,tone:"positive"}),u.jsx(mS,{value:nf(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(we,{variant:"outline",size:"sm",disabled:c,onClick:R,children:[u.jsx(aT,{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 flex items-end justify-between",children:[u.jsxs("div",{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(Yn,{text:"Tracks sessions from known AI referrers and matching AI-tagged UTMs detected in GA4 sessionSource, firstUserSource, and sessionManualSource. Generic search sources are excluded to avoid false positives."})]})]}),Y&&u.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Y.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Y.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),de.length>0&&u.jsxs(We,{className:"surface-card p-5 mb-4",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:Ce.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Ce.length===0&&u.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Ce.length===0&&u.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),u.jsx("div",{className:"h-64",children:u.jsx(A1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:de,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(be,ze)=>{const Re=typeof be=="number"?be.toLocaleString():String(be??0),_e=String(ze??"");return _e==="_totalSessions"?[Re,"Total Sessions"]:_e==="_organicSessions"?[Re,"Organic Sessions"]:[Re,_e]}}),u.jsx(I1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_totalSessions"?"Total Sessions":be==="_organicSessions"?"Organic Sessions":be}),u.jsx(Xc,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Ce.map((be,ze)=>u.jsx(Xc,{type:"monotone",dataKey:be,stackId:"ai",stroke:Ks[ze%Ks.length],fill:Ks[ze%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(We,{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(hi,{label:"AI Sessions",value:nf(Me),hint:`${Me.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hi,{label:"Share of Traffic",value:`${rt}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines. A higher share indicates stronger AI-driven discovery."}),u.jsx(hi,{label:"Tracked Sources",value:String(it),hint:`${r.aiReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct AI referral sources detected. Each unique source/medium combination (e.g. chatgpt.com/referral) counts as one source row."})]}),Nt&&u.jsxs("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:["Top AI referrer: ",u.jsx("span",{className:"font-medium",children:Nt.source})," via ",Nt.medium,", accounting for ",Nt.sessions.toLocaleString()," sessions."]})]}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"AI Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines."}),u.jsx(hi,{label:"Tracked Sources",value:"0",hint:"known AI sources",tone:"neutral",tooltip:"Number of distinct AI referral sources detected after matching known AI engine referrers and AI-tagged UTM sources."})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[u.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring for AI referral traffic from:"}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Known AI answer engines and matching UTM-tagged variants. Sessions will appear here once GA4 detects visits from tracked AI sources."})]})]})]}),u.jsxs(We,{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(fi,{label:"Source",sortKey:"source",current:_,dir:P,onSort:M,align:"left"}),u.jsx(fi,{label:"Medium",sortKey:"medium",current:_,dir:P,onSort:M,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:_,dir:P,onSort:M,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(fi,{label:"Users",sortKey:"users",current:_,dir:P,onSort:M,align:"right"})]})}),u.jsx("tbody",{children:ie.map(be=>u.jsx(Jje,{referral:be,totalSessions:Me},`${be.source}:${be.medium}:${be.sourceDimension}`))})]})}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),u.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from ChatGPT, Claude, Gemini, or other AI platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),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:"Social Attribution"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",u.jsx(Yn,{text:"Tracks sessions classified as social traffic by GA4's default channel grouping (Organic Social and Paid Social). Google maintains the source-to-channel mapping."})]})]}),je.length>0&&u.jsxs(We,{className:"surface-card p-5 mb-4",children:[u.jsx("div",{className:"mb-4 flex items-end justify-between",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]})}),u.jsx("div",{className:"h-64",children:u.jsx(A1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:je,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(be,ze)=>{const Re=typeof be=="number"?be.toLocaleString():String(be??0),_e=String(ze??"");return _e==="_socialTotal"?[Re,"Total Social"]:[Re,_e]}}),u.jsx(I1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_socialTotal"?"Total Social":be}),u.jsx(Xc,{type:"monotone",dataKey:"_socialTotal",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),ee.map((be,ze)=>u.jsx(Xc,{type:"monotone",dataKey:be,stackId:"social",stroke:Ks[ze%Ks.length],fill:Ks[ze%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(We,{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:"Social media visits"})]}),r.socialReferrals.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"Social Sessions",value:nf(Lt),hint:`${Lt.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),u.jsx(hi,{label:"Share of Traffic",value:`${bn}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),u.jsx(hi,{label:"Platforms",value:String(ve),hint:`${r.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Ve&&u.jsxs("div",{className:"mt-4 rounded-lg border border-sky-800/40 bg-sky-500/6 px-4 py-3 text-sm text-sky-100",children:["Top social source: ",u.jsx("span",{className:"font-medium",children:Ve.source})," via ",Ve.medium,", accounting for ",Ve.sessions.toLocaleString()," sessions."]})]}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),u.jsx(hi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),u.jsx(hi,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[u.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Sessions classified as Organic Social or Paid Social by GA4 will appear here. Google maintains the source-to-channel mapping, which includes Facebook, Instagram, X/Twitter, LinkedIn, Reddit, Pinterest, Snapchat, and other platforms."})]})]})]}),u.jsxs(We,{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.socialReferrals.length>0?`${r.socialReferrals.length} rows`:"No source rows"})]}),r.socialReferrals.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(fi,{label:"Source",sortKey:"source",current:O,dir:I,onSort:V,align:"left"}),u.jsx(fi,{label:"Medium",sortKey:"medium",current:O,dir:I,onSort:V,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:O,dir:I,onSort:V,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(fi,{label:"Users",sortKey:"users",current:O,dir:I,onSort:V,align:"right"})]})}),u.jsx("tbody",{children:he.map(be=>u.jsx(eNe,{referral:be,totalSessions:Lt},`${be.source}:${be.medium}:${be.channelGroup}`))})]})}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),u.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from Facebook, X/Twitter, LinkedIn, or other social platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),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(Yn,{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(fi,{label:"Landing Page",sortKey:"landingPage",current:w,dir:k,onSort:U,align:"left"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:w,dir:k,onSort:U,align:"right"}),u.jsx(fi,{label:"Organic",sortKey:"organicSessions",current:w,dir:k,onSort:U,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(fi,{label:"Users",sortKey:"users",current:w,dir:k,onSort:U,align:"right"})]})}),u.jsx("tbody",{children:se.map(be=>u.jsx(Wje,{page:be},be.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 ${Vje(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function Yje({projectName:e,onConnected:t}){const[n,r]=S.useState(""),[i,a]=S.useState(null),[o,c]=S.useState(null),[d,f]=S.useState(!1),[p,m]=S.useState(null),y=S.useRef(null),v=S.useCallback(w=>{const j=w.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const A=k.result;try{const _=JSON.parse(A);if(!_.client_email||!_.private_key){m("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{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},k.onerror=()=>{m("Failed to read file."),c(null)},k.readAsText(j)},[]);async function x(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await d7(e,{propertyId:n.trim(),keyJson:o});try{await PI(e)}catch{}t()}catch(w){m(w instanceof Error?w.message:"Failed to connect GA4")}finally{f(!1)}}return u.jsxs(We,{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."}),p&&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:p}),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:w=>r(w.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(hG,{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(we,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:x,children:d?"Connecting & syncing…":"Connect GA4"})]})}function fi({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,o&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const m8={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function mS({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 ${m8[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function hi({value:e,label:t,hint:n,tone:r,tooltip:i}){return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&u.jsx(Yn,{text:i})]}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${m8[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Wje({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()})]})}const Qje={session:"Session",first_user:"First Visit",manual_utm:"UTM"},Xje={session:"Detected via GA4 sessionSource (referrer or utm_source for this session)",first_user:"Detected via GA4 firstUserSource (referrer from the user's first-ever visit)",manual_utm:"Detected via GA4 sessionManualSource (explicit utm_source parameter for the session)"};function Jje({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=Qje[e.sourceDimension]??e.sourceDimension,i=Xje[e.sourceDimension]??"";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",children:u.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),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 eNe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic";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",children:u.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:`GA4 channel group: ${e.channelGroup}`,children:r})}),u.jsx("td",{className:"py-1.5 text-right text-sky-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 jh(e){e.invalidateQueries({queryKey:Or.runs.all}),e.invalidateQueries({queryKey:Or.projects.all})}function tNe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function nNe(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 Dv(e,t){BI({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),ft({title:tNe(e.kind),detail:nNe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function rNe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){ft({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)BI({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=PG({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});ft({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 Iv(e,t){if(e instanceof is&&e.code==="RUN_IN_PROGRESS"){ft({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}ft({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function g8(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>SH(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function iNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:t=>BH(t),onSuccess:t=>{jh(e),rNe(t)},onError:t=>{ft({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function aNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>OI(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function sNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>e7(t),onSuccess:(t,n)=>{jh(e),Dv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function oNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>XH(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const lNe=["7d","30d","90d","all"];function cNe({projectName:e}){const[t,n]=S.useState(!1),[r,i]=S.useState([]),[a,o]=S.useState([]),[c,d]=S.useState([]),[f,p]=S.useState([]),[m,y]=S.useState([]),[v,x]=S.useState(null),[w,j]=S.useState(""),[k,A]=S.useState(""),[_,C]=S.useState("30"),[P,T]=S.useState(!1),[O,z]=S.useState("30d"),[I,F]=S.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[$,L]=S.useState(""),[J,ae]=S.useState(!0),[Q,K]=S.useState(!1),[X,ye]=S.useState(!1),[Se,R]=S.useState(!1),[B,U]=S.useState(!1),[M,V]=S.useState(!1),[se,ie]=S.useState(!1),[he,je]=S.useState(null),[ee,de]=S.useState(!1),[Ce,Y]=S.useState(!1),[Ke,Me]=S.useState(null),[rt,it]=S.useState(""),[Nt,Lt]=S.useState(!1),[bn,ve]=S.useState(!1),[Ve,be]=S.useState("indexed"),[ze,Re]=S.useState(null),_e=S.useMemo(()=>{if(!ze)return c;const{key:G,dir:Ne}=ze;return[...c].sort((yt,ct)=>{const _t=G===Js.CTR?Number.isFinite(yt.ctr)?yt.ctr:0:yt[G],Dr=G===Js.CTR?Number.isFinite(ct.ctr)?ct.ctr:0:ct[G];return Ne==="asc"?_t-Dr:Dr-_t})},[c,ze]),[te,xe]=S.useState([]),[Ae,Ge]=S.useState(null),[Je,tn]=S.useState(!1),[xn,Qe]=S.useState(null),[kt,$t]=S.useState(null),ue=r.find(G=>G.connectionType==="gsc"),Mn=c.length>0||f.length>0||m.length>0,or=aNe(),No=sNe(),ps=oNe();async function ko(G){if(!G){o([]),j("");return}ye(!0);try{const{sites:Ne}=await KH(e);o(Ne),j(G.propertyId??Ne[0]?.siteUrl??"")}catch(Ne){o([]),Qe(Ne instanceof Error?Ne.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function Ca(){U(!0);try{const G=await VH(e,{startDate:I.startDate||void 0,endDate:I.endDate||void 0,query:I.query||void 0,page:I.page||void 0,limit:parseInt(I.limit,10)||20,window:O});d(G)}catch(G){d([]),Qe(G instanceof Error?G.message:"Failed to load GSC performance data")}finally{U(!1)}}async function Xr(){V(!0);try{const[G,Ne]=await Promise.all([YH(e,{url:$.trim()||void 0,limit:20}),WH(e)]);p(G),y(Ne)}catch(G){p([]),y([]),Qe(G instanceof Error?G.message:"Failed to load GSC inspection history")}finally{V(!1)}}async function Co(){de(!0);try{const[G,Ne]=await Promise.all([Mj(e),QH(e).catch(()=>[])]);je(G),xe(Ne)}catch(G){je(null),xe([]),Qe(G instanceof Error?G.message:"Failed to load coverage data")}finally{de(!1)}}async function ms(G){tn(!0),Qe(null);try{const Ne=await ZE(e,{urls:G}),{succeeded:yt,failed:ct,total:_t}=Ne.summary;ft({title:"Indexing requested",detail:ct===0?`${yt} URL${yt!==1?"s":""} submitted for indexing.`:`${yt}/${_t} submitted successfully, ${ct} failed.`,tone:ct===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ne){Qe(Ne instanceof Error?Ne.message:"Failed to request indexing")}finally{tn(!1)}}async function $v(){tn(!0),Qe(null);try{const G=await ZE(e,{urls:[],allUnindexed:!0}),{succeeded:Ne,failed:yt,total:ct}=G.summary;ft({title:"Indexing requested",detail:yt===0?`${Ne} unindexed URL${Ne!==1?"s":""} submitted for indexing.`:`${Ne}/${ct} submitted successfully, ${yt} failed.`,tone:yt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(G){Qe(G instanceof Error?G.message:"Failed to request indexing")}finally{tn(!1)}}async function _o(){if(rt.trim()){Lt(!0),Qe(null);try{await GH(e,"gsc",rt.trim()),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,sitemapUrl:rt.trim()}:Ne)),ft({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),it("")}catch(G){Qe(G instanceof Error?G.message:"Failed to save sitemap URL")}finally{Lt(!1)}}}async function Gl(){Qe(null);try{const G=await No.mutateAsync({projectName:e,projectLabel:e});Me(G.sitemaps),i(Ne=>Ne.map(yt=>yt.connectionType==="gsc"?{...yt,sitemapUrl:G.primarySitemapUrl}:yt))}catch{}}async function Oo(){Y(!0),Qe(null);try{const G=await JH(e);Me(G.sitemaps),G.sitemaps.length===0&&$t("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(G){Qe(G instanceof Error?G.message:"Failed to list sitemaps")}finally{Y(!1)}}async function kh(){ae(!0),Qe(null);try{const[G,Ne]=await Promise.all([Rj().catch(()=>null),_I(e).catch(()=>[])]);n(!!G?.google?.configured),i(Ne);const yt=Ne.find(ct=>ct.connectionType==="gsc");await Promise.all([ko(yt),Ca(),Xr(),Co()])}finally{ae(!1)}}S.useEffect(()=>{kh()},[e]),S.useEffect(()=>{Ca()},[O]);async function Ch(){if(!t){Qe("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}K(!0),Qe(null),$t(null);try{const{authUrl:G}=await FH(e,"gsc");if(!G.startsWith("https://accounts.google.com/")){Qe("Unexpected OAuth redirect URL. Please try again.");return}const Ne=window.open(G,"_blank","width=600,height=700");if(!Ne){window.location.assign(G);return}$t("Finish the Google consent flow in the popup, then close it to refresh this project.");const yt=window.setInterval(()=>{Ne.closed&&(window.clearInterval(yt),$t(null),kh())},1e3)}catch(G){Qe(G instanceof Error?G.message:"Failed to start OAuth flow")}finally{K(!1)}}async function _h(){Qe(null),$t(null);try{await qH(e,"gsc"),i(G=>G.filter(Ne=>Ne.connectionType!=="gsc")),o([]),j("")}catch(G){Qe(G instanceof Error?G.message:"Failed to disconnect")}}async function Oh(){if(w){R(!0),Qe(null);try{await HH(e,"gsc",w),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,propertyId:w}:Ne)),ft({title:"GSC property updated",detail:`${e} is now linked to ${w}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(G){Qe(G instanceof Error?G.message:"Failed to save GSC property")}finally{R(!1)}}}async function Hu(){Qe(null),$t(null);try{await or.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(_,10)||void 0,full:P||void 0}})}catch{}}async function Vl(){if(k.trim()){ie(!0),Qe(null),$t(null);try{const G=await ZH(e,k.trim());x(G),A(""),await Xr()}catch(G){Qe(G instanceof Error?G.message:"Failed to inspect URL")}finally{ie(!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.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex gap-1",children:lNe.map(G=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${O===G?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>z(G),children:G==="all"?"All":G},G))}),ue&&u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:B,onClick:()=>{Ca()},children:B?"Refreshing…":"Refresh data"})]})]}),xn&&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:[xn,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Qe(null),children:"×"})]}),kt&&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:[kt,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>$t(null),children:"×"})]}),J?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(We,{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(Et,{tone:ue?"positive":t?"caution":"negative",children:ue?"Connected":t?"Ready to connect":"App credentials missing"})]}),ue?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:ue.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:_h,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:ue.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:ue.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:Ui(ue.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(we,{type:"button",variant:"outline",size:"sm",disabled:Q,onClick:Ch,children:Q?"Opening…":"Connect Google Search Console"}):u.jsx(we,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Wt,{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."})]})]})]}),ue&&!ue.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(we,{type:"button",size:"sm",disabled:No.isPending||!ue.propertyId,onClick:Gl,children:No.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:rt,onChange:G=>it(G.target.value),onKeyDown:G=>G.key==="Enter"&&void _o()}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:Nt||!rt.trim(),onClick:_o,children:Nt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ue||Mn)&&u.jsxs(u.Fragment,{children:[u.jsxs(We,{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:[he&&he.notIndexed.length>0&&u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:Je,onClick:()=>{$v()},children:Je?"Requesting…":`Request indexing (${he.notIndexed.length})`}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:ee,onClick:()=>{Co()},children:ee?"Loading…":"Refresh coverage"})]})]}),he&&he.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const G=he.summary.indexed+he.summary.notIndexed,Ne=G>0?he.summary.indexed/G:0,yt=G>0?he.summary.notIndexed/G:0,ct=54,_t=2*Math.PI*ct,Dr=_t*(1-Ne),Ti=_t*yt,gs=_t*Ne;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:ct,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:ct,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:_t,strokeDashoffset:Dr,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),he.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:ct,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ti} ${_t-Ti}`,strokeDashoffset:-gs,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:[(Ne*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:he.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:he.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(he.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(he.reasonGroups??[]).length," ",(he.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),he.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:he.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(G=>{const Ne=G==="indexed"?he.indexed.length:G==="notIndexed"?he.notIndexed.length:he.deindexed.length,yt=G==="indexed"?"Indexed":G==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ve===G?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{be(G),Ge(null)},children:[yt," (",Ne,")"]},G)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ve==="indexed"&&he.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:he.indexed.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.crawlTime?G.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:G.isMobileFriendly===!0?"Yes":G.isMobileFriendly===!1?"No":"—"})]},G.id))})]}),Ve==="notIndexed"&&!Ae&&(he.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:(he.reasonGroups??[]).map(G=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ge(G.reason),children:[u.jsx("td",{className:"text-zinc-200",children:G.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.count})]},G.reason))})]}),Ve==="notIndexed"&&!Ae&&(he.reasonGroups??[]).length===0&&he.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:he.notIndexed.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"})]},G.id))})]}),Ve==="notIndexed"&&Ae&&(()=>{const G=(he.reasonGroups??[]).find(Ne=>Ne.reason===Ae);return G?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:()=>Ge(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:G.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[G.count," affected page",G.count!==1?"s":""]})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:Je,onClick:()=>{ms(G.urls.map(Ne=>Ne.url))},children:Je?"Requesting…":`Request indexing (${G.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:G.urls.map(Ne=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ne.url}),u.jsx("td",{className:"text-zinc-400",children:Ne.crawlTime?Ne.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:Je,onClick:()=>{ms([Ne.url])},title:"Request indexing",children:"Index"})})]},Ne.id))})]})]}):null})(),Ve==="deindexed"&&he.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:he.deindexed.map((G,Ne)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.previousState}),u.jsx("td",{className:"text-zinc-400",children:G.currentState}),u.jsx("td",{className:"text-zinc-400",children:G.transitionDate.split("T")[0]})]},`${G.url}-${Ne}`))})]}),(Ve==="indexed"&&he.indexed.length===0||Ve==="notIndexed"&&!Ae&&he.notIndexed.length===0||Ve==="deindexed"&&he.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:ee?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(We,{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(we,{type:"button",variant:"outline",size:"sm",disabled:B,onClick:()=>{Ca()},children:B?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const G=new Map;for(const at of c){const vt=G.get(at.date);vt?(vt.clicks+=at.clicks,vt.impressions+=at.impressions):G.set(at.date,{clicks:at.clicks,impressions:at.impressions})}const Ne=[...G.entries()].sort(([at],[vt])=>at.localeCompare(vt));if(Ne.length===0)return null;const yt=Math.max(...Ne.map(([,at])=>at.impressions),1),ct=Ne.reduce((at,[,vt])=>at+vt.clicks,0),_t=Ne.reduce((at,[,vt])=>at+vt.impressions,0),Dr=_t>0?(ct/_t*100).toFixed(1):"0.0",Ti=700,gs=220,vr={top:12,bottom:36,left:48,right:12},Ah=Ti-vr.left-vr.right,Jr=gs-vr.top-vr.bottom,_a=Ah/Ne.length,Pi=Math.max(Math.min(_a*.35,24),4),Oa=Math.max(Pi*.15,1),Ao=at=>{if(at<=0)return 1;const vt=Math.pow(10,Math.floor(Math.log10(at))),Ir=at/vt,Ri=Ir<=1.5?1.5:Ir<=3?3:Ir<=5?5:10;return Math.ceil(Ri*vt)},zi=4,nn=Math.ceil(Ao(yt)/zi)*zi,Eh=Array.from({length:zi+1},(at,vt)=>nn/zi*vt),Th=at=>at>=1e3?`${(at/1e3).toFixed(at>=1e4?0:1)}k`:String(at);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:ct.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:_t.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Dr,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ti} / ${gs}`},children:u.jsxs("svg",{viewBox:`0 0 ${Ti} ${gs}`,className:"h-full w-full",children:[Eh.map((at,vt)=>{const Ir=vr.top+Jr-at/nn*Jr;return u.jsxs("g",{children:[u.jsx("line",{x1:vr.left,y1:Ir,x2:Ti-vr.right,y2:Ir,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:vr.left-6,y:Ir+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Th(at)})]},`t-${vt}`)}),Ne.map(([at,vt],Ir)=>{const Ri=vr.left+_a*Ir+_a/2,Eo=vt.impressions/nn*Jr,Ph=vt.clicks/nn*Jr;return u.jsxs("g",{children:[u.jsx("title",{children:`${at}
289
- Clicks: ${vt.clicks}
290
- Impressions: ${vt.impressions}
291
- CTR: ${vt.impressions>0?(vt.clicks/vt.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:Ri-Pi-Oa/2,y:vr.top+Jr-Eo,width:Pi,height:Math.max(Eo,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:Ri+Oa/2,y:vr.top+Jr-Ph,width:Pi,height:Math.max(Ph,1),rx:2,fill:"#10b981",opacity:.85})]},at)}),(()=>{const at=Math.min(Ne.length,7);return Array.from({length:at},(vt,Ir)=>{const Ri=Ne.length===1?0:Math.round(Ir/(at-1)*(Ne.length-1)),Eo=vr.left+_a*Ri+_a/2;return u.jsx("text",{x:Eo,y:gs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ne[Ri][0].slice(5)},`xl-${Ri}`)})})()]})})]})})(),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:I.startDate,onChange:G=>F(Ne=>({...Ne,startDate:G.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:I.endDate,onChange:G=>F(Ne=>({...Ne,endDate:G.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:I.query,onChange:G=>F(Ne=>({...Ne,query:G.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:I.page,onChange:G=>F(Ne=>({...Ne,page:G.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:I.limit,onChange:G=>F(Ne=>({...Ne,limit:G.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"}),Object.values(Js).map(G=>u.jsx("th",{className:"text-right","aria-sort":ze?.key===G?ze.dir==="asc"?"ascending":"descending":"none",children:u.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>Re(Ne=>Ne?.key===G?Ne.dir==="desc"?{key:G,dir:"asc"}:null:{key:G,dir:"desc"}),children:[yG[G],ze?.key===G?ze.dir==="desc"?" ↓":" ↑":""]})},G))]})}),u.jsx("tbody",{children:_e.map((G,Ne)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:G.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:G.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:G.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:G.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(G.ctr)?G.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.position.toFixed(1)})]},`${G.date}:${G.query}:${G.page}:${Ne}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(We,{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:k,onChange:G=>A(G.target.value),onKeyDown:G=>G.key==="Enter"&&void Vl()}),u.jsx(we,{type:"button",size:"sm",disabled:se||!ue?.propertyId||!k.trim(),onClick:Vl,children:se?"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:oT(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:Ui(v.crawlTime)})]})]})]}),u.jsxs(We,{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(we,{type:"button",variant:"outline",size:"sm",disabled:M,onClick:()=>{Xr()},children:M?"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:$,onChange:G=>L(G.target.value)}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:M,onClick:()=>{Xr()},children:"Apply filter"})]}),f.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:f.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-300",children:G.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:oT(G.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:Ui(G.inspectedAt)})]},G.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(We,{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"})]})}),m.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:m.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:G.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Ui(G.transitionDate)})]},`${G.url}:${G.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ue&&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:()=>ve(G=>!G),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 ${bn?"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"})]})}),bn&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(We,{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:w,disabled:X||a.length===0,onChange:G=>j(G.target.value),children:a.length===0?u.jsx("option",{value:"",children:X?"Loading properties…":"No properties available"}):a.map(G=>u.jsxs("option",{value:G.siteUrl,children:[G.siteUrl," · ",G.permissionLevel]},G.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:X,onClick:()=>{ko(ue)},children:X?"Refreshing…":"Refresh properties"}),u.jsx(we,{type:"button",size:"sm",disabled:!w||Se,onClick:Oh,children:Se?"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(We,{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:_,onChange:G=>C(G.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:P,onChange:G=>T(G.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(we,{type:"button",size:"sm",disabled:or.isPending||!ue.propertyId,onClick:Hu,children:or.isPending?"Queueing…":"Queue sync"}),!ue.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(We,{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:[ue.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:ue.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:Ce||!ue.propertyId,onClick:()=>{Oo()},children:Ce?"Loading…":"Browse sitemaps from GSC"}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:No.isPending||!ue.propertyId,onClick:Gl,children:No.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."}),Ke&&Ke.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 (",Ke.length,")"]}),Ke.map(G=>{const Ne=G.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:G.path}),G.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",G.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ne&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[Ne.indexed," / ",Ne.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:()=>it(G.path),children:"Use"})]})]},G.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:ue.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:rt,onChange:G=>it(G.target.value),onKeyDown:G=>G.key==="Enter"&&rt.trim()&&void _o()}),u.jsx(we,{type:"button",size:"sm",disabled:Nt||!rt.trim(),onClick:_o,children:Nt?"Saving…":ue.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(we,{type:"button",size:"sm",variant:"outline",disabled:ps.isPending||!ue.propertyId,onClick:async()=>{const Ne=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ue.sitemapUrl||void 0;Qe(null),$t(null);try{await ps.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ne}})}catch{}},children:ps.isPending?"Queueing…":"Inspect sitemap"})]}),!ue.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function uNe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=S.useState(!1),[a,o]=S.useState(!1),[c,d]=S.useState(null),[f,p]=S.useState(e.displayName),[m,y]=S.useState(e.canonicalDomain),[v,x]=S.useState(e.country),[w,j]=S.useState(e.language),[k,A]=S.useState(e.ownedDomains??[]),[_,C]=S.useState(""),[P,T]=S.useState(null),[O,z]=S.useState(!1),[I,F]=S.useState(!1),[$,L]=S.useState(""),[J,ae]=S.useState(""),[Q,K]=S.useState(""),[X,ye]=S.useState(""),[Se,R]=S.useState("");S.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),x(e.country),j(e.language),A(e.ownedDomains??[]))},[e,r]);function B(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),x(e.country),j(e.language),A(e.ownedDomains??[]),C("")}function U(){const Y=_.trim();Y&&(k.includes(Y)||A([...k,Y]),C(""))}function M(Y){A(k.filter(Ke=>Ke!==Y))}async function V(){if(!(!f.trim()||!m.trim()||!v.trim()||!w.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:w.trim()}),i(!1),ft({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Y){d(Y instanceof Error?Y.message:"Failed to save")}finally{o(!1)}}}async function se(){const Y=$.trim(),Ke=J.trim(),Me=Q.trim(),rt=X.trim();if(!(!Y||!Ke||!Me||!rt)){z(!0),T(null);try{const it={label:Y,city:Ke,region:Me,country:rt};Se.trim()&&(it.timezone=Se.trim()),await jH(e.name,it),n(),L(""),ae(""),K(""),ye(""),R(""),F(!1),ft({title:"Location added",detail:`${Y} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Y}`,dedupeMode:"drop"})}catch(it){T(it instanceof Error?it.message:"Failed to add location")}finally{z(!1)}}}async function ie(Y){z(!0),T(null);try{await NH(e.name,Y),n(),ft({title:"Location removed",detail:`${Y} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Ke){T(Ke instanceof Error?Ke.message:"Failed to remove location")}finally{z(!1)}}async function he(Y){z(!0),T(null);try{await kH(e.name,Y),n(),ft({title:"Default location updated",detail:`${Y} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ke){T(Ke instanceof Error?Ke.message:"Failed to set default location")}finally{z(!1)}}const je=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||w!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ee="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",de="block text-xs font-medium text-zinc-400 mb-1",Ce=$.trim()&&J.trim()&&Q.trim()&&X.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(we,{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:()=>d(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:de,children:"Display name"}),u.jsx("input",{className:ee,type:"text",value:f,onChange:Y=>p(Y.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Canonical domain"}),u.jsx("input",{className:ee,type:"text",value:m,onChange:Y=>y(Y.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Country"}),u.jsx("input",{className:ee,type:"text",value:v,onChange:Y=>x(Y.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Language"}),u.jsx("input",{className:ee,type:"text",value:w,onChange:Y=>j(Y.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Y=>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:[Y,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>M(Y),"aria-label":`Remove ${Y}`,children:"×"})]},Y))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:Y=>C(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&(Y.preventDefault(),U())}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:U,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(we,{type:"button",disabled:a||!je||!f.trim()||!m.trim(),onClick:V,children:a?"Saving...":"Save changes"}),u.jsx(we,{type:"button",variant:"outline",disabled:a,onClick:B,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(Y=>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:Y},Y))}):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:[P&&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:[P,u.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>T(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(Y=>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 ${Y.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:[Y.label,Y.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Y.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[Y.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:O,onClick:()=>he(Y.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Y.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:O,onClick:()=>ie(Y.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Y.label}`,children:"Remove"})]})})]},Y.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),I?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:ee,type:"text",value:$,onChange:Y=>L(Y.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:ee,type:"text",value:J,onChange:Y=>ae(Y.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:ee,type:"text",value:Q,onChange:Y=>K(Y.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:ee,type:"text",value:X,onChange:Y=>ye(Y.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:ee,type:"text",value:Se,onChange:Y=>R(Y.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(we,{type:"button",size:"sm",disabled:O||!Ce,onClick:se,children:O?"Adding...":"Add location"}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:O,onClick:()=>{F(!1),T(null)},children:"Cancel"})]})]}):u.jsx(we,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const dNe=[{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"}],DD=["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 fNe({projectName:e}){const[t,n]=S.useState("loading"),[r,i]=S.useState(!1),[a,o]=S.useState("daily"),[c,d]=S.useState(6),[f,p]=S.useState(""),[m,y]=S.useState("UTC"),[v,x]=S.useState(!1),[w,j]=S.useState(""),[k,A]=S.useState(!1),[_,C]=S.useState(!1),[P,T]=S.useState(null);S.useEffect(()=>{zH(e).then(n).catch(()=>n(null))},[e]);const O=()=>{if(t&&t!=="loading"){const $=xG(t.preset??null,t.cronExpr);o($.freq),d($.hour),p($.customCron);const L=DD.includes(t.timezone);y(L?t.timezone:"Other"),x(!L),j(L?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),x(!1),j("");T(null),i(!0)},z=async()=>{A(!0),T(null);try{const L={timezone:v?w.trim()||"UTC":m};a==="custom"?L.cron=f.trim():L.preset=bG(a,c);const J=await GE(e,L);n(J),i(!1),ft({title:"Schedule saved",detail:ux(J.preset??null,J.cronExpr,J.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch($){T($ instanceof Error?$.message:"Failed to save schedule")}finally{A(!1)}},I=async()=>{if(!(!t||t==="loading")){A(!0),T(null);try{const $={timezone:t.timezone,enabled:!t.enabled};t.preset?$.preset=t.preset:$.cron=t.cronExpr;const L=await GE(e,$);n(L),ft({title:L.enabled?"Schedule resumed":"Schedule paused",detail:ux(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch($){T($ instanceof Error?$.message:"Failed to update schedule")}finally{A(!1)}}},F=async()=>{C(!0),T(null);try{await RH(e),n(null),i(!1),ft({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch($){T($ instanceof Error?$.message:"Failed to remove schedule")}finally{C(!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(we,{type:"button",variant:"outline",size:"sm",onClick:O,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(We,{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(We,{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:ux(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(Et,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:I,children:t.enabled?"Pause":"Resume"}),u.jsx(we,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:F,children:_?"Removing...":"Remove"})]})]}),P&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),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:a,onChange:$=>o($.target.value),children:dNe.map($=>u.jsx("option",{value:$.value,children:$.label},$.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:a==="twice-daily"||a==="custom",onChange:$=>d(parseInt($.target.value)),children:Array.from({length:24},($,L)=>u.jsx("option",{value:L,children:zS(L)},L))})]})]}),a==="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:f,onChange:$=>p($.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":m,onChange:$=>{$.target.value==="Other"?(x(!0),y("Other")):(x(!1),y($.target.value))},children:[DD.map($=>u.jsx("option",{value:$,children:$},$)),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:w,onChange:$=>j($.target.value)})]}),P&&u.jsx("p",{className:"text-rose-400 text-sm",children:P}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),T(null)},children:"Cancel"}),u.jsx(we,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:z,children:k?"Saving...":"Save schedule"})]})]})]})}const hNe=[{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 pNe({projectName:e}){const[t,n]=S.useState("loading"),[r,i]=S.useState(!1),[a,o]=S.useState(""),[c,d]=S.useState(["citation.lost","citation.gained"]),[f,p]=S.useState(!1),[m,y]=S.useState(null),[v,x]=S.useState({});S.useEffect(()=>{MH(e).then(n).catch(()=>n([]))},[e]);const w=_=>{d(C=>C.includes(_)?C.filter(P=>P!==_):[...C,_])},j=async()=>{if(!(!a.trim()||c.length===0)){p(!0),y(null);try{const _=await DH(e,{channel:"webhook",url:a.trim(),events:c});n(C=>C==="loading"?[_]:[...C,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),ft({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},k=async _=>{try{await IH(e,_),n(C=>C==="loading"?C:C.filter(P=>P.id!==_)),ft({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}},A=async _=>{x(C=>({...C,[_]:{state:"testing"}}));try{const C=await LH(e,_);x(P=>({...P,[_]:{state:C.ok?"ok":"fail",status:C.status}})),C.ok&&ft({title:"Test notification sent",detail:`Webhook returned status ${C.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{x(C=>({...C,[_]:{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(we,{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:a,onChange:_=>o(_.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:hNe.map(_=>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(_.value),onChange:()=>w(_.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.value))})]}),m&&u.jsx("p",{className:"text-rose-400 text-sm",children:m}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),u.jsx(we,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:j,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(We,{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(_=>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:_.urlHost,children:_.urlDisplay??_.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(C=>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:C.replace("."," ")},C))})}),u.jsx("td",{children:u.jsx(Et,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const C=v[_.id],P=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return u.jsx(Et,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:P})})(),u.jsx(we,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>A(_.id),children:"Test"}),u.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(_.id),children:"Remove"})]})})]},_.id))})]}),m&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function mNe({projectName:e,refreshNonce:t}){const[n,r]=S.useState(null),[i,a]=S.useState([]),[o,c]=S.useState(null),[d,f]=S.useState([]),[p,m]=S.useState([]),[y,v]=S.useState(null),[x,w]=S.useState(""),[j,k]=S.useState(""),[A,_]=S.useState(""),[C,P]=S.useState(!0),[T,O]=S.useState(!1),[z,I]=S.useState(null),[F,$]=S.useState("coverage");S.useEffect(()=>{L()},[e,t]);async function L(){P(!0),I(null);try{const R=await AI(e);if(r(R),R.connected){const[B,U,M,V]=await Promise.all([Dj(e).catch(()=>null),EI(e).catch(()=>[]),s7(e).catch(()=>[]),R.siteUrl?Promise.resolve([]):i7(e).then(se=>se.sites).catch(()=>[])]);c(B),f(U),m(M),a(V)}else c(null),f([]),m([]),a([])}catch(R){I(R instanceof Error?R.message:"Failed to load Bing data")}finally{P(!1)}}async function J(){if(j.trim()){I(null);try{const R=await n7(e,j.trim());k(""),R.availableSites.length>0&&a(R.availableSites),await L()}catch(R){I(R instanceof Error?R.message:"Failed to connect")}}}async function ae(){try{await r7(e),r(null),a([]),c(null),f([]),m([]),v(null),_(""),I(null)}catch(R){I(R instanceof Error?R.message:"Failed to disconnect")}}async function Q(){if(A)try{await a7(e,A),await L()}catch(R){I(R instanceof Error?R.message:"Failed to set site")}}async function K(){if(x.trim())try{const R=await TI(e,x.trim());v(R),f(B=>[R,...B])}catch(R){I(R instanceof Error?R.message:"Inspection failed")}}async function X(R){O(!0),I(null);try{const B=await YE(e,{urls:[R]}),{succeeded:U,failed:M,total:V}=B.summary;ft({title:"Bing submission requested",detail:M===0?`${U} URL submitted to Bing.`:`${U}/${V} submitted successfully, ${M} failed.`,tone:M===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}catch(B){const U=B instanceof Error?B.message:"Submission failed";I(U),ft({title:"Bing submission failed",detail:U,tone:"negative",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}finally{O(!1)}}async function ye(){O(!0),I(null),ft({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const R=await YE(e,{allUnindexed:!0}),{succeeded:B,failed:U,total:M}=R.summary;ft({title:"Bing submissions requested",detail:U===0?`${B}/${M} URL${M!==1?"s":""} submitted to Bing.`:`${B}/${M} submitted successfully, ${U} failed.`,tone:U===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(R){const B=R instanceof Error?R.message:"Batch submission failed";I(B),ft({title:"Bing submissions failed",detail:B,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{O(!1)}}if(C)return u.jsx(We,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(We,{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(Et,{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:j,onChange:R=>k(R.target.value),onKeyDown:R=>R.key==="Enter"&&J()}),u.jsx(we,{size:"sm",disabled:!j.trim(),onClick:J,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(We,{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(Et,{tone:"positive",children:"Connected"}),u.jsx(we,{size:"sm",variant:"ghost",onClick:ae,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?Ui(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:R=>_(R.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(R=>u.jsxs("option",{value:R.url,children:[R.url,R.verified?" (verified)":""]},R.url))]}),u.jsx(we,{size:"sm",disabled:!A,onClick:Q,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 Se=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(We,{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(Et,{tone:"positive",children:"Connected"}),u.jsx(we,{size:"sm",variant:"ghost",onClick:ae,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?Ui(n.updatedAt):"—"})]})]})]})]}),u.jsxs(We,{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:o?.lastInspectedAt?`Last inspected ${Ui(o.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:Se.map(R=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${F===R.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>$(R.key),children:R.label},R.key))}),F==="coverage"&&o&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(gm,{label:"Indexed",value:o.summary.indexed,tone:"positive"}),u.jsx(gm,{label:"Not in index",value:o.summary.notIndexed+(o.summary.unknown??0),tone:"negative"}),u.jsx(gm,{label:"Status unknown",value:o.summary.unknown??0,tone:"neutral"}),u.jsx(gm,{label:"Coverage",value:`${o.summary.percentage}%`,tone:"neutral"})]}),o.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 (",o.notIndexed.length,")"]}),u.jsx(we,{size:"sm",variant:"ghost",disabled:T,onClick:ye,children:T?"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:o.notIndexed.map(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:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.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:T,onClick:()=>X(R.url),children:"Submit"})})]},R.id))})]})})]}),(o.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 (",(o.unknown??[]).length,")"]}),u.jsx(we,{size:"sm",variant:"ghost",disabled:T,onClick:ye,children:T?"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:(o.unknown??[]).map(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:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Ui(R.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:T,onClick:()=>X(R.url),children:"Submit"})})]},R.id))})]})})]}),o.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",o.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:o.indexed.map(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:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Ui(R.lastCrawledDate):"—"})]},R.id))})]})})]})]}),F==="coverage"&&!o&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),F==="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:x,onChange:R=>w(R.target.value),onKeyDown:R=>R.key==="Enter"&&K()}),u.jsx(we,{size:"sm",disabled:!x.trim(),onClick:K,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??"—"]})]}),d.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:d.map(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:R.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(Et,{tone:R.inIndex?"positive":"negative",children:R.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:Ui(R.inspectedAt)})]},R.id))})]})})]}),F==="performance"&&u.jsx("div",{className:"mt-4",children:p.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:Yp[Js.Clicks]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Yp[Js.Impressions]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Yp[Js.CTR]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Yp[Js.Position]})]})}),u.jsx("tbody",{children:p.map((R,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:R.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:R.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(R.ctr)?R.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.averagePosition.toFixed(1)})]},B))})]})})})]})]})}function gNe({projectName:e}){const[t,n]=S.useState("google"),[r,i]=S.useState(!0),[a,o]=S.useState("idle"),[c,d]=S.useState(null),f=S.useRef(null),[p,m]=S.useState(!1),[y,v]=S.useState(null),[x,w]=S.useState(null),[j,k]=S.useState(!1),[A,_]=S.useState(null),[C,P]=S.useState(null),[T,O]=S.useState(0);async function z(B=!1){B||i(!0),d(null);try{const[U,M,V]=await Promise.all([Rj().catch(()=>null),_I(e).catch(()=>[]),AI(e).catch(()=>null)]),se=M.find(je=>je.connectionType==="gsc")??null;m(!!U?.google?.configured),k(!!U?.bing?.configured),v(se),_(V);const[ie,he]=await Promise.all([se?Mj(e).catch(()=>null):Promise.resolve(null),V?.connected?Dj(e).catch(()=>null):Promise.resolve(null)]);w(ie),P(he)}catch(U){d(U instanceof Error?U.message:"Failed to load search console overview")}finally{i(!1)}}async function I(){if(a!=="idle")return;f.current?.abort();const B=new AbortController;f.current=B;const U=B.signal;o("syncing"),d(null);const M=[];try{async function V(){if(!y)return;const je=await OI(e);if(!je?.id)return;const ee=2e3,Ce=Date.now()+12e4;for(;Date.now()<Ce;){if(U.aborted||(await new Promise(Ke=>setTimeout(Ke,ee)),U.aborted))return;const Y=await uu(je.id).catch(()=>null);if(!Y)break;if(["completed","failed","cancelled"].includes(Y.status)){Y.status!=="completed"&&M.push(`Google sync ${Y.status}`);break}}}const se=10;async function ie(){if(!A?.connected)return;const je=await EI(e).catch(()=>[]),ee=[...new Set(je.map(de=>de.url))];if(ee.length!==0)for(let de=0;de<ee.length;de+=se){if(U.aborted)return;const Ce=ee.slice(de,de+se),Ke=(await Promise.allSettled(Ce.map(Me=>TI(e,Me)))).filter(Me=>Me.status==="rejected").length;Ke>0&&M.push(`${Ke} Bing inspection(s) failed`)}}const he=await Promise.allSettled([V(),ie()]);for(const je of he)je.status==="rejected"&&M.push(je.reason instanceof Error?je.reason.message:"Sync failed");if(U.aborted)return;o("reloading"),await z(!0),O(je=>je+1),M.length>0&&d(`Partial refresh: ${M.join("; ")}`)}catch(V){U.aborted||d(V instanceof Error?V.message:"Refresh failed")}finally{U.aborted||o("idle")}}S.useEffect(()=>(z(),()=>{f.current?.abort()}),[e]);const F=y?"positive":p?"caution":"negative",$=y?"Connected":p?"Ready to connect":"Needs setup",L=x?`${x.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",J=x?`${x.summary.notIndexed} not indexed${x.summary.deindexed>0?` · ${x.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ae=x?.lastInspectedAt??y?.updatedAt??null,Q=A?.connected?"positive":j?"caution":"negative",K=A?.connected?"Connected":j?"Ready to connect":"Needs setup",X=C?`${C.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",ye=C?C.summary.notIndexed+(C.summary.unknown??0):0,Se=C?`${ye} not in index`:A?.connected?"Inspect URLs to populate coverage":j?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",R=C?.lastInspectedAt??A?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(We,{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(we,{type:"button",variant:"outline",size:"sm",disabled:r||a!=="idle",onClick:()=>{I()},children:r?"Loading…":a==="syncing"?"Refreshing Google & Bing…":a==="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(lP,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":$,tone:r?"neutral":F,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":J,updatedAt:ae,active:t==="google",onClick:()=>n("google")}),u.jsx(lP,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":K,tone:r?"neutral":Q,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:r?"Loading…":X,note:r?"Loading overview…":Se,updatedAt:R,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(([B,U])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===B,className:`project-subnav-link ${t===B?"project-subnav-link-active":""}`,onClick:()=>n(B),children:U},B))}),t==="google"&&u.jsx(cNe,{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(mNe,{projectName:e,refreshNonce:T})]})]})}function yNe({insights:e}){const{openEvidence:t}=Ou(),[n,r]=S.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&u.jsx(Yf,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),u.jsx(Et,{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})]}),o&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,d)=>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(u1,{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(Nf,{provider:c.provider})})]}),c.evidenceId&&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}-${d}`))})]},i.id)})})}function Lv({tab:e}){const{projectId:t}=Sy({from:"/projects/$projectId"}),n=yo(),{dashboard:r,isLoading:i,refetch:a}=Ul();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(ve=>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"})]},ve))}),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(ve=>u.jsx("div",{className:"skeleton-text-sm w-full"},ve))})]})]});const o=Kee(r,t),[c,d]=S.useState(!1),[f,p]=S.useState(!1),[m,y]=S.useState(!1),[v,x]=S.useState(""),[w,j]=S.useState(!1),[k,A]=S.useState(!1),[_,C]=S.useState(""),[P,T]=S.useState(!1),[O,z]=S.useState(!1),[I,F]=S.useState(""),[$,L]=S.useState(!1),[J,ae]=S.useState(void 0),[Q,K]=S.useState(!1),[X,ye]=S.useState(null),[Se,R]=S.useState(!1),B=o?.visibilityEvidence??[],U=o?.project.name??"",M=o?.project.displayName||o?.project.name||U,V=g8(),se=S.useMemo(()=>new Set(B.map(ve=>ve.location??"")),[B]),ie=se.has(""),he=S.useMemo(()=>[...se].filter(Boolean),[se]);S.useEffect(()=>{if(J===void 0||J===""||!U){ye(null),R(!1);return}R(!0),kI(U,J).then(ve=>{ye(ve),R(!1)}).catch(()=>{ye(null),R(!1)})},[J,U]);const je=S.useMemo(()=>{if(!X)return null;const ve=new Map;for(const Ve of X){for(const[be,ze]of Object.entries(Ve.providerRuns??{}))ve.set(`${Ve.keyword}::${be}`,ze.map(Re=>({runId:Re.runId,citationState:Re.citationState,createdAt:Re.createdAt,answerMentioned:Re.answerMentioned,visibilityState:Re.visibilityState,visibilityTransition:Re.visibilityTransition})));(!Ve.providerRuns||Object.keys(Ve.providerRuns).length===0)&&ve.set(`${Ve.keyword}::`,Ve.runs.map(be=>({runId:be.runId,citationState:be.citationState,createdAt:be.createdAt,answerMentioned:be.answerMentioned,visibilityState:be.visibilityState,visibilityTransition:be.visibilityTransition})))}return ve},[X]),ee=S.useMemo(()=>{const ve=J!==void 0?B.filter(Ve=>J===""?!Ve.location:Ve.location===J):B;return je?ve.map(Ve=>{const be=je.get(`${Ve.keyword}::${Ve.provider}`)??je.get(`${Ve.keyword}::`);return be?{...Ve,runHistory:be}:Ve}):ve},[B,J,je]);if(!o)return u.jsx("div",{className:"page-container",children:u.jsxs(We,{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(we,{asChild:!0,children:u.jsx(Wt,{to:"/",children:"Return to overview"})})]})});async function de(){try{await V.mutateAsync({projectName:U,projectLabel:M,sourceAction:"project-run"}),a()}catch{}}async function Ce(){p(!0);try{await CH(U),ft({title:"Project deleted",detail:`${M} was removed.`,tone:"positive",dedupeKey:`project:delete:${U}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(ve){console.error("Failed to delete project:",ve)}finally{p(!1)}}async function Y(){try{const ve=await _H(U),Ve=typeof ve=="string"?ve:JSON.stringify(ve,null,2),be=new Blob([Ve],{type:"text/yaml"}),ze=URL.createObjectURL(be),Re=document.createElement("a");Re.href=ze,Re.download=`${U}.yaml`,Re.click()}catch(ve){ft({title:"Export failed",detail:ve instanceof Error?ve.message:"Could not export project YAML.",tone:"negative"})}}async function Ke(){const ve=v.split(`
292
- `).map(Ve=>Ve.trim()).filter(Boolean);if(ve.length!==0){j(!0);try{await xH(U,ve),a(),x(""),y(!1)}finally{j(!1)}}}async function Me(){const ve=_.trim();if(ve){T(!0);try{const be=(await NI(U)).map(Re=>Re.domain),ze=[...new Set([...be,ve])];await CI(U,ze),a(),C(""),A(!1)}finally{T(!1)}}}async function rt(){const ve=I.trim();if(ve){L(!0);try{const Ve=o?.project.ownedDomains??[];await HE(U,[...Ve,ve]),a(),F(""),z(!1)}finally{L(!1)}}}async function it(ve){L(!0);try{const Ve=o?.project.ownedDomains??[];await HE(U,Ve.filter(be=>be!==ve)),a()}finally{L(!1)}}async function Nt(ve,Ve){await wH(ve,Ve),a()}const Lt=ve=>!Number.isNaN(Number.parseInt(ve,10)),bn=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${o.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(We,{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:o.project.displayName||o.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(we,{type:"button",variant:"destructive",disabled:f,onClick:Ce,children:f?"Deleting...":"Yes, delete project"}),u.jsx(we,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!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:o.project.displayName||o.project.name}),u.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!O&&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"})," "," · ",o.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:o.project.country}),u.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(ve=>u.jsx("span",{className:"tag",children:ve},ve))]}),((o.project.ownedDomains??[]).length>0||O)&&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"}),(o.project.ownedDomains??[]).map(ve=>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:[ve,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:$,onClick:()=>it(ve),"aria-label":`Remove ${ve}`,children:"×"})]},ve)),O?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:I,onChange:ve=>F(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&rt(),autoFocus:!0}),u.jsx(we,{type:"button",size:"sm",disabled:!I.trim()||$,onClick:rt,children:$?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),F("")},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:o.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:Y,"aria-label":"Export project as YAML",children:u.jsx(D7,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:u.jsx(lG,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(we,{type:"button",disabled:V.isPending,onClick:de,children:V.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:bn.map(ve=>u.jsx(Wt,{to:ve.href,className:`project-subnav-link ${ve.key===e?"project-subnav-link-active":""}`,"aria-current":ve.key===e?"page":void 0,children:ve.label},ve.key))}),e==="overview"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(o3,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:Lt(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Yn,{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:o.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",o.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapKeyPhrases.tone}`,style:{width:o.gapKeyPhrases.progress!==void 0?`${o.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:o.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:o.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Yn,{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:o.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-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Yn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.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:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),o.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(Yn,{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:o.providerScores.map(ve=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Nf,{provider:ve.provider}),ve.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:ve.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${ve.score>=70?"text-emerald-400":ve.score>=40?"text-amber-400":"text-rose-400"}`,children:[ve.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[ve.cited," of ",ve.total]})]},`${ve.provider}::${ve.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(yNe,{insights:o.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(o.visibilityEvidence.map(ve=>ve.keyword)).size," key phrases tracked"]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add key phrases"})]})]}),m&&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:ve=>x(ve.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(`
293
- `).filter(ve=>ve.trim()).length," key phrases"]}),u.jsx(we,{type:"button",size:"sm",disabled:!v.trim()||w,onClick:Ke,children:w?"Adding...":"Add key phrases"})]})]}),o.project.locations&&o.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 ${J===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":J===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),o.project.locations.map(ve=>se.has(ve.label)&&u.jsx("button",{className:`filter-chip ${J===ve.label?"filter-chip-active":""}`,type:"button","aria-pressed":J===ve.label,onClick:()=>{ae(ve.label),K(!1)},children:ve.label},ve.label)),ie&&u.jsx("button",{className:`filter-chip ${J===""?"filter-chip-active":""}`,type:"button","aria-pressed":J==="",onClick:()=>{ae(""),K(!1)},children:"No location"}),he.length>1&&J===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${Q?"filter-chip-active":""}`,type:"button","aria-pressed":Q,onClick:()=>K(ve=>!ve),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(Ioe,{evidence:ee})]}),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:[o.competitors.length," tracked"]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&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:_,onChange:ve=>C(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&Me()}),u.jsx(we,{type:"button",size:"sm",disabled:!_.trim()||P,onClick:Me,children:P?"Adding...":"Add"})]}),u.jsx(Loe,{competitors:o.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:o.recentRuns.map(ve=>u.jsx(s3,{run:ve},ve.id))})]}),u.jsx(uNe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Nt,onRefresh:()=>{a()}}),u.jsx(fNe,{projectName:o.project.name}),u.jsx(pNe,{projectName:o.project.name})]}):e==="analytics"?u.jsx(Fje,{projectName:o.project.name}):e==="traffic"?u.jsx(Zje,{projectName:o.project.name}):u.jsx(gNe,{projectName:o.project.name})]})}function vNe(){const{dashboard:e,isLoading:t}=Ul(),n=iNe();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(d=>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"})]},d))})]});const r=e.runs,[i,a]=S.useState("all"),o=i==="all"?r:r.filter(d=>d.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(we,{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(d=>u.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":ky(d)},d))}),u.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>u.jsx(s3,{run:d},d.id)):u.jsxs(We,{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 bNe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=S.useState(""),[c,d]=S.useState(""),[f,p]=S.useState(""),[m,y]=S.useState(""),[v,x]=S.useState(""),[w,j]=S.useState(""),[k,A]=S.useState(!1),[_,C]=S.useState(null),[P,T]=S.useState(!1),O=i?c.trim().length>0:a.trim().length>0;async function z(){if(O){A(!0),C(null),T(!1);try{const F=Q=>{const K=parseInt(Q.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},$={},L=F(m);L!==void 0&&($.maxConcurrency=L);const J=F(v);J!==void 0&&($.maxRequestsPerMinute=J);const ae=F(w);ae!==void 0&&($.maxRequestsPerDay=ae),await TH(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys($).length>0?{quota:$}:{}}),o(""),d(""),p(""),y(""),x(""),j(""),T(!0),ft({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){C(F instanceof Error?F.message:"Failed to update provider")}finally{A(!1)}}}const I=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:F=>d(F.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:a,onChange:F=>o(F.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:I,value:f,onChange:F=>p(F.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:m,onChange:F=>y(F.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:F=>x(F.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:w,onChange:F=>j(F.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&u.jsx("p",{className:"text-xs text-rose-400",children:_}),P&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!O||k,onClick:z,children:k?"Saving...":"Save"})]})}function xNe({onSaved:e}){const[t,n]=S.useState(""),[r,i]=S.useState(""),[a,o]=S.useState(!1),[c,d]=S.useState(null),[f,p]=S.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await PH({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),ft({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{o(!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}),f&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function wNe(){const[e,t]=S.useState(null),[n,r]=S.useState(null),[i,a]=S.useState(!1),[o,c]=S.useState("localhost"),[d,f]=S.useState("9222"),[p,m]=S.useState(!1);return S.useEffect(()=>{VE().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),u.jsxs(We,{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(Et,{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(we,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!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(),m(!0);try{await t7(o,parseInt(d,10)||9222);const v=await VE().catch(()=>null);v&&t(v),a(!1),ft({title:"CDP endpoint saved",detail:`${o}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!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:o,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:d,onChange:y=>f(y.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(we,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const SNe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function jNe(){const e=Xf(),{dashboard:t}=Ul(),n=t?.settings??e?.dashboard?.settings,a=Dy(!e,e?.health).data??e?.health??SNe,[o,c]=S.useState(null),[d,f]=S.useState(!1),[p,m]=S.useState(!1),[y,v]=S.useState(""),[x,w]=S.useState(!1),[j,k]=S.useState(null),[A,_]=S.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(C=>u.jsxs(We,{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:C.displayName??C.name})]}),u.jsx(Et,{tone:C.state==="ready"?"positive":"caution",children:C.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:C.model})]}),C.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:C.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>c(o===C.name?null:C.name),children:o===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===C.name&&u.jsx(bNe,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{c(null)}})]},C.name)),u.jsxs(We,{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(Et,{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(we,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&u.jsx(xNe,{onSaved:()=>{f(!1)}})]}),u.jsxs(We,{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(Et,{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(we,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&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:C=>v(C.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."]}),j&&u.jsx("p",{className:"text-xs text-rose-400",children:j}),A&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!y.trim()||x,onClick:async()=>{if(y.trim()){w(!0),k(null),_(!1);try{await o7(y.trim()),v(""),_(!0),m(!1),ft({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){k(C instanceof Error?C.message:"Failed to update Bing API key")}finally{w(!1)}}},children:x?"Saving...":"Save Bing API key"})]})]}),u.jsx(wNe,{}),u.jsxs(We,{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:a.apiStatus.detail})]}),u.jsx(Et,{tone:og(a.apiStatus),title:uo(a.apiStatus),children:a.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:a.workerStatus.detail})]}),u.jsx(Et,{tone:og(a.workerStatus),title:uo(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(We,{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(C=>u.jsx("li",{children:C},C))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const NNe=[{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 kNe({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,a=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"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 CNe(){const e=Xf(),{dashboard:t,isLoading:n,refetch:r}=Ul(),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(ue=>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"})]},ue))})]})]});const a=i.settings,d=Dy(!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=CG(i.setup,d,a),p=yo(),[m,y]=S.useState(0),[v,x]=S.useState(""),[w,j]=S.useState(""),[k,A]=S.useState(""),[_,C]=S.useState("US"),[P,T]=S.useState("en"),[O,z]=S.useState(null),[I,F]=S.useState(null),[$,L]=S.useState(null),[J,ae]=S.useState(!1),[Q,K]=S.useState(""),[X,ye]=S.useState(!1),[Se,R]=S.useState(null),[B,U]=S.useState(!1),M=a.providerStatuses.filter(ue=>ue.state==="ready"),[V,se]=S.useState(M[0]?.name??""),[ie,he]=S.useState(5),[je,ee]=S.useState(!1),[de,Ce]=S.useState(null),[Y,Ke]=S.useState(""),[Me,rt]=S.useState(!1),[it,Nt]=S.useState(null),[Lt,bn]=S.useState(!1),[ve,Ve]=S.useState(!1),[be,ze]=S.useState(!1),Re=g8(),_e=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),te=Q.split(`
294
- `).map(ue=>ue.trim()).filter(Boolean),xe=Y.split(`
295
- `).map(ue=>ue.trim()).filter(Boolean),Ae=f.healthChecks.some(ue=>ue.id==="api"&&ue.state==="ready"),Ge=async()=>{if(!(!_e||!k)){ae(!0),L(null);try{const ue=await Ny(_e,{displayName:w||v,canonicalDomain:k,country:_,language:P});z(_e),F(ue.id),ft({title:"Project created",detail:`${ue.displayName||ue.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ue.name}`,dedupeMode:"drop"}),r(),y(2)}catch(ue){L(ue instanceof Error?ue.message:"Failed to create project")}finally{ae(!1)}}},Je=async()=>{if(!O)return;const ue=te;if(ue.length!==0){U(!0),R(null);try{await bH(O,ue),ye(!0),r(),y(3)}catch(Mn){R(Mn instanceof Error?Mn.message:"Failed to save key phrases")}finally{U(!1)}}},tn=async()=>{if(!(!O||!V)){ee(!0),Ce(null);try{const ue=await $H(O,V,ie);if(ue.keywords.length>0){const Mn=Q?Q.trimEnd()+`
296
- `+ue.keywords.join(`
297
- `):ue.keywords.join(`
298
- `);K(Mn)}}catch(ue){Ce(ue instanceof Error?ue.message:"Failed to generate key phrases")}finally{ee(!1)}}},xn=async()=>{if(!O)return;const ue=xe;if(ue.length!==0){bn(!0),Nt(null);try{await CI(O,ue),rt(!0),r(),y(4)}catch(Mn){Nt(Mn instanceof Error?Mn.message:"Failed to save competitors")}finally{bn(!1)}}},Qe=async()=>{if(O){ze(!0);try{await Re.mutateAsync({projectName:O,projectLabel:w||v||O,sourceAction:"setup-launch"}),Ve(!0),r()}catch{}finally{ze(!1)}}},kt=()=>y(ue=>Math.max(0,ue-1)),$t=(()=>{switch(m){case 0:return u.jsxs(We,{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:f.healthChecks.map(ue=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:ue.label}),u.jsx("p",{className:"supporting-copy",children:ue.detail}),ue.id==="provider"&&ue.state!=="ready"&&u.jsx(Wt,{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(Et,{tone:ue.state==="ready"?"positive":"caution",title:ue.id==="api"?uo(d.apiStatus):ue.id==="worker"?uo(d.workerStatus):ue.detail,children:ue.state==="ready"?"Ready":"Attention"})]},ue.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(we,{type:"button",disabled:!Ae,onClick:()=>y(1),children:"Continue"})]})]});case 1:return u.jsxs(We,{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"})]}),O?u.jsx(Et,{tone:"positive",children:"Created"}):null]}),O?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:O})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{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:ue=>x(ue.target.value)}),_e&&_e!==v?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",_e]}):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:w,onChange:ue=>j(ue.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:k,onChange:ue=>A(ue.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:_,onChange:ue=>C(ue.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:P,onChange:ue=>T(ue.target.value.toLowerCase())})]})]}),$?u.jsx("p",{className:"text-rose-400 text-sm",children:$}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:!_e||!k||J,onClick:Ge,children:J?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(We,{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"})]}),X?u.jsxs(Et,{tone:"positive",children:[te.length," saved"]}):u.jsxs(Et,{tone:"neutral",children:[te.length," key phrase",te.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),X?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:te.map(ue=>u.jsx("li",{children:ue},ue))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[M.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:V,onChange:ue=>se(ue.target.value),children:M.map(ue=>u.jsxs("option",{value:ue.name,children:[ue.displayName??ue.name,ue.model?` (${ue.model})`:""]},ue.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:ue=>he(Number(ue.target.value)),children:[3,5,10,15,20].map(ue=>u.jsx("option",{value:ue,children:ue},ue))})]}),u.jsx(we,{type:"button",variant:"outline",disabled:je||!V,onClick:tn,children:je?"Analyzing site...":"Generate"})]}),de?u.jsx("p",{className:"text-rose-400 text-sm",children:de}):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
299
- best invisalign downtown brooklyn
300
- pediatric dentist brooklyn heights`,value:Q,onChange:ue=>K(ue.target.value)})]}),Se?u.jsx("p",{className:"text-rose-400 text-sm",children:Se}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:te.length===0||B,onClick:Je,children:B?"Saving...":`Save ${te.length} key phrase${te.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(We,{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"})]}),Me?u.jsx(Et,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Me?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:xe.map(ue=>u.jsx("li",{children:ue},ue))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{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
301
- competitor2.com`,value:Y,onChange:ue=>Ke(ue.target.value)})]}),it?u.jsx("p",{className:"text-rose-400 text-sm",children:it}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(we,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),u.jsx(we,{type:"button",disabled:xe.length===0||Lt,onClick:xn,children:Lt?"Saving...":`Save ${xe.length} competitor${xe.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(We,{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"})]}),ve?u.jsx(Et,{tone:"positive",children:"Queued"}):null]}),ve?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(we,{type:"button",onClick:()=>p({to:I?`/projects/${I}`:"/"}),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:O}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:be,onClick:Qe,children:be?"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(kNe,{current:m,labels:NNe}),u.jsx("section",{className:"setup-wizard",children:$t})]})}function _Ne(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(We,{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(we,{asChild:!0,children:u.jsx(Wt,{to:"/",children:"Return to overview"})})]})})})}function ONe(){return u.jsx(xse,{children:u.jsx(bse,{})})}const Hi=XK()({component:ONe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),ANe=_i({getParentRoute:()=>Hi,path:"/",component:jse,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Or.projects.all);if(t&&t.length===0)throw jj({to:"/setup"})}}),ENe=_i({getParentRoute:()=>Hi,path:"/projects",component:Moe}),Nh=_i({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>u.jsx(Pj,{})}),TNe=_i({getParentRoute:()=>Nh,path:"/",component:()=>u.jsx(Lv,{tab:"overview"})}),PNe=_i({getParentRoute:()=>Nh,path:"/search-console",component:()=>u.jsx(Lv,{tab:"search-console"})}),zNe=_i({getParentRoute:()=>Nh,path:"/analytics",component:()=>u.jsx(Lv,{tab:"analytics"})}),RNe=_i({getParentRoute:()=>Nh,path:"/traffic",component:()=>u.jsx(Lv,{tab:"traffic"})}),MNe=_i({getParentRoute:()=>Hi,path:"/runs",component:vNe}),DNe=_i({getParentRoute:()=>Hi,path:"/settings",component:jNe,beforeLoad:({context:e})=>{}}),INe=_i({getParentRoute:()=>Hi,path:"/setup",component:CNe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Or.projects.all);if(t&&t.length>0)throw jj({to:"/"})}}),LNe=_i({getParentRoute:()=>Hi,path:"*",component:_Ne}),$Ne=Hi.addChildren([ANe,ENe,Nh.addChildren([TNe,PNe,zNe,RNe]),MNe,DNe,INe,LNe]);function UNe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const ID=UNe(),BNe=ID==="/"?"":ID.replace(/\/$/,"");function FNe(e,t){return lH({routeTree:$Ne,basepath:BNe||"/",context:{queryClient:e},...t?.initialEntries})}const y8=w7(),qNe=FNe(y8),v8=document.getElementById("root");if(!v8)throw new Error("Expected #root element for web app bootstrap.");function KNe(){const[e,t]=S.useState(KE()?"ready":"checking"),[n,r]=S.useState(""),[i,a]=S.useState(""),[o,c]=S.useState(null),[d,f]=S.useState(!1);S.useEffect(()=>{if(KE())return;let y=!1;return OH().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 p=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}f(!0),c(null);try{if(!(await AH(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),t("ready")}catch(v){c(v instanceof is||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await EH(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(v){c(v instanceof is||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?u.jsx(sq,{client:y8,children:u.jsx(dH,{router:qNe})}):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(We,{className:"surface-card w-full",children:e==="checking"?u.jsx(Bm,{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(t1,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(n1,{children:"Create a dashboard password"}),u.jsx(r1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(Bm,{children:u.jsxs("form",{className:"space-y-4",onSubmit:p,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=>a(y.target.value),placeholder:"Re-enter password"})]}),o?u.jsx("p",{className:"text-sm text-rose-400",children:o}):null,u.jsx(we,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(t1,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(n1,{children:"Sign in to Canonry"}),u.jsx(r1,{children:"Enter your dashboard password to continue."})]}),u.jsx(Bm,{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:"Dashboard password"})]}),o?u.jsx("p",{className:"text-sm text-rose-400",children:o}):null,u.jsx(we,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}M9.createRoot(v8).render(u.jsx(S.StrictMode,{children:u.jsx(KNe,{})}));