@ainyc/canonry 1.48.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,282 +0,0 @@
1
- function yB(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eb={exports:{}},sd={};var bk;function bB(){if(bk)return sd;bk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return sd.Fragment=t,sd.jsx=n,sd.jsxs=n,sd}var xk;function xB(){return xk||(xk=1,eb.exports=bB()),eb.exports}var u=xB(),tb={exports:{}},Ge={};var wk;function wB(){if(wk)return Ge;wk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,N={};function C(D,G,ae){this.props=D,this.context=G,this.refs=N,this.updater=ae||S}C.prototype.isReactComponent={},C.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,G,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=C.prototype;function k(D,G,ae){this.props=D,this.context=G,this.refs=N,this.updater=ae||S}var O=k.prototype=new E;O.constructor=k,w(O,C.prototype),O.isPureReactComponent=!0;var T=Array.isArray;function z(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function R(D,G,ae){var Y=ae.ref;return{$$typeof:e,type:D,key:G,ref:Y!==void 0?Y:null,props:ae}}function B(D,G){return R(D.type,G,D.props)}function $(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function L(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ae){return G[ae]})}var re=/\/+/g;function ge(D,G){return typeof D=="object"&&D!==null&&D.key!=null?L(""+D.key):G.toString(36)}function be(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(z,z):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function H(D,G,ae,Y,ie){var oe=typeof D;(oe==="undefined"||oe==="boolean")&&(D=null);var ue=!1;if(D===null)ue=!0;else switch(oe){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(D.$$typeof){case e:case t:ue=!0;break;case p:return ue=D._init,H(ue(D._payload),G,ae,Y,ie)}}if(ue)return ie=ie(D),ue=Y===""?"."+ge(D,0):Y,T(ie)?(ae="",ue!=null&&(ae=ue.replace(re,"$&/")+"/"),H(ie,G,ae,"",function(le){return le})):ie!=null&&($(ie)&&(ie=B(ie,ae+(ie.key==null||D&&D.key===ie.key?"":(""+ie.key).replace(re,"$&/")+"/")+ue)),G.push(ie)),1;ue=0;var we=Y===""?".":Y+":";if(T(D))for(var W=0;W<D.length;W++)Y=D[W],oe=we+ge(Y,W),ue+=H(Y,G,ae,oe,ie);else if(W=y(D),typeof W=="function")for(D=W.call(D),W=0;!(Y=D.next()).done;)Y=Y.value,oe=we+ge(Y,W++),ue+=H(Y,G,ae,oe,ie);else if(oe==="object"){if(typeof D.then=="function")return H(be(D),G,ae,Y,ie);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ue}function ee(D,G,ae){if(D==null)return D;var Y=[],ie=0;return H(D,Y,"","",function(oe){return G.call(ae,oe,ie++)}),Y}function ye(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(ae){(D._status===0||D._status===-1)&&(D._status=1,D._result=ae)},function(ae){(D._status===0||D._status===-1)&&(D._status=2,D._result=ae)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var Se=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},q={map:ee,forEach:function(D,G,ae){ee(D,function(){G.apply(this,arguments)},ae)},count:function(D){var G=0;return ee(D,function(){G++}),G},toArray:function(D){return ee(D,function(G){return G})||[]},only:function(D){if(!$(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ge.Activity=g,Ge.Children=q,Ge.Component=C,Ge.Fragment=n,Ge.Profiler=i,Ge.PureComponent=k,Ge.StrictMode=r,Ge.Suspense=f,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(D){return A.H.useMemoCache(D)}},Ge.cache=function(D){return function(){return D.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(D,G,ae){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Y=w({},D.props),ie=D.key;if(G!=null)for(oe in G.key!==void 0&&(ie=""+G.key),G)!P.call(G,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&G.ref===void 0||(Y[oe]=G[oe]);var oe=arguments.length-2;if(oe===1)Y.children=ae;else if(1<oe){for(var ue=Array(oe),we=0;we<oe;we++)ue[we]=arguments[we+2];Y.children=ue}return R(D.type,ie,Y)},Ge.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},Ge.createElement=function(D,G,ae){var Y,ie={},oe=null;if(G!=null)for(Y in G.key!==void 0&&(oe=""+G.key),G)P.call(G,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ie[Y]=G[Y]);var ue=arguments.length-2;if(ue===1)ie.children=ae;else if(1<ue){for(var we=Array(ue),W=0;W<ue;W++)we[W]=arguments[W+2];ie.children=we}if(D&&D.defaultProps)for(Y in ue=D.defaultProps,ue)ie[Y]===void 0&&(ie[Y]=ue[Y]);return R(D,oe,ie)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(D){return{$$typeof:c,render:D}},Ge.isValidElement=$,Ge.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:ye}},Ge.memo=function(D,G){return{$$typeof:h,type:D,compare:G===void 0?null:G}},Ge.startTransition=function(D){var G=A.T,ae={};A.T=ae;try{var Y=D(),ie=A.S;ie!==null&&ie(ae,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(z,Se)}catch(oe){Se(oe)}finally{G!==null&&ae.types!==null&&(G.types=ae.types),A.T=G}},Ge.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ge.use=function(D){return A.H.use(D)},Ge.useActionState=function(D,G,ae){return A.H.useActionState(D,G,ae)},Ge.useCallback=function(D,G){return A.H.useCallback(D,G)},Ge.useContext=function(D){return A.H.useContext(D)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(D,G){return A.H.useDeferredValue(D,G)},Ge.useEffect=function(D,G){return A.H.useEffect(D,G)},Ge.useEffectEvent=function(D){return A.H.useEffectEvent(D)},Ge.useId=function(){return A.H.useId()},Ge.useImperativeHandle=function(D,G,ae){return A.H.useImperativeHandle(D,G,ae)},Ge.useInsertionEffect=function(D,G){return A.H.useInsertionEffect(D,G)},Ge.useLayoutEffect=function(D,G){return A.H.useLayoutEffect(D,G)},Ge.useMemo=function(D,G){return A.H.useMemo(D,G)},Ge.useOptimistic=function(D,G){return A.H.useOptimistic(D,G)},Ge.useReducer=function(D,G,ae){return A.H.useReducer(D,G,ae)},Ge.useRef=function(D){return A.H.useRef(D)},Ge.useState=function(D){return A.H.useState(D)},Ge.useSyncExternalStore=function(D,G,ae){return A.H.useSyncExternalStore(D,G,ae)},Ge.useTransition=function(){return A.H.useTransition()},Ge.version="19.2.4",Ge}var Sk;function Xc(){return Sk||(Sk=1,tb.exports=wB()),tb.exports}var x=Xc();const Oi=Gs(x),Og=yB({__proto__:null,default:Oi},[x]);var nb={exports:{}},od={},rb={exports:{}},ib={};var jk;function SB(){return jk||(jk=1,(function(e){function t(H,ee){var ye=H.length;H.push(ee);e:for(;0<ye;){var Se=ye-1>>>1,q=H[Se];if(0<i(q,ee))H[Se]=ee,H[ye]=q,ye=Se;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ee=H[0],ye=H.pop();if(ye!==ee){H[0]=ye;e:for(var Se=0,q=H.length,D=q>>>1;Se<D;){var G=2*(Se+1)-1,ae=H[G],Y=G+1,ie=H[Y];if(0>i(ae,ye))Y<q&&0>i(ie,ae)?(H[Se]=ie,H[Y]=ye,Se=Y):(H[Se]=ae,H[G]=ye,Se=G);else if(Y<q&&0>i(ie,ye))H[Se]=ie,H[Y]=ye,Se=Y;else break e}}return ee}function i(H,ee){var ye=H.sortIndex-ee.sortIndex;return ye!==0?ye:H.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,g=null,v=3,y=!1,S=!1,w=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function O(H){for(var ee=n(h);ee!==null;){if(ee.callback===null)r(h);else if(ee.startTime<=H)r(h),ee.sortIndex=ee.expirationTime,t(f,ee);else break;ee=n(h)}}function T(H){if(w=!1,O(H),!S)if(n(f)!==null)S=!0,z||(z=!0,L());else{var ee=n(h);ee!==null&&be(T,ee.startTime-H)}}var z=!1,A=-1,P=5,R=-1;function B(){return N?!0:!(e.unstable_now()-R<P)}function $(){if(N=!1,z){var H=e.unstable_now();R=H;var ee=!0;try{e:{S=!1,w&&(w=!1,E(A),A=-1),y=!0;var ye=v;try{t:{for(O(H),g=n(f);g!==null&&!(g.expirationTime>H&&B());){var Se=g.callback;if(typeof Se=="function"){g.callback=null,v=g.priorityLevel;var q=Se(g.expirationTime<=H);if(H=e.unstable_now(),typeof q=="function"){g.callback=q,O(H),ee=!0;break t}g===n(f)&&r(f),O(H)}else r(f);g=n(f)}if(g!==null)ee=!0;else{var D=n(h);D!==null&&be(T,D.startTime-H),ee=!1}}break e}finally{g=null,v=ye,y=!1}ee=void 0}}finally{ee?L():z=!1}}}var L;if(typeof k=="function")L=function(){k($)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ge=re.port2;re.port1.onmessage=$,L=function(){ge.postMessage(null)}}else L=function(){C($,0)};function be(H,ee){A=C(function(){H(e.unstable_now())},ee)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(H){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var ye=v;v=ee;try{return H()}finally{v=ye}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ye=v;v=H;try{return ee()}finally{v=ye}},e.unstable_scheduleCallback=function(H,ee,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,H){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=ye+q,H={id:p++,callback:ee,priorityLevel:H,startTime:ye,expirationTime:q,sortIndex:-1},ye>Se?(H.sortIndex=ye,t(h,H),n(f)===null&&H===n(h)&&(w?(E(A),A=-1):w=!0,be(T,ye-Se))):(H.sortIndex=q,t(f,H),S||y||(S=!0,z||(z=!0,L()))),H},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(H){var ee=v;return function(){var ye=v;v=ee;try{return H.apply(this,arguments)}finally{v=ye}}}})(ib)),ib}var Nk;function jB(){return Nk||(Nk=1,rb.exports=SB()),rb.exports}var ab={exports:{}},qn={};var Ck;function NB(){if(Ck)return qn;Ck=1;var e=Xc();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return qn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qn.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,p)},qn.flushSync=function(f){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=p,r.d.f()}},qn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},qn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},qn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},qn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},qn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},qn.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},qn.requestFormReset=function(f){r.d.r(f)},qn.unstable_batchedUpdates=function(f,h){return f(h)},qn.useFormState=function(f,h,p){return l.H.useFormState(f,h,p)},qn.useFormStatus=function(){return l.H.useHostTransitionStatus()},qn.version="19.2.4",qn}var Ok;function yM(){if(Ok)return ab.exports;Ok=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(),ab.exports=NB(),ab.exports}var _k;function CB(){if(_k)return od;_k=1;var e=jB(),t=Xc(),n=yM();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(s(a)!==a)throw Error(r(188))}function h(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,m=o;;){var b=d.return;if(b===null)break;var j=b.alternate;if(j===null){if(m=b.return,m!==null){d=m;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===d)return f(b),a;if(j===m)return f(b),o;j=j.sibling}throw Error(r(188))}if(d.return!==m.return)d=b,m=j;else{for(var _=!1,M=b.child;M;){if(M===d){_=!0,d=b,m=j;break}if(M===m){_=!0,m=b,d=j;break}M=M.sibling}if(!_){for(M=j.child;M;){if(M===d){_=!0,d=j,m=b;break}if(M===m){_=!0,m=j,d=b;break}M=M.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==m)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function p(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=p(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),k=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function L(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var re=Symbol.for("react.client.reference");function ge(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===re?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case T:return"Suspense";case z:return"SuspenseList";case R:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case S:return"Portal";case k:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case O:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return o=a.displayName||null,o!==null?o:ge(a.type)||"Memo";case P:o=a._payload,a=a._init;try{return ge(a(o))}catch{}}return null}var be=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Se=[],q=-1;function D(a){return{current:a}}function G(a){0>q||(a.current=Se[q],Se[q]=null,q--)}function ae(a,o){q++,Se[q]=a.current,a.current=o}var Y=D(null),ie=D(null),oe=D(null),ue=D(null);function we(a,o){switch(ae(oe,o),ae(ie,a),ae(Y,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?q_(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=q_(o),a=F_(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(Y),ae(Y,a)}function W(){G(Y),G(ie),G(oe)}function le(a){a.memoizedState!==null&&ae(ue,a);var o=Y.current,d=F_(o,a.type);o!==d&&(ae(ie,a),ae(Y,d))}function je(a){ie.current===a&&(G(Y),G(ie)),ue.current===a&&(G(ue),nd._currentValue=ye)}var V,Be;function ze(a){if(V===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);V=o&&o[1]||"",Be=-1<d.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+V+a+Be}var Je=!1;function et(a,o){if(!a||Je)return"";Je=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(o){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ne){var J=ne}Reflect.construct(a,[],he)}else{try{he.call()}catch(ne){J=ne}a.call(he.prototype)}}else{try{throw Error()}catch(ne){J=ne}(he=a())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=m.DetermineComponentFrameRoot(),_=j[0],M=j[1];if(_&&M){var U=_.split(`
4
- `),X=M.split(`
5
- `);for(b=m=0;m<U.length&&!U[m].includes("DetermineComponentFrameRoot");)m++;for(;b<X.length&&!X[b].includes("DetermineComponentFrameRoot");)b++;if(m===U.length||b===X.length)for(m=U.length-1,b=X.length-1;1<=m&&0<=b&&U[m]!==X[b];)b--;for(;1<=m&&0<=b;m--,b--)if(U[m]!==X[b]){if(m!==1||b!==1)do if(m--,b--,0>b||U[m]!==X[b]){var se=`
6
- `+U[m].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=m&&0<=b);break}}}finally{Je=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?ze(d):""}function Ot(a,o){switch(a.tag){case 26:case 27:case 5:return ze(a.type);case 16:return ze("Lazy");case 13:return a.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return et(a.type,!1);case 11:return et(a.type.render,!1);case 1:return et(a.type,!0);case 31:return ze("Activity");default:return""}}function It(a){try{var o="",d=null;do o+=Ot(a,d),d=a,a=a.return;while(a);return o}catch(m){return`
7
- Error generating stack: `+m.message+`
8
- `+m.stack}}var kn=Object.prototype.hasOwnProperty,pe=e.unstable_scheduleCallback,Fe=e.unstable_cancelCallback,me=e.unstable_shouldYield,Ee=e.unstable_requestPaint,Te=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,Ke=e.unstable_ImmediatePriority,_t=e.unstable_UserBlockingPriority,dt=e.unstable_NormalPriority,Bn=e.unstable_LowPriority,Yn=e.unstable_IdlePriority,pi=e.log,Mr=e.unstable_setDisableYieldValue,ot=null,Lt=null;function ln(a){if(typeof pi=="function"&&Mr(a),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(ot,a)}catch{}}var ce=Math.clz32?Math.clz32:to,mi=Math.log,vu=Math.LN2;function to(a){return a>>>=0,a===0?32:31-(mi(a)/vu|0)|0}var Va=256,no=262144,oa=4194304;function Rr(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ro(a,o,d){var m=a.pendingLanes;if(m===0)return 0;var b=0,j=a.suspendedLanes,_=a.pingedLanes;a=a.warmLanes;var M=m&134217727;return M!==0?(m=M&~j,m!==0?b=Rr(m):(_&=M,_!==0?b=Rr(_):d||(d=M&~a,d!==0&&(b=Rr(d))))):(M=m&~j,M!==0?b=Rr(M):_!==0?b=Rr(_):d||(d=m&~a,d!==0&&(b=Rr(d)))),b===0?0:o!==0&&o!==b&&(o&j)===0&&(j=b&-b,d=o&-o,j>=d||j===32&&(d&4194048)!==0)?o:b}function Za(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Gv(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function io(){var a=oa;return oa<<=1,(oa&62914560)===0&&(oa=4194304),a}function Nl(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function ao(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Bf(a,o,d,m,b,j){var _=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var M=a.entanglements,U=a.expirationTimes,X=a.hiddenUpdates;for(d=_&~d;0<d;){var se=31-ce(d),he=1<<se;M[se]=0,U[se]=-1;var J=X[se];if(J!==null)for(X[se]=null,se=0;se<J.length;se++){var ne=J[se];ne!==null&&(ne.lane&=-536870913)}d&=~he}m!==0&&qf(a,m,0),j!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=j&~(_&~o))}function qf(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var m=31-ce(o);a.entangledLanes|=o,a.entanglements[m]=a.entanglements[m]|1073741824|d&261930}function Ff(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var m=31-ce(d),b=1<<m;b&o|a[m]&o&&(a[m]|=o),d&=~b}}function Kf(a,o){var d=o&-o;return d=(d&42)!==0?1:yu(d),(d&(a.suspendedLanes|o))!==0?0:d}function yu(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Cl(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function F(){var a=ee.p;return a!==0?a:(a=window.event,a===void 0?32:fk(a.type))}function xe(a,o){var d=ee.p;try{return ee.p=a,o()}finally{ee.p=d}}var ut=Math.random().toString(36).slice(2),tt="__reactFiber$"+ut,yt="__reactProps$"+ut,xr="__reactContainer$"+ut,gi="__reactEvents$"+ut,Ya="__reactListeners$"+ut,sr="__reactHandles$"+ut,Hf="__reactResources$"+ut,Dr="__reactMarker$"+ut;function la(a){delete a[tt],delete a[yt],delete a[gi],delete a[Ya],delete a[sr]}function vi(a){var o=a[tt];if(o)return o;for(var d=a.parentNode;d;){if(o=d[xr]||d[tt]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=W_(a);a!==null;){if(d=a[tt])return d;a=W_(a)}return o}a=d,d=a.parentNode}return null}function ca(a){if(a=a[tt]||a[xr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function so(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function yi(a){var o=a[Hf];return o||(o=a[Hf]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Ht(a){a[Dr]=!0}var Gf=new Set,Vf={};function We(a,o){ft(a,o),ft(a+"Capture",o)}function ft(a,o){for(Vf[a]=o,a=0;a<o.length;a++)Gf.add(o[a])}var wr=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]*$"),bi={},oo={};function Zf(a){return kn.call(oo,a)?!0:kn.call(bi,a)?!1:wr.test(a)?oo[a]=!0:(bi[a]=!0,!1)}function Yf(a,o,d){if(Zf(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var m=o.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Wf(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function ua(a,o,d,m){if(m===null)a.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+m)}}function Ir(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function MN(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function dU(a,o,d){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,j=m.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(_){d=""+_,j.call(this,_)}}),Object.defineProperty(a,o,{enumerable:m.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Vv(a){if(!a._valueTracker){var o=MN(a)?"checked":"value";a._valueTracker=dU(a,o,""+a[o])}}function RN(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),m="";return a&&(m=MN(a)?a.checked?"true":"false":a.value),a=m,a!==d?(o.setValue(a),!0):!1}function Qf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var fU=/[\n"\\]/g;function Lr(a){return a.replace(fU,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Zv(a,o,d,m,b,j,_,M){a.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.type=_:a.removeAttribute("type"),o!=null?_==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Ir(o)):a.value!==""+Ir(o)&&(a.value=""+Ir(o)):_!=="submit"&&_!=="reset"||a.removeAttribute("value"),o!=null?Yv(a,_,Ir(o)):d!=null?Yv(a,_,Ir(d)):m!=null&&a.removeAttribute("value"),b==null&&j!=null&&(a.defaultChecked=!!j),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+Ir(M):a.removeAttribute("name")}function DN(a,o,d,m,b,j,_,M){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.type=j),o!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||o!=null)){Vv(a);return}d=d!=null?""+Ir(d):"",o=o!=null?""+Ir(o):d,M||o===a.value||(a.value=o),a.defaultValue=o}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=M?a.checked:!!m,a.defaultChecked=!!m,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(a.name=_),Vv(a)}function Yv(a,o,d){o==="number"&&Qf(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function Ol(a,o,d,m){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&m&&(a[d].defaultSelected=!0)}else{for(d=""+Ir(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function IN(a,o,d){if(o!=null&&(o=""+Ir(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Ir(d):""}function LN(a,o,d,m){if(o==null){if(m!=null){if(d!=null)throw Error(r(92));if(be(m)){if(1<m.length)throw Error(r(93));m=m[0]}d=m}d==null&&(d=""),o=d}d=Ir(o),a.defaultValue=d,m=a.textContent,m===d&&m!==""&&m!==null&&(a.value=m),Vv(a)}function _l(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var hU=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 $N(a,o,d){var m=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?m?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":m?a.setProperty(o,d):typeof d!="number"||d===0||hU.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function UN(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var m in d)!d.hasOwnProperty(m)||o!=null&&o.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in o)m=o[b],o.hasOwnProperty(b)&&d[b]!==m&&$N(a,b,m)}else for(var j in o)o.hasOwnProperty(j)&&$N(a,j,o[j])}function Wv(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pU=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"]]),mU=/^[\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 Xf(a){return mU.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function da(){}var Qv=null;function Xv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var kl=null,Al=null;function BN(a){var o=ca(a);if(o&&(a=o.stateNode)){var d=a[yt]||null;e:switch(a=o.stateNode,o.type){case"input":if(Zv(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Lr(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var m=d[o];if(m!==a&&m.form===a.form){var b=m[yt]||null;if(!b)throw Error(r(90));Zv(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)m=d[o],m.form===a.form&&RN(m)}break e;case"textarea":IN(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&Ol(a,!!d.multiple,o,!1)}}}var Jv=!1;function qN(a,o,d){if(Jv)return a(o,d);Jv=!0;try{var m=a(o);return m}finally{if(Jv=!1,(kl!==null||Al!==null)&&($h(),kl&&(o=kl,a=Al,Al=kl=null,BN(o),a)))for(o=0;o<a.length;o++)BN(a[o])}}function bu(a,o){var d=a.stateNode;if(d===null)return null;var m=d[yt]||null;if(m===null)return null;d=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var fa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ey=!1;if(fa)try{var xu={};Object.defineProperty(xu,"passive",{get:function(){ey=!0}}),window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{ey=!1}var Wa=null,ty=null,Jf=null;function FN(){if(Jf)return Jf;var a,o=ty,d=o.length,m,b="value"in Wa?Wa.value:Wa.textContent,j=b.length;for(a=0;a<d&&o[a]===b[a];a++);var _=d-a;for(m=1;m<=_&&o[d-m]===b[j-m];m++);return Jf=b.slice(a,1<m?1-m:void 0)}function eh(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function th(){return!0}function KN(){return!1}function or(a){function o(d,m,b,j,_){this._reactName=d,this._targetInst=b,this.type=m,this.nativeEvent=j,this.target=_,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(d=a[M],this[M]=d?d(j):j[M]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?th:KN,this.isPropagationStopped=KN,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=th)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=th)},persist:function(){},isPersistent:th}),o}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nh=or(lo),wu=g({},lo,{view:0,detail:0}),gU=or(wu),ny,ry,Su,rh=g({},wu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ay,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Su&&(Su&&a.type==="mousemove"?(ny=a.screenX-Su.screenX,ry=a.screenY-Su.screenY):ry=ny=0,Su=a),ny)},movementY:function(a){return"movementY"in a?a.movementY:ry}}),HN=or(rh),vU=g({},rh,{dataTransfer:0}),yU=or(vU),bU=g({},wu,{relatedTarget:0}),iy=or(bU),xU=g({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),wU=or(xU),SU=g({},lo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),jU=or(SU),NU=g({},lo,{data:0}),GN=or(NU),CU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OU={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"},_U={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kU(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=_U[a])?!!o[a]:!1}function ay(){return kU}var AU=g({},wu,{key:function(a){if(a.key){var o=CU[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=eh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?OU[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ay,charCode:function(a){return a.type==="keypress"?eh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?eh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),EU=or(AU),TU=g({},rh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),VN=or(TU),PU=g({},wu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ay}),zU=or(PU),MU=g({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),RU=or(MU),DU=g({},rh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),IU=or(DU),LU=g({},lo,{newState:0,oldState:0}),$U=or(LU),UU=[9,13,27,32],sy=fa&&"CompositionEvent"in window,ju=null;fa&&"documentMode"in document&&(ju=document.documentMode);var BU=fa&&"TextEvent"in window&&!ju,ZN=fa&&(!sy||ju&&8<ju&&11>=ju),YN=" ",WN=!1;function QN(a,o){switch(a){case"keyup":return UU.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XN(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var El=!1;function qU(a,o){switch(a){case"compositionend":return XN(o);case"keypress":return o.which!==32?null:(WN=!0,YN);case"textInput":return a=o.data,a===YN&&WN?null:a;default:return null}}function FU(a,o){if(El)return a==="compositionend"||!sy&&QN(a,o)?(a=FN(),Jf=ty=Wa=null,El=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ZN&&o.locale!=="ko"?null:o.data;default:return null}}var KU={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 JN(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!KU[a.type]:o==="textarea"}function eC(a,o,d,m){kl?Al?Al.push(m):Al=[m]:kl=m,o=Gh(o,"onChange"),0<o.length&&(d=new nh("onChange","change",null,d,m),a.push({event:d,listeners:o}))}var Nu=null,Cu=null;function HU(a){D_(a,0)}function ih(a){var o=so(a);if(RN(o))return a}function tC(a,o){if(a==="change")return o}var nC=!1;if(fa){var oy;if(fa){var ly="oninput"in document;if(!ly){var rC=document.createElement("div");rC.setAttribute("oninput","return;"),ly=typeof rC.oninput=="function"}oy=ly}else oy=!1;nC=oy&&(!document.documentMode||9<document.documentMode)}function iC(){Nu&&(Nu.detachEvent("onpropertychange",aC),Cu=Nu=null)}function aC(a){if(a.propertyName==="value"&&ih(Cu)){var o=[];eC(o,Cu,a,Xv(a)),qN(HU,o)}}function GU(a,o,d){a==="focusin"?(iC(),Nu=o,Cu=d,Nu.attachEvent("onpropertychange",aC)):a==="focusout"&&iC()}function VU(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ih(Cu)}function ZU(a,o){if(a==="click")return ih(o)}function YU(a,o){if(a==="input"||a==="change")return ih(o)}function WU(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Sr=typeof Object.is=="function"?Object.is:WU;function Ou(a,o){if(Sr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),m=Object.keys(o);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var b=d[m];if(!kn.call(o,b)||!Sr(a[b],o[b]))return!1}return!0}function sC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function oC(a,o){var d=sC(a);a=0;for(var m;d;){if(d.nodeType===3){if(m=a+d.textContent.length,a<=o&&m>=o)return{node:d,offset:o-a};a=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=sC(d)}}function lC(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?lC(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function cC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Qf(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Qf(a.document)}return o}function cy(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var QU=fa&&"documentMode"in document&&11>=document.documentMode,Tl=null,uy=null,_u=null,dy=!1;function uC(a,o,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;dy||Tl==null||Tl!==Qf(m)||(m=Tl,"selectionStart"in m&&cy(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),_u&&Ou(_u,m)||(_u=m,m=Gh(uy,"onSelect"),0<m.length&&(o=new nh("onSelect","select",null,o,d),a.push({event:o,listeners:m}),o.target=Tl)))}function co(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var Pl={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},fy={},dC={};fa&&(dC=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function uo(a){if(fy[a])return fy[a];if(!Pl[a])return a;var o=Pl[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in dC)return fy[a]=o[d];return a}var fC=uo("animationend"),hC=uo("animationiteration"),pC=uo("animationstart"),XU=uo("transitionrun"),JU=uo("transitionstart"),e6=uo("transitioncancel"),mC=uo("transitionend"),gC=new Map,hy="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(" ");hy.push("scrollEnd");function xi(a,o){gC.set(a,o),We(o,[a])}var ah=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},$r=[],zl=0,py=0;function sh(){for(var a=zl,o=py=zl=0;o<a;){var d=$r[o];$r[o++]=null;var m=$r[o];$r[o++]=null;var b=$r[o];$r[o++]=null;var j=$r[o];if($r[o++]=null,m!==null&&b!==null){var _=m.pending;_===null?b.next=b:(b.next=_.next,_.next=b),m.pending=b}j!==0&&vC(d,b,j)}}function oh(a,o,d,m){$r[zl++]=a,$r[zl++]=o,$r[zl++]=d,$r[zl++]=m,py|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function my(a,o,d,m){return oh(a,o,d,m),lh(a)}function fo(a,o){return oh(a,null,null,o),lh(a)}function vC(a,o,d){a.lanes|=d;var m=a.alternate;m!==null&&(m.lanes|=d);for(var b=!1,j=a.return;j!==null;)j.childLanes|=d,m=j.alternate,m!==null&&(m.childLanes|=d),j.tag===22&&(a=j.stateNode,a===null||a._visibility&1||(b=!0)),a=j,j=j.return;return a.tag===3?(j=a.stateNode,b&&o!==null&&(b=31-ce(d),a=j.hiddenUpdates,m=a[b],m===null?a[b]=[o]:m.push(o),o.lane=d|536870912),j):null}function lh(a){if(50<Yu)throw Yu=0,N0=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Ml={};function t6(a,o,d,m){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(a,o,d,m){return new t6(a,o,d,m)}function gy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ha(a,o){var d=a.alternate;return d===null?(d=jr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function yC(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function ch(a,o,d,m,b,j){var _=0;if(m=a,typeof a=="function")gy(a)&&(_=1);else if(typeof a=="string")_=sB(a,d,Y.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case R:return a=jr(31,d,o,b),a.elementType=R,a.lanes=j,a;case w:return ho(d.children,b,j,o);case N:_=8,b|=24;break;case C:return a=jr(12,d,o,b|2),a.elementType=C,a.lanes=j,a;case T:return a=jr(13,d,o,b),a.elementType=T,a.lanes=j,a;case z:return a=jr(19,d,o,b),a.elementType=z,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:_=10;break e;case E:_=9;break e;case O:_=11;break e;case A:_=14;break e;case P:_=16,m=null;break e}_=29,d=Error(r(130,a===null?"null":typeof a,"")),m=null}return o=jr(_,d,o,b),o.elementType=a,o.type=m,o.lanes=j,o}function ho(a,o,d,m){return a=jr(7,a,m,o),a.lanes=d,a}function vy(a,o,d){return a=jr(6,a,null,o),a.lanes=d,a}function bC(a){var o=jr(18,null,null,0);return o.stateNode=a,o}function yy(a,o,d){return o=jr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var xC=new WeakMap;function Ur(a,o){if(typeof a=="object"&&a!==null){var d=xC.get(a);return d!==void 0?d:(o={value:a,source:o,stack:It(o)},xC.set(a,o),o)}return{value:a,source:o,stack:It(o)}}var Rl=[],Dl=0,uh=null,ku=0,Br=[],qr=0,Qa=null,Li=1,$i="";function pa(a,o){Rl[Dl++]=ku,Rl[Dl++]=uh,uh=a,ku=o}function wC(a,o,d){Br[qr++]=Li,Br[qr++]=$i,Br[qr++]=Qa,Qa=a;var m=Li;a=$i;var b=32-ce(m)-1;m&=~(1<<b),d+=1;var j=32-ce(o)+b;if(30<j){var _=b-b%5;j=(m&(1<<_)-1).toString(32),m>>=_,b-=_,Li=1<<32-ce(o)+b|d<<b|m,$i=j+a}else Li=1<<j|d<<b|m,$i=a}function by(a){a.return!==null&&(pa(a,1),wC(a,1,0))}function xy(a){for(;a===uh;)uh=Rl[--Dl],Rl[Dl]=null,ku=Rl[--Dl],Rl[Dl]=null;for(;a===Qa;)Qa=Br[--qr],Br[qr]=null,$i=Br[--qr],Br[qr]=null,Li=Br[--qr],Br[qr]=null}function SC(a,o){Br[qr++]=Li,Br[qr++]=$i,Br[qr++]=Qa,Li=o.id,$i=o.overflow,Qa=a}var An=null,zt=null,lt=!1,Xa=null,Fr=!1,wy=Error(r(519));function Ja(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Au(Ur(o,a)),wy}function jC(a){var o=a.stateNode,d=a.type,m=a.memoizedProps;switch(o[tt]=a,o[yt]=m,d){case"dialog":rt("cancel",o),rt("close",o);break;case"iframe":case"object":case"embed":rt("load",o);break;case"video":case"audio":for(d=0;d<Qu.length;d++)rt(Qu[d],o);break;case"source":rt("error",o);break;case"img":case"image":case"link":rt("error",o),rt("load",o);break;case"details":rt("toggle",o);break;case"input":rt("invalid",o),DN(o,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":rt("invalid",o);break;case"textarea":rt("invalid",o),LN(o,m.value,m.defaultValue,m.children)}d=m.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||m.suppressHydrationWarning===!0||U_(o.textContent,d)?(m.popover!=null&&(rt("beforetoggle",o),rt("toggle",o)),m.onScroll!=null&&rt("scroll",o),m.onScrollEnd!=null&&rt("scrollend",o),m.onClick!=null&&(o.onclick=da),o=!0):o=!1,o||Ja(a,!0)}function NC(a){for(An=a.return;An;)switch(An.tag){case 5:case 31:case 13:Fr=!1;return;case 27:case 3:Fr=!0;return;default:An=An.return}}function Il(a){if(a!==An)return!1;if(!lt)return NC(a),lt=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||$0(a.type,a.memoizedProps)),d=!d),d&&zt&&Ja(a),NC(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));zt=Y_(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));zt=Y_(a)}else o===27?(o=zt,hs(a.type)?(a=K0,K0=null,zt=a):zt=o):zt=An?Hr(a.stateNode.nextSibling):null;return!0}function po(){zt=An=null,lt=!1}function Sy(){var a=Xa;return a!==null&&(dr===null?dr=a:dr.push.apply(dr,a),Xa=null),a}function Au(a){Xa===null?Xa=[a]:Xa.push(a)}var jy=D(null),mo=null,ma=null;function es(a,o,d){ae(jy,o._currentValue),o._currentValue=d}function ga(a){a._currentValue=jy.current,G(jy)}function Ny(a,o,d){for(;a!==null;){var m=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),a===d)break;a=a.return}}function Cy(a,o,d,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var j=b.dependencies;if(j!==null){var _=b.child;j=j.firstContext;e:for(;j!==null;){var M=j;j=b;for(var U=0;U<o.length;U++)if(M.context===o[U]){j.lanes|=d,M=j.alternate,M!==null&&(M.lanes|=d),Ny(j.return,d,a),m||(_=null);break e}j=M.next}}else if(b.tag===18){if(_=b.return,_===null)throw Error(r(341));_.lanes|=d,j=_.alternate,j!==null&&(j.lanes|=d),Ny(_,d,a),_=null}else _=b.child;if(_!==null)_.return=b;else for(_=b;_!==null;){if(_===a){_=null;break}if(b=_.sibling,b!==null){b.return=_.return,_=b;break}_=_.return}b=_}}function Ll(a,o,d,m){a=null;for(var b=o,j=!1;b!==null;){if(!j){if((b.flags&524288)!==0)j=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var _=b.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var M=b.type;Sr(b.pendingProps.value,_.value)||(a!==null?a.push(M):a=[M])}}else if(b===ue.current){if(_=b.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(nd):a=[nd])}b=b.return}a!==null&&Cy(o,a,d,m),o.flags|=262144}function dh(a){for(a=a.firstContext;a!==null;){if(!Sr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function go(a){mo=a,ma=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function En(a){return CC(mo,a)}function fh(a,o){return mo===null&&go(a),CC(a,o)}function CC(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},ma===null){if(a===null)throw Error(r(308));ma=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else ma=ma.next=o;return d}var n6=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,m){a.push(m)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},r6=e.unstable_scheduleCallback,i6=e.unstable_NormalPriority,cn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oy(){return{controller:new n6,data:new Map,refCount:0}}function Eu(a){a.refCount--,a.refCount===0&&r6(i6,function(){a.controller.abort()})}var Tu=null,_y=0,$l=0,Ul=null;function a6(a,o){if(Tu===null){var d=Tu=[];_y=0,$l=E0(),Ul={status:"pending",value:void 0,then:function(m){d.push(m)}}}return _y++,o.then(OC,OC),o}function OC(){if(--_y===0&&Tu!==null){Ul!==null&&(Ul.status="fulfilled");var a=Tu;Tu=null,$l=0,Ul=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function s6(a,o){var d=[],m={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){m.status="fulfilled",m.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(m.status="rejected",m.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),m}var _C=H.S;H.S=function(a,o){u_=Te(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&a6(a,o),_C!==null&&_C(a,o)};var vo=D(null);function ky(){var a=vo.current;return a!==null?a:kt.pooledCache}function hh(a,o){o===null?ae(vo,vo.current):ae(vo,o.pool)}function kC(){var a=ky();return a===null?null:{parent:cn._currentValue,pool:a}}var Bl=Error(r(460)),Ay=Error(r(474)),ph=Error(r(542)),mh={then:function(){}};function AC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function EC(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(da,da),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,PC(a),a;default:if(typeof o.status=="string")o.then(da,da);else{if(a=kt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(m){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=m}},function(m){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=m}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,PC(a),a}throw bo=o,Bl}}function yo(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(bo=d,Bl):d}}var bo=null;function TC(){if(bo===null)throw Error(r(459));var a=bo;return bo=null,a}function PC(a){if(a===Bl||a===ph)throw Error(r(483))}var ql=null,Pu=0;function gh(a){var o=Pu;return Pu+=1,ql===null&&(ql=[]),EC(ql,a,o)}function zu(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function vh(a,o){throw o.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function zC(a){function o(Z,K){if(a){var Q=Z.deletions;Q===null?(Z.deletions=[K],Z.flags|=16):Q.push(K)}}function d(Z,K){if(!a)return null;for(;K!==null;)o(Z,K),K=K.sibling;return null}function m(Z){for(var K=new Map;Z!==null;)Z.key!==null?K.set(Z.key,Z):K.set(Z.index,Z),Z=Z.sibling;return K}function b(Z,K){return Z=ha(Z,K),Z.index=0,Z.sibling=null,Z}function j(Z,K,Q){return Z.index=Q,a?(Q=Z.alternate,Q!==null?(Q=Q.index,Q<K?(Z.flags|=67108866,K):Q):(Z.flags|=67108866,K)):(Z.flags|=1048576,K)}function _(Z){return a&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,K,Q,de){return K===null||K.tag!==6?(K=vy(Q,Z.mode,de),K.return=Z,K):(K=b(K,Q),K.return=Z,K)}function U(Z,K,Q,de){var Ue=Q.type;return Ue===w?se(Z,K,Q.props.children,de,Q.key):K!==null&&(K.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===P&&yo(Ue)===K.type)?(K=b(K,Q.props),zu(K,Q),K.return=Z,K):(K=ch(Q.type,Q.key,Q.props,null,Z.mode,de),zu(K,Q),K.return=Z,K)}function X(Z,K,Q,de){return K===null||K.tag!==4||K.stateNode.containerInfo!==Q.containerInfo||K.stateNode.implementation!==Q.implementation?(K=yy(Q,Z.mode,de),K.return=Z,K):(K=b(K,Q.children||[]),K.return=Z,K)}function se(Z,K,Q,de,Ue){return K===null||K.tag!==7?(K=ho(Q,Z.mode,de,Ue),K.return=Z,K):(K=b(K,Q),K.return=Z,K)}function he(Z,K,Q){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=vy(""+K,Z.mode,Q),K.return=Z,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return Q=ch(K.type,K.key,K.props,null,Z.mode,Q),zu(Q,K),Q.return=Z,Q;case S:return K=yy(K,Z.mode,Q),K.return=Z,K;case P:return K=yo(K),he(Z,K,Q)}if(be(K)||L(K))return K=ho(K,Z.mode,Q,null),K.return=Z,K;if(typeof K.then=="function")return he(Z,gh(K),Q);if(K.$$typeof===k)return he(Z,fh(Z,K),Q);vh(Z,K)}return null}function J(Z,K,Q,de){var Ue=K!==null?K.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:M(Z,K,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return Q.key===Ue?U(Z,K,Q,de):null;case S:return Q.key===Ue?X(Z,K,Q,de):null;case P:return Q=yo(Q),J(Z,K,Q,de)}if(be(Q)||L(Q))return Ue!==null?null:se(Z,K,Q,de,null);if(typeof Q.then=="function")return J(Z,K,gh(Q),de);if(Q.$$typeof===k)return J(Z,K,fh(Z,Q),de);vh(Z,Q)}return null}function ne(Z,K,Q,de,Ue){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return Z=Z.get(Q)||null,M(K,Z,""+de,Ue);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case y:return Z=Z.get(de.key===null?Q:de.key)||null,U(K,Z,de,Ue);case S:return Z=Z.get(de.key===null?Q:de.key)||null,X(K,Z,de,Ue);case P:return de=yo(de),ne(Z,K,Q,de,Ue)}if(be(de)||L(de))return Z=Z.get(Q)||null,se(K,Z,de,Ue,null);if(typeof de.then=="function")return ne(Z,K,Q,gh(de),Ue);if(de.$$typeof===k)return ne(Z,K,Q,fh(K,de),Ue);vh(K,de)}return null}function Pe(Z,K,Q,de){for(var Ue=null,ht=null,Ie=K,Qe=K=0,st=null;Ie!==null&&Qe<Q.length;Qe++){Ie.index>Qe?(st=Ie,Ie=null):st=Ie.sibling;var pt=J(Z,Ie,Q[Qe],de);if(pt===null){Ie===null&&(Ie=st);break}a&&Ie&&pt.alternate===null&&o(Z,Ie),K=j(pt,K,Qe),ht===null?Ue=pt:ht.sibling=pt,ht=pt,Ie=st}if(Qe===Q.length)return d(Z,Ie),lt&&pa(Z,Qe),Ue;if(Ie===null){for(;Qe<Q.length;Qe++)Ie=he(Z,Q[Qe],de),Ie!==null&&(K=j(Ie,K,Qe),ht===null?Ue=Ie:ht.sibling=Ie,ht=Ie);return lt&&pa(Z,Qe),Ue}for(Ie=m(Ie);Qe<Q.length;Qe++)st=ne(Ie,Z,Qe,Q[Qe],de),st!==null&&(a&&st.alternate!==null&&Ie.delete(st.key===null?Qe:st.key),K=j(st,K,Qe),ht===null?Ue=st:ht.sibling=st,ht=st);return a&&Ie.forEach(function(ys){return o(Z,ys)}),lt&&pa(Z,Qe),Ue}function qe(Z,K,Q,de){if(Q==null)throw Error(r(151));for(var Ue=null,ht=null,Ie=K,Qe=K=0,st=null,pt=Q.next();Ie!==null&&!pt.done;Qe++,pt=Q.next()){Ie.index>Qe?(st=Ie,Ie=null):st=Ie.sibling;var ys=J(Z,Ie,pt.value,de);if(ys===null){Ie===null&&(Ie=st);break}a&&Ie&&ys.alternate===null&&o(Z,Ie),K=j(ys,K,Qe),ht===null?Ue=ys:ht.sibling=ys,ht=ys,Ie=st}if(pt.done)return d(Z,Ie),lt&&pa(Z,Qe),Ue;if(Ie===null){for(;!pt.done;Qe++,pt=Q.next())pt=he(Z,pt.value,de),pt!==null&&(K=j(pt,K,Qe),ht===null?Ue=pt:ht.sibling=pt,ht=pt);return lt&&pa(Z,Qe),Ue}for(Ie=m(Ie);!pt.done;Qe++,pt=Q.next())pt=ne(Ie,Z,Qe,pt.value,de),pt!==null&&(a&&pt.alternate!==null&&Ie.delete(pt.key===null?Qe:pt.key),K=j(pt,K,Qe),ht===null?Ue=pt:ht.sibling=pt,ht=pt);return a&&Ie.forEach(function(vB){return o(Z,vB)}),lt&&pa(Z,Qe),Ue}function Ct(Z,K,Q,de){if(typeof Q=="object"&&Q!==null&&Q.type===w&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:e:{for(var Ue=Q.key;K!==null;){if(K.key===Ue){if(Ue=Q.type,Ue===w){if(K.tag===7){d(Z,K.sibling),de=b(K,Q.props.children),de.return=Z,Z=de;break e}}else if(K.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===P&&yo(Ue)===K.type){d(Z,K.sibling),de=b(K,Q.props),zu(de,Q),de.return=Z,Z=de;break e}d(Z,K);break}else o(Z,K);K=K.sibling}Q.type===w?(de=ho(Q.props.children,Z.mode,de,Q.key),de.return=Z,Z=de):(de=ch(Q.type,Q.key,Q.props,null,Z.mode,de),zu(de,Q),de.return=Z,Z=de)}return _(Z);case S:e:{for(Ue=Q.key;K!==null;){if(K.key===Ue)if(K.tag===4&&K.stateNode.containerInfo===Q.containerInfo&&K.stateNode.implementation===Q.implementation){d(Z,K.sibling),de=b(K,Q.children||[]),de.return=Z,Z=de;break e}else{d(Z,K);break}else o(Z,K);K=K.sibling}de=yy(Q,Z.mode,de),de.return=Z,Z=de}return _(Z);case P:return Q=yo(Q),Ct(Z,K,Q,de)}if(be(Q))return Pe(Z,K,Q,de);if(L(Q)){if(Ue=L(Q),typeof Ue!="function")throw Error(r(150));return Q=Ue.call(Q),qe(Z,K,Q,de)}if(typeof Q.then=="function")return Ct(Z,K,gh(Q),de);if(Q.$$typeof===k)return Ct(Z,K,fh(Z,Q),de);vh(Z,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,K!==null&&K.tag===6?(d(Z,K.sibling),de=b(K,Q),de.return=Z,Z=de):(d(Z,K),de=vy(Q,Z.mode,de),de.return=Z,Z=de),_(Z)):d(Z,K)}return function(Z,K,Q,de){try{Pu=0;var Ue=Ct(Z,K,Q,de);return ql=null,Ue}catch(Ie){if(Ie===Bl||Ie===ph)throw Ie;var ht=jr(29,Ie,null,Z.mode);return ht.lanes=de,ht.return=Z,ht}}}var xo=zC(!0),MC=zC(!1),ts=!1;function Ey(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ty(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ns(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function rs(a,o,d){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(gt&2)!==0){var b=m.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),m.pending=o,o=lh(a),vC(a,null,d),o}return oh(a,m,o,d),lh(a)}function Mu(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Ff(a,d)}}function Py(a,o){var d=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=_:j=j.next=_,d=d.next}while(d!==null);j===null?b=j=o:j=j.next=o}else b=j=o;d={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:m.shared,callbacks:m.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var zy=!1;function Ru(){if(zy){var a=Ul;if(a!==null)throw a}}function Du(a,o,d,m){zy=!1;var b=a.updateQueue;ts=!1;var j=b.firstBaseUpdate,_=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var U=M,X=U.next;U.next=null,_===null?j=X:_.next=X,_=U;var se=a.alternate;se!==null&&(se=se.updateQueue,M=se.lastBaseUpdate,M!==_&&(M===null?se.firstBaseUpdate=X:M.next=X,se.lastBaseUpdate=U))}if(j!==null){var he=b.baseState;_=0,se=X=U=null,M=j;do{var J=M.lane&-536870913,ne=J!==M.lane;if(ne?(at&J)===J:(m&J)===J){J!==0&&J===$l&&(zy=!0),se!==null&&(se=se.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Pe=a,qe=M;J=o;var Ct=d;switch(qe.tag){case 1:if(Pe=qe.payload,typeof Pe=="function"){he=Pe.call(Ct,he,J);break e}he=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=qe.payload,J=typeof Pe=="function"?Pe.call(Ct,he,J):Pe,J==null)break e;he=g({},he,J);break e;case 2:ts=!0}}J=M.callback,J!==null&&(a.flags|=64,ne&&(a.flags|=8192),ne=b.callbacks,ne===null?b.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:M.tag,payload:M.payload,callback:M.callback,next:null},se===null?(X=se=ne,U=he):se=se.next=ne,_|=J;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;ne=M,M=ne.next,ne.next=null,b.lastBaseUpdate=ne,b.shared.pending=null}}while(!0);se===null&&(U=he),b.baseState=U,b.firstBaseUpdate=X,b.lastBaseUpdate=se,j===null&&(b.shared.lanes=0),ls|=_,a.lanes=_,a.memoizedState=he}}function RC(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function DC(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)RC(d[a],o)}var Fl=D(null),yh=D(0);function IC(a,o){a=Ca,ae(yh,a),ae(Fl,o),Ca=a|o.baseLanes}function My(){ae(yh,Ca),ae(Fl,Fl.current)}function Ry(){Ca=yh.current,G(Fl),G(yh)}var Nr=D(null),Kr=null;function is(a){var o=a.alternate;ae(nn,nn.current&1),ae(Nr,a),Kr===null&&(o===null||Fl.current!==null||o.memoizedState!==null)&&(Kr=a)}function Dy(a){ae(nn,nn.current),ae(Nr,a),Kr===null&&(Kr=a)}function LC(a){a.tag===22?(ae(nn,nn.current),ae(Nr,a),Kr===null&&(Kr=a)):as()}function as(){ae(nn,nn.current),ae(Nr,Nr.current)}function Cr(a){G(Nr),Kr===a&&(Kr=null),G(nn)}var nn=D(0);function bh(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||q0(d)||F0(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var va=0,Ze=null,jt=null,un=null,xh=!1,Kl=!1,wo=!1,wh=0,Iu=0,Hl=null,o6=0;function Qt(){throw Error(r(321))}function Iy(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!Sr(a[d],o[d]))return!1;return!0}function Ly(a,o,d,m,b,j){return va=j,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=a===null||a.memoizedState===null?wO:Jy,wo=!1,j=d(m,b),wo=!1,Kl&&(j=UC(o,d,m,b)),$C(a),j}function $C(a){H.H=Uu;var o=jt!==null&&jt.next!==null;if(va=0,un=jt=Ze=null,xh=!1,Iu=0,Hl=null,o)throw Error(r(300));a===null||dn||(a=a.dependencies,a!==null&&dh(a)&&(dn=!0))}function UC(a,o,d,m){Ze=a;var b=0;do{if(Kl&&(Hl=null),Iu=0,Kl=!1,25<=b)throw Error(r(301));if(b+=1,un=jt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}H.H=SO,j=o(d,m)}while(Kl);return j}function l6(){var a=H.H,o=a.useState()[0];return o=typeof o.then=="function"?Lu(o):o,a=a.useState()[0],(jt!==null?jt.memoizedState:null)!==a&&(Ze.flags|=1024),o}function $y(){var a=wh!==0;return wh=0,a}function Uy(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function By(a){if(xh){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}xh=!1}va=0,un=jt=Ze=null,Kl=!1,Iu=wh=0,Hl=null}function Wn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Ze.memoizedState=un=a:un=un.next=a,un}function rn(){if(jt===null){var a=Ze.alternate;a=a!==null?a.memoizedState:null}else a=jt.next;var o=un===null?Ze.memoizedState:un.next;if(o!==null)un=o,jt=a;else{if(a===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));jt=a,a={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},un===null?Ze.memoizedState=un=a:un=un.next=a}return un}function Sh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lu(a){var o=Iu;return Iu+=1,Hl===null&&(Hl=[]),a=EC(Hl,a,o),o=Ze,(un===null?o.memoizedState:un.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?wO:Jy),a}function jh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Lu(a);if(a.$$typeof===k)return En(a)}throw Error(r(438,String(a)))}function qy(a){var o=null,d=Ze.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var m=Ze.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(o={data:m.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=Sh(),Ze.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),m=0;m<a;m++)d[m]=B;return o.index++,d}function ya(a,o){return typeof o=="function"?o(a):o}function Nh(a){var o=rn();return Fy(o,jt,a)}function Fy(a,o,d){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=d;var b=a.baseQueue,j=m.pending;if(j!==null){if(b!==null){var _=b.next;b.next=j.next,j.next=_}o.baseQueue=b=j,m.pending=null}if(j=a.baseState,b===null)a.memoizedState=j;else{o=b.next;var M=_=null,U=null,X=o,se=!1;do{var he=X.lane&-536870913;if(he!==X.lane?(at&he)===he:(va&he)===he){var J=X.revertLane;if(J===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),he===$l&&(se=!0);else if((va&J)===J){X=X.next,J===$l&&(se=!0);continue}else he={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(M=U=he,_=j):U=U.next=he,Ze.lanes|=J,ls|=J;he=X.action,wo&&d(j,he),j=X.hasEagerState?X.eagerState:d(j,he)}else J={lane:he,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(M=U=J,_=j):U=U.next=J,Ze.lanes|=he,ls|=he;X=X.next}while(X!==null&&X!==o);if(U===null?_=j:U.next=M,!Sr(j,a.memoizedState)&&(dn=!0,se&&(d=Ul,d!==null)))throw d;a.memoizedState=j,a.baseState=_,a.baseQueue=U,m.lastRenderedState=j}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Ky(a){var o=rn(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var m=d.dispatch,b=d.pending,j=o.memoizedState;if(b!==null){d.pending=null;var _=b=b.next;do j=a(j,_.action),_=_.next;while(_!==b);Sr(j,o.memoizedState)||(dn=!0),o.memoizedState=j,o.baseQueue===null&&(o.baseState=j),d.lastRenderedState=j}return[j,m]}function BC(a,o,d){var m=Ze,b=rn(),j=lt;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=o();var _=!Sr((jt||b).memoizedState,d);if(_&&(b.memoizedState=d,dn=!0),b=b.queue,Vy(KC.bind(null,m,b,a),[a]),b.getSnapshot!==o||_||un!==null&&un.memoizedState.tag&1){if(m.flags|=2048,Gl(9,{destroy:void 0},FC.bind(null,m,b,d,o),null),kt===null)throw Error(r(349));j||(va&127)!==0||qC(m,o,d)}return d}function qC(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=Ze.updateQueue,o===null?(o=Sh(),Ze.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function FC(a,o,d,m){o.value=d,o.getSnapshot=m,HC(o)&&GC(a)}function KC(a,o,d){return d(function(){HC(o)&&GC(a)})}function HC(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!Sr(a,d)}catch{return!0}}function GC(a){var o=fo(a,2);o!==null&&fr(o,a,2)}function Hy(a){var o=Wn();if(typeof a=="function"){var d=a;if(a=d(),wo){ln(!0);try{d()}finally{ln(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:a},o}function VC(a,o,d,m){return a.baseState=d,Fy(a,jt,typeof m=="function"?m:ya)}function c6(a,o,d,m,b){if(_h(a))throw Error(r(485));if(a=o.action,a!==null){var j={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){j.listeners.push(_)}};H.T!==null?d(!0):j.isTransition=!1,m(j),d=o.pending,d===null?(j.next=o.pending=j,ZC(o,j)):(j.next=d.next,o.pending=d.next=j)}}function ZC(a,o){var d=o.action,m=o.payload,b=a.state;if(o.isTransition){var j=H.T,_={};H.T=_;try{var M=d(b,m),U=H.S;U!==null&&U(_,M),YC(a,o,M)}catch(X){Gy(a,o,X)}finally{j!==null&&_.types!==null&&(j.types=_.types),H.T=j}}else try{j=d(b,m),YC(a,o,j)}catch(X){Gy(a,o,X)}}function YC(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(m){WC(a,o,m)},function(m){return Gy(a,o,m)}):WC(a,o,d)}function WC(a,o,d){o.status="fulfilled",o.value=d,QC(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,ZC(a,d)))}function Gy(a,o,d){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do o.status="rejected",o.reason=d,QC(o),o=o.next;while(o!==m)}a.action=null}function QC(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function XC(a,o){return o}function JC(a,o){if(lt){var d=kt.formState;if(d!==null){e:{var m=Ze;if(lt){if(zt){t:{for(var b=zt,j=Fr;b.nodeType!==8;){if(!j){b=null;break t}if(b=Hr(b.nextSibling),b===null){b=null;break t}}j=b.data,b=j==="F!"||j==="F"?b:null}if(b){zt=Hr(b.nextSibling),m=b.data==="F!";break e}}Ja(m)}m=!1}m&&(o=d[0])}}return d=Wn(),d.memoizedState=d.baseState=o,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XC,lastRenderedState:o},d.queue=m,d=yO.bind(null,Ze,m),m.dispatch=d,m=Hy(!1),j=Xy.bind(null,Ze,!1,m.queue),m=Wn(),b={state:o,dispatch:null,action:a,pending:null},m.queue=b,d=c6.bind(null,Ze,b,j,d),b.dispatch=d,m.memoizedState=a,[o,d,!1]}function eO(a){var o=rn();return tO(o,jt,a)}function tO(a,o,d){if(o=Fy(a,o,XC)[0],a=Nh(ya)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var m=Lu(o)}catch(_){throw _===Bl?ph:_}else m=o;o=rn();var b=o.queue,j=b.dispatch;return d!==o.memoizedState&&(Ze.flags|=2048,Gl(9,{destroy:void 0},u6.bind(null,b,d),null)),[m,j,a]}function u6(a,o){a.action=o}function nO(a){var o=rn(),d=jt;if(d!==null)return tO(o,d,a);rn(),o=o.memoizedState,d=rn();var m=d.queue.dispatch;return d.memoizedState=a,[o,m,!1]}function Gl(a,o,d,m){return a={tag:a,create:d,deps:m,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=Sh(),Ze.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(m=d.next,d.next=a,a.next=m,o.lastEffect=a),a}function rO(){return rn().memoizedState}function Ch(a,o,d,m){var b=Wn();Ze.flags|=a,b.memoizedState=Gl(1|o,{destroy:void 0},d,m===void 0?null:m)}function Oh(a,o,d,m){var b=rn();m=m===void 0?null:m;var j=b.memoizedState.inst;jt!==null&&m!==null&&Iy(m,jt.memoizedState.deps)?b.memoizedState=Gl(o,j,d,m):(Ze.flags|=a,b.memoizedState=Gl(1|o,j,d,m))}function iO(a,o){Ch(8390656,8,a,o)}function Vy(a,o){Oh(2048,8,a,o)}function d6(a){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=Sh(),Ze.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function aO(a){var o=rn().memoizedState;return d6({ref:o,nextImpl:a}),function(){if((gt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function sO(a,o){return Oh(4,2,a,o)}function oO(a,o){return Oh(4,4,a,o)}function lO(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function cO(a,o,d){d=d!=null?d.concat([a]):null,Oh(4,4,lO.bind(null,o,a),d)}function Zy(){}function uO(a,o){var d=rn();o=o===void 0?null:o;var m=d.memoizedState;return o!==null&&Iy(o,m[1])?m[0]:(d.memoizedState=[a,o],a)}function dO(a,o){var d=rn();o=o===void 0?null:o;var m=d.memoizedState;if(o!==null&&Iy(o,m[1]))return m[0];if(m=a(),wo){ln(!0);try{a()}finally{ln(!1)}}return d.memoizedState=[m,o],m}function Yy(a,o,d){return d===void 0||(va&1073741824)!==0&&(at&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=f_(),Ze.lanes|=a,ls|=a,d)}function fO(a,o,d,m){return Sr(d,o)?d:Fl.current!==null?(a=Yy(a,d,m),Sr(a,o)||(dn=!0),a):(va&42)===0||(va&1073741824)!==0&&(at&261930)===0?(dn=!0,a.memoizedState=d):(a=f_(),Ze.lanes|=a,ls|=a,o)}function hO(a,o,d,m,b){var j=ee.p;ee.p=j!==0&&8>j?j:8;var _=H.T,M={};H.T=M,Xy(a,!1,o,d);try{var U=b(),X=H.S;if(X!==null&&X(M,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var se=s6(U,m);$u(a,o,se,kr(a))}else $u(a,o,m,kr(a))}catch(he){$u(a,o,{then:function(){},status:"rejected",reason:he},kr())}finally{ee.p=j,_!==null&&M.types!==null&&(_.types=M.types),H.T=_}}function f6(){}function Wy(a,o,d,m){if(a.tag!==5)throw Error(r(476));var b=pO(a).queue;hO(a,b,o,ye,d===null?f6:function(){return mO(a),d(m)})}function pO(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:ye},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function mO(a){var o=pO(a);o.next===null&&(o=a.alternate.memoizedState),$u(a,o.next.queue,{},kr())}function Qy(){return En(nd)}function gO(){return rn().memoizedState}function vO(){return rn().memoizedState}function h6(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=kr();a=ns(d);var m=rs(o,a,d);m!==null&&(fr(m,o,d),Mu(m,o,d)),o={cache:Oy()},a.payload=o;return}o=o.return}}function p6(a,o,d){var m=kr();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},_h(a)?bO(o,d):(d=my(a,o,d,m),d!==null&&(fr(d,a,m),xO(d,o,m)))}function yO(a,o,d){var m=kr();$u(a,o,d,m)}function $u(a,o,d,m){var b={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(_h(a))bO(o,b);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=o.lastRenderedReducer,j!==null))try{var _=o.lastRenderedState,M=j(_,d);if(b.hasEagerState=!0,b.eagerState=M,Sr(M,_))return oh(a,o,b,0),kt===null&&sh(),!1}catch{}if(d=my(a,o,b,m),d!==null)return fr(d,a,m),xO(d,o,m),!0}return!1}function Xy(a,o,d,m){if(m={lane:2,revertLane:E0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},_h(a)){if(o)throw Error(r(479))}else o=my(a,d,m,2),o!==null&&fr(o,a,2)}function _h(a){var o=a.alternate;return a===Ze||o!==null&&o===Ze}function bO(a,o){Kl=xh=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function xO(a,o,d){if((d&4194048)!==0){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Ff(a,d)}}var Uu={readContext:En,use:jh,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Uu.useEffectEvent=Qt;var wO={readContext:En,use:jh,useCallback:function(a,o){return Wn().memoizedState=[a,o===void 0?null:o],a},useContext:En,useEffect:iO,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,Ch(4194308,4,lO.bind(null,o,a),d)},useLayoutEffect:function(a,o){return Ch(4194308,4,a,o)},useInsertionEffect:function(a,o){Ch(4,2,a,o)},useMemo:function(a,o){var d=Wn();o=o===void 0?null:o;var m=a();if(wo){ln(!0);try{a()}finally{ln(!1)}}return d.memoizedState=[m,o],m},useReducer:function(a,o,d){var m=Wn();if(d!==void 0){var b=d(o);if(wo){ln(!0);try{d(o)}finally{ln(!1)}}}else b=o;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=p6.bind(null,Ze,a),[m.memoizedState,a]},useRef:function(a){var o=Wn();return a={current:a},o.memoizedState=a},useState:function(a){a=Hy(a);var o=a.queue,d=yO.bind(null,Ze,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:Zy,useDeferredValue:function(a,o){var d=Wn();return Yy(d,a,o)},useTransition:function(){var a=Hy(!1);return a=hO.bind(null,Ze,a.queue,!0,!1),Wn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var m=Ze,b=Wn();if(lt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),kt===null)throw Error(r(349));(at&127)!==0||qC(m,o,d)}b.memoizedState=d;var j={value:d,getSnapshot:o};return b.queue=j,iO(KC.bind(null,m,j,a),[a]),m.flags|=2048,Gl(9,{destroy:void 0},FC.bind(null,m,j,d,o),null),d},useId:function(){var a=Wn(),o=kt.identifierPrefix;if(lt){var d=$i,m=Li;d=(m&~(1<<32-ce(m)-1)).toString(32)+d,o="_"+o+"R_"+d,d=wh++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=o6++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Qy,useFormState:JC,useActionState:JC,useOptimistic:function(a){var o=Wn();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Xy.bind(null,Ze,!0,d),d.dispatch=o,[a,o]},useMemoCache:qy,useCacheRefresh:function(){return Wn().memoizedState=h6.bind(null,Ze)},useEffectEvent:function(a){var o=Wn(),d={impl:a};return o.memoizedState=d,function(){if((gt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Jy={readContext:En,use:jh,useCallback:uO,useContext:En,useEffect:Vy,useImperativeHandle:cO,useInsertionEffect:sO,useLayoutEffect:oO,useMemo:dO,useReducer:Nh,useRef:rO,useState:function(){return Nh(ya)},useDebugValue:Zy,useDeferredValue:function(a,o){var d=rn();return fO(d,jt.memoizedState,a,o)},useTransition:function(){var a=Nh(ya)[0],o=rn().memoizedState;return[typeof a=="boolean"?a:Lu(a),o]},useSyncExternalStore:BC,useId:gO,useHostTransitionStatus:Qy,useFormState:eO,useActionState:eO,useOptimistic:function(a,o){var d=rn();return VC(d,jt,a,o)},useMemoCache:qy,useCacheRefresh:vO};Jy.useEffectEvent=aO;var SO={readContext:En,use:jh,useCallback:uO,useContext:En,useEffect:Vy,useImperativeHandle:cO,useInsertionEffect:sO,useLayoutEffect:oO,useMemo:dO,useReducer:Ky,useRef:rO,useState:function(){return Ky(ya)},useDebugValue:Zy,useDeferredValue:function(a,o){var d=rn();return jt===null?Yy(d,a,o):fO(d,jt.memoizedState,a,o)},useTransition:function(){var a=Ky(ya)[0],o=rn().memoizedState;return[typeof a=="boolean"?a:Lu(a),o]},useSyncExternalStore:BC,useId:gO,useHostTransitionStatus:Qy,useFormState:nO,useActionState:nO,useOptimistic:function(a,o){var d=rn();return jt!==null?VC(d,jt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:qy,useCacheRefresh:vO};SO.useEffectEvent=aO;function e0(a,o,d,m){o=a.memoizedState,d=d(m,o),d=d==null?o:g({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var t0={enqueueSetState:function(a,o,d){a=a._reactInternals;var m=kr(),b=ns(m);b.payload=o,d!=null&&(b.callback=d),o=rs(a,b,m),o!==null&&(fr(o,a,m),Mu(o,a,m))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var m=kr(),b=ns(m);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=rs(a,b,m),o!==null&&(fr(o,a,m),Mu(o,a,m))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=kr(),m=ns(d);m.tag=2,o!=null&&(m.callback=o),o=rs(a,m,d),o!==null&&(fr(o,a,d),Mu(o,a,d))}};function jO(a,o,d,m,b,j,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,j,_):o.prototype&&o.prototype.isPureReactComponent?!Ou(d,m)||!Ou(b,j):!0}function NO(a,o,d,m){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,m),o.state!==a&&t0.enqueueReplaceState(o,o.state,null)}function So(a,o){var d=o;if("ref"in o){d={};for(var m in o)m!=="ref"&&(d[m]=o[m])}if(a=a.defaultProps){d===o&&(d=g({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function CO(a){ah(a)}function OO(a){console.error(a)}function _O(a){ah(a)}function kh(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(m){setTimeout(function(){throw m})}}function kO(a,o,d){try{var m=a.onCaughtError;m(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function n0(a,o,d){return d=ns(d),d.tag=3,d.payload={element:null},d.callback=function(){kh(a,o)},d}function AO(a){return a=ns(a),a.tag=3,a}function EO(a,o,d,m){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var j=m.value;a.payload=function(){return b(j)},a.callback=function(){kO(o,d,m)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(a.callback=function(){kO(o,d,m),typeof b!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var M=m.stack;this.componentDidCatch(m.value,{componentStack:M!==null?M:""})})}function m6(a,o,d,m,b){if(d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(o=d.alternate,o!==null&&Ll(o,d,b,!0),d=Nr.current,d!==null){switch(d.tag){case 31:case 13:return Kr===null?Uh():d.alternate===null&&Xt===0&&(Xt=3),d.flags&=-257,d.flags|=65536,d.lanes=b,m===mh?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([m]):o.add(m),_0(a,m,b)),!1;case 22:return d.flags|=65536,m===mh?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([m])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([m]):d.add(m)),_0(a,m,b)),!1}throw Error(r(435,d.tag))}return _0(a,m,b),Uh(),!1}if(lt)return o=Nr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,m!==wy&&(a=Error(r(422),{cause:m}),Au(Ur(a,d)))):(m!==wy&&(o=Error(r(423),{cause:m}),Au(Ur(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=Ur(m,d),b=n0(a.stateNode,m,b),Py(a,b),Xt!==4&&(Xt=2)),!1;var j=Error(r(520),{cause:m});if(j=Ur(j,d),Zu===null?Zu=[j]:Zu.push(j),Xt!==4&&(Xt=2),o===null)return!0;m=Ur(m,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=n0(d.stateNode,m,a),Py(d,a),!1;case 1:if(o=d.type,j=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(cs===null||!cs.has(j))))return d.flags|=65536,b&=-b,d.lanes|=b,b=AO(b),EO(b,a,d,m),Py(d,b),!1}d=d.return}while(d!==null);return!1}var r0=Error(r(461)),dn=!1;function Tn(a,o,d,m){o.child=a===null?MC(o,null,d,m):xo(o,a.child,d,m)}function TO(a,o,d,m,b){d=d.render;var j=o.ref;if("ref"in m){var _={};for(var M in m)M!=="ref"&&(_[M]=m[M])}else _=m;return go(o),m=Ly(a,o,d,_,j,b),M=$y(),a!==null&&!dn?(Uy(a,o,b),ba(a,o,b)):(lt&&M&&by(o),o.flags|=1,Tn(a,o,m,b),o.child)}function PO(a,o,d,m,b){if(a===null){var j=d.type;return typeof j=="function"&&!gy(j)&&j.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=j,zO(a,o,j,m,b)):(a=ch(d.type,null,m,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(j=a.child,!d0(a,b)){var _=j.memoizedProps;if(d=d.compare,d=d!==null?d:Ou,d(_,m)&&a.ref===o.ref)return ba(a,o,b)}return o.flags|=1,a=ha(j,m),a.ref=o.ref,a.return=o,o.child=a}function zO(a,o,d,m,b){if(a!==null){var j=a.memoizedProps;if(Ou(j,m)&&a.ref===o.ref)if(dn=!1,o.pendingProps=m=j,d0(a,b))(a.flags&131072)!==0&&(dn=!0);else return o.lanes=a.lanes,ba(a,o,b)}return i0(a,o,d,m,b)}function MO(a,o,d,m){var b=m.children,j=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((o.flags&128)!==0){if(j=j!==null?j.baseLanes|d:d,a!==null){for(m=o.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~j}else m=0,o.child=null;return RO(a,o,j,d,m)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&hh(o,j!==null?j.cachePool:null),j!==null?IC(o,j):My(),LC(o);else return m=o.lanes=536870912,RO(a,o,j!==null?j.baseLanes|d:d,d,m)}else j!==null?(hh(o,j.cachePool),IC(o,j),as(),o.memoizedState=null):(a!==null&&hh(o,null),My(),as());return Tn(a,o,b,d),o.child}function Bu(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function RO(a,o,d,m,b){var j=ky();return j=j===null?null:{parent:cn._currentValue,pool:j},o.memoizedState={baseLanes:d,cachePool:j},a!==null&&hh(o,null),My(),LC(o),a!==null&&Ll(a,o,m,!0),o.childLanes=b,null}function Ah(a,o){return o=Th({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function DO(a,o,d){return xo(o,a.child,null,d),a=Ah(o,o.pendingProps),a.flags|=2,Cr(o),o.memoizedState=null,a}function g6(a,o,d){var m=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(lt){if(m.mode==="hidden")return a=Ah(o,m),o.lanes=536870912,Bu(null,a);if(Dy(o),(a=zt)?(a=Z_(a,Fr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Li,overflow:$i}:null,retryLane:536870912,hydrationErrors:null},d=bC(a),d.return=o,o.child=d,An=o,zt=null)):a=null,a===null)throw Ja(o);return o.lanes=536870912,null}return Ah(o,m)}var j=a.memoizedState;if(j!==null){var _=j.dehydrated;if(Dy(o),b)if(o.flags&256)o.flags&=-257,o=DO(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(dn||Ll(a,o,d,!1),b=(d&a.childLanes)!==0,dn||b){if(m=kt,m!==null&&(_=Kf(m,d),_!==0&&_!==j.retryLane))throw j.retryLane=_,fo(a,_),fr(m,a,_),r0;Uh(),o=DO(a,o,d)}else a=j.treeContext,zt=Hr(_.nextSibling),An=o,lt=!0,Xa=null,Fr=!1,a!==null&&SC(o,a),o=Ah(o,m),o.flags|=4096;return o}return a=ha(a.child,{mode:m.mode,children:m.children}),a.ref=o.ref,o.child=a,a.return=o,a}function Eh(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function i0(a,o,d,m,b){return go(o),d=Ly(a,o,d,m,void 0,b),m=$y(),a!==null&&!dn?(Uy(a,o,b),ba(a,o,b)):(lt&&m&&by(o),o.flags|=1,Tn(a,o,d,b),o.child)}function IO(a,o,d,m,b,j){return go(o),o.updateQueue=null,d=UC(o,m,d,b),$C(a),m=$y(),a!==null&&!dn?(Uy(a,o,j),ba(a,o,j)):(lt&&m&&by(o),o.flags|=1,Tn(a,o,d,j),o.child)}function LO(a,o,d,m,b){if(go(o),o.stateNode===null){var j=Ml,_=d.contextType;typeof _=="object"&&_!==null&&(j=En(_)),j=new d(m,j),o.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=t0,o.stateNode=j,j._reactInternals=o,j=o.stateNode,j.props=m,j.state=o.memoizedState,j.refs={},Ey(o),_=d.contextType,j.context=typeof _=="object"&&_!==null?En(_):Ml,j.state=o.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(e0(o,d,_,m),j.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(_=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),_!==j.state&&t0.enqueueReplaceState(j,j.state,null),Du(o,m,j,b),Ru(),j.state=o.memoizedState),typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!0}else if(a===null){j=o.stateNode;var M=o.memoizedProps,U=So(d,M);j.props=U;var X=j.context,se=d.contextType;_=Ml,typeof se=="object"&&se!==null&&(_=En(se));var he=d.getDerivedStateFromProps;se=typeof he=="function"||typeof j.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,se||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(M||X!==_)&&NO(o,j,m,_),ts=!1;var J=o.memoizedState;j.state=J,Du(o,m,j,b),Ru(),X=o.memoizedState,M||J!==X||ts?(typeof he=="function"&&(e0(o,d,he,m),X=o.memoizedState),(U=ts||jO(o,d,U,m,J,X,_))?(se||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(o.flags|=4194308)):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=X),j.props=m,j.state=X,j.context=_,m=U):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{j=o.stateNode,Ty(a,o),_=o.memoizedProps,se=So(d,_),j.props=se,he=o.pendingProps,J=j.context,X=d.contextType,U=Ml,typeof X=="object"&&X!==null&&(U=En(X)),M=d.getDerivedStateFromProps,(X=typeof M=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(_!==he||J!==U)&&NO(o,j,m,U),ts=!1,J=o.memoizedState,j.state=J,Du(o,m,j,b),Ru();var ne=o.memoizedState;_!==he||J!==ne||ts||a!==null&&a.dependencies!==null&&dh(a.dependencies)?(typeof M=="function"&&(e0(o,d,M,m),ne=o.memoizedState),(se=ts||jO(o,d,se,m,J,ne,U)||a!==null&&a.dependencies!==null&&dh(a.dependencies))?(X||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(m,ne,U),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(m,ne,U)),typeof j.componentDidUpdate=="function"&&(o.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof j.componentDidUpdate!="function"||_===a.memoizedProps&&J===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&J===a.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=ne),j.props=m,j.state=ne,j.context=U,m=se):(typeof j.componentDidUpdate!="function"||_===a.memoizedProps&&J===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||_===a.memoizedProps&&J===a.memoizedState||(o.flags|=1024),m=!1)}return j=m,Eh(a,o),m=(o.flags&128)!==0,j||m?(j=o.stateNode,d=m&&typeof d.getDerivedStateFromError!="function"?null:j.render(),o.flags|=1,a!==null&&m?(o.child=xo(o,a.child,null,b),o.child=xo(o,null,d,b)):Tn(a,o,d,b),o.memoizedState=j.state,a=o.child):a=ba(a,o,b),a}function $O(a,o,d,m){return po(),o.flags|=256,Tn(a,o,d,m),o.child}var a0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function s0(a){return{baseLanes:a,cachePool:kC()}}function o0(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=_r),a}function UO(a,o,d){var m=o.pendingProps,b=!1,j=(o.flags&128)!==0,_;if((_=j)||(_=a!==null&&a.memoizedState===null?!1:(nn.current&2)!==0),_&&(b=!0,o.flags&=-129),_=(o.flags&32)!==0,o.flags&=-33,a===null){if(lt){if(b?is(o):as(),(a=zt)?(a=Z_(a,Fr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Li,overflow:$i}:null,retryLane:536870912,hydrationErrors:null},d=bC(a),d.return=o,o.child=d,An=o,zt=null)):a=null,a===null)throw Ja(o);return F0(a)?o.lanes=32:o.lanes=536870912,null}var M=m.children;return m=m.fallback,b?(as(),b=o.mode,M=Th({mode:"hidden",children:M},b),m=ho(m,b,d,null),M.return=o,m.return=o,M.sibling=m,o.child=M,m=o.child,m.memoizedState=s0(d),m.childLanes=o0(a,_,d),o.memoizedState=a0,Bu(null,m)):(is(o),l0(o,M))}var U=a.memoizedState;if(U!==null&&(M=U.dehydrated,M!==null)){if(j)o.flags&256?(is(o),o.flags&=-257,o=c0(a,o,d)):o.memoizedState!==null?(as(),o.child=a.child,o.flags|=128,o=null):(as(),M=m.fallback,b=o.mode,m=Th({mode:"visible",children:m.children},b),M=ho(M,b,d,null),M.flags|=2,m.return=o,M.return=o,m.sibling=M,o.child=m,xo(o,a.child,null,d),m=o.child,m.memoizedState=s0(d),m.childLanes=o0(a,_,d),o.memoizedState=a0,o=Bu(null,m));else if(is(o),F0(M)){if(_=M.nextSibling&&M.nextSibling.dataset,_)var X=_.dgst;_=X,m=Error(r(419)),m.stack="",m.digest=_,Au({value:m,source:null,stack:null}),o=c0(a,o,d)}else if(dn||Ll(a,o,d,!1),_=(d&a.childLanes)!==0,dn||_){if(_=kt,_!==null&&(m=Kf(_,d),m!==0&&m!==U.retryLane))throw U.retryLane=m,fo(a,m),fr(_,a,m),r0;q0(M)||Uh(),o=c0(a,o,d)}else q0(M)?(o.flags|=192,o.child=a.child,o=null):(a=U.treeContext,zt=Hr(M.nextSibling),An=o,lt=!0,Xa=null,Fr=!1,a!==null&&SC(o,a),o=l0(o,m.children),o.flags|=4096);return o}return b?(as(),M=m.fallback,b=o.mode,U=a.child,X=U.sibling,m=ha(U,{mode:"hidden",children:m.children}),m.subtreeFlags=U.subtreeFlags&65011712,X!==null?M=ha(X,M):(M=ho(M,b,d,null),M.flags|=2),M.return=o,m.return=o,m.sibling=M,o.child=m,Bu(null,m),m=o.child,M=a.child.memoizedState,M===null?M=s0(d):(b=M.cachePool,b!==null?(U=cn._currentValue,b=b.parent!==U?{parent:U,pool:U}:b):b=kC(),M={baseLanes:M.baseLanes|d,cachePool:b}),m.memoizedState=M,m.childLanes=o0(a,_,d),o.memoizedState=a0,Bu(a.child,m)):(is(o),d=a.child,a=d.sibling,d=ha(d,{mode:"visible",children:m.children}),d.return=o,d.sibling=null,a!==null&&(_=o.deletions,_===null?(o.deletions=[a],o.flags|=16):_.push(a)),o.child=d,o.memoizedState=null,d)}function l0(a,o){return o=Th({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Th(a,o){return a=jr(22,a,null,o),a.lanes=0,a}function c0(a,o,d){return xo(o,a.child,null,d),a=l0(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function BO(a,o,d){a.lanes|=o;var m=a.alternate;m!==null&&(m.lanes|=o),Ny(a.return,o,d)}function u0(a,o,d,m,b,j){var _=a.memoizedState;_===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:b,treeForkCount:j}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=d,_.tailMode=b,_.treeForkCount=j)}function qO(a,o,d){var m=o.pendingProps,b=m.revealOrder,j=m.tail;m=m.children;var _=nn.current,M=(_&2)!==0;if(M?(_=_&1|2,o.flags|=128):_&=1,ae(nn,_),Tn(a,o,m,d),m=lt?ku:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&BO(a,d,o);else if(a.tag===19)BO(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&bh(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),u0(o,!1,b,d,j,m);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&bh(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}u0(o,!0,d,null,j,m);break;case"together":u0(o,!1,null,null,void 0,m);break;default:o.memoizedState=null}return o.child}function ba(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),ls|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(Ll(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=ha(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=ha(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function d0(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&dh(a)))}function v6(a,o,d){switch(o.tag){case 3:we(o,o.stateNode.containerInfo),es(o,cn,a.memoizedState.cache),po();break;case 27:case 5:le(o);break;case 4:we(o,o.stateNode.containerInfo);break;case 10:es(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Dy(o),null;break;case 13:var m=o.memoizedState;if(m!==null)return m.dehydrated!==null?(is(o),o.flags|=128,null):(d&o.child.childLanes)!==0?UO(a,o,d):(is(o),a=ba(a,o,d),a!==null?a.sibling:null);is(o);break;case 19:var b=(a.flags&128)!==0;if(m=(d&o.childLanes)!==0,m||(Ll(a,o,d,!1),m=(d&o.childLanes)!==0),b){if(m)return qO(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ae(nn,nn.current),m)break;return null;case 22:return o.lanes=0,MO(a,o,d,o.pendingProps);case 24:es(o,cn,a.memoizedState.cache)}return ba(a,o,d)}function FO(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)dn=!0;else{if(!d0(a,d)&&(o.flags&128)===0)return dn=!1,v6(a,o,d);dn=(a.flags&131072)!==0}else dn=!1,lt&&(o.flags&1048576)!==0&&wC(o,ku,o.index);switch(o.lanes=0,o.tag){case 16:e:{var m=o.pendingProps;if(a=yo(o.elementType),o.type=a,typeof a=="function")gy(a)?(m=So(a,m),o.tag=1,o=LO(null,o,a,m,d)):(o.tag=0,o=i0(null,o,a,m,d));else{if(a!=null){var b=a.$$typeof;if(b===O){o.tag=11,o=TO(null,o,a,m,d);break e}else if(b===A){o.tag=14,o=PO(null,o,a,m,d);break e}}throw o=ge(a)||a,Error(r(306,o,""))}}return o;case 0:return i0(a,o,o.type,o.pendingProps,d);case 1:return m=o.type,b=So(m,o.pendingProps),LO(a,o,m,b,d);case 3:e:{if(we(o,o.stateNode.containerInfo),a===null)throw Error(r(387));m=o.pendingProps;var j=o.memoizedState;b=j.element,Ty(a,o),Du(o,m,null,d);var _=o.memoizedState;if(m=_.cache,es(o,cn,m),m!==j.cache&&Cy(o,[cn],d,!0),Ru(),m=_.element,j.isDehydrated)if(j={element:m,isDehydrated:!1,cache:_.cache},o.updateQueue.baseState=j,o.memoizedState=j,o.flags&256){o=$O(a,o,m,d);break e}else if(m!==b){b=Ur(Error(r(424)),o),Au(b),o=$O(a,o,m,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,zt=Hr(a.firstChild),An=o,lt=!0,Xa=null,Fr=!0,d=MC(o,null,m,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(po(),m===b){o=ba(a,o,d);break e}Tn(a,o,m,d)}o=o.child}return o;case 26:return Eh(a,o),a===null?(d=ek(o.type,null,o.pendingProps,null))?o.memoizedState=d:lt||(d=o.type,a=o.pendingProps,m=Vh(oe.current).createElement(d),m[tt]=o,m[yt]=a,Pn(m,d,a),Ht(m),o.stateNode=m):o.memoizedState=ek(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return le(o),a===null&&lt&&(m=o.stateNode=Q_(o.type,o.pendingProps,oe.current),An=o,Fr=!0,b=zt,hs(o.type)?(K0=b,zt=Hr(m.firstChild)):zt=b),Tn(a,o,o.pendingProps.children,d),Eh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&lt&&((b=m=zt)&&(m=V6(m,o.type,o.pendingProps,Fr),m!==null?(o.stateNode=m,An=o,zt=Hr(m.firstChild),Fr=!1,b=!0):b=!1),b||Ja(o)),le(o),b=o.type,j=o.pendingProps,_=a!==null?a.memoizedProps:null,m=j.children,$0(b,j)?m=null:_!==null&&$0(b,_)&&(o.flags|=32),o.memoizedState!==null&&(b=Ly(a,o,l6,null,null,d),nd._currentValue=b),Eh(a,o),Tn(a,o,m,d),o.child;case 6:return a===null&&lt&&((a=d=zt)&&(d=Z6(d,o.pendingProps,Fr),d!==null?(o.stateNode=d,An=o,zt=null,a=!0):a=!1),a||Ja(o)),null;case 13:return UO(a,o,d);case 4:return we(o,o.stateNode.containerInfo),m=o.pendingProps,a===null?o.child=xo(o,null,m,d):Tn(a,o,m,d),o.child;case 11:return TO(a,o,o.type,o.pendingProps,d);case 7:return Tn(a,o,o.pendingProps,d),o.child;case 8:return Tn(a,o,o.pendingProps.children,d),o.child;case 12:return Tn(a,o,o.pendingProps.children,d),o.child;case 10:return m=o.pendingProps,es(o,o.type,m.value),Tn(a,o,m.children,d),o.child;case 9:return b=o.type._context,m=o.pendingProps.children,go(o),b=En(b),m=m(b),o.flags|=1,Tn(a,o,m,d),o.child;case 14:return PO(a,o,o.type,o.pendingProps,d);case 15:return zO(a,o,o.type,o.pendingProps,d);case 19:return qO(a,o,d);case 31:return g6(a,o,d);case 22:return MO(a,o,d,o.pendingProps);case 24:return go(o),m=En(cn),a===null?(b=ky(),b===null&&(b=kt,j=Oy(),b.pooledCache=j,j.refCount++,j!==null&&(b.pooledCacheLanes|=d),b=j),o.memoizedState={parent:m,cache:b},Ey(o),es(o,cn,b)):((a.lanes&d)!==0&&(Ty(a,o),Du(o,null,null,d),Ru()),b=a.memoizedState,j=o.memoizedState,b.parent!==m?(b={parent:m,cache:m},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),es(o,cn,m)):(m=j.cache,es(o,cn,m),m!==b.cache&&Cy(o,[cn],d,!0))),Tn(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function xa(a){a.flags|=4}function f0(a,o,d,m,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(g_())a.flags|=8192;else throw bo=mh,Ay}else a.flags&=-16777217}function KO(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!ak(o))if(g_())a.flags|=8192;else throw bo=mh,Ay}function Ph(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?io():536870912,a.lanes|=o,Wl|=o)}function qu(a,o){if(!lt)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Mt(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,m=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=d,o}function y6(a,o,d){var m=o.pendingProps;switch(xy(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(o),null;case 1:return Mt(o),null;case 3:return d=o.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),o.memoizedState.cache!==m&&(o.flags|=2048),ga(cn),W(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Il(o)?xa(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Sy())),Mt(o),null;case 26:var b=o.type,j=o.memoizedState;return a===null?(xa(o),j!==null?(Mt(o),KO(o,j)):(Mt(o),f0(o,b,null,m,d))):j?j!==a.memoizedState?(xa(o),Mt(o),KO(o,j)):(Mt(o),o.flags&=-16777217):(a=a.memoizedProps,a!==m&&xa(o),Mt(o),f0(o,b,a,m,d)),null;case 27:if(je(o),d=oe.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&xa(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}a=Y.current,Il(o)?jC(o):(a=Q_(b,m,d),o.stateNode=a,xa(o))}return Mt(o),null;case 5:if(je(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&xa(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return Mt(o),null}if(j=Y.current,Il(o))jC(o);else{var _=Vh(oe.current);switch(j){case 1:j=_.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:j=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":j=_.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":j=_.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":j=_.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof m.is=="string"?_.createElement("select",{is:m.is}):_.createElement("select"),m.multiple?j.multiple=!0:m.size&&(j.size=m.size);break;default:j=typeof m.is=="string"?_.createElement(b,{is:m.is}):_.createElement(b)}}j[tt]=o,j[yt]=m;e:for(_=o.child;_!==null;){if(_.tag===5||_.tag===6)j.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===o)break e;for(;_.sibling===null;){if(_.return===null||_.return===o)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}o.stateNode=j;e:switch(Pn(j,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&xa(o)}}return Mt(o),f0(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==m&&xa(o);else{if(typeof m!="string"&&o.stateNode===null)throw Error(r(166));if(a=oe.current,Il(o)){if(a=o.stateNode,d=o.memoizedProps,m=null,b=An,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[tt]=o,a=!!(a.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||U_(a.nodeValue,d)),a||Ja(o,!0)}else a=Vh(a).createTextNode(m),a[tt]=o,o.stateNode=a}return Mt(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(m=Il(o),d!==null){if(a===null){if(!m)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[tt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),a=!1}else d=Sy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(Cr(o),o):(Cr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Mt(o),null;case 13:if(m=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Il(o),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[tt]=o}else po(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Mt(o),b=!1}else b=Sy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Cr(o),o):(Cr(o),null)}return Cr(o),(o.flags&128)!==0?(o.lanes=d,o):(d=m!==null,a=a!==null&&a.memoizedState!==null,d&&(m=o.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),j=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(j=m.memoizedState.cachePool.pool),j!==b&&(m.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),Ph(o,o.updateQueue),Mt(o),null);case 4:return W(),a===null&&M0(o.stateNode.containerInfo),Mt(o),null;case 10:return ga(o.type),Mt(o),null;case 19:if(G(nn),m=o.memoizedState,m===null)return Mt(o),null;if(b=(o.flags&128)!==0,j=m.rendering,j===null)if(b)qu(m,!1);else{if(Xt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(j=bh(a),j!==null){for(o.flags|=128,qu(m,!1),a=j.updateQueue,o.updateQueue=a,Ph(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)yC(d,a),d=d.sibling;return ae(nn,nn.current&1|2),lt&&pa(o,m.treeForkCount),o.child}a=a.sibling}m.tail!==null&&Te()>Ih&&(o.flags|=128,b=!0,qu(m,!1),o.lanes=4194304)}else{if(!b)if(a=bh(j),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,Ph(o,a),qu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!j.alternate&&!lt)return Mt(o),null}else 2*Te()-m.renderingStartTime>Ih&&d!==536870912&&(o.flags|=128,b=!0,qu(m,!1),o.lanes=4194304);m.isBackwards?(j.sibling=o.child,o.child=j):(a=m.last,a!==null?a.sibling=j:o.child=j,m.last=j)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Te(),a.sibling=null,d=nn.current,ae(nn,b?d&1|2:d&1),lt&&pa(o,m.treeForkCount),a):(Mt(o),null);case 22:case 23:return Cr(o),Ry(),m=o.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(o.flags|=8192):m&&(o.flags|=8192),m?(d&536870912)!==0&&(o.flags&128)===0&&(Mt(o),o.subtreeFlags&6&&(o.flags|=8192)):Mt(o),d=o.updateQueue,d!==null&&Ph(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==d&&(o.flags|=2048),a!==null&&G(vo),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),ga(cn),Mt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function b6(a,o){switch(xy(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return ga(cn),W(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return je(o),null;case 31:if(o.memoizedState!==null){if(Cr(o),o.alternate===null)throw Error(r(340));po()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Cr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));po()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return G(nn),null;case 4:return W(),null;case 10:return ga(o.type),null;case 22:case 23:return Cr(o),Ry(),a!==null&&G(vo),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return ga(cn),null;case 25:return null;default:return null}}function HO(a,o){switch(xy(o),o.tag){case 3:ga(cn),W();break;case 26:case 27:case 5:je(o);break;case 4:W();break;case 31:o.memoizedState!==null&&Cr(o);break;case 13:Cr(o);break;case 19:G(nn);break;case 10:ga(o.type);break;case 22:case 23:Cr(o),Ry(),a!==null&&G(vo);break;case 24:ga(cn)}}function Fu(a,o){try{var d=o.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var b=m.next;d=b;do{if((d.tag&a)===a){m=void 0;var j=d.create,_=d.inst;m=j(),_.destroy=m}d=d.next}while(d!==b)}}catch(M){xt(o,o.return,M)}}function ss(a,o,d){try{var m=o.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var j=b.next;m=j;do{if((m.tag&a)===a){var _=m.inst,M=_.destroy;if(M!==void 0){_.destroy=void 0,b=o;var U=d,X=M;try{X()}catch(se){xt(b,U,se)}}}m=m.next}while(m!==j)}}catch(se){xt(o,o.return,se)}}function GO(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{DC(o,d)}catch(m){xt(a,a.return,m)}}}function VO(a,o,d){d.props=So(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(m){xt(a,o,m)}}function Ku(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof d=="function"?a.refCleanup=d(m):d.current=m}}catch(b){xt(a,o,b)}}function Ui(a,o){var d=a.ref,m=a.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(b){xt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){xt(a,o,b)}else d.current=null}function ZO(a){var o=a.type,d=a.memoizedProps,m=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(b){xt(a,a.return,b)}}function h0(a,o,d){try{var m=a.stateNode;B6(m,a.type,d,o),m[yt]=o}catch(b){xt(a,a.return,b)}}function YO(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&hs(a.type)||a.tag===4}function p0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||YO(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&hs(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function m0(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=da));else if(m!==4&&(m===27&&hs(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(m0(a,o,d),a=a.sibling;a!==null;)m0(a,o,d),a=a.sibling}function zh(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(m!==4&&(m===27&&hs(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(zh(a,o,d),a=a.sibling;a!==null;)zh(a,o,d),a=a.sibling}function WO(a){var o=a.stateNode,d=a.memoizedProps;try{for(var m=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Pn(o,m,d),o[tt]=a,o[yt]=d}catch(j){xt(a,a.return,j)}}var wa=!1,fn=!1,g0=!1,QO=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function x6(a,o){if(a=a.containerInfo,I0=ep,a=cC(a),cy(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var b=m.anchorOffset,j=m.focusNode;m=m.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var _=0,M=-1,U=-1,X=0,se=0,he=a,J=null;t:for(;;){for(var ne;he!==d||b!==0&&he.nodeType!==3||(M=_+b),he!==j||m!==0&&he.nodeType!==3||(U=_+m),he.nodeType===3&&(_+=he.nodeValue.length),(ne=he.firstChild)!==null;)J=he,he=ne;for(;;){if(he===a)break t;if(J===d&&++X===b&&(M=_),J===j&&++se===m&&(U=_),(ne=he.nextSibling)!==null)break;he=J,J=he.parentNode}he=ne}d=M===-1||U===-1?null:{start:M,end:U}}else d=null}d=d||{start:0,end:0}}else d=null;for(L0={focusedElem:a,selectionRange:d},ep=!1,Sn=o;Sn!==null;)if(o=Sn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Sn=a;else for(;Sn!==null;){switch(o=Sn,j=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&j!==null){a=void 0,d=o,b=j.memoizedProps,j=j.memoizedState,m=d.stateNode;try{var Pe=So(d.type,b);a=m.getSnapshotBeforeUpdate(Pe,j),m.__reactInternalSnapshotBeforeUpdate=a}catch(qe){xt(d,d.return,qe)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)B0(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":B0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Sn=a;break}Sn=o.return}}function XO(a,o,d){var m=d.flags;switch(d.tag){case 0:case 11:case 15:ja(a,d),m&4&&Fu(5,d);break;case 1:if(ja(a,d),m&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(_){xt(d,d.return,_)}else{var b=So(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(_){xt(d,d.return,_)}}m&64&&GO(d),m&512&&Ku(d,d.return);break;case 3:if(ja(a,d),m&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{DC(a,o)}catch(_){xt(d,d.return,_)}}break;case 27:o===null&&m&4&&WO(d);case 26:case 5:ja(a,d),o===null&&m&4&&ZO(d),m&512&&Ku(d,d.return);break;case 12:ja(a,d);break;case 31:ja(a,d),m&4&&t_(a,d);break;case 13:ja(a,d),m&4&&n_(a,d),m&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=A6.bind(null,d),Y6(a,d))));break;case 22:if(m=d.memoizedState!==null||wa,!m){o=o!==null&&o.memoizedState!==null||fn,b=wa;var j=fn;wa=m,(fn=o)&&!j?Na(a,d,(d.subtreeFlags&8772)!==0):ja(a,d),wa=b,fn=j}break;case 30:break;default:ja(a,d)}}function JO(a){var o=a.alternate;o!==null&&(a.alternate=null,JO(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&la(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var $t=null,lr=!1;function Sa(a,o,d){for(d=d.child;d!==null;)e_(a,o,d),d=d.sibling}function e_(a,o,d){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(ot,d)}catch{}switch(d.tag){case 26:fn||Ui(d,o),Sa(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:fn||Ui(d,o);var m=$t,b=lr;hs(d.type)&&($t=d.stateNode,lr=!1),Sa(a,o,d),Ju(d.stateNode),$t=m,lr=b;break;case 5:fn||Ui(d,o);case 6:if(m=$t,b=lr,$t=null,Sa(a,o,d),$t=m,lr=b,$t!==null)if(lr)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(d.stateNode)}catch(j){xt(d,o,j)}else try{$t.removeChild(d.stateNode)}catch(j){xt(d,o,j)}break;case 18:$t!==null&&(lr?(a=$t,G_(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),ic(a)):G_($t,d.stateNode));break;case 4:m=$t,b=lr,$t=d.stateNode.containerInfo,lr=!0,Sa(a,o,d),$t=m,lr=b;break;case 0:case 11:case 14:case 15:ss(2,d,o),fn||ss(4,d,o),Sa(a,o,d);break;case 1:fn||(Ui(d,o),m=d.stateNode,typeof m.componentWillUnmount=="function"&&VO(d,o,m)),Sa(a,o,d);break;case 21:Sa(a,o,d);break;case 22:fn=(m=fn)||d.memoizedState!==null,Sa(a,o,d),fn=m;break;default:Sa(a,o,d)}}function t_(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ic(a)}catch(d){xt(o,o.return,d)}}}function n_(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ic(a)}catch(d){xt(o,o.return,d)}}function w6(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new QO),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new QO),o;default:throw Error(r(435,a.tag))}}function Mh(a,o){var d=w6(a);o.forEach(function(m){if(!d.has(m)){d.add(m);var b=E6.bind(null,a,m);m.then(b,b)}})}function cr(a,o){var d=o.deletions;if(d!==null)for(var m=0;m<d.length;m++){var b=d[m],j=a,_=o,M=_;e:for(;M!==null;){switch(M.tag){case 27:if(hs(M.type)){$t=M.stateNode,lr=!1;break e}break;case 5:$t=M.stateNode,lr=!1;break e;case 3:case 4:$t=M.stateNode.containerInfo,lr=!0;break e}M=M.return}if($t===null)throw Error(r(160));e_(j,_,b),$t=null,lr=!1,j=b.alternate,j!==null&&(j.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)r_(o,a),o=o.sibling}var wi=null;function r_(a,o){var d=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:cr(o,a),ur(a),m&4&&(ss(3,a,a.return),Fu(3,a),ss(5,a,a.return));break;case 1:cr(o,a),ur(a),m&512&&(fn||d===null||Ui(d,d.return)),m&64&&wa&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?m:d.concat(m))));break;case 26:var b=wi;if(cr(o,a),ur(a),m&512&&(fn||d===null||Ui(d,d.return)),m&4){var j=d!==null?d.memoizedState:null;if(m=a.memoizedState,d===null)if(m===null)if(a.stateNode===null){e:{m=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":j=b.getElementsByTagName("title")[0],(!j||j[Dr]||j[tt]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=b.createElement(m),b.head.insertBefore(j,b.querySelector("head > title"))),Pn(j,m,d),j[tt]=a,Ht(j),m=j;break e;case"link":var _=rk("link","href",b).get(m+(d.href||""));if(_){for(var M=0;M<_.length;M++)if(j=_[M],j.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&j.getAttribute("rel")===(d.rel==null?null:d.rel)&&j.getAttribute("title")===(d.title==null?null:d.title)&&j.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){_.splice(M,1);break t}}j=b.createElement(m),Pn(j,m,d),b.head.appendChild(j);break;case"meta":if(_=rk("meta","content",b).get(m+(d.content||""))){for(M=0;M<_.length;M++)if(j=_[M],j.getAttribute("content")===(d.content==null?null:""+d.content)&&j.getAttribute("name")===(d.name==null?null:d.name)&&j.getAttribute("property")===(d.property==null?null:d.property)&&j.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&j.getAttribute("charset")===(d.charSet==null?null:d.charSet)){_.splice(M,1);break t}}j=b.createElement(m),Pn(j,m,d),b.head.appendChild(j);break;default:throw Error(r(468,m))}j[tt]=a,Ht(j),m=j}a.stateNode=m}else ik(b,a.type,a.stateNode);else a.stateNode=nk(b,m,a.memoizedProps);else j!==m?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,m===null?ik(b,a.type,a.stateNode):nk(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&h0(a,a.memoizedProps,d.memoizedProps)}break;case 27:cr(o,a),ur(a),m&512&&(fn||d===null||Ui(d,d.return)),d!==null&&m&4&&h0(a,a.memoizedProps,d.memoizedProps);break;case 5:if(cr(o,a),ur(a),m&512&&(fn||d===null||Ui(d,d.return)),a.flags&32){b=a.stateNode;try{_l(b,"")}catch(Pe){xt(a,a.return,Pe)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,h0(a,b,d!==null?d.memoizedProps:b)),m&1024&&(g0=!0);break;case 6:if(cr(o,a),ur(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,d=a.stateNode;try{d.nodeValue=m}catch(Pe){xt(a,a.return,Pe)}}break;case 3:if(Wh=null,b=wi,wi=Zh(o.containerInfo),cr(o,a),wi=b,ur(a),m&4&&d!==null&&d.memoizedState.isDehydrated)try{ic(o.containerInfo)}catch(Pe){xt(a,a.return,Pe)}g0&&(g0=!1,i_(a));break;case 4:m=wi,wi=Zh(a.stateNode.containerInfo),cr(o,a),ur(a),wi=m;break;case 12:cr(o,a),ur(a);break;case 31:cr(o,a),ur(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Mh(a,m)));break;case 13:cr(o,a),ur(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Dh=Te()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Mh(a,m)));break;case 22:b=a.memoizedState!==null;var U=d!==null&&d.memoizedState!==null,X=wa,se=fn;if(wa=X||b,fn=se||U,cr(o,a),fn=se,wa=X,ur(a),m&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||U||wa||fn||jo(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){U=d=o;try{if(j=U.stateNode,b)_=j.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{M=U.stateNode;var he=U.memoizedProps.style,J=he!=null&&he.hasOwnProperty("display")?he.display:null;M.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Pe){xt(U,U.return,Pe)}}}else if(o.tag===6){if(d===null){U=o;try{U.stateNode.nodeValue=b?"":U.memoizedProps}catch(Pe){xt(U,U.return,Pe)}}}else if(o.tag===18){if(d===null){U=o;try{var ne=U.stateNode;b?V_(ne,!0):V_(U.stateNode,!1)}catch(Pe){xt(U,U.return,Pe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}m&4&&(m=a.updateQueue,m!==null&&(d=m.retryQueue,d!==null&&(m.retryQueue=null,Mh(a,d))));break;case 19:cr(o,a),ur(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Mh(a,m)));break;case 30:break;case 21:break;default:cr(o,a),ur(a)}}function ur(a){var o=a.flags;if(o&2){try{for(var d,m=a.return;m!==null;){if(YO(m)){d=m;break}m=m.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,j=p0(a);zh(a,j,b);break;case 5:var _=d.stateNode;d.flags&32&&(_l(_,""),d.flags&=-33);var M=p0(a);zh(a,M,_);break;case 3:case 4:var U=d.stateNode.containerInfo,X=p0(a);m0(a,X,U);break;default:throw Error(r(161))}}catch(se){xt(a,a.return,se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function i_(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;i_(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function ja(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)XO(a,o.alternate,o),o=o.sibling}function jo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:ss(4,o,o.return),jo(o);break;case 1:Ui(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&VO(o,o.return,d),jo(o);break;case 27:Ju(o.stateNode);case 26:case 5:Ui(o,o.return),jo(o);break;case 22:o.memoizedState===null&&jo(o);break;case 30:jo(o);break;default:jo(o)}a=a.sibling}}function Na(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var m=o.alternate,b=a,j=o,_=j.flags;switch(j.tag){case 0:case 11:case 15:Na(b,j,d),Fu(4,j);break;case 1:if(Na(b,j,d),m=j,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(X){xt(m,m.return,X)}if(m=j,b=m.updateQueue,b!==null){var M=m.stateNode;try{var U=b.shared.hiddenCallbacks;if(U!==null)for(b.shared.hiddenCallbacks=null,b=0;b<U.length;b++)RC(U[b],M)}catch(X){xt(m,m.return,X)}}d&&_&64&&GO(j),Ku(j,j.return);break;case 27:WO(j);case 26:case 5:Na(b,j,d),d&&m===null&&_&4&&ZO(j),Ku(j,j.return);break;case 12:Na(b,j,d);break;case 31:Na(b,j,d),d&&_&4&&t_(b,j);break;case 13:Na(b,j,d),d&&_&4&&n_(b,j);break;case 22:j.memoizedState===null&&Na(b,j,d),Ku(j,j.return);break;case 30:break;default:Na(b,j,d)}o=o.sibling}}function v0(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&Eu(d))}function y0(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Eu(a))}function Si(a,o,d,m){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)a_(a,o,d,m),o=o.sibling}function a_(a,o,d,m){var b=o.flags;switch(o.tag){case 0:case 11:case 15:Si(a,o,d,m),b&2048&&Fu(9,o);break;case 1:Si(a,o,d,m);break;case 3:Si(a,o,d,m),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Eu(a)));break;case 12:if(b&2048){Si(a,o,d,m),a=o.stateNode;try{var j=o.memoizedProps,_=j.id,M=j.onPostCommit;typeof M=="function"&&M(_,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(U){xt(o,o.return,U)}}else Si(a,o,d,m);break;case 31:Si(a,o,d,m);break;case 13:Si(a,o,d,m);break;case 23:break;case 22:j=o.stateNode,_=o.alternate,o.memoizedState!==null?j._visibility&2?Si(a,o,d,m):Hu(a,o):j._visibility&2?Si(a,o,d,m):(j._visibility|=2,Vl(a,o,d,m,(o.subtreeFlags&10256)!==0||!1)),b&2048&&v0(_,o);break;case 24:Si(a,o,d,m),b&2048&&y0(o.alternate,o);break;default:Si(a,o,d,m)}}function Vl(a,o,d,m,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var j=a,_=o,M=d,U=m,X=_.flags;switch(_.tag){case 0:case 11:case 15:Vl(j,_,M,U,b),Fu(8,_);break;case 23:break;case 22:var se=_.stateNode;_.memoizedState!==null?se._visibility&2?Vl(j,_,M,U,b):Hu(j,_):(se._visibility|=2,Vl(j,_,M,U,b)),b&&X&2048&&v0(_.alternate,_);break;case 24:Vl(j,_,M,U,b),b&&X&2048&&y0(_.alternate,_);break;default:Vl(j,_,M,U,b)}o=o.sibling}}function Hu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,m=o,b=m.flags;switch(m.tag){case 22:Hu(d,m),b&2048&&v0(m.alternate,m);break;case 24:Hu(d,m),b&2048&&y0(m.alternate,m);break;default:Hu(d,m)}o=o.sibling}}var Gu=8192;function Zl(a,o,d){if(a.subtreeFlags&Gu)for(a=a.child;a!==null;)s_(a,o,d),a=a.sibling}function s_(a,o,d){switch(a.tag){case 26:Zl(a,o,d),a.flags&Gu&&a.memoizedState!==null&&oB(d,wi,a.memoizedState,a.memoizedProps);break;case 5:Zl(a,o,d);break;case 3:case 4:var m=wi;wi=Zh(a.stateNode.containerInfo),Zl(a,o,d),wi=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Gu,Gu=16777216,Zl(a,o,d),Gu=m):Zl(a,o,d));break;default:Zl(a,o,d)}}function o_(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Vu(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];Sn=m,c_(m,a)}o_(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)l_(a),a=a.sibling}function l_(a){switch(a.tag){case 0:case 11:case 15:Vu(a),a.flags&2048&&ss(9,a,a.return);break;case 3:Vu(a);break;case 12:Vu(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Rh(a)):Vu(a);break;default:Vu(a)}}function Rh(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];Sn=m,c_(m,a)}o_(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:ss(8,o,o.return),Rh(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,Rh(o));break;default:Rh(o)}a=a.sibling}}function c_(a,o){for(;Sn!==null;){var d=Sn;switch(d.tag){case 0:case 11:case 15:ss(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var m=d.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Eu(d.memoizedState.cache)}if(m=d.child,m!==null)m.return=d,Sn=m;else e:for(d=a;Sn!==null;){m=Sn;var b=m.sibling,j=m.return;if(JO(m),m===d){Sn=null;break e}if(b!==null){b.return=j,Sn=b;break e}Sn=j}}}var S6={getCacheForType:function(a){var o=En(cn),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return En(cn).controller.signal}},j6=typeof WeakMap=="function"?WeakMap:Map,gt=0,kt=null,nt=null,at=0,bt=0,Or=null,os=!1,Yl=!1,b0=!1,Ca=0,Xt=0,ls=0,No=0,x0=0,_r=0,Wl=0,Zu=null,dr=null,w0=!1,Dh=0,u_=0,Ih=1/0,Lh=null,cs=null,mn=0,us=null,Ql=null,Oa=0,S0=0,j0=null,d_=null,Yu=0,N0=null;function kr(){return(gt&2)!==0&&at!==0?at&-at:H.T!==null?E0():F()}function f_(){if(_r===0)if((at&536870912)===0||lt){var a=no;no<<=1,(no&3932160)===0&&(no=262144),_r=a}else _r=536870912;return a=Nr.current,a!==null&&(a.flags|=32),_r}function fr(a,o,d){(a===kt&&(bt===2||bt===9)||a.cancelPendingCommit!==null)&&(Xl(a,0),ds(a,at,_r,!1)),ao(a,d),((gt&2)===0||a!==kt)&&(a===kt&&((gt&2)===0&&(No|=d),Xt===4&&ds(a,at,_r,!1)),Bi(a))}function h_(a,o,d){if((gt&6)!==0)throw Error(r(327));var m=!d&&(o&127)===0&&(o&a.expiredLanes)===0||Za(a,o),b=m?O6(a,o):O0(a,o,!0),j=m;do{if(b===0){Yl&&!m&&ds(a,o,0,!1);break}else{if(d=a.current.alternate,j&&!N6(d)){b=O0(a,o,!1),j=!1;continue}if(b===2){if(j=o,a.errorRecoveryDisabledLanes&j)var _=0;else _=a.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){o=_;e:{var M=a;b=Zu;var U=M.current.memoizedState.isDehydrated;if(U&&(Xl(M,_).flags|=256),_=O0(M,_,!1),_!==2){if(b0&&!U){M.errorRecoveryDisabledLanes|=j,No|=j,b=4;break e}j=dr,dr=b,j!==null&&(dr===null?dr=j:dr.push.apply(dr,j))}b=_}if(j=!1,b!==2)continue}}if(b===1){Xl(a,0),ds(a,o,0,!0);break}e:{switch(m=a,j=b,j){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ds(m,o,_r,!os);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Dh+300-Te(),10<b)){if(ds(m,o,_r,!os),ro(m,0,!0)!==0)break e;Oa=o,m.timeoutHandle=K_(p_.bind(null,m,d,dr,Lh,w0,o,_r,No,Wl,os,j,"Throttled",-0,0),b);break e}p_(m,d,dr,Lh,w0,o,_r,No,Wl,os,j,null,-0,0)}}break}while(!0);Bi(a)}function p_(a,o,d,m,b,j,_,M,U,X,se,he,J,ne){if(a.timeoutHandle=-1,he=o.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},s_(o,j,he);var Pe=(j&62914560)===j?Dh-Te():(j&4194048)===j?u_-Te():0;if(Pe=lB(he,Pe),Pe!==null){Oa=j,a.cancelPendingCommit=Pe(S_.bind(null,a,o,j,d,m,b,_,M,U,se,he,null,J,ne)),ds(a,j,_,!X);return}}S_(a,o,j,d,m,b,_,M,U)}function N6(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var m=0;m<d.length;m++){var b=d[m],j=b.getSnapshot;b=b.value;try{if(!Sr(j(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ds(a,o,d,m){o&=~x0,o&=~No,a.suspendedLanes|=o,a.pingedLanes&=~o,m&&(a.warmLanes|=o),m=a.expirationTimes;for(var b=o;0<b;){var j=31-ce(b),_=1<<j;m[j]=-1,b&=~_}d!==0&&qf(a,d,o)}function $h(){return(gt&6)===0?(Wu(0),!1):!0}function C0(){if(nt!==null){if(bt===0)var a=nt.return;else a=nt,ma=mo=null,By(a),ql=null,Pu=0,a=nt;for(;a!==null;)HO(a.alternate,a),a=a.return;nt=null}}function Xl(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,K6(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),Oa=0,C0(),kt=a,nt=d=ha(a.current,null),at=o,bt=0,Or=null,os=!1,Yl=Za(a,o),b0=!1,Wl=_r=x0=No=ls=Xt=0,dr=Zu=null,w0=!1,(o&8)!==0&&(o|=o&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=o;0<m;){var b=31-ce(m),j=1<<b;o|=a[b],m&=~j}return Ca=o,sh(),d}function m_(a,o){Ze=null,H.H=Uu,o===Bl||o===ph?(o=TC(),bt=3):o===Ay?(o=TC(),bt=4):bt=o===r0?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Or=o,nt===null&&(Xt=1,kh(a,Ur(o,a.current)))}function g_(){var a=Nr.current;return a===null?!0:(at&4194048)===at?Kr===null:(at&62914560)===at||(at&536870912)!==0?a===Kr:!1}function v_(){var a=H.H;return H.H=Uu,a===null?Uu:a}function y_(){var a=H.A;return H.A=S6,a}function Uh(){Xt=4,os||(at&4194048)!==at&&Nr.current!==null||(Yl=!0),(ls&134217727)===0&&(No&134217727)===0||kt===null||ds(kt,at,_r,!1)}function O0(a,o,d){var m=gt;gt|=2;var b=v_(),j=y_();(kt!==a||at!==o)&&(Lh=null,Xl(a,o)),o=!1;var _=Xt;e:do try{if(bt!==0&&nt!==null){var M=nt,U=Or;switch(bt){case 8:C0(),_=6;break e;case 3:case 2:case 9:case 6:Nr.current===null&&(o=!0);var X=bt;if(bt=0,Or=null,Jl(a,M,U,X),d&&Yl){_=0;break e}break;default:X=bt,bt=0,Or=null,Jl(a,M,U,X)}}C6(),_=Xt;break}catch(se){m_(a,se)}while(!0);return o&&a.shellSuspendCounter++,ma=mo=null,gt=m,H.H=b,H.A=j,nt===null&&(kt=null,at=0,sh()),_}function C6(){for(;nt!==null;)b_(nt)}function O6(a,o){var d=gt;gt|=2;var m=v_(),b=y_();kt!==a||at!==o?(Lh=null,Ih=Te()+500,Xl(a,o)):Yl=Za(a,o);e:do try{if(bt!==0&&nt!==null){o=nt;var j=Or;t:switch(bt){case 1:bt=0,Or=null,Jl(a,o,j,1);break;case 2:case 9:if(AC(j)){bt=0,Or=null,x_(o);break}o=function(){bt!==2&&bt!==9||kt!==a||(bt=7),Bi(a)},j.then(o,o);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:AC(j)?(bt=0,Or=null,x_(o)):(bt=0,Or=null,Jl(a,o,j,7));break;case 5:var _=null;switch(nt.tag){case 26:_=nt.memoizedState;case 5:case 27:var M=nt;if(_?ak(_):M.stateNode.complete){bt=0,Or=null;var U=M.sibling;if(U!==null)nt=U;else{var X=M.return;X!==null?(nt=X,Bh(X)):nt=null}break t}}bt=0,Or=null,Jl(a,o,j,5);break;case 6:bt=0,Or=null,Jl(a,o,j,6);break;case 8:C0(),Xt=6;break e;default:throw Error(r(462))}}_6();break}catch(se){m_(a,se)}while(!0);return ma=mo=null,H.H=m,H.A=b,gt=d,nt!==null?0:(kt=null,at=0,sh(),Xt)}function _6(){for(;nt!==null&&!me();)b_(nt)}function b_(a){var o=FO(a.alternate,a,Ca);a.memoizedProps=a.pendingProps,o===null?Bh(a):nt=o}function x_(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=IO(d,o,o.pendingProps,o.type,void 0,at);break;case 11:o=IO(d,o,o.pendingProps,o.type.render,o.ref,at);break;case 5:By(o);default:HO(d,o),o=nt=yC(o,Ca),o=FO(d,o,Ca)}a.memoizedProps=a.pendingProps,o===null?Bh(a):nt=o}function Jl(a,o,d,m){ma=mo=null,By(o),ql=null,Pu=0;var b=o.return;try{if(m6(a,b,o,d,at)){Xt=1,kh(a,Ur(d,a.current)),nt=null;return}}catch(j){if(b!==null)throw nt=b,j;Xt=1,kh(a,Ur(d,a.current)),nt=null;return}o.flags&32768?(lt||m===1?a=!0:Yl||(at&536870912)!==0?a=!1:(os=a=!0,(m===2||m===9||m===3||m===6)&&(m=Nr.current,m!==null&&m.tag===13&&(m.flags|=16384))),w_(o,a)):Bh(o)}function Bh(a){var o=a;do{if((o.flags&32768)!==0){w_(o,os);return}a=o.return;var d=y6(o.alternate,o,Ca);if(d!==null){nt=d;return}if(o=o.sibling,o!==null){nt=o;return}nt=o=a}while(o!==null);Xt===0&&(Xt=5)}function w_(a,o){do{var d=b6(a.alternate,a);if(d!==null){d.flags&=32767,nt=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){nt=a;return}nt=a=d}while(a!==null);Xt=6,nt=null}function S_(a,o,d,m,b,j,_,M,U){a.cancelPendingCommit=null;do qh();while(mn!==0);if((gt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(j=o.lanes|o.childLanes,j|=py,Bf(a,d,j,_,M,U),a===kt&&(nt=kt=null,at=0),Ql=o,us=a,Oa=d,S0=j,j0=b,d_=m,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,T6(dt,function(){return __(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||m){m=H.T,H.T=null,b=ee.p,ee.p=2,_=gt,gt|=4;try{x6(a,o,d)}finally{gt=_,ee.p=b,H.T=m}}mn=1,j_(),N_(),C_()}}function j_(){if(mn===1){mn=0;var a=us,o=Ql,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=H.T,H.T=null;var m=ee.p;ee.p=2;var b=gt;gt|=4;try{r_(o,a);var j=L0,_=cC(a.containerInfo),M=j.focusedElem,U=j.selectionRange;if(_!==M&&M&&M.ownerDocument&&lC(M.ownerDocument.documentElement,M)){if(U!==null&&cy(M)){var X=U.start,se=U.end;if(se===void 0&&(se=X),"selectionStart"in M)M.selectionStart=X,M.selectionEnd=Math.min(se,M.value.length);else{var he=M.ownerDocument||document,J=he&&he.defaultView||window;if(J.getSelection){var ne=J.getSelection(),Pe=M.textContent.length,qe=Math.min(U.start,Pe),Ct=U.end===void 0?qe:Math.min(U.end,Pe);!ne.extend&&qe>Ct&&(_=Ct,Ct=qe,qe=_);var Z=oC(M,qe),K=oC(M,Ct);if(Z&&K&&(ne.rangeCount!==1||ne.anchorNode!==Z.node||ne.anchorOffset!==Z.offset||ne.focusNode!==K.node||ne.focusOffset!==K.offset)){var Q=he.createRange();Q.setStart(Z.node,Z.offset),ne.removeAllRanges(),qe>Ct?(ne.addRange(Q),ne.extend(K.node,K.offset)):(Q.setEnd(K.node,K.offset),ne.addRange(Q))}}}}for(he=[],ne=M;ne=ne.parentNode;)ne.nodeType===1&&he.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<he.length;M++){var de=he[M];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ep=!!I0,L0=I0=null}finally{gt=b,ee.p=m,H.T=d}}a.current=o,mn=2}}function N_(){if(mn===2){mn=0;var a=us,o=Ql,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=H.T,H.T=null;var m=ee.p;ee.p=2;var b=gt;gt|=4;try{XO(a,o.alternate,o)}finally{gt=b,ee.p=m,H.T=d}}mn=3}}function C_(){if(mn===4||mn===3){mn=0,Ee();var a=us,o=Ql,d=Oa,m=d_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?mn=5:(mn=0,Ql=us=null,O_(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(cs=null),Cl(d),o=o.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(ot,o,void 0,(o.current.flags&128)===128)}catch{}if(m!==null){o=H.T,b=ee.p,ee.p=2,H.T=null;try{for(var j=a.onRecoverableError,_=0;_<m.length;_++){var M=m[_];j(M.value,{componentStack:M.stack})}}finally{H.T=o,ee.p=b}}(Oa&3)!==0&&qh(),Bi(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===N0?Yu++:(Yu=0,N0=a):Yu=0,Wu(0)}}function O_(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Eu(o)))}function qh(){return j_(),N_(),C_(),__()}function __(){if(mn!==5)return!1;var a=us,o=S0;S0=0;var d=Cl(Oa),m=H.T,b=ee.p;try{ee.p=32>d?32:d,H.T=null,d=j0,j0=null;var j=us,_=Oa;if(mn=0,Ql=us=null,Oa=0,(gt&6)!==0)throw Error(r(331));var M=gt;if(gt|=4,l_(j.current),a_(j,j.current,_,d),gt=M,Wu(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(ot,j)}catch{}return!0}finally{ee.p=b,H.T=m,O_(a,o)}}function k_(a,o,d){o=Ur(d,o),o=n0(a.stateNode,o,2),a=rs(a,o,2),a!==null&&(ao(a,2),Bi(a))}function xt(a,o,d){if(a.tag===3)k_(a,a,d);else for(;o!==null;){if(o.tag===3){k_(o,a,d);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(cs===null||!cs.has(m))){a=Ur(d,a),d=AO(2),m=rs(o,d,2),m!==null&&(EO(d,m,o,a),ao(m,2),Bi(m));break}}o=o.return}}function _0(a,o,d){var m=a.pingCache;if(m===null){m=a.pingCache=new j6;var b=new Set;m.set(o,b)}else b=m.get(o),b===void 0&&(b=new Set,m.set(o,b));b.has(d)||(b0=!0,b.add(d),a=k6.bind(null,a,o,d),o.then(a,a))}function k6(a,o,d){var m=a.pingCache;m!==null&&m.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,kt===a&&(at&d)===d&&(Xt===4||Xt===3&&(at&62914560)===at&&300>Te()-Dh?(gt&2)===0&&Xl(a,0):x0|=d,Wl===at&&(Wl=0)),Bi(a)}function A_(a,o){o===0&&(o=io()),a=fo(a,o),a!==null&&(ao(a,o),Bi(a))}function A6(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),A_(a,d)}function E6(a,o){var d=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(o),A_(a,d)}function T6(a,o){return pe(a,o)}var Fh=null,ec=null,k0=!1,Kh=!1,A0=!1,fs=0;function Bi(a){a!==ec&&a.next===null&&(ec===null?Fh=ec=a:ec=ec.next=a),Kh=!0,k0||(k0=!0,z6())}function Wu(a,o){if(!A0&&Kh){A0=!0;do for(var d=!1,m=Fh;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var j=0;else{var _=m.suspendedLanes,M=m.pingedLanes;j=(1<<31-ce(42|a)+1)-1,j&=b&~(_&~M),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,z_(m,j))}else j=at,j=ro(m,m===kt?j:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(j&3)===0||Za(m,j)||(d=!0,z_(m,j));m=m.next}while(d);A0=!1}}function P6(){E_()}function E_(){Kh=k0=!1;var a=0;fs!==0&&F6()&&(a=fs);for(var o=Te(),d=null,m=Fh;m!==null;){var b=m.next,j=T_(m,o);j===0?(m.next=null,d===null?Fh=b:d.next=b,b===null&&(ec=d)):(d=m,(a!==0||(j&3)!==0)&&(Kh=!0)),m=b}mn!==0&&mn!==5||Wu(a),fs!==0&&(fs=0)}function T_(a,o){for(var d=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var _=31-ce(j),M=1<<_,U=b[_];U===-1?((M&d)===0||(M&m)!==0)&&(b[_]=Gv(M,o)):U<=o&&(a.expiredLanes|=M),j&=~M}if(o=kt,d=at,d=ro(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,d===0||a===o&&(bt===2||bt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Fe(m),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Za(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(m!==null&&Fe(m),Cl(d)){case 2:case 8:d=_t;break;case 32:d=dt;break;case 268435456:d=Yn;break;default:d=dt}return m=P_.bind(null,a),d=pe(d,m),a.callbackPriority=o,a.callbackNode=d,o}return m!==null&&m!==null&&Fe(m),a.callbackPriority=2,a.callbackNode=null,2}function P_(a,o){if(mn!==0&&mn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(qh()&&a.callbackNode!==d)return null;var m=at;return m=ro(a,a===kt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(h_(a,m,o),T_(a,Te()),a.callbackNode!=null&&a.callbackNode===d?P_.bind(null,a):null)}function z_(a,o){if(qh())return null;h_(a,o,!0)}function z6(){H6(function(){(gt&6)!==0?pe(Ke,P6):E_()})}function E0(){if(fs===0){var a=$l;a===0&&(a=Va,Va<<=1,(Va&261888)===0&&(Va=256)),fs=a}return fs}function M_(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Xf(""+a)}function R_(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function M6(a,o,d,m,b){if(o==="submit"&&d&&d.stateNode===b){var j=M_((b[yt]||null).action),_=m.submitter;_&&(o=(o=_[yt]||null)?M_(o.formAction):_.getAttribute("formAction"),o!==null&&(j=o,_=null));var M=new nh("action","action",null,m,b);a.push({event:M,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(fs!==0){var U=_?R_(b,_):new FormData(b);Wy(d,{pending:!0,data:U,method:b.method,action:j},null,U)}}else typeof j=="function"&&(M.preventDefault(),U=_?R_(b,_):new FormData(b),Wy(d,{pending:!0,data:U,method:b.method,action:j},j,U))},currentTarget:b}]})}}for(var T0=0;T0<hy.length;T0++){var P0=hy[T0],R6=P0.toLowerCase(),D6=P0[0].toUpperCase()+P0.slice(1);xi(R6,"on"+D6)}xi(fC,"onAnimationEnd"),xi(hC,"onAnimationIteration"),xi(pC,"onAnimationStart"),xi("dblclick","onDoubleClick"),xi("focusin","onFocus"),xi("focusout","onBlur"),xi(XU,"onTransitionRun"),xi(JU,"onTransitionStart"),xi(e6,"onTransitionCancel"),xi(mC,"onTransitionEnd"),ft("onMouseEnter",["mouseout","mouseover"]),ft("onMouseLeave",["mouseout","mouseover"]),ft("onPointerEnter",["pointerout","pointerover"]),ft("onPointerLeave",["pointerout","pointerover"]),We("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),We("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),We("onBeforeInput",["compositionend","keypress","textInput","paste"]),We("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qu="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(" "),I6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qu));function D_(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var m=a[d],b=m.event;m=m.listeners;e:{var j=void 0;if(o)for(var _=m.length-1;0<=_;_--){var M=m[_],U=M.instance,X=M.currentTarget;if(M=M.listener,U!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=X;try{j(b)}catch(se){ah(se)}b.currentTarget=null,j=U}else for(_=0;_<m.length;_++){if(M=m[_],U=M.instance,X=M.currentTarget,M=M.listener,U!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=X;try{j(b)}catch(se){ah(se)}b.currentTarget=null,j=U}}}}function rt(a,o){var d=o[gi];d===void 0&&(d=o[gi]=new Set);var m=a+"__bubble";d.has(m)||(I_(o,a,2,!1),d.add(m))}function z0(a,o,d){var m=0;o&&(m|=4),I_(d,a,m,o)}var Hh="_reactListening"+Math.random().toString(36).slice(2);function M0(a){if(!a[Hh]){a[Hh]=!0,Gf.forEach(function(d){d!=="selectionchange"&&(I6.has(d)||z0(d,!1,a),z0(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Hh]||(o[Hh]=!0,z0("selectionchange",!1,o))}}function I_(a,o,d,m){switch(fk(o)){case 2:var b=dB;break;case 8:b=fB;break;default:b=Y0}d=b.bind(null,o,d,a),b=void 0,!ey||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function R0(a,o,d,m,b){var j=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var _=m.tag;if(_===3||_===4){var M=m.stateNode.containerInfo;if(M===b)break;if(_===4)for(_=m.return;_!==null;){var U=_.tag;if((U===3||U===4)&&_.stateNode.containerInfo===b)return;_=_.return}for(;M!==null;){if(_=vi(M),_===null)return;if(U=_.tag,U===5||U===6||U===26||U===27){m=j=_;continue e}M=M.parentNode}}m=m.return}qN(function(){var X=j,se=Xv(d),he=[];e:{var J=gC.get(a);if(J!==void 0){var ne=nh,Pe=a;switch(a){case"keypress":if(eh(d)===0)break e;case"keydown":case"keyup":ne=EU;break;case"focusin":Pe="focus",ne=iy;break;case"focusout":Pe="blur",ne=iy;break;case"beforeblur":case"afterblur":ne=iy;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=HN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=yU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=zU;break;case fC:case hC:case pC:ne=wU;break;case mC:ne=RU;break;case"scroll":case"scrollend":ne=gU;break;case"wheel":ne=IU;break;case"copy":case"cut":case"paste":ne=jU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=VN;break;case"toggle":case"beforetoggle":ne=$U}var qe=(o&4)!==0,Ct=!qe&&(a==="scroll"||a==="scrollend"),Z=qe?J!==null?J+"Capture":null:J;qe=[];for(var K=X,Q;K!==null;){var de=K;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||Z===null||(de=bu(K,Z),de!=null&&qe.push(Xu(K,de,Q))),Ct)break;K=K.return}0<qe.length&&(J=new ne(J,Pe,null,d,se),he.push({event:J,listeners:qe}))}}if((o&7)===0){e:{if(J=a==="mouseover"||a==="pointerover",ne=a==="mouseout"||a==="pointerout",J&&d!==Qv&&(Pe=d.relatedTarget||d.fromElement)&&(vi(Pe)||Pe[xr]))break e;if((ne||J)&&(J=se.window===se?se:(J=se.ownerDocument)?J.defaultView||J.parentWindow:window,ne?(Pe=d.relatedTarget||d.toElement,ne=X,Pe=Pe?vi(Pe):null,Pe!==null&&(Ct=s(Pe),qe=Pe.tag,Pe!==Ct||qe!==5&&qe!==27&&qe!==6)&&(Pe=null)):(ne=null,Pe=X),ne!==Pe)){if(qe=HN,de="onMouseLeave",Z="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(qe=VN,de="onPointerLeave",Z="onPointerEnter",K="pointer"),Ct=ne==null?J:so(ne),Q=Pe==null?J:so(Pe),J=new qe(de,K+"leave",ne,d,se),J.target=Ct,J.relatedTarget=Q,de=null,vi(se)===X&&(qe=new qe(Z,K+"enter",Pe,d,se),qe.target=Q,qe.relatedTarget=Ct,de=qe),Ct=de,ne&&Pe)t:{for(qe=L6,Z=ne,K=Pe,Q=0,de=Z;de;de=qe(de))Q++;de=0;for(var Ue=K;Ue;Ue=qe(Ue))de++;for(;0<Q-de;)Z=qe(Z),Q--;for(;0<de-Q;)K=qe(K),de--;for(;Q--;){if(Z===K||K!==null&&Z===K.alternate){qe=Z;break t}Z=qe(Z),K=qe(K)}qe=null}else qe=null;ne!==null&&L_(he,J,ne,qe,!1),Pe!==null&&Ct!==null&&L_(he,Ct,Pe,qe,!0)}}e:{if(J=X?so(X):window,ne=J.nodeName&&J.nodeName.toLowerCase(),ne==="select"||ne==="input"&&J.type==="file")var ht=tC;else if(JN(J))if(nC)ht=YU;else{ht=VU;var Ie=GU}else ne=J.nodeName,!ne||ne.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?X&&Wv(X.elementType)&&(ht=tC):ht=ZU;if(ht&&(ht=ht(a,X))){eC(he,ht,d,se);break e}Ie&&Ie(a,J,X),a==="focusout"&&X&&J.type==="number"&&X.memoizedProps.value!=null&&Yv(J,"number",J.value)}switch(Ie=X?so(X):window,a){case"focusin":(JN(Ie)||Ie.contentEditable==="true")&&(Tl=Ie,uy=X,_u=null);break;case"focusout":_u=uy=Tl=null;break;case"mousedown":dy=!0;break;case"contextmenu":case"mouseup":case"dragend":dy=!1,uC(he,d,se);break;case"selectionchange":if(QU)break;case"keydown":case"keyup":uC(he,d,se)}var Qe;if(sy)e:{switch(a){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else El?QN(a,d)&&(st="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(st="onCompositionStart");st&&(ZN&&d.locale!=="ko"&&(El||st!=="onCompositionStart"?st==="onCompositionEnd"&&El&&(Qe=FN()):(Wa=se,ty="value"in Wa?Wa.value:Wa.textContent,El=!0)),Ie=Gh(X,st),0<Ie.length&&(st=new GN(st,a,null,d,se),he.push({event:st,listeners:Ie}),Qe?st.data=Qe:(Qe=XN(d),Qe!==null&&(st.data=Qe)))),(Qe=BU?qU(a,d):FU(a,d))&&(st=Gh(X,"onBeforeInput"),0<st.length&&(Ie=new GN("onBeforeInput","beforeinput",null,d,se),he.push({event:Ie,listeners:st}),Ie.data=Qe)),M6(he,a,X,d,se)}D_(he,o)})}function Xu(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Gh(a,o){for(var d=o+"Capture",m=[];a!==null;){var b=a,j=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||j===null||(b=bu(a,d),b!=null&&m.unshift(Xu(a,b,j)),b=bu(a,o),b!=null&&m.push(Xu(a,b,j))),a.tag===3)return m;a=a.return}return[]}function L6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function L_(a,o,d,m,b){for(var j=o._reactName,_=[];d!==null&&d!==m;){var M=d,U=M.alternate,X=M.stateNode;if(M=M.tag,U!==null&&U===m)break;M!==5&&M!==26&&M!==27||X===null||(U=X,b?(X=bu(d,j),X!=null&&_.unshift(Xu(d,X,U))):b||(X=bu(d,j),X!=null&&_.push(Xu(d,X,U)))),d=d.return}_.length!==0&&a.push({event:o,listeners:_})}var $6=/\r\n?/g,U6=/\u0000|\uFFFD/g;function $_(a){return(typeof a=="string"?a:""+a).replace($6,`
9
- `).replace(U6,"")}function U_(a,o){return o=$_(o),$_(a)===o}function Nt(a,o,d,m,b,j){switch(d){case"children":typeof m=="string"?o==="body"||o==="textarea"&&m===""||_l(a,m):(typeof m=="number"||typeof m=="bigint")&&o!=="body"&&_l(a,""+m);break;case"className":Wf(a,"class",m);break;case"tabIndex":Wf(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Wf(a,d,m);break;case"style":UN(a,m,j);break;case"data":if(o!=="object"){Wf(a,"data",m);break}case"src":case"href":if(m===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=Xf(""+m),a.setAttribute(d,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof j=="function"&&(d==="formAction"?(o!=="input"&&Nt(a,o,"name",b.name,b,null),Nt(a,o,"formEncType",b.formEncType,b,null),Nt(a,o,"formMethod",b.formMethod,b,null),Nt(a,o,"formTarget",b.formTarget,b,null)):(Nt(a,o,"encType",b.encType,b,null),Nt(a,o,"method",b.method,b,null),Nt(a,o,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=Xf(""+m),a.setAttribute(d,m);break;case"onClick":m!=null&&(a.onclick=da);break;case"onScroll":m!=null&&rt("scroll",a);break;case"onScrollEnd":m!=null&&rt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}d=Xf(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""+m):a.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":m===!0?a.setAttribute(d,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,m):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(d,m):a.removeAttribute(d);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(d):a.setAttribute(d,m);break;case"popover":rt("beforetoggle",a),rt("toggle",a),Yf(a,"popover",m);break;case"xlinkActuate":ua(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ua(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ua(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ua(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ua(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ua(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ua(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ua(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ua(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Yf(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=pU.get(d)||d,Yf(a,d,m))}}function D0(a,o,d,m,b,j){switch(d){case"style":UN(a,m,j);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof m=="string"?_l(a,m):(typeof m=="number"||typeof m=="bigint")&&_l(a,""+m);break;case"onScroll":m!=null&&rt("scroll",a);break;case"onScrollEnd":m!=null&&rt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vf.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),j=a[yt]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(o,j,b),typeof m=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,m,b);break e}d in a?a[d]=m:m===!0?a.setAttribute(d,""):Yf(a,d,m)}}}function Pn(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",a),rt("load",a);var m=!1,b=!1,j;for(j in d)if(d.hasOwnProperty(j)){var _=d[j];if(_!=null)switch(j){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Nt(a,o,j,_,d,null)}}b&&Nt(a,o,"srcSet",d.srcSet,d,null),m&&Nt(a,o,"src",d.src,d,null);return;case"input":rt("invalid",a);var M=j=_=b=null,U=null,X=null;for(m in d)if(d.hasOwnProperty(m)){var se=d[m];if(se!=null)switch(m){case"name":b=se;break;case"type":_=se;break;case"checked":U=se;break;case"defaultChecked":X=se;break;case"value":j=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:Nt(a,o,m,se,d,null)}}DN(a,j,M,U,X,_,b,!1);return;case"select":rt("invalid",a),m=_=j=null;for(b in d)if(d.hasOwnProperty(b)&&(M=d[b],M!=null))switch(b){case"value":j=M;break;case"defaultValue":_=M;break;case"multiple":m=M;default:Nt(a,o,b,M,d,null)}o=j,d=_,a.multiple=!!m,o!=null?Ol(a,!!m,o,!1):d!=null&&Ol(a,!!m,d,!0);return;case"textarea":rt("invalid",a),j=b=m=null;for(_ in d)if(d.hasOwnProperty(_)&&(M=d[_],M!=null))switch(_){case"value":m=M;break;case"defaultValue":b=M;break;case"children":j=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:Nt(a,o,_,M,d,null)}LN(a,m,b,j);return;case"option":for(U in d)d.hasOwnProperty(U)&&(m=d[U],m!=null)&&(U==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":Nt(a,o,U,m,d,null));return;case"dialog":rt("beforetoggle",a),rt("toggle",a),rt("cancel",a),rt("close",a);break;case"iframe":case"object":rt("load",a);break;case"video":case"audio":for(m=0;m<Qu.length;m++)rt(Qu[m],a);break;case"image":rt("error",a),rt("load",a);break;case"details":rt("toggle",a);break;case"embed":case"source":case"link":rt("error",a),rt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in d)if(d.hasOwnProperty(X)&&(m=d[X],m!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Nt(a,o,X,m,d,null)}return;default:if(Wv(o)){for(se in d)d.hasOwnProperty(se)&&(m=d[se],m!==void 0&&D0(a,o,se,m,d,void 0));return}}for(M in d)d.hasOwnProperty(M)&&(m=d[M],m!=null&&Nt(a,o,M,m,d,null))}function B6(a,o,d,m){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,j=null,_=null,M=null,U=null,X=null,se=null;for(ne in d){var he=d[ne];if(d.hasOwnProperty(ne)&&he!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":U=he;default:m.hasOwnProperty(ne)||Nt(a,o,ne,null,m,he)}}for(var J in m){var ne=m[J];if(he=d[J],m.hasOwnProperty(J)&&(ne!=null||he!=null))switch(J){case"type":j=ne;break;case"name":b=ne;break;case"checked":X=ne;break;case"defaultChecked":se=ne;break;case"value":_=ne;break;case"defaultValue":M=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,o));break;default:ne!==he&&Nt(a,o,J,ne,m,he)}}Zv(a,_,M,U,X,se,j,b);return;case"select":ne=_=M=J=null;for(j in d)if(U=d[j],d.hasOwnProperty(j)&&U!=null)switch(j){case"value":break;case"multiple":ne=U;default:m.hasOwnProperty(j)||Nt(a,o,j,null,m,U)}for(b in m)if(j=m[b],U=d[b],m.hasOwnProperty(b)&&(j!=null||U!=null))switch(b){case"value":J=j;break;case"defaultValue":M=j;break;case"multiple":_=j;default:j!==U&&Nt(a,o,b,j,m,U)}o=M,d=_,m=ne,J!=null?Ol(a,!!d,J,!1):!!m!=!!d&&(o!=null?Ol(a,!!d,o,!0):Ol(a,!!d,d?[]:"",!1));return;case"textarea":ne=J=null;for(M in d)if(b=d[M],d.hasOwnProperty(M)&&b!=null&&!m.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Nt(a,o,M,null,m,b)}for(_ in m)if(b=m[_],j=d[_],m.hasOwnProperty(_)&&(b!=null||j!=null))switch(_){case"value":J=b;break;case"defaultValue":ne=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==j&&Nt(a,o,_,b,m,j)}IN(a,J,ne);return;case"option":for(var Pe in d)J=d[Pe],d.hasOwnProperty(Pe)&&J!=null&&!m.hasOwnProperty(Pe)&&(Pe==="selected"?a.selected=!1:Nt(a,o,Pe,null,m,J));for(U in m)J=m[U],ne=d[U],m.hasOwnProperty(U)&&J!==ne&&(J!=null||ne!=null)&&(U==="selected"?a.selected=J&&typeof J!="function"&&typeof J!="symbol":Nt(a,o,U,J,m,ne));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 qe in d)J=d[qe],d.hasOwnProperty(qe)&&J!=null&&!m.hasOwnProperty(qe)&&Nt(a,o,qe,null,m,J);for(X in m)if(J=m[X],ne=d[X],m.hasOwnProperty(X)&&J!==ne&&(J!=null||ne!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,o));break;default:Nt(a,o,X,J,m,ne)}return;default:if(Wv(o)){for(var Ct in d)J=d[Ct],d.hasOwnProperty(Ct)&&J!==void 0&&!m.hasOwnProperty(Ct)&&D0(a,o,Ct,void 0,m,J);for(se in m)J=m[se],ne=d[se],!m.hasOwnProperty(se)||J===ne||J===void 0&&ne===void 0||D0(a,o,se,J,m,ne);return}}for(var Z in d)J=d[Z],d.hasOwnProperty(Z)&&J!=null&&!m.hasOwnProperty(Z)&&Nt(a,o,Z,null,m,J);for(he in m)J=m[he],ne=d[he],!m.hasOwnProperty(he)||J===ne||J==null&&ne==null||Nt(a,o,he,J,m,ne)}function B_(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),m=0;m<d.length;m++){var b=d[m],j=b.transferSize,_=b.initiatorType,M=b.duration;if(j&&M&&B_(_)){for(_=0,M=b.responseEnd,m+=1;m<d.length;m++){var U=d[m],X=U.startTime;if(X>M)break;var se=U.transferSize,he=U.initiatorType;se&&B_(he)&&(U=U.responseEnd,_+=se*(U<M?1:(M-X)/(U-X)))}if(--m,o+=8*(j+_)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var I0=null,L0=null;function Vh(a){return a.nodeType===9?a:a.ownerDocument}function q_(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function F_(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function $0(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var U0=null;function F6(){var a=window.event;return a&&a.type==="popstate"?a===U0?!1:(U0=a,!0):(U0=null,!1)}var K_=typeof setTimeout=="function"?setTimeout:void 0,K6=typeof clearTimeout=="function"?clearTimeout:void 0,H_=typeof Promise=="function"?Promise:void 0,H6=typeof queueMicrotask=="function"?queueMicrotask:typeof H_<"u"?function(a){return H_.resolve(null).then(a).catch(G6)}:K_;function G6(a){setTimeout(function(){throw a})}function hs(a){return a==="head"}function G_(a,o){var d=o,m=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(m===0){a.removeChild(b),ic(o);return}m--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")m++;else if(d==="html")Ju(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Ju(d);for(var j=d.firstChild;j;){var _=j.nextSibling,M=j.nodeName;j[Dr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&j.rel.toLowerCase()==="stylesheet"||d.removeChild(j),j=_}}else d==="body"&&Ju(a.ownerDocument.body);d=b}while(d);ic(o)}function V_(a,o){var d=a;a=0;do{var m=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),m&&m.nodeType===8)if(d=m.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=m}while(d)}function B0(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":B0(d),la(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function V6(a,o,d,m){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Dr])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(j=a.getAttribute("rel"),j==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(j!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(j=a.getAttribute("src"),(j!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&j&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var j=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===j)return a}else return a;if(a=Hr(a.nextSibling),a===null)break}return null}function Z6(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Hr(a.nextSibling),a===null))return null;return a}function Z_(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Hr(a.nextSibling),a===null))return null;return a}function q0(a){return a.data==="$?"||a.data==="$~"}function F0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Y6(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var m=function(){o(),d.removeEventListener("DOMContentLoaded",m)};d.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Hr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var K0=null;function Y_(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return Hr(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function W_(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function Q_(a,o,d){switch(o=Vh(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Ju(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);la(a)}var Gr=new Map,X_=new Set;function Zh(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var _a=ee.d;ee.d={f:W6,r:Q6,D:X6,C:J6,L:eB,m:tB,X:rB,S:nB,M:iB};function W6(){var a=_a.f(),o=$h();return a||o}function Q6(a){var o=ca(a);o!==null&&o.tag===5&&o.type==="form"?mO(o):_a.r(a)}var tc=typeof document>"u"?null:document;function J_(a,o,d){var m=tc;if(m&&typeof o=="string"&&o){var b=Lr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),X_.has(b)||(X_.add(b),a={rel:a,crossOrigin:d,href:o},m.querySelector(b)===null&&(o=m.createElement("link"),Pn(o,"link",a),Ht(o),m.head.appendChild(o)))}}function X6(a){_a.D(a),J_("dns-prefetch",a,null)}function J6(a,o){_a.C(a,o),J_("preconnect",a,o)}function eB(a,o,d){_a.L(a,o,d);var m=tc;if(m&&a&&o){var b='link[rel="preload"][as="'+Lr(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Lr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Lr(d.imageSizes)+'"]')):b+='[href="'+Lr(a)+'"]';var j=b;switch(o){case"style":j=nc(a);break;case"script":j=rc(a)}Gr.has(j)||(a=g({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),Gr.set(j,a),m.querySelector(b)!==null||o==="style"&&m.querySelector(ed(j))||o==="script"&&m.querySelector(td(j))||(o=m.createElement("link"),Pn(o,"link",a),Ht(o),m.head.appendChild(o)))}}function tB(a,o){_a.m(a,o);var d=tc;if(d&&a){var m=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Lr(m)+'"][href="'+Lr(a)+'"]',j=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=rc(a)}if(!Gr.has(j)&&(a=g({rel:"modulepreload",href:a},o),Gr.set(j,a),d.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(td(j)))return}m=d.createElement("link"),Pn(m,"link",a),Ht(m),d.head.appendChild(m)}}}function nB(a,o,d){_a.S(a,o,d);var m=tc;if(m&&a){var b=yi(m).hoistableStyles,j=nc(a);o=o||"default";var _=b.get(j);if(!_){var M={loading:0,preload:null};if(_=m.querySelector(ed(j)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},d),(d=Gr.get(j))&&H0(a,d);var U=_=m.createElement("link");Ht(U),Pn(U,"link",a),U._p=new Promise(function(X,se){U.onload=X,U.onerror=se}),U.addEventListener("load",function(){M.loading|=1}),U.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Yh(_,o,m)}_={type:"stylesheet",instance:_,count:1,state:M},b.set(j,_)}}}function rB(a,o){_a.X(a,o);var d=tc;if(d&&a){var m=yi(d).hoistableScripts,b=rc(a),j=m.get(b);j||(j=d.querySelector(td(b)),j||(a=g({src:a,async:!0},o),(o=Gr.get(b))&&G0(a,o),j=d.createElement("script"),Ht(j),Pn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function iB(a,o){_a.M(a,o);var d=tc;if(d&&a){var m=yi(d).hoistableScripts,b=rc(a),j=m.get(b);j||(j=d.querySelector(td(b)),j||(a=g({src:a,async:!0,type:"module"},o),(o=Gr.get(b))&&G0(a,o),j=d.createElement("script"),Ht(j),Pn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function ek(a,o,d,m){var b=(b=oe.current)?Zh(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=nc(d.href),d=yi(b).hoistableStyles,m=d.get(o),m||(m={type:"style",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=nc(d.href);var j=yi(b).hoistableStyles,_=j.get(a);if(_||(b=b.ownerDocument||b,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,_),(j=b.querySelector(ed(a)))&&!j._p&&(_.instance=j,_.state.loading=5),Gr.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Gr.set(a,d),j||aB(b,a,d,_.state))),o&&m===null)throw Error(r(528,""));return _}if(o&&m!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=rc(d),d=yi(b).hoistableScripts,m=d.get(o),m||(m={type:"script",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function nc(a){return'href="'+Lr(a)+'"'}function ed(a){return'link[rel="stylesheet"]['+a+"]"}function tk(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function aB(a,o,d,m){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?m.loading=1:(o=a.createElement("link"),m.preload=o,o.addEventListener("load",function(){return m.loading|=1}),o.addEventListener("error",function(){return m.loading|=2}),Pn(o,"link",d),Ht(o),a.head.appendChild(o))}function rc(a){return'[src="'+Lr(a)+'"]'}function td(a){return"script[async]"+a}function nk(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var m=a.querySelector('style[data-href~="'+Lr(d.href)+'"]');if(m)return o.instance=m,Ht(m),m;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Ht(m),Pn(m,"style",b),Yh(m,d.precedence,a),o.instance=m;case"stylesheet":b=nc(d.href);var j=a.querySelector(ed(b));if(j)return o.state.loading|=4,o.instance=j,Ht(j),j;m=tk(d),(b=Gr.get(b))&&H0(m,b),j=(a.ownerDocument||a).createElement("link"),Ht(j);var _=j;return _._p=new Promise(function(M,U){_.onload=M,_.onerror=U}),Pn(j,"link",m),o.state.loading|=4,Yh(j,d.precedence,a),o.instance=j;case"script":return j=rc(d.src),(b=a.querySelector(td(j)))?(o.instance=b,Ht(b),b):(m=d,(b=Gr.get(j))&&(m=g({},d),G0(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),Ht(b),Pn(b,"link",m),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(m=o.instance,o.state.loading|=4,Yh(m,d.precedence,a));return o.instance}function Yh(a,o,d){for(var m=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,j=b,_=0;_<m.length;_++){var M=m[_];if(M.dataset.precedence===o)j=M;else if(j!==b)break}j?j.parentNode.insertBefore(a,j.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function H0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function G0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Wh=null;function rk(a,o,d){if(Wh===null){var m=new Map,b=Wh=new Map;b.set(d,m)}else b=Wh,m=b.get(d),m||(m=new Map,b.set(d,m));if(m.has(a))return m;for(m.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var j=d[b];if(!(j[Dr]||j[tt]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var _=j.getAttribute(o)||"";_=a+_;var M=m.get(_);M?M.push(j):m.set(_,[j])}}return m}function ik(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function sB(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function ak(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function oB(a,o,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=nc(m.href),j=o.querySelector(ed(b));if(j){o=j._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Qh.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=j,Ht(j);return}j=o.ownerDocument||o,m=tk(m),(b=Gr.get(b))&&H0(m,b),j=j.createElement("link"),Ht(j);var _=j;_._p=new Promise(function(M,U){_.onload=M,_.onerror=U}),Pn(j,"link",m),d.instance=j}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Qh.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var V0=0;function lB(a,o){return a.stylesheets&&a.count===0&&Jh(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var m=setTimeout(function(){if(a.stylesheets&&Jh(a,a.stylesheets),a.unsuspend){var j=a.unsuspend;a.unsuspend=null,j()}},6e4+o);0<a.imgBytes&&V0===0&&(V0=62500*q6());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Jh(a,a.stylesheets),a.unsuspend)){var j=a.unsuspend;a.unsuspend=null,j()}},(a.imgBytes>V0?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Qh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Xh=null;function Jh(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Xh=new Map,o.forEach(cB,a),Xh=null,Qh.call(a))}function cB(a,o){if(!(o.state.loading&4)){var d=Xh.get(a);if(d)var m=d.get(null);else{d=new Map,Xh.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<b.length;j++){var _=b[j];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),m=_)}m&&d.set(null,m)}b=o.instance,_=b.getAttribute("data-precedence"),j=d.get(_)||m,j===m&&d.set(null,b),d.set(_,b),this.count++,m=Qh.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),j?j.parentNode.insertBefore(b,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var nd={$$typeof:k,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function uB(a,o,d,m,b,j,_,M,U){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nl(0),this.hiddenUpdates=Nl(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=j,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function sk(a,o,d,m,b,j,_,M,U,X,se,he){return a=new uB(a,o,d,_,U,X,se,he,M),o=1,j===!0&&(o|=24),j=jr(3,null,null,o),a.current=j,j.stateNode=a,o=Oy(),o.refCount++,a.pooledCache=o,o.refCount++,j.memoizedState={element:m,isDehydrated:d,cache:o},Ey(j),a}function ok(a){return a?(a=Ml,a):Ml}function lk(a,o,d,m,b,j){b=ok(b),m.context===null?m.context=b:m.pendingContext=b,m=ns(o),m.payload={element:d},j=j===void 0?null:j,j!==null&&(m.callback=j),d=rs(a,m,o),d!==null&&(fr(d,a,o),Mu(d,a,o))}function ck(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function Z0(a,o){ck(a,o),(a=a.alternate)&&ck(a,o)}function uk(a){if(a.tag===13||a.tag===31){var o=fo(a,67108864);o!==null&&fr(o,a,67108864),Z0(a,67108864)}}function dk(a){if(a.tag===13||a.tag===31){var o=kr();o=yu(o);var d=fo(a,o);d!==null&&fr(d,a,o),Z0(a,o)}}var ep=!0;function dB(a,o,d,m){var b=H.T;H.T=null;var j=ee.p;try{ee.p=2,Y0(a,o,d,m)}finally{ee.p=j,H.T=b}}function fB(a,o,d,m){var b=H.T;H.T=null;var j=ee.p;try{ee.p=8,Y0(a,o,d,m)}finally{ee.p=j,H.T=b}}function Y0(a,o,d,m){if(ep){var b=W0(m);if(b===null)R0(a,o,m,tp,d),hk(a,m);else if(pB(b,a,o,d,m))m.stopPropagation();else if(hk(a,m),o&4&&-1<hB.indexOf(a)){for(;b!==null;){var j=ca(b);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var _=Rr(j.pendingLanes);if(_!==0){var M=j;for(M.pendingLanes|=2,M.entangledLanes|=2;_;){var U=1<<31-ce(_);M.entanglements[1]|=U,_&=~U}Bi(j),(gt&6)===0&&(Ih=Te()+500,Wu(0))}}break;case 31:case 13:M=fo(j,2),M!==null&&fr(M,j,2),$h(),Z0(j,2)}if(j=W0(m),j===null&&R0(a,o,m,tp,d),j===b)break;b=j}b!==null&&m.stopPropagation()}else R0(a,o,m,null,d)}}function W0(a){return a=Xv(a),Q0(a)}var tp=null;function Q0(a){if(tp=null,a=vi(a),a!==null){var o=s(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=l(o),a!==null)return a;a=null}else if(d===31){if(a=c(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return tp=a,null}function fk(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ne()){case Ke:return 2;case _t:return 8;case dt:case Bn:return 32;case Yn:return 268435456;default:return 32}default:return 32}}var X0=!1,ps=null,ms=null,gs=null,rd=new Map,id=new Map,vs=[],hB="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 hk(a,o){switch(a){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":ms=null;break;case"mouseover":case"mouseout":gs=null;break;case"pointerover":case"pointerout":rd.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":id.delete(o.pointerId)}}function ad(a,o,d,m,b,j){return a===null||a.nativeEvent!==j?(a={blockedOn:o,domEventName:d,eventSystemFlags:m,nativeEvent:j,targetContainers:[b]},o!==null&&(o=ca(o),o!==null&&uk(o)),a):(a.eventSystemFlags|=m,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function pB(a,o,d,m,b){switch(o){case"focusin":return ps=ad(ps,a,o,d,m,b),!0;case"dragenter":return ms=ad(ms,a,o,d,m,b),!0;case"mouseover":return gs=ad(gs,a,o,d,m,b),!0;case"pointerover":var j=b.pointerId;return rd.set(j,ad(rd.get(j)||null,a,o,d,m,b)),!0;case"gotpointercapture":return j=b.pointerId,id.set(j,ad(id.get(j)||null,a,o,d,m,b)),!0}return!1}function pk(a){var o=vi(a.target);if(o!==null){var d=s(o);if(d!==null){if(o=d.tag,o===13){if(o=l(d),o!==null){a.blockedOn=o,xe(a.priority,function(){dk(d)});return}}else if(o===31){if(o=c(d),o!==null){a.blockedOn=o,xe(a.priority,function(){dk(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function np(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=W0(a.nativeEvent);if(d===null){d=a.nativeEvent;var m=new d.constructor(d.type,d);Qv=m,d.target.dispatchEvent(m),Qv=null}else return o=ca(d),o!==null&&uk(o),a.blockedOn=d,!1;o.shift()}return!0}function mk(a,o,d){np(a)&&d.delete(o)}function mB(){X0=!1,ps!==null&&np(ps)&&(ps=null),ms!==null&&np(ms)&&(ms=null),gs!==null&&np(gs)&&(gs=null),rd.forEach(mk),id.forEach(mk)}function rp(a,o){a.blockedOn===o&&(a.blockedOn=null,X0||(X0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mB)))}var ip=null;function gk(a){ip!==a&&(ip=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ip===a&&(ip=null);for(var o=0;o<a.length;o+=3){var d=a[o],m=a[o+1],b=a[o+2];if(typeof m!="function"){if(Q0(m||d)===null)continue;break}var j=ca(d);j!==null&&(a.splice(o,3),o-=3,Wy(j,{pending:!0,data:b,method:d.method,action:m},m,b))}}))}function ic(a){function o(U){return rp(U,a)}ps!==null&&rp(ps,a),ms!==null&&rp(ms,a),gs!==null&&rp(gs,a),rd.forEach(o),id.forEach(o);for(var d=0;d<vs.length;d++){var m=vs[d];m.blockedOn===a&&(m.blockedOn=null)}for(;0<vs.length&&(d=vs[0],d.blockedOn===null);)pk(d),d.blockedOn===null&&vs.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(m=0;m<d.length;m+=3){var b=d[m],j=d[m+1],_=b[yt]||null;if(typeof j=="function")_||gk(d);else if(_){var M=null;if(j&&j.hasAttribute("formAction")){if(b=j,_=j[yt]||null)M=_.formAction;else if(Q0(b)!==null)continue}else M=_.action;typeof M=="function"?d[m+1]=M:(d.splice(m,3),m-=3),gk(d)}}}function vk(){function a(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(_){return b=_})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),m||setTimeout(d,20)}function d(){if(!m&&!navigation.transition){var j=navigation.currentEntry;j&&j.url!=null&&navigation.navigate(j.url,{state:j.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function J0(a){this._internalRoot=a}ap.prototype.render=J0.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,m=kr();lk(d,m,a,o,null,null)},ap.prototype.unmount=J0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;lk(a.current,2,null,a,null,null),$h(),o[xr]=null}};function ap(a){this._internalRoot=a}ap.prototype.unstable_scheduleHydration=function(a){if(a){var o=F();a={blockedOn:null,target:a,priority:o};for(var d=0;d<vs.length&&o!==0&&o<vs[d].priority;d++);vs.splice(d,0,a),d===0&&pk(a)}};var yk=t.version;if(yk!=="19.2.4")throw Error(r(527,yk,"19.2.4"));ee.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(o),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var gB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sp.isDisabled&&sp.supportsFiber)try{ot=sp.inject(gB),Lt=sp}catch{}}return od.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,m="",b=CO,j=OO,_=_O;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError)),o=sk(a,1,!1,null,null,d,m,null,b,j,_,vk),a[xr]=o.current,M0(a),new J0(o)},od.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var m=!1,b="",j=CO,_=OO,M=_O,U=null;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(M=d.onRecoverableError),d.formState!==void 0&&(U=d.formState)),o=sk(a,1,!0,o,d??null,m,b,U,j,_,M,vk),o.context=ok(null),d=o.current,m=kr(),m=yu(m),b=ns(m),b.callback=null,rs(d,b,m),d=m,o.current.lanes=d,ao(o,d),Bi(o),a[xr]=o.current,M0(a),new ap(o)},od.version="19.2.4",od}var kk;function OB(){if(kk)return nb.exports;kk=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(),nb.exports=CB(),nb.exports}var _B=OB(),pl=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(){}},kB={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},AB=class{#t=kB;#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)}},Do=new AB;function EB(e){setTimeout(e,0)}var tl=typeof window>"u"||"Deno"in globalThis;function Kn(){}function TB(e,t){return typeof e=="function"?e(t):e}function uw(e){return typeof e=="number"&&e>=0&&e!==1/0}function bM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ms(e,t){return typeof e=="function"?e(t):e}function Jr(e,t){return typeof e=="function"?e(t):e}function Ak(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==QS(l,t.options))return!1}else if(!Ld(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function Ek(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(nl(t.options.mutationKey)!==nl(s))return!1}else if(!Ld(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function QS(e,t){return(t?.queryKeyHashFn||nl)(e)}function nl(e){return JSON.stringify(e,(t,n)=>dw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ld(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ld(e[n],t[n])):!1}var PB=Object.prototype.hasOwnProperty;function XS(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Tk(e)&&Tk(t);if(!r&&!(dw(e)&&dw(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const g=r?p:l[p],v=e[g],y=t[g];if(v===y){f[g]=v,(r?p<s:PB.call(e,g))&&h++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){f[g]=y;continue}const S=XS(v,y,n+1);f[g]=S,S===v&&h++}return s===c&&h===s?e:f}function $d(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 Tk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dw(e){if(!Pk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Pk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Pk(e){return Object.prototype.toString.call(e)==="[object Object]"}function zB(e){return new Promise(t=>{Do.setTimeout(t,e)})}function fw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?XS(e,t):t}function MB(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function RB(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var JS=Symbol();function xM(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===JS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function e1(e,t){return typeof e=="function"?e(...t):!!e}function DB(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 IB=class extends pl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!tl&&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"}},t1=new IB;function hw(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var LB=EB;function $B(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=LB;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var tn=$B(),UB=class extends pl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!tl&&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}},lm=new UB;function BB(e){return Math.min(1e3*2**e,3e4)}function wM(e){return(e??"online")==="online"?lm.isOnline():!0}var pw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function SM(e){let t=!1,n=0,r;const i=hw(),s=()=>i.status!=="pending",l=w=>{if(!s()){const N=new pw(w);v(N),e.onCancel?.(N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>t1.isFocused()&&(e.networkMode==="always"||lm.isOnline())&&e.canRun(),p=()=>wM(e.networkMode)&&e.canRun(),g=w=>{s()||(r?.(),i.resolve(w))},v=w=>{s()||(r?.(),i.reject(w))},y=()=>new Promise(w=>{r=N=>{(s()||h())&&w(N)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),S=()=>{if(s())return;let w;const N=n===0?e.initialPromise:void 0;try{w=N??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(s())return;const E=e.retry??(tl?0:3),k=e.retryDelay??BB,O=typeof k=="function"?k(n,C):k,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,C);if(t||!T){v(C);return}n++,e.onFail?.(n,C),zB(O).then(()=>h()?void 0:y()).then(()=>{t?v(C):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:f,canStart:p,start:()=>(p()?S():y().then(S),i)}}var jM=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uw(this.gcTime)&&(this.#t=Do.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Do.clearTimeout(this.#t),this.#t=void 0)}},qB=class extends jM{#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=Mk(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=Mk(this.options);t.data!==void 0&&(this.setState(zk(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=fw(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(Kn).catch(Kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Jr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===JS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ms(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:!bM(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=xM(this.options,t),h=(()=>{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,h,this):c(h)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=SM({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof pw&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof pw){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,...NM(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...zk(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),tn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function NM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Mk(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 n1=class extends pl{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=hw(),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),Rk(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mw(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mw(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 Jr(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&&!$d(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Dk(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Jr(this.options.enabled,this.#e)!==Jr(t.enabled,this.#e)||Ms(this.options.staleTime,this.#e)!==Ms(t.staleTime,this.#e))&&this.#g();const i=this.#v();r&&(this.#e!==n||Jr(this.options.enabled,this.#e)!==Jr(t.enabled,this.#e)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return KB(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(Kn)),t}#g(){this.#x();const e=Ms(this.options.staleTime,this.#e);if(tl||this.#i.isStale||!uw(e))return;const n=bM(this.#i.dataUpdatedAt,e)+1;this.#c=Do.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(tl||Jr(this.options.enabled,this.#e)===!1||!uw(this.#l)||this.#l===0)&&(this.#u=Do.setInterval(()=>{(this.options.refetchIntervalInBackground||t1.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Do.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Do.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,s=this.#r,l=this.#a,f=e!==n?e.state:this.#n,{state:h}=e;let p={...h},g=!1,v;if(t._optimisticResults){const P=this.hasListeners(),R=!P&&Rk(e,t),B=P&&Dk(e,n,t,r);(R||B)&&(p={...p,...NM(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:S,status:w}=p;v=p.data;let N=!1;if(t.placeholderData!==void 0&&v===void 0&&w==="pending"){let P;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(P=i.data,N=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,P!==void 0&&(w="success",v=fw(i?.data,P,t),g=!0)}if(t.select&&v!==void 0&&!N)if(i&&v===s?.data&&t.select===this.#p)v=this.#d;else try{this.#p=t.select,v=t.select(v),v=fw(i?.data,v,t),this.#d=v,this.#s=null}catch(P){this.#s=P}this.#s&&(y=this.#s,v=this.#d,S=Date.now(),w="error");const C=p.fetchStatus==="fetching",E=w==="pending",k=w==="error",O=E&&C,T=v!==void 0,A={status:w,fetchStatus:p.fetchStatus,isPending:E,isSuccess:w==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:k&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&T,isStale:r1(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Jr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=A.data!==void 0,R=A.status==="error"&&!P,B=re=>{R?re.reject(A.error):P&&re.resolve(A.data)},$=()=>{const re=this.#o=A.promise=hw();B(re)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&B(L);break;case"fulfilled":(R||A.data!==L.value)&&$();break;case"rejected":(!R||A.error!==L.reason)&&$();break}}return A}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),$d(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const s=new Set(i??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(l=>{const c=l;return this.#i[c]!==e[c]&&s.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){tn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function FB(e,t){return Jr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Rk(e,t){return FB(e,t)||e.state.data!==void 0&&mw(e,t,t.refetchOnMount)}function mw(e,t,n){if(Jr(t.enabled,e)!==!1&&Ms(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&r1(e,t)}return!1}function Dk(e,t,n,r){return(e!==t||Jr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&r1(e,n)}function r1(e,t){return Jr(t.enabled,e)!==!1&&e.isStaleByTime(Ms(t.staleTime,e))}function KB(e,t){return!$d(e.getCurrentResult(),t)}function Ik(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let p=!1;const g=S=>{DB(S,()=>t.signal,()=>p=!0)},v=xM(t.options,t.fetchOptions),y=async(S,w,N)=>{if(p)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:N?"backward":"forward",meta:t.options.meta};return g(z),z})(),k=await v(E),{maxPages:O}=t.options,T=N?RB:MB;return{pages:T(S.pages,k,O),pageParams:T(S.pageParams,w,O)}};if(i&&s.length){const S=i==="backward",w=S?HB:Lk,N={pages:s,pageParams:l},C=w(r,N);c=await y(N,C,S)}else{const S=e??s.length;do{const w=f===0?l[0]??r.initialPageParam:Lk(r,c);if(f>0&&w==null)break;c=await y(c,w),f++}while(f<S)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function Lk(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 HB(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var GB=class extends jM{#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||CM(),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=SM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,l)=>{this.#r({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),tn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function CM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var OM=class extends pl{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 GB({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=op(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=op(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=op(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=op(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){tn.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=>Ek(t,n))}findAll(e={}){return this.getAll().filter(t=>Ek(e,t))}notify(e){tn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return tn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Kn))))}};function op(e){return e.options.scope?.id}var VB=class extends pl{#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),$d(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&nl(n.mutationKey)!==nl(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??CM();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){tn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function $k(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function ZB(e,t,n){const r=e.slice(0);return r[t]=n,r}var YB=class extends pl{#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,tn.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),s=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,c=i.some((p,g)=>p!==n[g]),f=l||c,h=f?!0:s.some((p,g)=>{const v=this.#e[g];return!v||!$d(p,v)});!f&&!h||(f&&(this.#d=r,this.#r=i),this.#e=s,this.hasListeners()&&(f&&($k(n,i).forEach(p=>{p.destroy()}),$k(i,n).forEach(p=>{p.subscribe(g=>{this.#l(p,g)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),i=n.map(s=>s.defaultedQueryOptions.queryHash);return[r,s=>this.#c(s??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,s=>{t.forEach(l=>{l.observer.trackProp(s)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((s,l)=>s!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=XS(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const s=t.get(i);s?s.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new n1(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=ZB(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&&tn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},WB=class extends pl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??QS(r,t);let s=this.get(i);return s||(s=new qB({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){tn.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=>Ak(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ak(e,n)):t}notify(e){tn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){tn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){tn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},QB=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new WB,this.#e=e.mutationCache||new OM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=t1.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=lm.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(Ms(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,l=TB(t,s);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return tn.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;tn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return tn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=tn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kn).catch(Kn)}invalidateQueries(e,t={}){return tn.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=tn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Ms(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kn).catch(Kn)}fetchInfiniteQuery(e){return e.behavior=Ik(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kn).catch(Kn)}ensureInfiniteQueryData(e){return e.behavior=Ik(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return lm.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(nl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Ld(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(nl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ld(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=QS(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===JS&&(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()}},_M=x.createContext(void 0),Vs=e=>{const t=x.useContext(_M);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},XB=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(_M.Provider,{value:e,children:t})),kM=x.createContext(!1),AM=()=>x.useContext(kM);kM.Provider;function JB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var e8=x.createContext(JB()),EM=()=>x.useContext(e8),TM=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?e1(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},PM=e=>{x.useEffect(()=>{e.clearReset()},[e])},zM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||e1(n,[e.error,r])),MM=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))}},t8=(e,t)=>e.isLoading&&e.isFetching&&!t,gw=(e,t)=>e?.suspense&&t.isPending,vw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function n8({queries:e,...t},n){const r=Vs(),i=AM(),s=EM(),l=x.useMemo(()=>e.map(w=>{const N=r.defaultQueryOptions(w);return N._optimisticResults=i?"isRestoring":"optimistic",N}),[e,r,i]);l.forEach(w=>{MM(w);const N=r.getQueryCache().get(w.queryHash);TM(w,s,N)}),PM(s);const[c]=x.useState(()=>new YB(r,l,t)),[f,h,p]=c.getOptimisticResult(l,t.combine),g=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>g?c.subscribe(tn.batchCalls(w)):Kn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const y=f.some((w,N)=>gw(l[N],w))?f.flatMap((w,N)=>{const C=l[N];if(C&&gw(C,w)){const E=new n1(r,C);return vw(C,E,s)}return[]}):[];if(y.length>0)throw Promise.all(y);const S=f.find((w,N)=>{const C=l[N];return C&&zM({result:w,errorResetBoundary:s,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(S?.error)throw S.error;return h(p())}function r8(e,t,n){const r=AM(),i=EM(),s=Vs(),l=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",MM(l),TM(l,i,c),PM(i);const f=!s.getQueryCache().get(l.queryHash),[h]=x.useState(()=>new t(s,l)),p=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(v=>{const y=g?h.subscribe(tn.batchCalls(v)):Kn;return h.updateResult(),y},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(l)},[l,h]),gw(l,p))throw vw(l,h,i);if(zM({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!tl&&t8(p,r)&&(f?vw(l,h,i):c?.promise)?.catch(Kn).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?p:h.trackResult(p)}function Go(e,t){return r8(e,n1)}function pf(e,t){const n=Vs(),[r]=x.useState(()=>new VB(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(tn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((l,c)=>{r.mutate(l,c).catch(Kn)},[r]);if(i.error&&e1(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var lp=typeof window<"u"?x.useLayoutEffect:x.useEffect;function sb(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function i8(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{t(s)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function a8(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var s8=!1;function Ud(e){return e[e.length-1]}function o8(e){return typeof e=="function"}function As(e,t){return o8(e)?e(t):e}var l8=Object.prototype.hasOwnProperty,Uk=Object.prototype.propertyIsEnumerable,c8=()=>Object.create(null),Co=(e,t)=>Io(e,t,c8);function Io(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=Fk(e)&&Fk(i);if(!s&&!(cm(e)&&cm(i)))return i;const l=s?e:Bk(e);if(!l)return i;const c=s?i:Bk(i);if(!c)return i;const f=l.length,h=c.length,p=s?new Array(h):n();let g=0;for(let v=0;v<h;v++){const y=s?v:c[v],S=e[y],w=i[y];if(S===w){p[y]=S,(s?v<f:l8.call(e,y))&&g++;continue}if(S===null||w===null||typeof S!="object"||typeof w!="object"){p[y]=w;continue}const N=Io(S,w,n,r+1);p[y]=N,N===S&&g++}return f===h&&g===f?e:p}function Bk(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Uk.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(!Uk.call(e,i))return!1;r.push(i)}return r}function cm(e){if(!qk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qk(n)||!n.hasOwnProperty("isPrototypeOf"))}function qk(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vo(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(!Vo(e[r],t[r],n))return!1;return!0}if(cm(e)&&cm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Vo(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let s=0;for(const l in t)if((!r||t[l]!==void 0)&&(s++,s>i||!Vo(e[l],t[l],n)))return!1;return i===s}return!1}function Ic(e){let t,n;const r=new Promise((i,s)=>{t=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Bd(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function u8(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Kk(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 u8(t)}var d8=["http:","https:","mailto:","tel:"];function um(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ld(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+=Kk(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Kk(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function f8(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function dm(e){const t=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const l=t.get(s);if(l)return i(l),l.value},set(s,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(s);if(c)c.value=l,i(c);else{const f={key:s,value:l,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(s,f)}},clear(){t.clear(),n=void 0,r=void 0}}}var h8="Invariant failed";function Bs(e,t){if(!e)throw new Error(h8)}var Lo=4,RM=5;function p8(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 i1(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,s=e.substring(t,i);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=p8(s);if(l){const[c,f]=l,h=s.charCodeAt(c+1);if(h===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){const p=c+3,g=f;if(p<g)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=i,n}}else if(h===36){const p=c+1,g=c+2;return g===f?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+g,n[3]=t+f,n[4]=t+f+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function _g(e,t,n,r,i,s,l){l?.(n);let c=r;{const f=n.fullPath??n.from,h=f.length,p=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<h;){const y=i1(f,c,t);let S;const w=c,N=y[5];switch(c=N+1,s++,y[0]){case 0:{const C=f.substring(y[2],y[3]);if(p){const E=i.static?.get(C);if(E)S=E;else{i.static??=new Map;const k=$o(n.fullPath??n.from);k.parent=i,k.depth=s,S=k,i.static.set(C,k)}}else{const E=C.toLowerCase(),k=i.staticInsensitive?.get(E);if(k)S=k;else{i.staticInsensitive??=new Map;const O=$o(n.fullPath??n.from);O.parent=i,O.depth=s,S=O,i.staticInsensitive.set(E,O)}}break}case 1:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,z=!g&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===k&&A.prefix===O&&A.suffix===T);if(z)S=z;else{const A=lb(1,n.fullPath??n.from,k,O,T);S=A,A.depth=s,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case 3:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,z=!g&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===k&&A.prefix===O&&A.suffix===T);if(z)S=z;else{const A=lb(3,n.fullPath??n.from,k,O,T);S=A,A.parent=i,A.depth=s,i.optional??=[],i.optional.push(A)}break}case 2:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),k=p&&!!(C||E),O=C?k?C:C.toLowerCase():void 0,T=E?k?E:E.toLowerCase():void 0,z=lb(2,n.fullPath??n.from,k,O,T);S=z,z.parent=i,z.depth=s,i.wildcard??=[],i.wildcard.push(z)}}i=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=$o(n.fullPath??n.from);y.kind=RM,y.parent=i,s++,y.depth=s,i.pathless??=[],i.pathless.push(y),i=y}const v=(n.path||!n.children)&&!n.isRoot;if(v&&f.endsWith("/")){const y=$o(n.fullPath??n.from);y.kind=Lo,y.parent=i,s++,y.depth=s,i.index=y,i=y}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,v&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)_g(e,t,f,c,i,s,l)}function ob(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 Ns(e){if(e.pathless)for(const t of e.pathless)Ns(t);if(e.static)for(const t of e.static.values())Ns(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ns(t);if(e.dynamic?.length){e.dynamic.sort(ob);for(const t of e.dynamic)Ns(t)}if(e.optional?.length){e.optional.sort(ob);for(const t of e.optional)Ns(t)}if(e.wildcard?.length){e.wildcard.sort(ob);for(const t of e.wildcard)Ns(t)}}function $o(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 lb(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 m8(e,t){const n=$o("/"),r=new Uint16Array(6);for(const i of e)_g(!1,r,i,1,n,0);Ns(n),t.masksTree=n,t.flatCache=dm(1e3)}function g8(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=a1(e,t.masksTree);return t.flatCache.set(e,r),r}function v8(e,t,n,r,i){e||="/",r||="/";const s=t?`case\0${e}`:e;let l=i.singleCache.get(s);return l||(l=$o("/"),_g(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(s,l)),a1(r,l,n)}function y8(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let s;try{s=a1(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)s=null;else throw l}return s&&(s.branch=w8(s.route)),t.matchCache.set(r,s),s}function b8(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function x8(e,t=!1,n){const r=$o(e.fullPath),i=new Uint16Array(6),s={},l={};let c=0;return _g(t,i,e,1,r,0,f=>{if(n?.(f,c),Bs(!(f.id in s),`Duplicate routes found with id: ${String(f.id)}`),s[f.id]=f,c!==0&&f.path){const h=b8(f.fullPath);(!l[h]||f.fullPath.endsWith("/"))&&(l[h]=f)}c++}),Ns(r),{processedTree:{segmentTree:r,singleCache:dm(1e3),matchCache:dm(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:l}}function a1(e,t,n=!1){const r=e.split("/"),i=j8(e,r,t,n);if(!i)return null;const[s]=DM(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function DM(e,t,n){const r=S8(n.node);let i=null;const s=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,f=n.extract?.path??0,h=n.extract?.segment??0;for(;c<r.length;l++,c++,f++,h++){const p=r[c];if(p.kind===Lo)break;if(p.kind===RM){h--,l--,f--;continue}const g=t[l],v=f;if(g&&(f+=g.length),p.kind===1){i??=n.node.fullPath.split("/");const y=i[h],S=p.prefix?.length??0;if(y.charCodeAt(S)===123){const w=p.suffix?.length??0,N=y.substring(S+2,y.length-w-1),C=g.substring(S,g.length-w);s[N]=decodeURIComponent(C)}else{const w=y.substring(1);s[w]=decodeURIComponent(g)}}else if(p.kind===3){if(n.skipped&1<<c){l--,f=v-1;continue}i??=n.node.fullPath.split("/");const y=i[h],S=p.prefix?.length??0,w=p.suffix?.length??0,N=y.substring(S+3,y.length-w-1),C=p.suffix||p.prefix?g.substring(S,g.length-w):g;C&&(s[N]=decodeURIComponent(C))}else if(p.kind===2){const y=p,S=e.substring(v+(y.prefix?.length??0),e.length-(y.suffix?.length??0)),w=decodeURIComponent(S);s["*"]=w,s._splat=w;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:l,node:c,path:f,segment:h}]}function w8(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function S8(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function j8(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ud(t),s=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,h=null,p=null;for(;c.length;){const g=c.pop(),{node:v,index:y,skipped:S,depth:w,statics:N,dynamics:C,optionals:E}=g;let{extract:k,rawParams:O,parsedParams:T}=g;if(v.skipOnParamError){if(!cb(e,t,g))continue;O=g.rawParams,k=g.extract,T=g.parsedParams}r&&v.route&&v.kind!==Lo&&cd(h,g)&&(h=g);const z=y===l;if(z&&(v.route&&!s&&cd(p,g)&&(p=g),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const A=z?void 0:t[y];let P;if(z&&v.index){const R={node:v.index,index:y,skipped:S,depth:w+1,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T};let B=!0;if(v.index.skipOnParamError&&(cb(e,t,R)||(B=!1)),B){if(N===l&&!C&&!E&&!S)return R;cd(p,R)&&(p=R)}}if(v.wildcard&&cd(f,g))for(const R of v.wildcard){const{prefix:B,suffix:$}=R;if(B&&(z||!(R.caseSensitive?A:P??=A.toLowerCase()).startsWith(B)))continue;if($){if(z)continue;const re=t.slice(y).join("/").slice(-$.length);if((R.caseSensitive?re:re.toLowerCase())!==$)continue}const L={node:R,index:l,skipped:S,depth:w,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T};if(!(R.skipOnParamError&&!cb(e,t,L))){f=L;break}}if(v.optional){const R=S|1<<w,B=w+1;for(let $=v.optional.length-1;$>=0;$--){const L=v.optional[$];c.push({node:L,index:y,skipped:R,depth:B,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!z)for(let $=v.optional.length-1;$>=0;$--){const L=v.optional[$],{prefix:re,suffix:ge}=L;if(re||ge){const be=L.caseSensitive?A:P??=A.toLowerCase();if(re&&!be.startsWith(re)||ge&&!be.endsWith(ge))continue}c.push({node:L,index:y+1,skipped:S,depth:B,statics:N,dynamics:C,optionals:E+1,extract:k,rawParams:O,parsedParams:T})}}if(!z&&v.dynamic&&A)for(let R=v.dynamic.length-1;R>=0;R--){const B=v.dynamic[R],{prefix:$,suffix:L}=B;if($||L){const re=B.caseSensitive?A:P??=A.toLowerCase();if($&&!re.startsWith($)||L&&!re.endsWith(L))continue}c.push({node:B,index:y+1,skipped:S,depth:w+1,statics:N,dynamics:C+1,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!z&&v.staticInsensitive){const R=v.staticInsensitive.get(P??=A.toLowerCase());R&&c.push({node:R,index:y+1,skipped:S,depth:w+1,statics:N+1,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(!z&&v.static){const R=v.static.get(A);R&&c.push({node:R,index:y+1,skipped:S,depth:w+1,statics:N+1,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}if(v.pathless){const R=w+1;for(let B=v.pathless.length-1;B>=0;B--){const $=v.pathless[B];c.push({node:$,index:y,skipped:S,depth:R,statics:N,dynamics:C,optionals:E,extract:k,rawParams:O,parsedParams:T})}}}if(p&&f)return cd(f,p)?p:f;if(p)return p;if(f)return f;if(r&&h){let g=h.index;for(let y=0;y<h.index;y++)g+=t[y].length;const v=g===e.length?"/":e.slice(g);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(v),h}return null}function cb(e,t,n){try{const[r,i]=DM(e,t,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,s),!0}catch{return null}}function cd(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===Lo)>(e.node.kind===Lo)||t.node.kind===Lo==(e.node.kind===Lo)&&t.depth>e.depth))):!0}function Hp(e){return s1(e.filter(t=>t!==void 0).join("/"))}function s1(e){return e.replace(/\/{2,}/g,"/")}function IM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rs(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function LM(e){return Rs(IM(e))}function fm(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function N8(e,t,n){return fm(e,n)===fm(t,n)}function C8({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),s=!i&&t===".";let l;if(r){l=i?t:s?e:e+"\0"+t;const g=r.get(l);if(g)return g}let c;if(s)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Ud(c)==="";)c.pop();const g=t.split("/");for(let v=0,y=g.length;v<y;v++){const S=g[v];S===""?v?v===y-1&&c.push(S):c=[S]:S===".."?c.pop():S==="."||c.push(S)}}c.length>1&&(Ud(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let g=0;g<c.length;g++){g>0&&(h+="/");const v=c[g];if(!v)continue;f=i1(v,0,f);const y=f[0];if(y===0){h+=v;continue}const S=f[5],w=v.substring(0,f[1]),N=v.substring(f[4],S),C=v.substring(f[2],f[3]);y===1?h+=w||N?`${w}{$${C}}${N}`:`$${C}`:y===2?h+=w||N?`${w}{$}${N}`:"$":h+=`${w}{-$${C}}${N}`}h=s1(h);const p=h||"/";return l&&r&&r.set(l,p),p}function O8(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>t.get(s)??s)}function ub(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=>Gk(i,n)).join("/"):Gk(r,n)}function Hk({path:e,params:t,decoder:n,...r}){let i=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let c=0,f,h="";for(;c<l;){const p=c;f=i1(e,p,f);const g=f[5];if(c=g+1,p===g)continue;const v=f[0];if(v===0){h+="/"+e.substring(p,g);continue}if(v===2){const y=t._splat;s._splat=y,s["*"]=y;const S=e.substring(p,f[1]),w=e.substring(f[4],g);if(!y){i=!0,(S||w)&&(h+="/"+S+w);continue}const N=ub("_splat",t,n);h+="/"+S+N+w;continue}if(v===1){const y=e.substring(f[2],f[3]);!i&&!(y in t)&&(i=!0),s[y]=t[y];const S=e.substring(p,f[1]),w=e.substring(f[4],g),N=ub(y,t,n)??"undefined";h+="/"+S+N+w;continue}if(v===3){const y=e.substring(f[2],f[3]),S=t[y];if(S==null)continue;s[y]=S;const w=e.substring(p,f[1]),N=e.substring(f[4],g),C=ub(y,t,n)??"";h+="/"+w+C+N;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:i}}function Gk(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function er(e){return!!e?.isNotFound}function _8(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var yw="tsr-scroll-restoration-v1_3",k8=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function A8(){const e=_8();if(!e)return null;const t=e.getItem(yw);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=As(r,n)||n;try{e.setItem(yw,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var cp=A8(),E8=e=>e.state.__TSR_key||e.href;function T8(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 hm=!1;function P8({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:s}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=l[c];hm=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const g in f){const v=f[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(g){const y=document.querySelector(g);y&&(y.scrollLeft=v.scrollX,y.scrollTop=v.scrollY)}}break e}const h=(s??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(h);v&&v.scrollIntoView(g)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const g of i){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(p)}}hm=!1}function z8(e,t){if(!cp||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!cp))return;e.isScrollRestorationSetup=!0,hm=!1;const n=e.options.getScrollRestorationKey||E8;window.history.scrollRestoration="manual";const r=i=>{if(hm||!e.isScrollRestoring)return;let s="";if(i.target===document||i.target===window)s="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?s=`[data-scroll-restoration-id="${c}"]`:s=T8(i.target)}const l=n(e.state.location);cp.set(c=>{const f=c[l]||={},h=f[s]||={};if(s==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(s){const p=document.querySelector(s);p&&(h.scrollX=p.scrollLeft||0,h.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",k8(r,100),!0),e.subscribe("onRendered",i=>{const s=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(P8({storageKey:yw,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&cp.set(l=>(l[s]||={},l)))})}function M8(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 R8(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 db(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function D8(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const s=n[r];s==null?n[r]=db(i):Array.isArray(s)?s.push(db(i)):n[r]=[s,db(i)]}return n}var I8=$8(JSON.parse),L8=U8(JSON.stringify,JSON.parse);function $8(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=D8(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function U8(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const s=R8(i,r);return s?`?${s}`:""}}var Zo="__root__";function o1(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 pr(e){return e instanceof Response&&!!e.options}function B8(e){return{input:({url:t})=>{for(const n of e)t=bw(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=$M(e[n],t);return t}}}function q8(e){const t=LM(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(s)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Hp(["/",t,l.pathname]),l)}}function bw(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 $M(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 Bt=(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))(Bt||{});function UM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:l,shallowPropagate:c};function r(h,p,g){const v=p.depsTail;if(v!==void 0&&v.dep===h)return;const y=v!==void 0?v.nextDep:p.deps;if(y!==void 0&&y.dep===h){y.version=g,p.depsTail=y;return}const S=h.subsTail;if(S!==void 0&&S.version===g&&S.sub===p)return;const w=p.depsTail=h.subsTail={version:g,dep:h,sub:p,prevDep:v,nextDep:y,prevSub:S,nextSub:void 0};y!==void 0&&(y.prevDep=w),v!==void 0?v.nextDep=w:p.deps=w,S!==void 0?S.nextSub=w:h.subs=w}function i(h,p=h.sub){const g=h.dep,v=h.prevDep,y=h.nextDep,S=h.nextSub,w=h.prevSub;return y!==void 0?y.prevDep=v:p.depsTail=v,v!==void 0?v.nextDep=y:p.deps=y,S!==void 0?S.prevSub=w:g.subsTail=w,w!==void 0?w.nextSub=S:(g.subs=S)===void 0&&n(g),y}function s(h){let p=h.nextSub,g;e:do{const v=h.sub;let y=v.flags;if(y&60?y&12?y&4?!(y&48)&&f(h,v)?(v.flags=y|40,y&=1):y=0:v.flags=y&-9|32:y=0:v.flags=y|32,y&2&&t(v),y&1){const S=v.subs;if(S!==void 0){const w=(h=S).nextSub;w!==void 0&&(g={value:p,prev:g},p=w);continue}}if((h=p)!==void 0){p=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){p=h.nextSub;continue e}break}while(!0)}function l(h,p){let g,v=0,y=!1;e:do{const S=h.dep,w=S.flags;if(p.flags&16)y=!0;else if((w&17)===17){if(e(S)){const N=S.subs;N.nextSub!==void 0&&c(N),y=!0}}else if((w&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=S.deps,p=S,++v;continue}if(!y){const N=h.nextDep;if(N!==void 0){h=N;continue}}for(;v--;){const N=p.subs,C=N.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=N,y){if(e(p)){C&&c(N),p=h.sub;continue}y=!1}else p.flags&=-33;p=h.sub;const E=h.nextDep;if(E!==void 0){h=E;continue e}}return y}while(!0)}function c(h){do{const p=h.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((h=h.nextSub)!==void 0)}function f(h,p){let g=p.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let l1=0,Oo=0,Pd=0;const Ea=[],{link:Iye,unlink:BM,propagate:Lye,checkDirty:F8,shallowPropagate:$ye}=UM({update(e){return e.depsTail!==void 0?V8(e):Z8(e)},notify(e){let t=Pd,n=t;do if(Ea[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Pd=t;n<--t;){const r=Ea[n];Ea[n++]=Ea[t],Ea[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,kg(e)):Q8.call(e)}});function K8(){return l1}function H8(){++l1}function G8(){--l1||W8()}function V8(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,kg(e)}}function Z8(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Y8(e){const t=e.flags;if(t&16||t&32&&F8(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,kg(e)}}else e.flags=2}function W8(){try{for(;Oo<Pd;){const e=Ea[Oo];Ea[Oo++]=void 0,Y8(e)}}finally{for(;Oo<Pd;){const e=Ea[Oo];Ea[Oo++]=void 0,e.flags|=10}Oo=0,Pd=0}}function Q8(){this.depsTail=void 0,this.flags=0,kg(this);const e=this.subs;e!==void 0&&BM(e)}function kg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=BM(n,e)}function c1(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 xw=[];let Gp=0;const{link:Vk,unlink:X8,propagate:J8,checkDirty:qM,shallowPropagate:Zk}=UM({update(e){return e._update()},notify(e){xw[ww++]=e,e.flags&=~Bt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Bt.Mutable|Bt.Dirty,pm(e))}});let up=0,ww=0,Hi;function pm(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=X8(n,e)}function FM(){if(!(K8()>0)){for(;up<ww;){const e=xw[up];xw[up++]=void 0,e.notify()}up=0,ww=0}}function KM(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?Bt.None:Bt.Mutable,get(){return Hi!==void 0&&Vk(i,Hi,Gp),i._snapshot},subscribe(s){const l=c1(s),c={current:!1},f=eq(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(s){const l=Hi,c=Object.is;if(n)Hi=i,++Gp,i.depsTail=void 0;else if(s===void 0)return!1;n&&(i.flags=Bt.Mutable|Bt.RecursedCheck);try{const f=i._snapshot,h=typeof s=="function"?s(f):s===void 0&&n?r(f):s;return f===void 0||!c(f,h)?(i._snapshot=h,!0):!1}finally{Hi=l,n&&(i.flags&=~Bt.RecursedCheck),pm(i)}}};return n?(i.flags=Bt.Mutable|Bt.Dirty,i.get=function(){const s=i.flags;if(s&Bt.Dirty||s&Bt.Pending&&qM(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&Zk(l)}}else s&Bt.Pending&&(i.flags=s&~Bt.Pending);return Hi!==void 0&&Vk(i,Hi,Gp),i._snapshot}):i.set=function(s){if(i._update(s)){const l=i.subs;l!==void 0&&(J8(l),Zk(l),FM())}},i}function eq(e){const t=()=>{const r=Hi;Hi=n,++Gp,n.depsTail=void 0,n.flags=Bt.Watching|Bt.RecursedCheck;try{return e()}finally{Hi=r,n.flags&=~Bt.RecursedCheck,pm(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Bt.Watching|Bt.RecursedCheck,notify(){const r=this.flags;r&Bt.Dirty||r&Bt.Pending&&qM(this.deps,this)?t():this.flags=Bt.Watching},stop(){this.flags=Bt.None,this.depsTail=void 0,pm(this)}};return t(),n}class tq{constructor(t){this.atom=KM(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(c1(t))}}class nq{constructor(t){this.atom=KM(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(c1(t))}}function rq(e){return typeof e=="function"?new nq(e):new tq(e)}function iq(e){try{H8(),e()}finally{G8(),FM()}}function zd(e){let t;return iq(()=>{t=e()}),t}var Sw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ag=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Yo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let s=0;s<=i;s++){const l=e.matches[s];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},Yk=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let s=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=i);for(let l=s;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?s:i},Es=(e,t,n)=>{if(!(!pr(n)&&!er(n)))throw pr(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:pr(n)?"redirected":r.status==="pending"?"success":r.status,context:Yo(e,t.index),isFetching:!1,error:n})),er(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),pr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},HM=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Wk=(e,t,n)=>{const r=Yo(e,n);e.updateMatch(t,i=>({...i,context:r}))},ud=(e,t,n,r)=>{const{id:i,routeId:s}=e.matches[t],l=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Es(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,Es(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&&!pr(n)&&!er(n)&&(e.serialError??=n)},GM=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ag(e,t)&&(n.options.loader||n.options.beforeLoad||ZM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{Sw(e)},i);r._nonReactive.pendingTimeout=s}},aq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;GM(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Es(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},sq=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ic(()=>{s?.resolve(),s=void 0});const{paramsError:l,searchError:c}=i;l&&ud(e,n,l,"PARSE_PARAMS"),c&&ud(e,n,c,"VALIDATE_SEARCH"),GM(e,t,r,i);const f=new AbortController;let h=!1;const p=()=>{h||(h=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:f})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){zd(()=>{p(),g()});return}i._nonReactive.beforeLoadPromise=Ic();const v={...Yo(e,n,!1),...i.__routeContext},{search:y,params:S,cause:w}=i,N=Ag(e,t),C={search:y,abortController:f,params:S,preload:N,context:v,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=O=>{if(O===void 0){zd(()=>{p(),g()});return}(pr(O)||er(O))&&(p(),ud(e,n,O,"BEFORE_LOAD")),zd(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:O})),g()})};let k;try{if(k=r.options.beforeLoad(C),Bd(k))return p(),k.catch(O=>{ud(e,n,O,"BEFORE_LOAD")}).then(E)}catch(O){p(),ud(e,n,O,"BEFORE_LOAD")}E(k)},oq=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>c(),l=()=>sq(e,n,t,i),c=()=>{if(HM(e,n))return;const f=aq(e,n,i);return Bd(f)?f.then(l):l()};return s()},lq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([s,l,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:l,styles:s?.styles}))},VM=(e,t,n,r,i)=>{const s=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:h}=e.router.getMatch(n),p=Yo(e,r),g=Ag(e,n);return{params:l,deps:c,preload:!!g,parentMatchPromise:s,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":h,route:i,...e.router.options.additionalContext}},Qk=async(e,t,n,r,i)=>{try{const s=e.router.getMatch(n);try{(!(s8??e.router.isServer)||s.ssr===!0)&&qd(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(VM(e,t,n,r,i)),h=!!c&&Bd(f);if((h||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),c){const g=h?await f:f;Es(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,v=>({...v,loaderData:g}))}i._lazyPromise&&await i._lazyPromise;const p=s._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Yo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Yo(e,r)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,er(l)&&await i.options.notFoundComponent?.preload?.(),Es(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(h){c=h,Es(e,e.router.getMatch(n),h)}!pr(c)&&!er(c)&&await qd(i,["errorComponent"]),e.updateMatch(n,h=>({...h,error:c,context:Yo(e,r),status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Es(e,l,s)}},cq=async(e,t,n)=>{async function r(y,S,w,N,C){const E=Date.now()-S.updatedAt,k=y?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,O=C.options.shouldReload,T=typeof O=="function"?O(VM(e,t,i,n,C)):O,{status:z,invalid:A}=N,P=E>k&&(!!e.forceStaleReload||N.cause==="enter"||w!==void 0&&w!==N.id);l=z==="success"&&(A||(T??P)),y&&C.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await Qk(e,t,i,n,C);const R=e.router.getMatch(i);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0,R._nonReactive.loadPromise=void 0}catch(R){pr(R)&&await e.router.navigate(R.options)}})()):z!=="success"||l?await Qk(e,t,i,n,C):Wk(e,i,n))}const{id:i,routeId:s}=e.matches[n];let l=!1,c=!1;const f=e.router.looseRoutesById[s],h=f.options.loader,p=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(HM(e,i)){if(!e.router.getMatch(i))return e.matches[n];Wk(e,i,n)}else{const y=e.router.getMatch(i),S=e.router.state.matches[n]?.routeId===s?e.router.state.matches[n].id:e.router.state.matches.find(N=>N.routeId===s)?.id,w=Ag(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&p)return y;await y._nonReactive.loaderPromise;const N=e.router.getMatch(i),C=N._nonReactive.error||N.error;C&&Es(e,N,C),N.status==="pending"&&await r(w,y,S,N,f)}else{const N=w&&!e.router.state.matches.some(E=>E.id===i),C=e.router.getMatch(i);C._nonReactive.loaderPromise=Ic(),N!==C.preload&&e.updateMatch(i,E=>({...E,preload:N})),await r(w,y,S,C,f)}}const g=e.router.getMatch(i);c||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,c||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=c?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function Xk(e){const t=e,n=[];t.router.state.matches.some(v=>v._forcePending)&&Sw(t);let r;for(let v=0;v<t.matches.length;v++){try{const y=oq(t,v);Bd(y)&&await y}catch(y){if(pr(y))throw y;if(er(y))r=y;else if(!t.preload)throw y;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Yk(t,r):void 0,l=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let c,f;for(let v=0;v<l;v++)n.push(cq(t,n,v));try{await Promise.all(n)}catch{const v=await Promise.allSettled(n);for(const y of v){if(y.status!=="rejected")continue;const S=y.reason;if(pr(S))throw S;er(S)?c??=S:f??=S}if(f!==void 0)throw f}const h=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const v=Yk(t,h);Bs(v!==void 0);const y=t.matches[v],S=t.router.looseRoutesById[y.routeId],w=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&w&&(S.options.notFoundComponent=w),h.routeId=y.routeId;const N=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,C=>({...C,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),p=v,await qd(S,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await qd(v,["errorComponent"])}for(let v=0;v<=p;v++){const{id:y,routeId:S}=t.matches[v],w=t.router.looseRoutesById[S];try{const N=lq(t,y,w);if(N){const C=await N;t.updateMatch(y,E=>({...E,...C}))}}catch(N){console.error(`Error executing head for route ${S}:`,N)}}const g=Sw(t);if(Bd(g)&&await g,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Jk(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function qd(e,t=Vp){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Vp?(()=>{if(e._componentsPromise===void 0){const r=Jk(e,Vp);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Jk(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ZM(e){for(const t of Vp)if(e.options[t]?.preload)return!0;return!1}var Vp=["component","errorComponent","pendingComponent","notFoundComponent"],Ds="__TSR_index",eA="popstate",tA="beforeunload";function uq(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},s=async({task:l,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],p=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&h.length&&p)for(const g of h){const v=mm(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:v,action:f.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,f)=>{const h=t.state[Ds];c=nA(h+1,c),s({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:c})},replace:(l,c,f)=>{const h=t.state[Ds];c=nA(h,c),s({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:c})},go:(l,c)=>{s({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{s({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{s({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Ds]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function nA(e,t){t||(t={});const n=u1();return{...t,key:n,__TSR_key:n,[Ds]:e}}function dq(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const s=()=>i,l=P=>i=P,c=(P=>P),f=(()=>mm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=u1();t.history.replaceState({[Ds]:0,key:P,__TSR_key:P},"")}let h=f(),p,g=!1,v=!1,y=!1,S=!1;const w=()=>h;let N,C;const E=()=>{N&&(A._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),A._ignoreSubscribers=!1,N=void 0,C=void 0,p=void 0)},k=(P,R,B)=>{const $=c(R);C||(p=h),h=mm(R,B),N={href:$,state:B,isPush:N?.isPush||P==="push"},C||(C=Promise.resolve().then(()=>E()))},O=P=>{h=f(),A.notify({type:P})},T=async()=>{if(v){v=!1;return}const P=f(),R=P.state[Ds]-h.state[Ds],B=R===1,$=R===-1,L=!B&&!$||g;g=!1;const re=L?"GO":$?"BACK":"FORWARD",ge=L?{type:"GO",index:R}:{type:$?"BACK":"FORWARD"};if(y)y=!1;else{const be=s();if(typeof document<"u"&&be.length){for(const H of be)if(await H.blockerFn({currentLocation:h,nextLocation:P,action:re})){v=!0,t.history.go(1),A.notify(ge);return}}}h=f(),A.notify(ge)},z=P=>{if(S){S=!1;return}let R=!1;const B=s();if(typeof document<"u"&&B.length)for(const $ of B){const L=$.enableBeforeUnload??!0;if(L===!0){R=!0;break}if(typeof L=="function"&&L()===!0){R=!0;break}}if(R)return P.preventDefault(),P.returnValue=""},A=uq({getLocation:w,getLength:()=>t.history.length,pushState:(P,R)=>k("push",P,R),replaceState:(P,R)=>k("replace",P,R),back:P=>(P&&(y=!0),S=!0,t.history.back()),forward:P=>{P&&(y=!0),S=!0,t.history.forward()},go:P=>{g=!0,t.history.go(P)},createHref:P=>c(P),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(tA,z,{capture:!0}),t.removeEventListener(eA,T)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:s,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(tA,z,{capture:!0}),t.addEventListener(eA,T),t.history.pushState=function(...P){const R=n.apply(t.history,P);return A._ignoreSubscribers||O("PUSH"),R},t.history.replaceState=function(...P){const R=r.apply(t.history,P);return A._ignoreSubscribers||O("REPLACE"),R},A}function fq(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function mm(e,t){const n=fq(e),r=n.indexOf("#"),i=n.indexOf("?"),s=u1();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||{[Ds]:0,key:s,__TSR_key:s}}}function u1(){return(Math.random()+1).toString(36).substring(7)}function Wo(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 hq(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var pq=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,s=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=O8(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=dq()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=dm(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=rq(gq(this.latestLocation)),z8(this));let l=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(i||r!==c||s!==f){this.basepath=c;const h=[],p=LM(c);p&&p!=="/"&&h.push(q8({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:B8(h),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=x8(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&m8(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:f,hash:h,href:p,state:g})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const N=this.options.parseSearch(f),C=this.options.stringifySearch(N);return{href:c+C+h,publicHref:p,pathname:ld(c).path,external:!1,searchStr:C,search:Co(n?.search,N),hash:ld(h.slice(1)).path,state:Io(n?.state,g)}}const v=new URL(p,this.origin),y=bw(this.rewrite,v),S=this.options.parseSearch(y.search),w=this.options.stringifySearch(S);return y.search=w,{href:y.href.replace(y.origin,""),publicHref:p,pathname:ld(y.pathname).path,external:!!this.rewrite&&y.origin!==this.origin,searchStr:w,search:Co(n?.search,S),hash:ld(y.hash.slice(1)).path,state:Io(n?.state,g)}},i=r(t),{__tempLocation:s,__tempKey:l}=i.state;if(s&&(!l||l===this.tempLocationKey)){const c=r(s);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>C8({base:t,to:s1(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=>vq({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const s=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(s);i.from;const c=i.unsafeRelative==="path"?s.pathname:i.from??l.fullPath,f=this.resolvePathWithBase(c,"."),h=l.search,p=Object.assign(Object.create(null),l.params),g=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),v=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,As(i.params,p)),y=this.getMatchedRoutes(g);let S=y.matchedRoutes;if((!y.foundRoute||y.foundRoute.path!=="/"&&y.routeParams["**"])&&this.options.notFoundRoute&&(S=[...S,this.options.notFoundRoute]),Object.keys(v).length>0)for(const R of S){const B=R.options.params?.stringify??R.options.stringifyParams;if(B)try{Object.assign(v,B(v))}catch{}}const w=t.leaveParams?g:ld(Hk({path:g,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=h;if(t._includeValidateSearch&&this.options.search?.strict){const R={};S.forEach(B=>{if(B.options.validateSearch)try{Object.assign(R,Zp(B.options.validateSearch,{...R,...N}))}catch{}}),N=R}N=yq({search:N,dest:i,destRoutes:S,_includeValidateSearch:t._includeValidateSearch}),N=Co(h,N);const C=this.options.stringifySearch(N),E=i.hash===!0?s.hash:i.hash?As(i.hash,s.hash):void 0,k=E?`#${E}`:"";let O=i.state===!0?s.state:i.state?As(i.state,s.state):{};O=Io(s.state,O);const T=`${w}${C}${k}`;let z,A,P=!1;if(this.rewrite){const R=new URL(T,this.origin),B=$M(this.rewrite,R);z=R.href.replace(R.origin,""),B.origin!==this.origin?(A=B.href,P=!0):A=B.pathname+B.search+B.hash}else z=f8(T),A=z;return{publicHref:A,href:z,pathname:w,search:N,searchStr:C,state:O,hash:E??"",external:P,unmaskOnReload:i.unmaskOnReload}},r=(i={},s)=>{const l=n(i);let c=s?n(s):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=g8(l.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:p,params:g,...v}=h.route,y=g===!1||g===null?Object.create(null):(g??!0)===!0?f:Object.assign(f,As(g,f));s={from:t.from,...v,params:y},c=n(s)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(h=>{r.state[h]=this.latestLocation.state[h]});const f=Vo(r.state,this.latestLocation.state);return c.forEach(h=>{delete r.state[h]}),f},s=Rs(this.latestLocation.href)===Rs(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Ic(()=>{l?.resolve(),l=void 0}),s&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:f,...h}=r;c&&(h={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:s,href:l,...c}={})=>{if(l){const p=this.history.location.state.__TSR_index,g=mm(l,{__TSR_index:t?p:p+1}),v=new URL(g.pathname,this.origin);c.to=bw(this.rewrite,v).pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...s})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const f=this.buildLocation({to:t,...s});r=r??f.publicHref,i=i??f.publicHref}const c=!l&&i?i:r;if(um(c,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...s,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const s=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Wo({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...Wo({resolvedLocation:h,location:f})}),await Xk({router:this,sync:t?.sync,forceStaleReload:s.href===f.href,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],g=[],v=[],y=[];zd(()=>{this.__store.setState(S=>{const w=S.matches,N=S.pendingMatches||S.matches;return p=w.filter(C=>!N.some(E=>E.id===C.id)),g=w.filter(C=>!N.some(E=>E.routeId===C.routeId)),v=N.filter(C=>!w.some(E=>E.routeId===C.routeId)),y=N.filter(C=>w.some(E=>E.routeId===C.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:N,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[y,"onStay"]].forEach(([S,w])=>{S.forEach(N=>{this.looseRoutesById[N.routeId].options[w]?.(N)})})})})}})}catch(f){pr(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):er(f)&&(r=f),this.__store.setState(h=>({...h,statusCode:n?n.status:r?404:h.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 l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,s=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Wo({resolvedLocation:s,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:hq(i.cachedMatches.map(s=>s.id===t?n(s):s))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(s=>s.id===t?n(s):s)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&um(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=qd,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),s=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);zd(()=>{r.forEach(l=>{s.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await Xk({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(f=>f.id===l?c(f):f):this.updateMatch(l,c)}}),r}catch(l){if(pr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});er(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const s=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=v8(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,s.pathname,this.processedTree);return!l||t.params&&!Vo(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Vo(s.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??L8,parseSearch:e.parseSearch??I8,protocolAllowlist:e.protocolAllowlist??d8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:s}=n;let{matchedRoutes:l}=n,c=!1;(r?r.path!=="/"&&i["**"]:Rs(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const f=c?xq(this.options.notFoundMode,l):void 0,h=new Array(l.length),p=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<l.length;g++){const v=l[g],y=h[g-1];let S,w,N;{const re=y?.search??e.search,ge=y?._strictSearch??void 0;try{const be=Zp(v.options.validateSearch,{...re})??void 0;S={...re,...be},w={...ge,...be},N=void 0}catch(be){let H=be;if(be instanceof gm||(H=new gm(be.message,{cause:be})),t?.throwOnError)throw H;S=re,w={},N=H}}const C=v.options.loaderDeps?.({search:S})??"",E=C?JSON.stringify(C):"",{interpolatedPath:k,usedParams:O}=Hk({path:v.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=v.id+k+E,z=this.getMatch(T),A=p.get(v.id),P=z?._strictParams??O;let R;if(!z)try{rA(v,O,s,P)}catch(re){if(er(re)||pr(re)?R=re:R=new mq(re.message,{cause:re}),t?.throwOnError)throw R}Object.assign(i,P);const B=A?"stay":"enter";let $;if(z)$={...z,cause:B,params:A?.params??i,_strictParams:P,search:Co(A?A.search:z.search,S),_strictSearch:w};else{const re=v.options.loader||v.options.beforeLoad||v.lazyFn||ZM(v)?"pending":"success";$={id:T,ssr:v.options.ssr,index:g,routeId:v.id,params:A?.params??i,_strictParams:P,pathname:k,updatedAt:Date.now(),search:A?Co(A.search,S):S,_strictSearch:w,searchError:void 0,status:re,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Ic()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:A?Io(A.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||($.globalNotFound=f===v.id),$.searchError=N;const L=this.getParentContext(y);$.context={...L,...$.__routeContext,...$.__beforeLoadContext},h[g]=$}for(let g=0;g<h.length;g++){const v=h[g],y=this.looseRoutesById[v.routeId],S=this.getMatch(v.id),w=p.get(v.routeId);if(v.params=w?Co(w.params,i):i,!S){const N=h[g-1],C=this.getParentContext(N);if(y.options.context){const E={deps:v.loaderDeps,params:v.params,context:C??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:h,routeId:y.id};v.__routeContext=y.options.context(E)??void 0}v.context={...C,...v.__routeContext,...v.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Ud(t),s={...e.search};for(const h of t)try{Object.assign(s,Zp(h.options.validateSearch,s))}catch{}const l=Ud(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let f;if(c)f=l.params;else{const h=Object.assign(Object.create(null),n);for(const p of t)try{rA(p,n,r??{},h)}catch{}f=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:f}}},gm=class extends Error{},mq=class extends Error{};function gq(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Zp(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new gm("Async validation not supported");if(n.issues)throw new gm(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 vq({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Rs(e);let s,l;const c=y8(i,n,!0);return c&&(s=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:s,parsedParams:l}}function yq({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return bq(n)(e,t,r??!1)}function bq(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const s=({search:l,next:c})=>{let f=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(f=i.options.preSearchFilters.reduce((p,g)=>g(p),l));const h=c(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,g)=>g(p),h):h};t.middlewares.push(s)}if(i.options.validateSearch){const s=({search:l,next:c})=>{const f=c(l);if(!t._includeValidateSearch)return f;try{return{...f,...Zp(i.options.validateSearch,f)??void 0}}catch{return f}};t.middlewares.push(s)}}const n=({search:i})=>{const s=t.dest;return s.search?s.search===!0?i:As(s.search,i):{}};t.middlewares.push(n);const r=(i,s,l)=>{if(i>=l.length)return s;const c=l[i];return c({search:s,next:h=>r(i+1,h,l)})};return function(s,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,s,t.middlewares)}}function xq(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Zo}function rA(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=i(r);Object.assign(r,s)}}var wq="Error preloading route! ☝️",YM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Zo:this.parentRoute||Bs(!1);let i=r?Zo:n?.path;i&&i!=="/"&&(i=IM(i));const s=n?.id||i;let l=r?Zo:Hp([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Hp(["/",l]));const c=l==="__root__"?"/":Hp([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Rs(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=>o1({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.")}},Sq=class extends YM{constructor(e){super(e)}};function d1(e){const t=e.errorComponent??f1;return u.jsx(jq,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var jq=class extends x.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function f1({error:e}){const[t,n]=x.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function Nq({children:e,fallback:t=null}){return WM()?u.jsx(Oi.Fragment,{children:e}):u.jsx(Oi.Fragment,{children:t})}function WM(){return Oi.useSyncExternalStore(Cq,()=>!0,()=>!1)}function Cq(){return()=>{}}var QM=x.createContext(null);function ci(e){const t=x.useContext(QM);return e?.warn,t}var fb={exports:{}},hb={},pb={exports:{}},mb={};var iA;function Oq(){if(iA)return mb;iA=1;var e=Xc();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,v){var y=v(),S=r({inst:{value:y,getSnapshot:v}}),w=S[0].inst,N=S[1];return s(function(){w.value=y,w.getSnapshot=v,f(w)&&N({inst:w})},[g,y,v]),i(function(){return f(w)&&N({inst:w}),g(function(){f(w)&&N({inst:w})})},[g]),l(y),y}function f(g){var v=g.getSnapshot;g=g.value;try{var y=v();return!n(g,y)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return mb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,mb}var aA;function _q(){return aA||(aA=1,pb.exports=Oq()),pb.exports}var sA;function kq(){if(sA)return hb;sA=1;var e=Xc(),t=_q();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return hb.useSyncExternalStoreWithSelector=function(h,p,g,v,y){var S=s(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=c(function(){function C(z){if(!E){if(E=!0,k=z,z=v(z),y!==void 0&&w.hasValue){var A=w.value;if(y(A,z))return O=A}return O=z}if(A=O,r(k,z))return A;var P=v(z);return y!==void 0&&y(A,P)?(k=z,A):(k=z,O=P)}var E=!1,k,O,T=g===void 0?null:g;return[function(){return C(p())},T===null?void 0:function(){return C(T())}]},[p,g,v,y]);var N=i(h,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=N},[N]),f(N),N},hb}var oA;function Aq(){return oA||(oA=1,fb.exports=kq()),fb.exports}var XM=Aq();function Eq(e,t){return e===t}function Tq(e,t,n=Eq){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,i,i,t,n)}function vr(e){const t=ci({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return Tq(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=Io(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}var Eg=x.createContext(void 0),Pq=x.createContext(void 0);function Zs(e){const t=x.useContext(e.from?Pq:Eg);return vr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Bs(!((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 h1(e){return Zs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function p1(e){const{select:t,...n}=e;return Zs({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Tg(e){return Zs({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 Pg(e){return Zs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ys(e){const t=ci();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function m1(e){return Zs({...e,select:t=>e.select?e.select(t.context):t.context})}var ml=yM();const zq=Gs(ml);function Mq(e,t){const n=ci(),r=a8(t),{activeProps:i,inactiveProps:s,activeOptions:l,to:c,preload:f,preloadDelay:h,hashScrollIntoView:p,replace:g,startTransition:v,resetScroll:y,viewTransition:S,children:w,target:N,disabled:C,style:E,className:k,onClick:O,onBlur:T,onFocus:z,onMouseEnter:A,onMouseLeave:P,onTouchStart:R,ignoreBlocker:B,params:$,search:L,hash:re,state:ge,mask:be,reloadDocument:H,unsafeRelative:ee,from:ye,_fromLocation:Se,...q}=e,D=WM(),G=vr({select:Ne=>{const Ke=Ne.matches[Ne.matches.length-1];return{search:Ke?.search,hash:Ne.location.hash,path:Ke?.pathname}},structuralSharing:!0}),ae=e.from,Y=x.useMemo(()=>({...e,from:ae}),[n,G,ae,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ie=x.useMemo(()=>n.buildLocation({...Y}),[n,Y]),oe=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,ue=ie.maskedLocation?ie.maskedLocation.external:ie.external,we=x.useMemo(()=>Uq(oe,ue,n.history,C),[C,ue,oe,n.history]),W=x.useMemo(()=>{if(we?.external)return um(we.href,n.protocolAllowlist)?void 0:we.href;if(!Bq(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),um(c,n.protocolAllowlist)?void 0:c}catch{}},[c,we,n.protocolAllowlist]),le=vr({select:Ne=>{if(W)return!1;if(l?.exact){if(!N8(Ne.location.pathname,ie.pathname,n.basepath))return!1}else{const Ke=fm(Ne.location.pathname,n.basepath),_t=fm(ie.pathname,n.basepath);if(!(Ke.startsWith(_t)&&(Ke.length===_t.length||Ke[_t.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Vo(Ne.location.search,ie.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?D&&Ne.location.hash===ie.hash:!0}}),je=le?As(i,{})??Rq:gb,V=le?gb:As(s,{})??gb,Be=[k,je.className,V.className].filter(Boolean).join(" "),ze=(E||je.style||V.style)&&{...E,...je.style,...V.style},[Je,et]=x.useState(!1),Ot=x.useRef(!1),It=e.reloadDocument||W?!1:f??n.options.defaultPreload,kn=h??n.options.defaultPreloadDelay??0,pe=x.useCallback(()=>{n.preloadRoute({...Y,_builtLocation:ie}).catch(Ne=>{console.warn(Ne),console.warn(wq)})},[n,Y,ie]);i8(r,x.useCallback(Ne=>{Ne?.isIntersecting&&pe()},[pe]),$q,{disabled:!!C||It!=="viewport"}),x.useEffect(()=>{Ot.current||!C&&It==="render"&&(pe(),Ot.current=!0)},[C,pe,It]);const Fe=Ne=>{const Ke=Ne.currentTarget.getAttribute("target"),_t=N!==void 0?N:Ke;if(!C&&!qq(Ne)&&!Ne.defaultPrevented&&(!_t||_t==="_self")&&Ne.button===0){Ne.preventDefault(),ml.flushSync(()=>{et(!0)});const dt=n.subscribe("onResolved",()=>{dt(),et(!1)});n.navigate({...Y,replace:g,resetScroll:y,hashScrollIntoView:p,startTransition:v,viewTransition:S,ignoreBlocker:B})}};if(W)return{...q,ref:r,href:W,...w&&{children:w},...N&&{target:N},...C&&{disabled:C},...E&&{style:E},...k&&{className:k},...O&&{onClick:O},...T&&{onBlur:T},...z&&{onFocus:z},...A&&{onMouseEnter:A},...P&&{onMouseLeave:P},...R&&{onTouchStart:R}};const me=Ne=>{if(C||It!=="intent")return;if(!kn){pe();return}const Ke=Ne.currentTarget;if(dd.has(Ke))return;const _t=setTimeout(()=>{dd.delete(Ke),pe()},kn);dd.set(Ke,_t)},Ee=Ne=>{C||It!=="intent"||pe()},Te=Ne=>{if(C||!It||!kn)return;const Ke=Ne.currentTarget,_t=dd.get(Ke);_t&&(clearTimeout(_t),dd.delete(Ke))};return{...q,...je,...V,href:we?.href,ref:r,onClick:ac([O,Fe]),onBlur:ac([T,Te]),onFocus:ac([z,me]),onMouseEnter:ac([A,me]),onMouseLeave:ac([P,Te]),onTouchStart:ac([R,Ee]),disabled:!!C,target:N,...ze&&{style:ze},...Be&&{className:Be},...C&&Dq,...le&&Iq,...D&&Je&&Lq}}var gb={},Rq={className:"active"},Dq={role:"link","aria-disabled":!0},Iq={"data-status":"active","aria-current":"page"},Lq={"data-transitioning":"transitioning"},dd=new WeakMap,$q={rootMargin:"100px"},ac=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Uq(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Bq(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ut=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...s}=Mq(r,t),l=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...f}=s;return x.createElement("a",f,l)}return x.createElement(n,s,l)});function qq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Fq=class extends YM{constructor(e){super(e),this.useMatch=t=>Zs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>m1({...t,from:this.id}),this.useSearch=t=>Pg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>p1({...t,from:this.id}),this.useLoaderData=t=>h1({...t,from:this.id}),this.useNavigate=()=>Ys({from:this.fullPath}),this.Link=Oi.forwardRef((t,n)=>u.jsx(Ut,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ui(e){return new Fq(e)}function Kq(){return e=>Gq(e)}var Hq=class extends Sq{constructor(e){super(e),this.useMatch=t=>Zs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>m1({...t,from:this.id}),this.useSearch=t=>Pg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>p1({...t,from:this.id}),this.useLoaderData=t=>h1({...t,from:this.id}),this.useNavigate=()=>Ys({from:this.fullPath}),this.Link=Oi.forwardRef((t,n)=>u.jsx(Ut,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Gq(e){return new Hq(e)}function lA(e){return typeof e=="object"?new cA(e,{silent:!0}).createRoute(e):new cA(e,{silent:!0}).createRoute}var cA=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ui(n);return r.isRoot=!1,r},this.silent=t?.silent}},uA=class{constructor(e){this.useMatch=t=>Zs({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>m1({...t,from:this.options.id}),this.useSearch=t=>Pg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Tg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>p1({...t,from:this.options.id}),this.useLoaderData=t=>h1({...t,from:this.options.id}),this.useNavigate=()=>Ys({from:ci().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function dA(e){return typeof e=="object"?new uA(e):t=>new uA({id:e,...t})}function Vq(e){const t=vr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(d1,{getResetKey:()=>t,onCatch:(n,r)=>{if(er(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(er(n))return e.fallback?.(n);throw n},children:e.children})}function Zq(){return u.jsx("p",{children:"Not Found"})}function yc(e){return u.jsx(u.Fragment,{children:e.children})}function JM(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(Zq,{})}function Yq(){return ci().isScrollRestoring,null}var eR=x.memo(function({matchId:t}){const n=ci(),r=vr({select:S=>{const w=S.matches.findIndex(C=>C.id===t),N=S.matches[w];return Bs(N),{routeId:N.routeId,ssr:N.ssr,_displayPending:N._displayPending,resetKey:S.loadedAt,parentRouteId:S.matches[w-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],s=i.options.pendingComponent??n.options.defaultPendingComponent,l=s?u.jsx(s,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,f=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??s??(i.options.errorComponent?.preload||p))?x.Suspense:yc,v=c?d1:yc,y=h?Vq:yc;return u.jsxs(i.isRoot?i.options.shellComponent??yc:yc,{children:[u.jsx(Eg.Provider,{value:t,children:u.jsx(g,{fallback:l,children:u.jsx(v,{getResetKey:()=>r.resetKey,errorComponent:c||f1,onCatch:(S,w)=>{if(er(S))throw S;f?.(S,w)},children:u.jsx(y,{fallback:S=>{if(!h||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!i.isRoot)throw S;return x.createElement(h,S)},children:p||r._displayPending?u.jsx(Nq,{fallback:l,children:u.jsx(fA,{matchId:t})}):u.jsx(fA,{matchId:t})})})})}),r.parentRouteId===Zo&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(Wq,{}),u.jsx(Yq,{})]}):null]})});function Wq(){const e=ci(),t=x.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Wo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var fA=x.memo(function({matchId:t}){const n=ci(),{match:r,key:i,routeId:s}=vr({select:f=>{const h=f.matches.find(v=>v.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[s],c=x.useMemo(()=>{const f=l.options.component??n.options.defaultComponent;return f?u.jsx(f,{},i):u.jsx(g1,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const f=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise){const p=Ic();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Bs(er(r.error)),JM(n,l,r.error);if(r.status==="redirected")throw Bs(pr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),g1=x.memo(function(){const t=ci(),n=x.useContext(Eg),r=vr({select:h=>h.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],s=vr({select:h=>{const p=h.matches.find(g=>g.id===n);return Bs(p),p.globalNotFound}}),l=vr({select:h=>{const p=h.matches;return p[p.findIndex(g=>g.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(s)return JM(t,i,void 0);if(!l)return null;const f=u.jsx(eR,{matchId:l});return r===Zo?u.jsx(x.Suspense,{fallback:c,children:f}):f});function Qq(){const e=ci(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:s}=vr({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=sb(s),c=s||n||i,f=sb(c),h=s||i,p=sb(h);return e.startTransition=g=>{r(!0),x.startTransition(()=>{g(),r(!1)})},x.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Rs(e.latestLocation.publicHref)!==Rs(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),lp(()=>{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(v){console.error(v)}})()},[e]),lp(()=>{l&&!s&&e.emit({type:"onLoad",...Wo(e.state)})},[l,e,s]),lp(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...Wo(e.state)})},[h,p,e]),lp(()=>{if(f&&!c){const g=Wo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&M8(e)}},[c,f,e]),null}function Xq(){const e=ci(),t=e.routesById[Zo].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?yc:x.Suspense,{fallback:n,children:[u.jsx(Qq,{}),u.jsx(Jq,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function Jq(){const e=ci(),t=vr({select:i=>i.matches[0]?.id}),n=vr({select:i=>i.loadedAt}),r=t?u.jsx(eR,{matchId:t}):null;return u.jsx(Eg.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(d1,{getResetKey:()=>n,errorComponent:f1,onCatch:void 0,children:r})})}var e9=e=>new t9(e),t9=class extends pq{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=lA,globalThis.createLazyFileRoute=dA):typeof window<"u"&&(window.createFileRoute=lA,window.createLazyFileRoute=dA);function n9({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(QM.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function r9({router:e,...t}){return u.jsx(n9,{router:e,...t,children:u.jsx(Xq,{})})}function i9(e){return vr({select:t=>t.location})}class Fd extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function a9(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const s9=a9();function o9(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function l9(e){return`${o9()}${e}`}function c9(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 u9(){return""}function hA(){return!!u9()}async function Oe(e,t){const n=await fetch(`${s9}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,s;if(r)try{const l=JSON.parse(r);typeof l.error=="string"?i=l.error:l.error?.message?(i=l.error.message,s=l.error.code):l.message&&(i=l.message)}catch{i=r}throw new Fd(i,n.status,s)}if(n.status!==204)return n.json()}function tR(){return Oe("/projects")}function nR(e){return Oe(`/projects/${encodeURIComponent(e)}`)}function rR(){return Oe("/runs")}function Lc(e){return Oe(`/runs/${encodeURIComponent(e)}`)}function d9(e){return Oe(`/projects/${encodeURIComponent(e)}/keywords`)}function iR(e){return Oe(`/projects/${encodeURIComponent(e)}/competitors`)}function aR(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Oe(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function zg(e,t){return Oe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function f9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function h9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function sR(e,t){return Oe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function pA(e,t){const n=await nR(e);return zg(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 p9(e,t){const n=await nR(e);return zg(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 m9(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Oe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function g9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function v9(e,t){await Oe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function y9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function b9(e){await Oe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function x9(e){return Oe(`/projects/${encodeURIComponent(e)}/export`)}function v1(){return Oe("/settings")}function w9(){return Oe("/session")}function S9(e){return Oe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function j9(e){return Oe("/session",{method:"POST",body:JSON.stringify({password:e})})}function N9(e,t){return Oe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function C9(e){return Oe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function O9(e){try{return await Oe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Fd&&t.statusCode===404)return null;throw t}}function mA(e,t){return Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function _9(e){await Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function k9(e){return Oe(`/projects/${encodeURIComponent(e)}/notifications`)}function A9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function E9(e,t){await Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function T9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function P9(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function z9(e){return Oe("/apply",{method:"POST",body:JSON.stringify(e)})}function M9(e){return Oe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function oR(e){return Oe(`/projects/${encodeURIComponent(e)}/google/connections`)}function R9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function D9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function I9(e){return Oe(`/projects/${encodeURIComponent(e)}/google/properties`)}function L9(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function $9(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function lR(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function U9(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 Oe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function B9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function q9(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 Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function F9(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function y1(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function K9(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function H9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function G9(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function V9(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function gA(){return Oe("/cdp/status")}function Z9(e,t){return Oe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function vA(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function cR(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/status`)}function Y9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function W9(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function Q9(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function X9(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function b1(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function uR(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function dR(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function yA(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function J9(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function eF(e){return Oe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function tF(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function nF(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function rF(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function bA(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/status`)}function xA(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function fR(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function iF(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function wA(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function SA(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function jA(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function aF(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function sF(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Oe(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function oF(e,t){const n=l9(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:c9(e,r.status)};const i=await r.json(),s=typeof i.version=="string"?i.version:"unknown",l=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,f=[s,l===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:s,databaseConfigured:l,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 lF=6e3,cF=5,uF=180;let Hn=[],dF=0;const jw=new Set,Nw=new Map,Cw=new Map;function vm(){const e=[...Hn];for(const t of jw)t(e)}function x1(e){const t=Nw.get(e);t&&(clearTimeout(t),Nw.delete(e));const n=Cw.get(e);n&&(clearTimeout(n),Cw.delete(e))}function hR(e){x1(e);const t=Hn.length;Hn=Hn.filter(n=>n.id!==e),Hn.length!==t&&vm()}function NA(e){x1(e.id),Nw.set(e.id,setTimeout(()=>{Ow(e.id)},e.durationMs))}function fF(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function it(e,t="negative",n=lF){const r=fF(e,t,n),i={id:String(++dF),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const s=Hn.find(l=>l.dedupeKey===r.dedupeKey);if(s){if((r.dedupeMode??"drop")==="drop")return s.id;const l={...s,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Hn=Hn.map(c=>c.id===s.id?l:c),vm(),NA(l),s.id}}return Hn.length>=cF&&hR(Hn[0].id),Hn=[...Hn,i],vm(),NA(i),i.id}function Ow(e){const t=Hn.find(n=>n.id===e);!t||t.state==="closing"||(x1(e),Hn=Hn.map(n=>n.id===e?{...n,state:"closing"}:n),vm(),Cw.set(e,setTimeout(()=>{hR(e)},uF)))}function hF(e){return jw.add(e),()=>{jw.delete(e)}}function CA(){return Hn}function pF(){return new QB({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new OM({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||it({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const mF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),OA=e=>{const t=gF(e);return t.charAt(0).toUpperCase()+t.slice(1)},pR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),vF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var yF={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 bF=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>x.createElement("svg",{ref:f,...yF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pR("lucide",i),...!s&&!vF(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,p])=>x.createElement(h,p)),...Array.isArray(s)?s:[s]]));const $n=(e,t)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(bF,{ref:s,iconNode:t,className:pR(`lucide-${mF(OA(e))}`,`lucide-${e}`,r),...i}));return n.displayName=OA(e),n};const xF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mg=$n("chevron-right",xF);const wF=[["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"}]],SF=$n("download",wF);const jF=[["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"}]],NF=$n("github",jF);const CF=[["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"}]],OF=$n("globe",CF);const _F=[["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"}]],kF=$n("layout-dashboard",_F);const AF=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],EF=$n("menu",AF);const TF=[["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"}]],PF=$n("play",TF);const zF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_A=$n("plus",zF);const MF=[["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"}]],kA=$n("refresh-cw",MF);const RF=[["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"}]],DF=$n("rocket",RF);const IF=[["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"}]],LF=$n("rotate-ccw",IF);const $F=[["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"}]],UF=$n("settings",$F);const BF=[["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"}]],qF=$n("trash-2",BF);const FF=[["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"}]],KF=$n("triangle-alert",FF);const HF=[["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"}]],GF=$n("unplug",HF);const VF=[["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"}]],ZF=$n("upload",VF);const YF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Rg=$n("x",YF);var Ts=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Ts||{});const WF={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},dp={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function QF(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const s=r.slice(0,i).trim(),l=r.slice(i);try{const c=JSON.parse(l);return`${n} ${s}
10
-
11
- ${JSON.stringify(c,null,2)}`}catch{}}return`${n}
12
- ${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function Dg(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ci(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function AA(e){return e===null?"Unknown":e?"Pass":"Fail"}function _w(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function XF(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function JF(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 vb(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${_w(l)} · ${r}`}const s=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(s){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=s[2]?parseInt(s[2]):6;return`Every ${l[s[1]]} at ${_w(c)} · ${r}`}return`${e} · ${r}`}function ym(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function mR(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 eK(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 tK(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function nK(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function qs(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
13
- `):void 0}function rK(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:ym(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:ym(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(f=>f.state==="ready").length,s=n.providerStatuses.length,l=i>0,c=n.providerStatuses.filter(f=>f.state==="ready").map(f=>nK(f)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${s} configured`,meta:c||"None configured"}})}function iK(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 aK(e,t,n){const r=iK(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(s=>{if(s.id==="api")return{...s,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(s.id==="worker")return{...s,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(c=>c.state==="ready");return{...s,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const gR="canonry.run-tracker",kw=new Set;let EA=!1,sK=0,Ig={runs:{},batches:{}};function oK(){const e=rl();for(const t of kw)t(e)}function lK(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function cK(){typeof window>"u"||window.sessionStorage.setItem(gR,JSON.stringify(Ig))}function vR(){EA||(EA=!0,!(typeof window>"u")&&(Ig=lK(window.sessionStorage.getItem(gR))))}function Lg(e){Ig=e,cK(),oK()}function rl(){return vR(),Ig}function uK(e){return vR(),kw.add(e),()=>{kw.delete(e)}}function yR(e){const t=rl();Lg({...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 TA(e){const t=rl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Lg({...t,runs:r})}function dK(e){const t=rl(),n=`batch_${Date.now()}_${++sK}`;return Lg({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function fK(e){const t=rl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Lg({...t,batches:r})}function hK(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function pK(e,t){let n=0,r=0,i=0,s=0,l=0;for(const c of e){const f=t[c]?.status;f==="completed"?n+=1:f==="partial"?r+=1:f==="failed"?i+=1:f==="cancelled"?s+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:s,pending:l,finished:l===0}}function PA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function w1(...e){return t=>{let n=!1;const r=e.map(i=>{const s=PA(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():PA(e[i],null)}}}}function gl(...e){return x.useCallback(w1(...e),e)}var mK=Symbol.for("react.lazy"),bm=Og[" use ".trim().toString()];function gK(e){return typeof e=="object"&&e!==null&&"then"in e}function bR(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mK&&"_payload"in e&&gK(e._payload)}function vK(e){const t=bK(e),n=x.forwardRef((r,i)=>{let{children:s,...l}=r;bR(s)&&typeof bm=="function"&&(s=bm(s._payload));const c=x.Children.toArray(s),f=c.find(wK);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var yK=vK("Slot");function bK(e){const t=x.forwardRef((n,r)=>{let{children:i,...s}=n;if(bR(i)&&typeof bm=="function"&&(i=bm(i._payload)),x.isValidElement(i)){const l=jK(i),c=SK(s,i.props);return i.type!==x.Fragment&&(c.ref=r?w1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xK=Symbol("radix.slottable");function wK(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xK}function SK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function jK(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 xR(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=xR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xR(e))&&(r&&(r+=" "),r+=t);return r}const zA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,MA=vt,wR=(e,t)=>n=>{var r;if(t?.variants==null)return MA(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,l=Object.keys(i).map(h=>{const p=n?.[h],g=s?.[h];if(p===null)return null;const v=zA(p)||zA(g);return i[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...y}=p;return Object.entries(y).every(S=>{let[w,N]=S;return Array.isArray(N)?N.includes({...s,...c}[w]):{...s,...c}[w]===N})?[...h,g,v]:h},[]);return MA(e,l,f,n?.class,n?.className)},NK=(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},CK=(e,t)=>({classGroupId:e,validator:t}),SR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xm="-",RA=[],OK="arbitrary..",_K=e=>{const t=AK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return kK(l);const c=l.split(xm),f=c[0]===""&&c.length>1?1:0;return jR(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],h=n[l];return f?h?NK(h,f):f:h||RA}return n[l]||RA}}},jR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const h=jR(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(xm):e.slice(t).join(xm),f=l.length;for(let h=0;h<f;h++){const p=l[h];if(p.validator(c))return p.classGroupId}},kK=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?OK+r:void 0})(),AK=e=>{const{theme:t,classGroups:n}=e;return EK(n,t)},EK=(e,t)=>{const n=SR();for(const r in e){const i=e[r];S1(i,n,r,t)}return n},S1=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];TK(l,t,n,r)}},TK=(e,t,n,r)=>{if(typeof e=="string"){PK(e,t,n);return}if(typeof e=="function"){zK(e,t,n,r);return}MK(e,t,n,r)},PK=(e,t,n)=>{const r=e===""?t:NR(t,e);r.classGroupId=n},zK=(e,t,n,r)=>{if(RK(e)){S1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CK(n,e))},MK=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[c,f]=i[l];S1(f,NR(t,c),n,r)}},NR=(e,t)=>{let n=e;const r=t.split(xm),i=r.length;for(let s=0;s<i;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=SR(),n.nextPart.set(l,c)),n=c}return n},RK=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},Aw="!",DA=":",IK=[],IA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),LK=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let l=0,c=0,f=0,h;const p=i.length;for(let w=0;w<p;w++){const N=i[w];if(l===0&&c===0){if(N===DA){s.push(i.slice(f,w)),f=w+1;continue}if(N==="/"){h=w;continue}}N==="["?l++:N==="]"?l--:N==="("?c++:N===")"&&c--}const g=s.length===0?i:i.slice(f);let v=g,y=!1;g.endsWith(Aw)?(v=g.slice(0,-1),y=!0):g.startsWith(Aw)&&(v=g.slice(1),y=!0);const S=h&&h>f?h-f:void 0;return IA(s,y,v,S)};if(t){const i=t+DA,s=r;r=l=>l.startsWith(i)?s(l.slice(i.length)):IA(IK,!1,l,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},$K=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",f=t.has(l);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},UK=e=>({cache:DK(e.cacheSize),parseClassName:LK(e),sortModifiers:$K(e),..._K(e)}),BK=/\s+/,qK=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,l=[],c=e.trim().split(BK);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let N=!!w,C=r(N?S.substring(0,w):S);if(!C){if(!N){f=p+(f.length>0?" "+f:f);continue}if(C=r(S),!C){f=p+(f.length>0?" "+f:f);continue}N=!1}const E=v.length===0?"":v.length===1?v[0]:s(v).join(":"),k=y?E+Aw:E,O=k+C;if(l.indexOf(O)>-1)continue;l.push(O);const T=i(C,N);for(let z=0;z<T.length;++z){const A=T[z];l.push(k+A)}f=p+(f.length>0?" "+f:f)}return f},FK=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=CR(n))&&(i&&(i+=" "),i+=r);return i},CR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=CR(e[r]))&&(n&&(n+=" "),n+=t);return n},KK=(e,...t)=>{let n,r,i,s;const l=f=>{const h=t.reduce((p,g)=>g(p),e());return n=UK(h),r=n.cache.get,i=n.cache.set,s=c,c(f)},c=f=>{const h=r(f);if(h)return h;const p=qK(f,n);return i(f,p),p};return s=l,(...f)=>s(FK(...f))},HK=[],gn=e=>{const t=n=>n[e]||HK;return t.isThemeGetter=!0,t},OR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_R=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GK=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZK=/\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$/,YK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bs=e=>GK.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),xs=e=>!!e&&Number.isInteger(Number(e)),yb=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),ka=e=>VK.test(e),kR=()=>!0,XK=e=>ZK.test(e)&&!YK.test(e),j1=()=>!1,JK=e=>WK.test(e),eH=e=>QK.test(e),tH=e=>!Me(e)&&!Re(e),nH=e=>Ws(e,TR,j1),Me=e=>OR.test(e),_o=e=>Ws(e,PR,XK),LA=e=>Ws(e,uH,Xe),rH=e=>Ws(e,MR,kR),iH=e=>Ws(e,zR,j1),$A=e=>Ws(e,AR,j1),aH=e=>Ws(e,ER,eH),fp=e=>Ws(e,RR,JK),Re=e=>_R.test(e),fd=e=>vl(e,PR),sH=e=>vl(e,zR),UA=e=>vl(e,AR),oH=e=>vl(e,TR),lH=e=>vl(e,ER),hp=e=>vl(e,RR,!0),cH=e=>vl(e,MR,!0),Ws=(e,t,n)=>{const r=OR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vl=(e,t,n=!1)=>{const r=_R.exec(e);return r?r[1]?t(r[1]):n:!1},AR=e=>e==="position"||e==="percentage",ER=e=>e==="image"||e==="url",TR=e=>e==="length"||e==="size"||e==="bg-size",PR=e=>e==="length",uH=e=>e==="number",zR=e=>e==="family-name",MR=e=>e==="number"||e==="weight",RR=e=>e==="shadow",dH=()=>{const e=gn("color"),t=gn("font"),n=gn("text"),r=gn("font-weight"),i=gn("tracking"),s=gn("leading"),l=gn("breakpoint"),c=gn("container"),f=gn("spacing"),h=gn("radius"),p=gn("shadow"),g=gn("inset-shadow"),v=gn("text-shadow"),y=gn("drop-shadow"),S=gn("blur"),w=gn("perspective"),N=gn("aspect"),C=gn("ease"),E=gn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...O(),Re,Me],z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],P=()=>[Re,Me,f],R=()=>[bs,"full","auto",...P()],B=()=>[xs,"none","subgrid",Re,Me],$=()=>["auto",{span:["full",xs,Re,Me]},xs,Re,Me],L=()=>[xs,"auto",Re,Me],re=()=>["auto","min","max","fr",Re,Me],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],be=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...P()],ee=()=>[bs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],ye=()=>[bs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Se=()=>[bs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],q=()=>[e,Re,Me],D=()=>[...O(),UA,$A,{position:[Re,Me]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",oH,nH,{size:[Re,Me]}],Y=()=>[yb,fd,_o],ie=()=>["","none","full",h,Re,Me],oe=()=>["",Xe,fd,_o],ue=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[Xe,yb,UA,$A],le=()=>["","none",S,Re,Me],je=()=>["none",Xe,Re,Me],V=()=>["none",Xe,Re,Me],Be=()=>[Xe,Re,Me],ze=()=>[bs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ka],breakpoint:[ka],color:[kR],container:[ka],"drop-shadow":[ka],ease:["in","out","in-out"],font:[tH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ka],shadow:[ka],spacing:["px",Xe],text:[ka],"text-shadow":[ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bs,Me,Re,N]}],container:["container"],columns:[{columns:[Xe,Me,Re,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[xs,"auto",Re,Me]}],basis:[{basis:[bs,"full","auto",c,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,bs,"auto","initial","none",Me]}],grow:[{grow:["",Xe,Re,Me]}],shrink:[{shrink:["",Xe,Re,Me]}],order:[{order:[xs,"first","last","none",Re,Me]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":B()}],"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":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...be(),"normal"]}],"justify-self":[{"justify-self":["auto",...be()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...be(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...be(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...be(),"baseline"]}],"place-self":[{"place-self":["auto",...be()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"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",...ee()]}],"min-w":[{"min-w":[c,"screen","none",...ee()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,fd,_o]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,cH,rH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yb,Me]}],"font-family":[{font:[sH,iH,t]}],"font-features":[{"font-features":[Me]}],"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,Re,Me]}],"line-clamp":[{"line-clamp":[Xe,"none",Re,LA]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Re,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Re,_o]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Xe,"auto",Re,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Me]}],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",Re,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xs,Re,Me],radial:["",Re,Me],conic:[xs,Re,Me]},lH,aH]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Re,Me]}],"outline-w":[{outline:["",Xe,fd,_o]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,hp,fp]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",g,hp,fp]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Xe,_o]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",v,hp,fp]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[Xe,Re,Me]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Re,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,Me]}],filter:[{filter:["","none",Re,Me]}],blur:[{blur:le()}],brightness:[{brightness:[Xe,Re,Me]}],contrast:[{contrast:[Xe,Re,Me]}],"drop-shadow":[{"drop-shadow":["","none",y,hp,fp]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",Xe,Re,Me]}],"hue-rotate":[{"hue-rotate":[Xe,Re,Me]}],invert:[{invert:["",Xe,Re,Me]}],saturate:[{saturate:[Xe,Re,Me]}],sepia:[{sepia:["",Xe,Re,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Me]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Re,Me]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Re,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Re,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Re,Me]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Re,Me]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Re,Me]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Re,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Re,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Re,Me]}],ease:[{ease:["linear","initial",C,Re,Me]}],delay:[{delay:[Xe,Re,Me]}],animate:[{animate:["none",E,Re,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Re,Me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Re,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Re,Me]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Re,Me]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Xe,fd,_o,LA]}],stroke:[{stroke:["none",...q()]}],"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"]}},fH=KK(dH);function di(...e){return fH(vt(e))}const hH=wR("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"}}),ve=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const l=r?yK:"button";return u.jsx(l,{ref:s,className:di(hH({variant:t,size:n,className:e})),...i})});ve.displayName="Button";const pH=wR("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 DR({className:e,variant:t,...n}){return u.jsx("div",{className:di(pH({variant:t}),e),...n})}function BA({compact:e=!1}){return u.jsxs(Ut,{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 Kd({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 wt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(DR,{variant:r,...n,children:t})}function $g({status:e}){return u.jsx(wt,{tone:mR(e),children:Dg(e)})}function Is(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function mH(e,t){const n=x.createContext(t),r=s=>{const{children:l,...c}=s,f=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(s){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function gH(e,t=[]){let n=[];function r(s,l){const c=x.createContext(l),f=n.length;n=[...n,l];const h=g=>{const{scope:v,children:y,...S}=g,w=v?.[e]?.[f]||c,N=x.useMemo(()=>S,Object.values(S));return u.jsx(w.Provider,{value:N,children:y})};h.displayName=s+"Provider";function p(g,v){const y=v?.[e]?.[f]||c,S=x.useContext(y);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,p]}const i=()=>{const s=n.map(l=>x.createContext(l));return function(c){const f=c?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[r,vH(i,...t)]}function vH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const l=r.reduce((c,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...c,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Hd=globalThis?.document?x.useLayoutEffect:()=>{},yH=Og[" useId ".trim().toString()]||(()=>{}),bH=0;function bb(e){const[t,n]=x.useState(yH());return Hd(()=>{n(r=>r??String(bH++))},[e]),e||(t?`radix-${t}`:"")}var xH=Og[" useInsertionEffect ".trim().toString()]||Hd;function wH({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,l]=SH({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const h=x.useCallback(p=>{if(c){const g=jH(p)?p(e):p;g!==e&&l.current?.(g)}else s(p)},[c,e,s,l]);return[f,h]}function SH({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return xH(()=>{s.current=t},[t]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function jH(e){return typeof e=="function"}function IR(e){const t=NH(e),n=x.forwardRef((r,i)=>{const{children:s,...l}=r,c=x.Children.toArray(s),f=c.find(OH);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function NH(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const l=kH(i),c=_H(s,i.props);return i.type!==x.Fragment&&(c.ref=r?w1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CH=Symbol("radix.slottable");function OH(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CH}function _H(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function kH(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 AH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qa=AH.reduce((e,t)=>{const n=IR(`Primitive.${t}`),r=x.forwardRef((i,s)=>{const{asChild:l,...c}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function EH(e,t){e&&ml.flushSync(()=>e.dispatchEvent(t))}function Gd(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function TH(e,t=globalThis?.document){const n=Gd(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PH="DismissableLayer",Ew="dismissableLayer.update",zH="dismissableLayer.pointerDownOutside",MH="dismissableLayer.focusOutside",qA,LR=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$R=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...f}=e,h=x.useContext(LR),[p,g]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),S=gl(t,A=>g(A)),w=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(N),E=p?w.indexOf(p):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,O=E>=C,T=IH(A=>{const P=A.target,R=[...h.branches].some(B=>B.contains(P));!O||R||(i?.(A),l?.(A),A.defaultPrevented||c?.())},v),z=LH(A=>{const P=A.target;[...h.branches].some(B=>B.contains(P))||(s?.(A),l?.(A),A.defaultPrevented||c?.())},v);return TH(A=>{E===h.layers.size-1&&(r?.(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(qA=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),FA(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=qA)}},[p,v,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),FA())},[p,h]),x.useEffect(()=>{const A=()=>y({});return document.addEventListener(Ew,A),()=>document.removeEventListener(Ew,A)},[]),u.jsx(qa.div,{...f,ref:S,style:{pointerEvents:k?O?"auto":"none":void 0,...e.style},onFocusCapture:Is(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Is(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Is(e.onPointerDownCapture,T.onPointerDownCapture)})});$R.displayName=PH;var RH="DismissableLayerBranch",DH=x.forwardRef((e,t)=>{const n=x.useContext(LR),r=x.useRef(null),i=gl(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(qa.div,{...e,ref:i})});DH.displayName=RH;function IH(e,t=globalThis?.document){const n=Gd(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){UR(zH,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function LH(e,t=globalThis?.document){const n=Gd(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&UR(MH,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FA(){const e=new CustomEvent(Ew);document.dispatchEvent(e)}function UR(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?EH(i,s):i.dispatchEvent(s)}var xb="focusScope.autoFocusOnMount",wb="focusScope.autoFocusOnUnmount",KA={bubbles:!1,cancelable:!0},$H="FocusScope",BR=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,f]=x.useState(null),h=Gd(i),p=Gd(s),g=x.useRef(null),v=gl(t,w=>f(w)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(k){if(y.paused||!c)return;const O=k.target;c.contains(O)?g.current=O:js(g.current,{select:!0})},N=function(k){if(y.paused||!c)return;const O=k.relatedTarget;O!==null&&(c.contains(O)||js(g.current,{select:!0}))},C=function(k){if(document.activeElement===document.body)for(const T of k)T.removedNodes.length>0&&js(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const E=new MutationObserver(C);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),E.disconnect()}}},[r,c,y.paused]),x.useEffect(()=>{if(c){GA.add(y);const w=document.activeElement;if(!c.contains(w)){const C=new CustomEvent(xb,KA);c.addEventListener(xb,h),c.dispatchEvent(C),C.defaultPrevented||(UH(HH(qR(c)),{select:!0}),document.activeElement===w&&js(c))}return()=>{c.removeEventListener(xb,h),setTimeout(()=>{const C=new CustomEvent(wb,KA);c.addEventListener(wb,p),c.dispatchEvent(C),C.defaultPrevented||js(w??document.body,{select:!0}),c.removeEventListener(wb,p),GA.remove(y)},0)}}},[c,h,p,y]);const S=x.useCallback(w=>{if(!n&&!r||y.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(N&&C){const E=w.currentTarget,[k,O]=BH(E);k&&O?!w.shiftKey&&C===O?(w.preventDefault(),n&&js(k,{select:!0})):w.shiftKey&&C===k&&(w.preventDefault(),n&&js(O,{select:!0})):C===E&&w.preventDefault()}},[n,r,y.paused]);return u.jsx(qa.div,{tabIndex:-1,...l,ref:v,onKeyDown:S})});BR.displayName=$H;function UH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function BH(e){const t=qR(e),n=HA(t,e),r=HA(t.reverse(),e);return[n,r]}function qR(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 HA(e,t){for(const n of e)if(!qH(n,{upTo:t}))return n}function qH(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 FH(e){return e instanceof HTMLInputElement&&"select"in e}function js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&FH(e)&&t&&e.select()}}var GA=KH();function KH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=VA(e,t),e.unshift(t)},remove(t){e=VA(e,t),e[0]?.resume()}}}function VA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function HH(e){return e.filter(t=>t.tagName!=="A")}var GH="Portal",FR=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=x.useState(!1);Hd(()=>s(!0),[]);const l=n||i&&globalThis?.document?.body;return l?zq.createPortal(u.jsx(qa.div,{...r,ref:t}),l):null});FR.displayName=GH;function VH(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ug=e=>{const{present:t,children:n}=e,r=ZH(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=gl(r.ref,YH(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};Ug.displayName="Presence";function ZH(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),l=e?"mounted":"unmounted",[c,f]=VH(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=pp(r.current);s.current=c==="mounted"?h:"none"},[c]),Hd(()=>{const h=r.current,p=i.current;if(p!==e){const v=s.current,y=pp(h);e?f("MOUNT"):y==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Hd(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,g=y=>{const w=pp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(f("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},v=y=>{y.target===t&&(s.current=pp(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function pp(e){return e?.animationName||"none"}function YH(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 Sb=0;function WH(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ZA()),document.body.insertAdjacentElement("beforeend",e[1]??ZA()),Sb++,()=>{Sb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sb--}},[])}function ZA(){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 Vi=function(){return Vi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Vi.apply(this,arguments)};function KR(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 QH(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Yp="right-scroll-bar-position",Wp="width-before-scroll-bar",XH="with-scroll-bars-hidden",JH="--removed-body-scroll-bar-size";function jb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function e7(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var t7=typeof window<"u"?x.useLayoutEffect:x.useEffect,YA=new WeakMap;function n7(e,t){var n=e7(null,function(r){return e.forEach(function(i){return jb(i,r)})});return t7(function(){var r=YA.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(c){s.has(c)||jb(c,null)}),s.forEach(function(c){i.has(c)||jb(c,l)})}YA.set(n,e)},[e]),n}function r7(e){return e}function i7(e,t){t===void 0&&(t=r7);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var f=function(){var p=l;l=[],p.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return i}function a7(e){e===void 0&&(e={});var t=i7(null);return t.options=Vi({async:!0,ssr:!1},e),t}var HR=function(e){var t=e.sideCar,n=KR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Vi({},n))};HR.isSideCarExport=!0;function s7(e,t){return e.useMedium(t),HR}var GR=a7(),Nb=function(){},Bg=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Nb,onWheelCapture:Nb,onTouchMoveCapture:Nb}),i=r[0],s=r[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,N=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,k=e.gapMode,O=KR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,z=n7([n,t]),A=Vi(Vi({},O),i);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:GR,removeScrollBar:h,shards:g,noRelative:y,noIsolation:S,inert:w,setCallbacks:s,allowPinchZoom:!!N,lockRef:n,gapMode:k}),l?x.cloneElement(x.Children.only(c),Vi(Vi({},A),{ref:z})):x.createElement(E,Vi({},A,{className:f,ref:z}),c))});Bg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bg.classNames={fullWidth:Wp,zeroRight:Yp};var o7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function l7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o7();return t&&e.setAttribute("nonce",t),e}function c7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function u7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var d7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=l7())&&(c7(t,n),u7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},f7=function(){var e=d7();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VR=function(){var e=f7(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},h7={left:0,top:0,right:0,gap:0},Cb=function(e){return parseInt(e||"",10)||0},p7=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[Cb(n),Cb(r),Cb(i)]},m7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return h7;var t=p7(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])}},g7=VR(),Ec="data-scroll-locked",v7=function(e,t,n,r){var i=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
14
- .`.concat(XH,` {
15
- overflow: hidden `).concat(r,`;
16
- padding-right: `).concat(c,"px ").concat(r,`;
17
- }
18
- body[`).concat(Ec,`] {
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(s,`px;
24
- padding-right: `).concat(l,`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(Yp,` {
32
- right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(Wp,` {
36
- margin-right: `).concat(c,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(Yp," .").concat(Yp,` {
40
- right: 0 `).concat(r,`;
41
- }
42
-
43
- .`).concat(Wp," .").concat(Wp,` {
44
- margin-right: 0 `).concat(r,`;
45
- }
46
-
47
- body[`).concat(Ec,`] {
48
- `).concat(JH,": ").concat(c,`px;
49
- }
50
- `)},WA=function(){var e=parseInt(document.body.getAttribute(Ec)||"0",10);return isFinite(e)?e:0},y7=function(){x.useEffect(function(){return document.body.setAttribute(Ec,(WA()+1).toString()),function(){var e=WA()-1;e<=0?document.body.removeAttribute(Ec):document.body.setAttribute(Ec,e.toString())}},[])},b7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;y7();var s=x.useMemo(function(){return m7(i)},[i]);return x.createElement(g7,{styles:v7(s,!t,i,n?"":"!important")})},Tw=!1;if(typeof window<"u")try{var mp=Object.defineProperty({},"passive",{get:function(){return Tw=!0,!0}});window.addEventListener("test",mp,mp),window.removeEventListener("test",mp,mp)}catch{Tw=!1}var sc=Tw?{passive:!1}:!1,x7=function(e){return e.tagName==="TEXTAREA"},ZR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!x7(e)&&n[t]==="visible")},w7=function(e){return ZR(e,"overflowY")},S7=function(e){return ZR(e,"overflowX")},QA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=YR(e,r);if(i){var s=WR(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},j7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},N7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},YR=function(e,t){return e==="v"?w7(t):S7(t)},WR=function(e,t){return e==="v"?j7(t):N7(t)},C7=function(e,t){return e==="h"&&t==="rtl"?-1:1},O7=function(e,t,n,r,i){var s=C7(e,window.getComputedStyle(t).direction),l=s*r,c=n.target,f=t.contains(c),h=!1,p=l>0,g=0,v=0;do{if(!c)break;var y=WR(e,c),S=y[0],w=y[1],N=y[2],C=w-N-s*S;(S||C)&&YR(e,c)&&(g+=C,v+=S);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},gp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},XA=function(e){return[e.deltaX,e.deltaY]},JA=function(e){return e&&"current"in e?e.current:e},_7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k7=function(e){return`
51
- .block-interactivity-`.concat(e,` {pointer-events: none;}
52
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
53
- `)},A7=0,oc=[];function E7(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(A7++)[0],s=x.useState(VR)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=QH([e.lockRef.current],(e.shards||[]).map(JA),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(w,N){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var C=gp(w),E=n.current,k="deltaX"in w?w.deltaX:E[0]-C[0],O="deltaY"in w?w.deltaY:E[1]-C[1],T,z=w.target,A=Math.abs(k)>Math.abs(O)?"h":"v";if("touches"in w&&A==="h"&&z.type==="range")return!1;var P=window.getSelection(),R=P&&P.anchorNode,B=R?R===z||R.contains(z):!1;if(B)return!1;var $=QA(A,z);if(!$)return!0;if($?T=A:(T=A==="v"?"h":"v",$=QA(A,z)),!$)return!1;if(!r.current&&"changedTouches"in w&&(k||O)&&(r.current=T),!T)return!0;var L=r.current||T;return O7(L,N,w,L==="h"?k:O)},[]),f=x.useCallback(function(w){var N=w;if(!(!oc.length||oc[oc.length-1]!==s)){var C="deltaY"in N?XA(N):gp(N),E=t.current.filter(function(T){return T.name===N.type&&(T.target===N.target||N.target===T.shadowParent)&&_7(T.delta,C)})[0];if(E&&E.should){N.cancelable&&N.preventDefault();return}if(!E){var k=(l.current.shards||[]).map(JA).filter(Boolean).filter(function(T){return T.contains(N.target)}),O=k.length>0?c(N,k[0]):!l.current.noIsolation;O&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(w,N,C,E){var k={name:w,delta:N,target:C,should:E,shadowParent:T7(C)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(O){return O!==k})},1)},[]),p=x.useCallback(function(w){n.current=gp(w),r.current=void 0},[]),g=x.useCallback(function(w){h(w.type,XA(w),w.target,c(w,e.lockRef.current))},[]),v=x.useCallback(function(w){h(w.type,gp(w),w.target,c(w,e.lockRef.current))},[]);x.useEffect(function(){return oc.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,sc),document.addEventListener("touchmove",f,sc),document.addEventListener("touchstart",p,sc),function(){oc=oc.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,sc),document.removeEventListener("touchmove",f,sc),document.removeEventListener("touchstart",p,sc)}},[]);var y=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(s,{styles:k7(i)}):null,y?x.createElement(b7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function T7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const P7=s7(GR,E7);var QR=x.forwardRef(function(e,t){return x.createElement(Bg,Vi({},e,{ref:t,sideCar:P7}))});QR.classNames=Bg.classNames;var z7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lc=new WeakMap,vp=new WeakMap,yp={},Ob=0,XR=function(e){return e&&(e.host||XR(e.parentNode))},M7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XR(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})},R7=function(e,t,n,r){var i=M7(t,Array.isArray(e)?e:[e]);yp[n]||(yp[n]=new WeakMap);var s=yp[n],l=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var y=v.getAttribute(r),S=y!==null&&y!=="false",w=(lc.get(v)||0)+1,N=(s.get(v)||0)+1;lc.set(v,w),s.set(v,N),l.push(v),w===1&&S&&vp.set(v,!0),N===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),c.clear(),Ob++,function(){l.forEach(function(g){var v=lc.get(g)-1,y=s.get(g)-1;lc.set(g,v),s.set(g,y),v||(vp.has(g)||g.removeAttribute(r),vp.delete(g)),y||g.removeAttribute(n)}),Ob--,Ob||(lc=new WeakMap,lc=new WeakMap,vp=new WeakMap,yp={})}},D7=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=z7(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),R7(r,i,n,"aria-hidden")):function(){return null}},qg="Dialog",[JR]=gH(qg),[I7,Mi]=JR(qg),eD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=x.useRef(null),f=x.useRef(null),[h,p]=wH({prop:r,defaultProp:i??!1,onChange:s,caller:qg});return u.jsx(I7,{scope:t,triggerRef:c,contentRef:f,contentId:bb(),titleId:bb(),descriptionId:bb(),open:h,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};eD.displayName=qg;var tD="DialogTrigger",L7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Mi(tD,n),s=gl(t,i.triggerRef);return u.jsx(qa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":O1(i.open),...r,ref:s,onClick:Is(e.onClick,i.onOpenToggle)})});L7.displayName=tD;var N1="DialogPortal",[$7,nD]=JR(N1,{forceMount:void 0}),rD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Mi(N1,t);return u.jsx($7,{scope:t,forceMount:n,children:x.Children.map(r,l=>u.jsx(Ug,{present:n||s.open,children:u.jsx(FR,{asChild:!0,container:i,children:l})}))})};rD.displayName=N1;var wm="DialogOverlay",iD=x.forwardRef((e,t)=>{const n=nD(wm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Mi(wm,e.__scopeDialog);return s.modal?u.jsx(Ug,{present:r||s.open,children:u.jsx(B7,{...i,ref:t})}):null});iD.displayName=wm;var U7=IR("DialogOverlay.RemoveScroll"),B7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Mi(wm,n);return u.jsx(QR,{as:U7,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(qa.div,{"data-state":O1(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),il="DialogContent",aD=x.forwardRef((e,t)=>{const n=nD(il,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Mi(il,e.__scopeDialog);return u.jsx(Ug,{present:r||s.open,children:s.modal?u.jsx(q7,{...i,ref:t}):u.jsx(F7,{...i,ref:t})})});aD.displayName=il;var q7=x.forwardRef((e,t)=>{const n=Mi(il,e.__scopeDialog),r=x.useRef(null),i=gl(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return D7(s)},[]),u.jsx(sD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Is(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Is(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&s.preventDefault()}),onFocusOutside:Is(e.onFocusOutside,s=>s.preventDefault())})}),F7=x.forwardRef((e,t)=>{const n=Mi(il,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(sD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),sD=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=Mi(il,n),f=x.useRef(null),h=gl(t,f);return WH(),u.jsxs(u.Fragment,{children:[u.jsx(BR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx($R,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":O1(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(K7,{titleId:c.titleId}),u.jsx(G7,{contentRef:f,descriptionId:c.descriptionId})]})]})}),C1="DialogTitle",oD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Mi(C1,n);return u.jsx(qa.h2,{id:i.titleId,...r,ref:t})});oD.displayName=C1;var lD="DialogDescription",cD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Mi(lD,n);return u.jsx(qa.p,{id:i.descriptionId,...r,ref:t})});cD.displayName=lD;var uD="DialogClose",dD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Mi(uD,n);return u.jsx(qa.button,{type:"button",...r,ref:t,onClick:Is(e.onClick,()=>i.onOpenChange(!1))})});dD.displayName=uD;function O1(e){return e?"open":"closed"}var fD="DialogTitleWarning",[Uye,hD]=mH(fD,{contentName:il,titleName:C1,docsSlug:"dialog"}),K7=({titleId:e})=>{const t=hD(fD),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 x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},H7="DialogDescriptionWarning",G7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hD(H7).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},pD=eD,mD=rD,_1=iD,k1=aD,A1=oD,gD=cD,vD=dD;const V7=pD,Z7=mD,yD=x.forwardRef(({className:e,...t},n)=>u.jsx(_1,{ref:n,className:di("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));yD.displayName=_1.displayName;const Y7=400,W7=1200,Q7=720,bD=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,s]=x.useState(Q7),l=x.useRef(!1),c=x.useRef(0),f=x.useRef(0),h=x.useCallback(v=>{l.current=!0,c.current=v.clientX,f.current=i,v.target.setPointerCapture(v.pointerId),v.preventDefault()},[i]),p=x.useCallback(v=>{if(!l.current)return;const y=c.current-v.clientX,S=Math.min(W7,Math.max(Y7,f.current+y));s(S)},[]),g=x.useCallback(()=>{l.current=!1},[]);return u.jsxs(Z7,{children:[u.jsx(yD,{}),u.jsxs(k1,{ref:r,className:di("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[u.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:h,onPointerMove:p,onPointerUp:g}),t,u.jsxs(vD,{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(Rg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});bD.displayName=k1.displayName;const X7=({className:e,...t})=>u.jsx("div",{className:di("flex flex-col gap-1.5 pr-10",e),...t}),xD=x.forwardRef(({className:e,...t},n)=>u.jsx(A1,{ref:n,className:di("text-lg font-medium text-zinc-50",e),...t}));xD.displayName=A1.displayName;const wD=x.forwardRef(({className:e,...t},n)=>u.jsx(gD,{ref:n,className:di("text-sm text-zinc-500",e),...t}));wD.displayName=gD.displayName;function J7({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(V7,{open:r,onOpenChange:s=>s?void 0:i(),children:u.jsxs(bD,{children:[u.jsxs(X7,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(xD,{id:"drawer-title",children:e}),u.jsx(wD,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function fe(e,t,n){function r(c,f){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:f,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,f);const h=l.prototype,p=Object.keys(h);for(let g=0;g<p.length;g++){const v=p[g];v in c||(c[v]=h[v].bind(c))}}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function l(c){var f;const h=n?.Parent?new s:this;r(h,c),(f=h._zod).deferred??(f.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Tc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class SD extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const jD={};function Fs(e){return jD}function ND(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 Pw(e,t){return typeof t=="bigint"?t.toString():t}function E1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function T1(e){return e==null}function P1(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function eG(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const f=r.match(/\d?e-(\d?)/);f?.[1]&&(i=Number.parseInt(f[1]))}const s=n>i?n:i,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}const eE=Symbol("evaluating");function St(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==eE)return r===void 0&&(r=eE,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function yl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Qs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function tE(e){return JSON.stringify(e)}function tG(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const CD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Sm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const nG=E1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function $c(e){if(Sm(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Sm(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function OD(e){return $c(e)?{...e}:Array.isArray(e)?[...e]:e}const rG=new Set(["string","number","symbol"]);function Uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $e(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 iG(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const aG={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 sG(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Qs(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return yl(this,"shape",l),l},checks:[]});return Xs(e,s)}function oG(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Qs(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return yl(this,"shape",l),l},checks:[]});return Xs(e,s)}function lG(e,t){if(!$c(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(s,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Qs(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return yl(this,"shape",s),s}});return Xs(e,i)}function cG(e,t){if(!$c(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Qs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yl(this,"shape",r),r}});return Xs(e,n)}function uG(e,t){const n=Qs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Xs(e,n)}function dG(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Qs(t._zod.def,{get shape(){const c=t._zod.def.shape,f={...c};if(n)for(const h in n){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(f[h]=e?new e({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)f[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return yl(this,"shape",f),f},checks:[]});return Xs(t,l)}function fG(e,t,n){const r=Qs(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(s[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)s[l]=new e({type:"nonoptional",innerType:i[l]});return yl(this,"shape",s),s}});return Xs(t,r)}function xc(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 wc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function bp(e){return typeof e=="string"?e:e?.message}function Ks(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=bp(e.inst?._zod.def?.error?.(e))??bp(t?.error?.(e))??bp(n.customError?.(e))??bp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function z1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const _D=(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,Pw,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kD=fe("$ZodError",_D),AD=fe("$ZodError",_D,{Parent:Error});function hG(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 pG(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<s.path.length;){const f=s.path[c];c===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(t(s))):l[f]=l[f]||{_errors:[]},l=l[f],c++}}};return r(e),n}const M1=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise)throw new Tc;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Ks(f,s,Fs())));throw CD(c,i?.callee),c}return l.value},R1=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>Ks(f,s,Fs())));throw CD(c,i?.callee),c}return l.value},Fg=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Tc;return s.issues.length?{success:!1,error:new(e??kD)(s.issues.map(l=>Ks(l,i,Fs())))}:{success:!0,data:s.value}},mG=Fg(AD),Kg=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(l=>Ks(l,i,Fs())))}:{success:!0,data:s.value}},gG=Kg(AD),vG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return M1(e)(t,n,i)},yG=e=>(t,n,r)=>M1(e)(t,n,r),bG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return R1(e)(t,n,i)},xG=e=>async(t,n,r)=>R1(e)(t,n,r),wG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fg(e)(t,n,i)},SG=e=>(t,n,r)=>Fg(e)(t,n,r),jG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Kg(e)(t,n,i)},NG=e=>async(t,n,r)=>Kg(e)(t,n,r),CG=/^[cC][^\s-]{8,}$/,OG=/^[0-9a-z]+$/,_G=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kG=/^[0-9a-vA-V]{20}$/,AG=/^[A-Za-z0-9]{27}$/,EG=/^[a-zA-Z0-9_-]{21}$/,TG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,PG=/^([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})$/,nE=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)$/,zG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,MG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function RG(){return new RegExp(MG,"u")}const DG=/^(?:(?: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])$/,IG=/^(([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}|:))$/,LG=/^((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])$/,$G=/^(([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])$/,UG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ED=/^[A-Za-z0-9_-]*$/,BG=/^\+[1-9]\d{6,14}$/,TD="(?:(?:\\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])))",qG=new RegExp(`^${TD}$`);function PD(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 FG(e){return new RegExp(`^${PD(e)}$`)}function KG(e){const t=PD({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(`^${TD}T(?:${r})$`)}const HG=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},GG=/^-?\d+$/,zD=/^-?\d+(?:\.\d+)?$/,VG=/^(?:true|false)$/i,ZG=/^[^A-Z]*$/,YG=/^[^a-z]*$/,br=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),MD={number:"number",bigint:"bigint",object:"date"},RD=fe("$ZodCheckLessThan",(e,t)=>{br.init(e,t);const n=MD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),DD=fe("$ZodCheckGreaterThan",(e,t)=>{br.init(e,t);const n=MD[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),WG=fe("$ZodCheckMultipleOf",(e,t)=>{br.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):eG(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})}}),QG=fe("$ZodCheckNumberFormat",(e,t)=>{br.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=aG[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,n&&(c.pattern=GG)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),XG=fe("$ZodCheckMaxLength",(e,t)=>{var n;br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!T1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const l=z1(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),JG=fe("$ZodCheckMinLength",(e,t)=>{var n;br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!T1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=z1(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),eV=fe("$ZodCheckLengthEquals",(e,t)=>{var n;br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!T1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const l=z1(i),c=s>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Hg=fe("$ZodCheckStringFormat",(e,t)=>{var n,r;br.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),tV=fe("$ZodCheckRegex",(e,t)=>{Hg.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})}}),nV=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ZG),Hg.init(e,t)}),rV=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=YG),Hg.init(e,t)}),iV=fe("$ZodCheckIncludes",(e,t)=>{br.init(e,t);const n=Uc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),aV=fe("$ZodCheckStartsWith",(e,t)=>{br.init(e,t);const n=new RegExp(`^${Uc(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})}}),sV=fe("$ZodCheckEndsWith",(e,t)=>{br.init(e,t);const n=new RegExp(`.*${Uc(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})}}),oV=fe("$ZodCheckOverwrite",(e,t)=>{br.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class lV{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(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),s=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of s)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
59
- `))}}const cV={major:4,minor:3,patch:6},Vt=fe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cV;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,c,f)=>{let h=xc(l),p;for(const g of c){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const v=l.issues.length,y=g._zod.check(l);if(y instanceof Promise&&f?.async===!1)throw new Tc;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,l.issues.length!==v&&(h||(h=xc(l,v)))});else{if(l.issues.length===v)continue;h||(h=xc(l,v))}}return p?p.then(()=>l):l},s=(l,c,f)=>{if(xc(l))return l.aborted=!0,l;const h=i(c,r,f);if(h instanceof Promise){if(f.async===!1)throw new Tc;return h.then(p=>e._zod.parse(p,f))}return e._zod.parse(h,f)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(p=>s(p,l,c)):s(h,l,c)}const f=e._zod.parse(l,c);if(f instanceof Promise){if(c.async===!1)throw new Tc;return f.then(h=>i(h,r,c))}return i(f,r,c)}}St(e,"~standard",()=>({validate:i=>{try{const s=mG(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return gG(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),D1=fe("$ZodString",(e,t)=>{Vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??HG(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}}),Ft=fe("$ZodStringFormat",(e,t)=>{Hg.init(e,t),D1.init(e,t)}),uV=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=PG),Ft.init(e,t)}),dV=fe("$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=nE(r))}else t.pattern??(t.pattern=nE());Ft.init(e,t)}),fV=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zG),Ft.init(e,t)}),hV=fe("$ZodURL",(e,t)=>{Ft.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})}}}),pV=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RG()),Ft.init(e,t)}),mV=fe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=EG),Ft.init(e,t)}),gV=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=CG),Ft.init(e,t)}),vV=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=OG),Ft.init(e,t)}),yV=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_G),Ft.init(e,t)}),bV=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kG),Ft.init(e,t)}),xV=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=AG),Ft.init(e,t)}),wV=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=KG(t)),Ft.init(e,t)}),SV=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qG),Ft.init(e,t)}),jV=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=FG(t)),Ft.init(e,t)}),NV=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=TG),Ft.init(e,t)}),CV=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=DG),Ft.init(e,t),e._zod.bag.format="ipv4"}),OV=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=IG),Ft.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})}}}),_V=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=LG),Ft.init(e,t)}),kV=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=$G),Ft.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const l=Number(s);if(`${l}`!==s)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ID(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const AV=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=UG),Ft.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ID(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function EV(e){if(!ED.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ID(n)}const TV=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ED),Ft.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{EV(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),PV=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=BG),Ft.init(e,t)});function zV(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 MV=fe("$ZodJWT",(e,t)=>{Ft.init(e,t),e._zod.check=n=>{zV(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),LD=fe("$ZodNumber",(e,t)=>{Vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??zD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),RV=fe("$ZodNumberFormat",(e,t)=>{QG.init(e,t),LD.init(e,t)}),DV=fe("$ZodBoolean",(e,t)=>{Vt.init(e,t),e._zod.pattern=VG,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}}),IV=fe("$ZodUnknown",(e,t)=>{Vt.init(e,t),e._zod.parse=n=>n}),LV=fe("$ZodNever",(e,t)=>{Vt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rE(e,t,n){e.issues.length&&t.issues.push(...wc(n,e.issues)),t.value[n]=e.value}const $V=fe("$ZodArray",(e,t)=>{Vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let l=0;l<i.length;l++){const c=i[l],f=t.element._zod.run({value:c,issues:[]},r);f instanceof Promise?s.push(f.then(h=>rE(h,n,l))):rE(f,n,l)}return s.length?Promise.all(s).then(()=>n):n}});function jm(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...wc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function $D(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=iG(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function UD(e,t,n,r,i,s){const l=[],c=i.keySet,f=i.catchall._zod,h=f.def.type,p=f.optout==="optional";for(const g in t){if(c.has(g))continue;if(h==="never"){l.push(g);continue}const v=f.run({value:t[g],issues:[]},r);v instanceof Promise?e.push(v.then(y=>jm(y,n,g,t,p))):jm(v,n,g,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const UV=fe("$ZodObject",(e,t)=>{if(Vt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...c};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=E1(()=>$D(t));St(e._zod,"propValues",()=>{const c=t.shape,f={};for(const h in c){const p=c[h]._zod;if(p.values){f[h]??(f[h]=new Set);for(const g of p.values)f[h].add(g)}}return f});const i=Sm,s=t.catchall;let l;e._zod.parse=(c,f)=>{l??(l=r.value);const h=c.value;if(!i(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};const p=[],g=l.shape;for(const v of l.keys){const y=g[v],S=y._zod.optout==="optional",w=y._zod.run({value:h[v],issues:[]},f);w instanceof Promise?p.push(w.then(N=>jm(N,c,v,h,S))):jm(w,c,v,h,S)}return s?UD(p,h,c,f,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),BV=fe("$ZodObjectJIT",(e,t)=>{UV.init(e,t);const n=e._zod.parse,r=E1(()=>$D(t)),i=v=>{const y=new lV(["shape","payload","ctx"]),S=r.value,w=k=>{const O=tE(k);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};y.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const k of S.keys)N[k]=`key_${C++}`;y.write("const newResult = {};");for(const k of S.keys){const O=N[k],T=tE(k),A=v[k]?._zod?.optout==="optional";y.write(`const ${O} = ${w(k)};`),A?y.write(`
60
- if (${O}.issues.length) {
61
- if (${T} in input) {
62
- payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
63
- ...iss,
64
- path: iss.path ? [${T}, ...iss.path] : [${T}]
65
- })));
66
- }
67
- }
68
-
69
- if (${O}.value === undefined) {
70
- if (${T} in input) {
71
- newResult[${T}] = undefined;
72
- }
73
- } else {
74
- newResult[${T}] = ${O}.value;
75
- }
76
-
77
- `):y.write(`
78
- if (${O}.issues.length) {
79
- payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
80
- ...iss,
81
- path: iss.path ? [${T}, ...iss.path] : [${T}]
82
- })));
83
- }
84
-
85
- if (${O}.value === undefined) {
86
- if (${T} in input) {
87
- newResult[${T}] = undefined;
88
- }
89
- } else {
90
- newResult[${T}] = ${O}.value;
91
- }
92
-
93
- `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(k,O)=>E(v,k,O)};let s;const l=Sm,c=!jD.jitless,h=c&&nG.value,p=t.catchall;let g;e._zod.parse=(v,y)=>{g??(g=r.value);const S=v.value;return l(S)?c&&h&&y?.async===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),p?UD([],S,v,y,g,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function iE(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!xc(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>Ks(l,r,Fs())))}),t)}const qV=fe("$ZodUnion",(e,t)=>{Vt.init(e,t),St(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),St(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),St(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),St(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>P1(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let l=!1;const c=[];for(const f of t.options){const h=f._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)c.push(h),l=!0;else{if(h.issues.length===0)return h;c.push(h)}}return l?Promise.all(c).then(f=>iE(f,i,e,s)):iE(c,i,e,s)}}),FV=fe("$ZodIntersection",(e,t)=>{Vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([f,h])=>aE(n,f,h)):aE(n,s,l)}});function zw(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($c(e)&&$c(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const l=zw(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};i[s]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],l=zw(i,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function aE(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&i&&e.issues.push({...i,keys:s}),xc(e))return e;const l=zw(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const KV=fe("$ZodRecord",(e,t)=>{Vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!$c(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const p=t.valueType._zod.run({value:i[h],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...wc(h,g.issues)),n.value[h]=g.value})):(p.issues.length&&n.issues.push(...wc(h,p.issues)),n.value[h]=p.value)}let f;for(const h in i)c.has(h)||(f=f??[],f.push(h));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let f=t.keyType._zod.run({value:c,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&zD.test(c)&&f.issues.length){const g=t.keyType._zod.run({value:Number(c),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>Ks(g,r,Fs())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...wc(c,g.issues)),n.value[f.value]=g.value})):(p.issues.length&&n.issues.push(...wc(c,p.issues)),n.value[f.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),HV=fe("$ZodEnum",(e,t)=>{Vt.init(e,t);const n=ND(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>rG.has(typeof i)).map(i=>typeof i=="string"?Uc(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),GV=fe("$ZodLiteral",(e,t)=>{if(Vt.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"?Uc(r):r?Uc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),VV=fe("$ZodTransform",(e,t)=>{Vt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new SD(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Tc;return n.value=i,n}});function sE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const BD=fe("$ZodOptional",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",St(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${P1(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>sE(s,n.value)):sE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),ZV=fe("$ZodExactOptional",(e,t)=>{BD.init(e,t),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),YV=fe("$ZodNullable",(e,t)=>{Vt.init(e,t),St(e._zod,"optin",()=>t.innerType._zod.optin),St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${P1(n.source)}|null)$`):void 0}),St(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)}),WV=fe("$ZodDefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>oE(s,t)):oE(i,t)}});function oE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const QV=fe("$ZodPrefault",(e,t)=>{Vt.init(e,t),e._zod.optin="optional",St(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))}),XV=fe("$ZodNonOptional",(e,t)=>{Vt.init(e,t),St(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>lE(s,e)):lE(i,e)}});function lE(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 JV=fe("$ZodCatch",(e,t)=>{Vt.init(e,t),St(e._zod,"optin",()=>t.innerType._zod.optin),St(e._zod,"optout",()=>t.innerType._zod.optout),St(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>Ks(l,r,Fs()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ks(s,r,Fs()))},input:n.value}),n.issues=[]),n)}}),eZ=fe("$ZodPipe",(e,t)=>{Vt.init(e,t),St(e._zod,"values",()=>t.in._zod.values),St(e._zod,"optin",()=>t.in._zod.optin),St(e._zod,"optout",()=>t.out._zod.optout),St(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>xp(l,t.in,r)):xp(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>xp(s,t.out,r)):xp(i,t.out,r)}});function xp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const tZ=fe("$ZodReadonly",(e,t)=>{Vt.init(e,t),St(e._zod,"propValues",()=>t.innerType._zod.propValues),St(e._zod,"values",()=>t.innerType._zod.values),St(e._zod,"optin",()=>t.innerType?._zod?.optin),St(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(cE):cE(i)}});function cE(e){return e.value=Object.freeze(e.value),e}const nZ=fe("$ZodCustom",(e,t)=>{br.init(e,t),Vt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>uE(s,n,r,e));uE(i,n,r,e)}});function uE(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(Vd(i))}}var dE;class rZ{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 iZ(){return new rZ}(dE=globalThis).__zod_globalRegistry??(dE.__zod_globalRegistry=iZ());const Od=globalThis.__zod_globalRegistry;function aZ(e,t){return new e({type:"string",...$e(t)})}function sZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$e(t)})}function fE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$e(t)})}function oZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$e(t)})}function lZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$e(t)})}function cZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$e(t)})}function uZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$e(t)})}function dZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$e(t)})}function fZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$e(t)})}function hZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$e(t)})}function pZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$e(t)})}function mZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$e(t)})}function gZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$e(t)})}function vZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$e(t)})}function yZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$e(t)})}function bZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$e(t)})}function xZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$e(t)})}function wZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$e(t)})}function SZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$e(t)})}function jZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$e(t)})}function NZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$e(t)})}function CZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$e(t)})}function OZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$e(t)})}function _Z(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$e(t)})}function kZ(e,t){return new e({type:"string",format:"date",check:"string_format",...$e(t)})}function AZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$e(t)})}function EZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...$e(t)})}function TZ(e,t){return new e({type:"number",checks:[],...$e(t)})}function PZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$e(t)})}function zZ(e,t){return new e({type:"boolean",...$e(t)})}function MZ(e){return new e({type:"unknown"})}function RZ(e,t){return new e({type:"never",...$e(t)})}function hE(e,t){return new RD({check:"less_than",...$e(t),value:e,inclusive:!1})}function _b(e,t){return new RD({check:"less_than",...$e(t),value:e,inclusive:!0})}function pE(e,t){return new DD({check:"greater_than",...$e(t),value:e,inclusive:!1})}function kb(e,t){return new DD({check:"greater_than",...$e(t),value:e,inclusive:!0})}function mE(e,t){return new WG({check:"multiple_of",...$e(t),value:e})}function qD(e,t){return new XG({check:"max_length",...$e(t),maximum:e})}function Nm(e,t){return new JG({check:"min_length",...$e(t),minimum:e})}function FD(e,t){return new eV({check:"length_equals",...$e(t),length:e})}function DZ(e,t){return new tV({check:"string_format",format:"regex",...$e(t),pattern:e})}function IZ(e){return new nV({check:"string_format",format:"lowercase",...$e(e)})}function LZ(e){return new rV({check:"string_format",format:"uppercase",...$e(e)})}function $Z(e,t){return new iV({check:"string_format",format:"includes",...$e(t),includes:e})}function UZ(e,t){return new aV({check:"string_format",format:"starts_with",...$e(t),prefix:e})}function BZ(e,t){return new sV({check:"string_format",format:"ends_with",...$e(t),suffix:e})}function Jc(e){return new oV({check:"overwrite",tx:e})}function qZ(e){return Jc(t=>t.normalize(e))}function FZ(){return Jc(e=>e.trim())}function KZ(){return Jc(e=>e.toLowerCase())}function HZ(){return Jc(e=>e.toUpperCase())}function GZ(){return Jc(e=>tG(e))}function VZ(e,t,n){return new e({type:"array",element:t,...$e(n)})}function ZZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...$e(n)})}function YZ(e){const t=WZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Vd(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(Vd(i))}},e(n.value,n)));return t}function WZ(e,t){const n=new br({check:"custom",...$e(t)});return n._zod.check=e,n}function KD(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??Od,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 hn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const v=l.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,p)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),hn(g,t,p),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(l.schema,f),t.io==="input"&&Qn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function HD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const f=r.get(c);if(f&&f!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(g)return{ref:v(g)};const y=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=y,{defId:y,ref:`${v("__shared")}#/${c}/${y}`}}if(l[1]===n)return{ref:"#"};const h=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:h+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:f,defId:h}=i(l);c.def={...c.schema},h&&(c.defId=h);const p=c.schema;for(const g in p)delete p[g];p.$ref=f};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
94
-
95
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function GD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const f=c.def??c.schema,h={...f},p=c.ref;if(c.ref=null,p){r(p);const v=e.seen.get(p),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,h),l._zod.parent===p)for(const w in f)w==="$ref"||w==="allOf"||w in h||delete f[w];if(y.$ref&&v.def)for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}const g=l._zod.parent;if(g&&g!==p){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:l,jsonSchema:f,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cm(t,"input",e.processors),output:Cm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Qn(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 Qn(r.element,n);if(r.type==="set")return Qn(r.valueType,n);if(r.type==="lazy")return Qn(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 Qn(r.innerType,n);if(r.type==="intersection")return Qn(r.left,n)||Qn(r.right,n);if(r.type==="record"||r.type==="map")return Qn(r.keyType,n)||Qn(r.valueType,n);if(r.type==="pipe")return Qn(r.in,n)||Qn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Qn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Qn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Qn(i,n))return!0;return!!(r.rest&&Qn(r.rest,n))}return!1}const QZ=(e,t={})=>n=>{const r=KD({...n,processors:t});return hn(e,r),HD(r,e),GD(r,e)},Cm=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},l=KD({...i??{},target:s,io:t,processors:n});return hn(e,l),HD(l,e),GD(l,e)},XZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},JZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:l,format:c,patterns:f,contentEncoding:h}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof l=="number"&&(i.maxLength=l),c&&(i.format=XZ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),h&&(i.contentEncoding=h),f&&f.size>0){const p=[...f];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},eY=(e,t,n,r)=>{const i=n,{minimum:s,maximum:l,format:c,multipleOf:f,exclusiveMaximum:h,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 s=="number"&&(i.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof f=="number"&&(i.multipleOf=f)},tY=(e,t,n,r)=>{n.type="boolean"},nY=(e,t,n,r)=>{n.not={}},rY=(e,t,n,r)=>{},iY=(e,t,n,r)=>{const i=e._zod.def,s=ND(i.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},aY=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},sY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lY=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=hn(s.element,t,{...r,path:[...r.path,"items"]})},cY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const l=s.shape;for(const h in l)i.properties[h]=hn(l[h],t,{...r,path:[...r.path,"properties",h]});const c=new Set(Object.keys(l)),f=new Set([...c].filter(h=>{const p=s.shape[h]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));f.size>0&&(i.required=Array.from(f)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=hn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},uY=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,l=i.options.map((c,f)=>hn(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",f]}));s?n.oneOf=l:n.anyOf=l},dY=(e,t,n,r)=>{const i=e._zod.def,s=hn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=hn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,f=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=f},fY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const l=s.keyType,f=l._zod.bag?.patterns;if(s.mode==="loose"&&f&&f.size>0){const p=hn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of f)i.patternProperties[g.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=hn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=hn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const h=l._zod.values;if(h){const p=[...h].filter(g=>typeof g=="string"||typeof g=="number");p.length>0&&(i.required=p)}},hY=(e,t,n,r)=>{const i=e._zod.def,s=hn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},pY=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},mY=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},gY=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},vY=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},yY=(e,t,n,r)=>{const i=e._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;hn(s,t,r);const l=t.seen.get(e);l.ref=s},bY=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},VD=(e,t,n,r)=>{const i=e._zod.def;hn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},xY=fe("ZodISODateTime",(e,t)=>{wV.init(e,t),Yt.init(e,t)});function wY(e){return _Z(xY,e)}const SY=fe("ZodISODate",(e,t)=>{SV.init(e,t),Yt.init(e,t)});function jY(e){return kZ(SY,e)}const NY=fe("ZodISOTime",(e,t)=>{jV.init(e,t),Yt.init(e,t)});function CY(e){return AZ(NY,e)}const OY=fe("ZodISODuration",(e,t)=>{NV.init(e,t),Yt.init(e,t)});function _Y(e){return EZ(OY,e)}const kY=(e,t)=>{kD.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>pG(e,n)},flatten:{value:n=>hG(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Pw,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Pw,2)}},isEmpty:{get(){return e.issues.length===0}}})},fi=fe("ZodError",kY,{Parent:Error}),AY=M1(fi),EY=R1(fi),TY=Fg(fi),PY=Kg(fi),zY=vG(fi),MY=yG(fi),RY=bG(fi),DY=xG(fi),IY=wG(fi),LY=SG(fi),$Y=jG(fi),UY=NG(fi),Zt=fe("ZodType",(e,t)=>(Vt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cm(e,"input"),output:Cm(e,"output")}}),e.toJSONSchema=QZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Qs(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)=>Xs(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>AY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>TY(e,n,r),e.parseAsync=async(n,r)=>EY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>PY(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>zY(e,n,r),e.decode=(n,r)=>MY(e,n,r),e.encodeAsync=async(n,r)=>RY(e,n,r),e.decodeAsync=async(n,r)=>DY(e,n,r),e.safeEncode=(n,r)=>IY(e,n,r),e.safeDecode=(n,r)=>LY(e,n,r),e.safeEncodeAsync=async(n,r)=>$Y(e,n,r),e.safeDecodeAsync=async(n,r)=>UY(e,n,r),e.refine=(n,r)=>e.check(MW(n,r)),e.superRefine=n=>e.check(RW(n)),e.overwrite=n=>e.check(Jc(n)),e.optional=()=>yE(e),e.exactOptional=()=>wW(e),e.nullable=()=>bE(e),e.nullish=()=>yE(bE(e)),e.nonoptional=n=>_W(e,n),e.array=()=>ke(e),e.or=n=>hW([e,n]),e.and=n=>mW(e,n),e.transform=n=>xE(e,bW(n)),e.default=n=>NW(e,n),e.prefault=n=>OW(e,n),e.catch=n=>AW(e,n),e.pipe=n=>xE(e,n),e.readonly=()=>PW(e),e.describe=n=>{const r=e.clone();return Od.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Od.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Od.get(e);const r=e.clone();return Od.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ZD=fe("_ZodString",(e,t)=>{D1.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>JZ(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(DZ(...r)),e.includes=(...r)=>e.check($Z(...r)),e.startsWith=(...r)=>e.check(UZ(...r)),e.endsWith=(...r)=>e.check(BZ(...r)),e.min=(...r)=>e.check(Nm(...r)),e.max=(...r)=>e.check(qD(...r)),e.length=(...r)=>e.check(FD(...r)),e.nonempty=(...r)=>e.check(Nm(1,...r)),e.lowercase=r=>e.check(IZ(r)),e.uppercase=r=>e.check(LZ(r)),e.trim=()=>e.check(FZ()),e.normalize=(...r)=>e.check(qZ(...r)),e.toLowerCase=()=>e.check(KZ()),e.toUpperCase=()=>e.check(HZ()),e.slugify=()=>e.check(GZ())}),BY=fe("ZodString",(e,t)=>{D1.init(e,t),ZD.init(e,t),e.email=n=>e.check(sZ(qY,n)),e.url=n=>e.check(dZ(FY,n)),e.jwt=n=>e.check(OZ(iW,n)),e.emoji=n=>e.check(fZ(KY,n)),e.guid=n=>e.check(fE(gE,n)),e.uuid=n=>e.check(oZ(wp,n)),e.uuidv4=n=>e.check(lZ(wp,n)),e.uuidv6=n=>e.check(cZ(wp,n)),e.uuidv7=n=>e.check(uZ(wp,n)),e.nanoid=n=>e.check(hZ(HY,n)),e.guid=n=>e.check(fE(gE,n)),e.cuid=n=>e.check(pZ(GY,n)),e.cuid2=n=>e.check(mZ(VY,n)),e.ulid=n=>e.check(gZ(ZY,n)),e.base64=n=>e.check(jZ(tW,n)),e.base64url=n=>e.check(NZ(nW,n)),e.xid=n=>e.check(vZ(YY,n)),e.ksuid=n=>e.check(yZ(WY,n)),e.ipv4=n=>e.check(bZ(QY,n)),e.ipv6=n=>e.check(xZ(XY,n)),e.cidrv4=n=>e.check(wZ(JY,n)),e.cidrv6=n=>e.check(SZ(eW,n)),e.e164=n=>e.check(CZ(rW,n)),e.datetime=n=>e.check(wY(n)),e.date=n=>e.check(jY(n)),e.time=n=>e.check(CY(n)),e.duration=n=>e.check(_Y(n))});function I(e){return aZ(BY,e)}const Yt=fe("ZodStringFormat",(e,t)=>{Ft.init(e,t),ZD.init(e,t)}),qY=fe("ZodEmail",(e,t)=>{fV.init(e,t),Yt.init(e,t)}),gE=fe("ZodGUID",(e,t)=>{uV.init(e,t),Yt.init(e,t)}),wp=fe("ZodUUID",(e,t)=>{dV.init(e,t),Yt.init(e,t)}),FY=fe("ZodURL",(e,t)=>{hV.init(e,t),Yt.init(e,t)}),KY=fe("ZodEmoji",(e,t)=>{pV.init(e,t),Yt.init(e,t)}),HY=fe("ZodNanoID",(e,t)=>{mV.init(e,t),Yt.init(e,t)}),GY=fe("ZodCUID",(e,t)=>{gV.init(e,t),Yt.init(e,t)}),VY=fe("ZodCUID2",(e,t)=>{vV.init(e,t),Yt.init(e,t)}),ZY=fe("ZodULID",(e,t)=>{yV.init(e,t),Yt.init(e,t)}),YY=fe("ZodXID",(e,t)=>{bV.init(e,t),Yt.init(e,t)}),WY=fe("ZodKSUID",(e,t)=>{xV.init(e,t),Yt.init(e,t)}),QY=fe("ZodIPv4",(e,t)=>{CV.init(e,t),Yt.init(e,t)}),XY=fe("ZodIPv6",(e,t)=>{OV.init(e,t),Yt.init(e,t)}),JY=fe("ZodCIDRv4",(e,t)=>{_V.init(e,t),Yt.init(e,t)}),eW=fe("ZodCIDRv6",(e,t)=>{kV.init(e,t),Yt.init(e,t)}),tW=fe("ZodBase64",(e,t)=>{AV.init(e,t),Yt.init(e,t)}),nW=fe("ZodBase64URL",(e,t)=>{TV.init(e,t),Yt.init(e,t)}),rW=fe("ZodE164",(e,t)=>{PV.init(e,t),Yt.init(e,t)}),iW=fe("ZodJWT",(e,t)=>{MV.init(e,t),Yt.init(e,t)}),YD=fe("ZodNumber",(e,t)=>{LD.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>eY(e,r,i),e.gt=(r,i)=>e.check(pE(r,i)),e.gte=(r,i)=>e.check(kb(r,i)),e.min=(r,i)=>e.check(kb(r,i)),e.lt=(r,i)=>e.check(hE(r,i)),e.lte=(r,i)=>e.check(_b(r,i)),e.max=(r,i)=>e.check(_b(r,i)),e.int=r=>e.check(vE(r)),e.safe=r=>e.check(vE(r)),e.positive=r=>e.check(pE(0,r)),e.nonnegative=r=>e.check(kb(0,r)),e.negative=r=>e.check(hE(0,r)),e.nonpositive=r=>e.check(_b(0,r)),e.multipleOf=(r,i)=>e.check(mE(r,i)),e.step=(r,i)=>e.check(mE(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 _e(e){return TZ(YD,e)}const aW=fe("ZodNumberFormat",(e,t)=>{RV.init(e,t),YD.init(e,t)});function vE(e){return PZ(aW,e)}const sW=fe("ZodBoolean",(e,t)=>{DV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tY(e,n,r)});function Gt(e){return zZ(sW,e)}const oW=fe("ZodUnknown",(e,t)=>{IV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rY()});function Om(){return MZ(oW)}const lW=fe("ZodNever",(e,t)=>{LV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nY(e,n,r)});function cW(e){return RZ(lW,e)}const uW=fe("ZodArray",(e,t)=>{$V.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lY(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Nm(n,r)),e.nonempty=n=>e.check(Nm(1,n)),e.max=(n,r)=>e.check(qD(n,r)),e.length=(n,r)=>e.check(FD(n,r)),e.unwrap=()=>e.element});function ke(e,t){return VZ(uW,e,t)}const dW=fe("ZodObject",(e,t)=>{BV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cY(e,n,r,i),St(e,"shape",()=>t.shape),e.keyof=()=>Tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Om()}),e.loose=()=>e.clone({...e._zod.def,catchall:Om()}),e.strict=()=>e.clone({...e._zod.def,catchall:cW()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>lG(e,n),e.safeExtend=n=>cG(e,n),e.merge=n=>uG(e,n),e.pick=n=>sG(e,n),e.omit=n=>oG(e,n),e.partial=(...n)=>dG(WD,e,n[0]),e.required=(...n)=>fG(QD,e,n[0])});function Ce(e,t){const n={type:"object",shape:e??{},...$e(t)};return new dW(n)}const fW=fe("ZodUnion",(e,t)=>{qV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uY(e,n,r,i),e.options=t.options});function hW(e,t){return new fW({type:"union",options:e,...$e(t)})}const pW=fe("ZodIntersection",(e,t)=>{FV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dY(e,n,r,i)});function mW(e,t){return new pW({type:"intersection",left:e,right:t})}const gW=fe("ZodRecord",(e,t)=>{KV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fY(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function mf(e,t,n){return new gW({type:"record",keyType:e,valueType:t,...$e(n)})}const Mw=fe("ZodEnum",(e,t)=>{HV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>iY(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Mw({...t,checks:[],...$e(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Mw({...t,checks:[],...$e(i),entries:s})}});function Tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Mw({type:"enum",entries:n,...$e(t)})}const vW=fe("ZodLiteral",(e,t)=>{GV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aY(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Zd(e,t){return new vW({type:"literal",values:Array.isArray(e)?e:[e],...$e(t)})}const yW=fe("ZodTransform",(e,t)=>{VV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oY(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new SD(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Vd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Vd(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function bW(e){return new yW({type:"transform",transform:e})}const WD=fe("ZodOptional",(e,t)=>{BD.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function yE(e){return new WD({type:"optional",innerType:e})}const xW=fe("ZodExactOptional",(e,t)=>{ZV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VD(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function wW(e){return new xW({type:"optional",innerType:e})}const SW=fe("ZodNullable",(e,t)=>{YV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function bE(e){return new SW({type:"nullable",innerType:e})}const jW=fe("ZodDefault",(e,t)=>{WV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function NW(e,t){return new jW({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():OD(t)}})}const CW=fe("ZodPrefault",(e,t)=>{QV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function OW(e,t){return new CW({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():OD(t)}})}const QD=fe("ZodNonOptional",(e,t)=>{XV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _W(e,t){return new QD({type:"nonoptional",innerType:e,...$e(t)})}const kW=fe("ZodCatch",(e,t)=>{JV.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AW(e,t){return new kW({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const EW=fe("ZodPipe",(e,t)=>{eZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yY(e,n,r,i),e.in=t.in,e.out=t.out});function xE(e,t){return new EW({type:"pipe",in:e,out:t})}const TW=fe("ZodReadonly",(e,t)=>{tZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function PW(e){return new TW({type:"readonly",innerType:e})}const zW=fe("ZodCustom",(e,t)=>{nZ.init(e,t),Zt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sY(e,n)});function MW(e,t={}){return ZZ(zW,e,t)}function RW(e){return YZ(e)}Ce({maxConcurrency:_e().int().positive(),maxRequestsPerMinute:_e().int().positive(),maxRequestsPerDay:_e().int().positive()});const eu=I().min(1);I().min(1);const I1=Ce({label:I().min(1),city:I().min(1),region:I().min(1),country:I().length(2),timezone:I().optional()}),XD=Tt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);Ce({id:I(),projectId:I(),channel:Zd("webhook"),url:I().url(),urlDisplay:I(),urlHost:I(),events:ke(XD),enabled:Gt().default(!0),source:I().optional(),webhookSecret:I().optional(),createdAt:I(),updatedAt:I()});const JD=Tt(["cli","api","config-file"]);function DW(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 IW(e,t){return t?e.some(n=>n.label===t):!0}Ce({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:ke(I().min(1)).optional(),country:I().length(2),language:I().min(2),tags:ke(I()).optional(),labels:mf(I(),I()).optional(),providers:ke(eu).optional(),locations:ke(I1).optional(),defaultLocation:I().nullable().optional(),configSource:JD.optional()});Ce({id:I(),name:I(),displayName:I().optional(),canonicalDomain:I(),ownedDomains:ke(I()).default([]),country:I().length(2),language:I().min(2),tags:ke(I()).default([]),labels:mf(I(),I()).default({}),locations:ke(I1).default([]),defaultLocation:I().nullable().optional(),configSource:JD.default("cli"),configRevision:_e().int().positive().default(1),createdAt:I().optional(),updatedAt:I().optional()});function Rw(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function LW(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const s=i.trim();if(!s)continue;const l=Rw(s);n.has(l)||(n.add(l),r.push(s))}return r}const $W=Ce({name:I().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:mf(I(),I()).optional().default({})}),UW=Ce({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),providers:ke(eu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),BW=Ce({channel:Zd("webhook"),url:I().url(),events:ke(XD).min(1)}),qW=Ce({gsc:Ce({propertyUrl:I()}).optional(),syncSchedule:Ce({preset:I().optional(),cron:I().optional()}).optional()}).optional(),FW=Ce({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:ke(I().min(1)).optional().default([]),country:I().length(2),language:I().min(2),keywords:ke(I().min(1)).optional().default([]),competitors:ke(I().min(1)).optional().default([]),providers:ke(eu).optional().default([]),locations:ke(I1).optional().default([]),defaultLocation:I().optional(),schedule:UW,notifications:ke(BW).optional().default([]),google:qW}).superRefine((e,t)=>{const n=DW(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),IW(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ce({apiVersion:Zd("canonry/v1"),kind:Zd("Project"),metadata:$W,spec:FW});const KW=Tt(["gsc","ga4"]);Ce({id:I(),domain:I(),connectionType:KW,propertyId:I().nullable().optional(),sitemapUrl:I().nullable().optional(),scopes:ke(I()).default([]),createdAt:I(),updatedAt:I()});Ce({date:I(),query:I(),page:I(),country:I().nullable().optional(),device:I().nullable().optional(),clicks:_e(),impressions:_e(),ctr:_e(),position:_e()});const Dw=Ce({id:I(),url:I(),indexingState:I().nullable().optional(),verdict:I().nullable().optional(),coverageState:I().nullable().optional(),pageFetchState:I().nullable().optional(),robotsTxtState:I().nullable().optional(),crawlTime:I().nullable().optional(),lastCrawlResult:I().nullable().optional(),isMobileFriendly:Gt().nullable().optional(),richResults:ke(I()).default([]),inspectedAt:I()});Tt(["stable","reindexed","deindexed","still-missing","new"]);const HW=Ce({url:I(),previousState:I().nullable(),currentState:I().nullable(),transitionDate:I()}),GW=Ce({reason:I(),count:_e(),urls:ke(Dw).default([])});Ce({summary:Ce({total:_e(),indexed:_e(),notIndexed:_e(),deindexed:_e(),percentage:_e()}),lastInspectedAt:I().nullable(),indexed:ke(Dw).default([]),notIndexed:ke(Dw).default([]),deindexed:ke(HW).default([]),reasonGroups:ke(GW).default([])});Ce({url:I(),type:Tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:I()});Ce({url:I(),type:Tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:I(),status:Tt(["success","error"]),error:I().optional()});Ce({date:I(),indexed:_e(),notIndexed:_e(),reasonBreakdown:mf(I(),_e()).default({})});Ce({id:I(),domain:I(),siteUrl:I().nullable().optional(),createdAt:I(),updatedAt:I()});const Ab=Ce({id:I(),url:I(),httpCode:_e().nullable().optional(),inIndex:Gt().nullable().optional(),lastCrawledDate:I().nullable().optional(),inIndexDate:I().nullable().optional(),inspectedAt:I(),documentSize:_e().nullable().optional(),anchorCount:_e().nullable().optional(),discoveryDate:I().nullable().optional()});Ce({summary:Ce({total:_e(),indexed:_e(),notIndexed:_e(),unknown:_e().optional(),percentage:_e()}),lastInspectedAt:I().nullable(),indexed:ke(Ab).default([]),notIndexed:ke(Ab).default([]),unknown:ke(Ab).default([]).optional()});Ce({query:I(),impressions:_e(),clicks:_e(),ctr:_e(),averagePosition:_e()});Ce({date:I(),indexed:_e(),notIndexed:_e(),unknown:_e()});Ce({url:I(),status:Tt(["success","error"]),submittedAt:I(),error:I().optional()});const tu=Tt(["live","staging"]);Ce({projectName:I(),url:I(),stagingUrl:I().optional(),username:I(),defaultEnv:tu,createdAt:I(),updatedAt:I()});const wE=Ce({url:I(),reachable:Gt(),pageCount:_e().nullable().optional(),version:I().nullable().optional(),error:I().nullable().optional(),plugins:ke(I()).optional(),authenticatedUser:Ce({id:_e(),slug:I()}).nullable().optional()});Ce({connected:Gt(),projectName:I(),defaultEnv:tu,live:wE.nullable(),staging:wE.nullable(),adminUrl:I().nullable().optional()});const VW=Ce({id:_e(),slug:I(),title:I(),status:I(),modifiedAt:I().nullable().optional(),link:I().nullable().optional()}),eI=Ce({title:I().nullable(),description:I().nullable(),noindex:Gt().nullable(),writable:Gt().default(!1),writeTargets:ke(I()).default([])}),ZW=Ce({type:I(),json:mf(I(),Om())}),YW=VW.extend({env:tu,content:I(),seo:eI,schemaBlocks:ke(ZW).default([])}),SE=YW.extend({contentHash:I(),contentSnippet:I()}),tI=Ce({manualRequired:Zd(!0),targetUrl:I(),adminUrl:I().nullable().optional(),content:I(),nextSteps:ke(I()).default([])}),WW=Ce({slug:I(),severity:Tt(["high","medium","low"]),code:Tt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:I()});Ce({slug:I(),title:I(),status:I(),wordCount:_e(),seo:eI,schemaPresent:Gt(),issues:ke(WW).default([])});const QW=Ce({slug:I(),status:Tt(["applied","skipped","manual"]),error:I().optional(),manualAssist:tI.optional()});Ce({env:tu,strategy:Tt(["plugin","manual"]),results:ke(QW)});const XW=Ce({slug:I(),status:Tt(["deployed","stripped","skipped","failed"]),schemasInjected:ke(I()).optional(),manualAssist:tI.optional(),error:I().optional()});Ce({env:tu,results:ke(XW)});const JW=Ce({slug:I(),title:I(),canonrySchemas:ke(I()),thirdPartySchemas:ke(I()),hasCanonrySchema:Gt()});Ce({env:tu,pages:ke(JW)});const eQ=Ce({name:I(),status:Tt(["completed","skipped","failed"]),summary:I().optional(),error:I().optional()});Ce({projectName:I(),steps:ke(eQ)});Ce({slug:I(),live:SE,staging:SE,hasDifferences:Gt(),differences:Ce({title:Gt(),slug:Gt(),content:Gt(),seoTitle:Gt(),seoDescription:Gt(),noindex:Gt(),schema:Gt()})});const nI=Tt(["queued","running","completed","partial","failed","cancelled"]),en=nI.enum,rI=Tt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect"]),hr=rI.enum,iI=Tt(["manual","scheduled","config-apply"]),Qp=iI.enum,aI=Tt(["cited","not-cited"]);aI.enum;const sI=Tt(["visible","not-visible"]);sI.enum;const oI=Tt(["new","cited","lost","emerging","not-cited"]);oI.enum;Ce({id:I(),projectId:I(),kind:rI,status:nI,trigger:iI.default("manual"),location:I().nullable().optional(),startedAt:I().nullable().optional(),finishedAt:I().nullable().optional(),error:I().nullable().optional(),createdAt:I()});const lI=Ce({uri:I(),title:I()});Ce({id:I(),runId:I(),keywordId:I(),keyword:I().optional(),provider:eu,citationState:aI,answerMentioned:Gt().optional(),visibilityState:sI.optional(),transition:oI.optional(),answerText:I().nullable().optional(),citedDomains:ke(I()).default([]),competitorOverlap:ke(I()).default([]),recommendedCompetitors:ke(I()).default([]),matchedTerms:ke(I()).default([]),groundingSources:ke(lI).default([]),searchQueries:ke(I()).default([]),model:I().nullable().optional(),location:I().nullable().optional(),createdAt:I()});Ce({id:I(),projectId:I().nullable().optional(),actor:I(),action:I(),entityType:I(),entityId:I().nullable().optional(),diff:Om().optional(),createdAt:I()});const tQ=Tt(["yes","no","unknown","not-mentioned"]);Ce({companyName:I().min(1),domain:I().min(1),phrases:ke(I().min(1)).optional().default([]),competitors:ke(I().min(1)).optional().default([])});const nQ=Ce({name:I(),count:_e().int().nonnegative()}),rQ=Ce({id:I(),name:I(),weight:_e(),score:_e(),grade:I(),status:Tt(["pass","partial","fail"]),findings:ke(Ce({type:I(),message:I()})).default([]),recommendations:ke(I()).default([])}),iQ=Ce({url:I(),finalUrl:I(),auditedAt:I(),overallScore:_e(),overallGrade:I(),summary:I(),factors:ke(rQ).default([])}),aQ=Ce({industry:I(),summary:I(),services:ke(I()).default([]),categoryTerms:ke(I()).default([])}),sQ=Ce({provider:I(),displayName:I(),model:I().nullable().optional(),mentioned:Gt(),cited:Gt(),describedAccurately:tQ,accuracyNotes:I().nullable().optional(),incorrectClaims:ke(I()).default([]),recommendedCompetitors:ke(I()).default([]),citedDomains:ke(I()).default([]),groundingSources:ke(lI).default([]),searchQueries:ke(I()).default([]),answerText:I(),error:I().nullable().optional()}),oQ=Ce({phrase:I(),providerResults:ke(sQ).default([])}),lQ=Ce({totalQueries:_e().int().nonnegative(),totalProviders:_e().int().nonnegative(),totalComparisons:_e().int().nonnegative(),mentionCount:_e().int().nonnegative(),citationCount:_e().int().nonnegative(),topCompetitors:ke(nQ).default([]),visibilityGap:I(),whatThisMeans:ke(I()).default([]),recommendedActions:ke(I()).default([])});Ce({companyName:I(),domain:I(),homepageUrl:I(),generatedAt:I(),phrases:ke(I()).default([]),competitors:ke(I()).default([]),profile:aQ,audit:iQ,queryResults:ke(oQ).default([]),summary:lQ});Ce({id:I(),projectId:I(),cronExpr:I(),preset:I().nullable().optional(),timezone:I().default("UTC"),enabled:Gt().default(!0),providers:ke(eu).default([]),lastRunAt:I().nullable().optional(),nextRunAt:I().nullable().optional(),createdAt:I(),updatedAt:I()});Ce({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),enabled:Gt().optional().default(!0),providers:ke(eu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const cQ=Tt(["answer","citation"]),Ps=cQ.enum;Ce({id:I(),projectId:I(),propertyId:I(),clientEmail:I(),connected:Gt(),createdAt:I(),updatedAt:I()});Ce({date:I(),landingPage:I(),sessions:_e(),organicSessions:_e(),users:_e()});const cI=Tt(["session","first_user","manual_utm"]),uQ=Ce({source:I(),medium:I(),sessions:_e(),users:_e(),sourceDimension:cI}),dQ=Ce({source:I(),medium:I(),sessions:_e(),users:_e(),channelGroup:I()});Ce({totalSessions:_e(),totalOrganicSessions:_e(),totalUsers:_e(),topPages:ke(Ce({landingPage:I(),sessions:_e(),organicSessions:_e(),users:_e()})),aiReferrals:ke(uQ),aiSessionsDeduped:_e(),aiUsersDeduped:_e(),socialReferrals:ke(dQ),socialSessions:_e(),socialUsers:_e(),organicSharePct:_e(),aiSharePct:_e(),socialSharePct:_e(),lastSyncedAt:I().nullable()});Ce({date:I(),source:I(),medium:I(),sessions:_e(),users:_e(),sourceDimension:cI});Ce({date:I(),source:I(),medium:I(),sessions:_e(),users:_e(),channelGroup:I()});Ce({date:I(),sessions:_e(),organicSessions:_e(),users:_e()});function jE(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Dn({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),s=x.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:s,onFocus:i,onBlur:s,children:[u.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&ml.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 NE(e,t){const n=fQ(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(h=>h.startsWith("**")&&h.endsWith("**")?{type:"bold",value:h.slice(2,-2)}:{type:"text",value:h}),i=n.flatMap(h=>h.terms).filter(h=>h.trim().length>1);if(i.length===0)return r.map((h,p)=>h.type==="bold"?Oi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},h.value):h.value).filter(Boolean);const l=[...i].sort((h,p)=>p.length-h.length).map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${l.join("|")})`,"gi"),f=new Map;for(const h of n)for(const p of h.terms){const g=p.toLowerCase();f.has(g)||f.set(g,h.className)}return r.flatMap((h,p)=>h.value.split(c).map((v,y)=>{if(!v)return null;if(y%2===1){const w=f.get(v.toLowerCase())??"answer-highlight";return h.type==="bold"?Oi.createElement("mark",{key:`hl-${p}-${y}`,className:w},Oi.createElement("strong",{className:"text-zinc-200 font-semibold"},v)):Oi.createElement("mark",{key:`hl-${p}-${y}`,className:w},v)}return h.type==="bold"?Oi.createElement("strong",{key:`b-${p}-${y}`,className:"text-zinc-200 font-semibold"},v):v})).filter(Boolean)}function fQ(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Eb(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 hQ({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[s,l]=x.useState("mentions"),[c,f]=x.useState(-1),[h,p]=x.useState(null),[g,v]=x.useState(!1),[y,S]=x.useState({}),w=LW(t.project),N=new Set(w.map(Rw)),C=e.runHistory,E=C.length>1,[k,O]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Y=C.at(-1);Y&&(T.current=!0,Lc(Y.runId).then(ie=>{const oe=ie.snapshots.find(ue=>ue.keyword===e.keyword&&ue.provider===e.provider);oe&&O({citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:Y.visibilityTransition,provider:oe.provider,model:oe.model??e.model,answerSnippet:oe.answerText??e.answerSnippet,citedDomains:oe.citedDomains??e.citedDomains,competitorDomains:oe.competitorOverlap??e.competitorDomains,recommendedCompetitors:oe.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:oe.matchedTerms??e.matchedTerms??[],groundingSources:oe.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,C]);const z=c>=0&&h!==null,A=z?h:k||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:C.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},P=A.visibilityState==="pending"||A.citationState==="pending",R=P?!1:A.visibilityState!=null?A.visibilityState==="visible":A.answerMentioned!=null?A.answerMentioned:A.citationState==="cited"||A.citationState==="emerging",B=A.answerMentioned!=null||A.visibilityState!=null||A.recommendedCompetitors.length>0,$=A.citedDomains.length>0||A.groundingSources.length>0||A.evidenceUrls.length>0,L=t.project.displayName||t.project.name,re=[...w.map(Rw),L,L.split(" ").slice(0,2).join(" "),...A.matchedTerms].filter(Y=>Y.trim().length>2),ge=[...A.competitorDomains.flatMap(Y=>{const ie=Y.split(".")[0];return ie&&ie.length>=4?[ie]:[]}),...A.recommendedCompetitors].filter(Y=>Y.trim().length>2),be=[{terms:re,className:"answer-highlight-brand"},...ge.length>0?[{terms:ge,className:"answer-highlight-competitor"}]:[]],H=P?"pending":A.visibilityTransition==="lost"?"lost":R?"cited":"not-cited",ee=x.useRef(0),ye=x.useCallback(async Y=>{const ie=++ee.current;if(Y===-1||Y===C.length-1){f(-1),p(null),i(!1);return}f(Y),i(!1);const oe=C[Y],ue=`${oe.runId}::${e.keyword}::${e.provider}`;if(y[ue]){p(y[ue]);return}v(!0);try{const we=await Lc(oe.runId);if(ie!==ee.current)return;const W=we.snapshots.find(je=>je.keyword===e.keyword&&je.provider===e.provider)??we.snapshots.find(je=>je.keyword===e.keyword),le=W?{citationState:W.citationState,answerMentioned:W.answerMentioned,visibilityState:W.visibilityState,visibilityTransition:oe.visibilityTransition,provider:W.provider,model:W.model??null,answerSnippet:W.answerText??"",citedDomains:W.citedDomains,competitorDomains:W.competitorOverlap,recommendedCompetitors:W.recommendedCompetitors??[],matchedTerms:W.matchedTerms??[],groundingSources:W.groundingSources,evidenceUrls:[],changeLabel:Eb(oe.visibilityTransition,oe.visibilityState),summary:""}:{citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:oe.visibilityTransition,provider:e.provider,model:oe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Eb(oe.visibilityTransition,oe.visibilityState),summary:"Snapshot data not available for this run."};S(je=>({...je,[ue]:le})),p(le)}catch{if(ie!==ee.current)return;p({citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:oe.visibilityTransition,provider:e.provider,model:oe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Eb(oe.visibilityTransition,oe.visibilityState),summary:"Failed to load historical run data."})}finally{ie===ee.current&&v(!1)}},[C,e.keyword,e.provider,y]),q=(z||e.historyScope!=="provider")&&A.model?`${A.provider} (${A.model}) · ${A.changeLabel.toLowerCase()}`:`${A.provider} · ${A.changeLabel.toLowerCase()}`,D=!z&&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(" · "):"",G=R?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:q}:A.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:q}:P?{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:q},ae=()=>{if(!A.answerSnippet)return null;const Y=A.answerSnippet.split(`
96
- `),ie=[];let oe=[],ue=0;const we=()=>{if(oe.length===0)return;const W=oe.join(" ").trim();W&&ie.push(u.jsx("p",{className:ie.length>0?"mt-2.5":"",children:NE(W,be)},ue++)),oe=[]};for(const W of Y){const le=W.trim();if(/^[-\u2013\u2014]{3,}$/.test(le)){we(),ie.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},ue++));continue}const je=le.match(/^(#{1,3})\s+(.+)$/);if(je){we();const V=je[1].length,Be=je[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||je[2],ze=V===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":V===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ie.push(u.jsx("p",{className:ze,children:NE(Be,be)},ue++));continue}if(le===""){we();continue}oe.push(le)}return we(),ie};return u.jsx(pD,{open:!0,onOpenChange:Y=>{Y||n()},children:u.jsxs(mD,{children:[u.jsx(_1,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(k1,{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," ","·"," ",A.provider||"All providers"]}),u.jsx(A1,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(vD,{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(Rg,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&u.jsxs("div",{className:"evidence-modal-timeline",children:[u.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:C.map((Y,ie)=>{const oe=c===-1&&ie===C.length-1||c===ie,ue=Y.visibilityState??(Y.answerMentioned?"visible":"not-visible"),we=Y.visibilityTransition??ue,W=ue==="visible"?"bg-emerald-400":we==="emerging"?"bg-amber-400":we==="lost"?"bg-rose-400":"bg-zinc-600",je=new Date(Y.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),V=!!(Y.model&&ie>0&&C[ie-1]?.model&&C[ie-1].model!==Y.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${oe?"evidence-run-dot--selected":""}`,onClick:()=>ye(ie===C.length-1?-1:ie),"aria-label":[`Run ${je}: ${ue}`,Y.model?`model ${Y.model}`:null,V?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":oe,children:[u.jsx("span",{className:`size-2 rounded-full ${W} ${V?"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:je})]},ie)})}),c>=0&&c<C.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(C[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:C[c].visibilityState??(C[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ye(-1),children:["←"," Back to latest"]})]}),!z&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Y=>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:`${Y.fromModel??"unknown"} -> ${Y.toModel??"unknown"} on ${new Date(Y.createdAt).toLocaleDateString()}`},`${Y.runId}:${Y.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[g&&u.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!g&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:G.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:G.title}),u.jsx("p",{className:"evidence-position-meta",children:G.meta}),D&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:D})]}),A.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:ae()}),A.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"})]}),!A.answerSnippet&&!g&&u.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!z&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:R?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Y,ie)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?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:Y})]},ie))})]}),A.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:A.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(B||$)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${s==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),u.jsx("button",{className:`sidebar-tab ${s==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),s==="mentions"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Answer visibility"}),u.jsx(Dn,{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--${R?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:P?"…":R?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:P?"Pending":R?"Visible":"Not visible"})]}),A.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:A.matchedTerms.map(Y=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:Y},Y))})]}),!P&&!R&&A.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:re.map(Y=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:Y},Y))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(A.recommendedCompetitors.length>0||A.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(Dn,{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 Y=A.competitorDomains.map(ue=>ue.replace(/^www\./,"")),ie=new Set(Y.map(ue=>jE(ue.replace(/\.[^.]+$/,""))));return[...A.recommendedCompetitors.filter(ue=>!ie.has(jE(ue))),...Y].map(ue=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:ue},ue))})()})]})]}),s==="sources"&&u.jsxs(u.Fragment,{children:[A.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(Dn,{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:A.citedDomains.map((Y,ie)=>{const oe=Y.toLowerCase().replace(/^www\./,""),ue=N.has(oe),we=!ue&&A.competitorDomains.some(le=>le.toLowerCase().replace(/^www\./,"")===oe),W=ue?"you":we?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${W}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ie+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:Y}),ue&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),we&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Y)})})]}),A.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 (",A.groundingSources.length,")"]}),u.jsx(Dn,{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:A.groundingSources.map((Y,ie)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Y.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y.title||Y.uri})},ie))})]}),A.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:A.evidenceUrls.map(Y=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y})},Y))})]}),A.citedDomains.length===0&&A.groundingSources.length===0&&A.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",z?"for this run":"yet"]})]}),!B&&!$&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",z?"for this run":"yet"]})]})]})]})]})]})})}function Ni(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 Tb=[{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 Gg(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 pQ=Gg({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"}),mQ=Gg({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"}),gQ=Gg({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"}),vQ=Gg({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"}),yQ=[{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:Ni(["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:Ni(["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:Ni(["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:Ni(["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:Ni(["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:Ni(["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:Ni(["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:Ni(["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:Ni(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Tb[0],Tb[1],Ni(["cited","cited","cited","cited","cited"]),Tb[2],2/7,Ni(["not-cited","not-cited","not-cited","cited"]);function bQ(e,t){return e.projects.find(n=>n.project.id===t)}function xQ(e,t){return e.runs.find(n=>n.id===t)}function wQ(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 SQ={regression:"negative",gain:"positive",opportunity:"caution"},jQ={regression:"lost",gain:"emerging",opportunity:"not-cited"},NQ={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function CQ(e){return{id:e.id,tone:SQ[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??NQ[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:jQ[e.type]}]}}function OQ(e){return e.filter(t=>!t.dismissed).map(CQ)}function uI(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 Iw(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function _Q(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),s=r%60;return`${i}m ${s}s`}function L1(e){switch(e){case hr["answer-visibility"]:return"Answer visibility sweep";case hr["gsc-sync"]:return"GSC sync";case hr["inspect-sitemap"]:return"Sitemap inspection";case hr["ga-sync"]:return"GA sync";case hr["bing-inspect"]:return"Bing URL inspection";case hr["site-audit"]:return"Site audit"}}function kQ(e){return e===Qp.manual?"Manual":e===Qp.scheduled?"Scheduled":e===Qp["config-apply"]?"Config apply":e}function $1(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:L1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Iw(e.startedAt):Iw(e.createdAt),duration:_Q(e.startedAt,e.finishedAt),statusDetail:e.error?dI(e.error):AQ(e),summary:EQ(e),triggerLabel:kQ(e.trigger)}}function dI(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 AQ(e){switch(e.status){case en.queued:return"Waiting for execution slot.";case en.running:return"Provider queries in progress.";case en.completed:return"All key phrases checked.";case en.partial:return"Run completed with some key phrases skipped.";case en.failed:return e.error?dI(e.error):"Run failed.";case en.cancelled:return"Run was cancelled.";default:return""}}function EQ(e){const t=L1(e.kind);switch(e.status){case en.queued:return`${t} queued`;case en.running:return`${t} in progress`;case en.completed:return`${t} completed`;case en.partial:return`${t} partially completed`;case en.failed:return`${t} failed`;case en.cancelled:return`${t} cancelled`;default:return e.status}}function fI(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const s of e){const l=s.keyword??s.id;t.has(l)||t.set(l,!1),s.citationState==="cited"&&t.set(l,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function hI(e){return e>=70?"positive":e>=40?"caution":"negative"}function TQ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function PQ(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function zQ(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const s of e){const l=s.keywordId,c=t.get(l)??{cited:!1,competitorOverlap:new Set};s.citationState==="cited"&&(c.cited=!0);for(const f of s.competitorOverlap)c.competitorOverlap.add(f);t.set(l,c)}const n=t.size,r=[...t.values()].filter(s=>!s.cited&&s.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:PQ(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 MQ(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 RQ(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function DQ(e,t){const n=MQ(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:RQ(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 pI(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const s of e)s.competitorOverlap.some(l=>n.has(l))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function IQ(e,t,n,r){const i=[];let s=0;const l=new Set;if(n){const c=new Map;for(const v of n.snapshots)if(v.keyword){const y=`${v.keyword}::${v.provider}`;c.set(y,v)}const f=new Set(n.snapshots.map(v=>v.provider)),h=new Set(t.flatMap(v=>Object.keys(v.providerRuns??{}))),p=[...new Set([...f,...h])].sort(),g=p.length>0?p:["gemini"];for(const v of t){if(v.runs.length===0)continue;l.add(v.keyword);const y=v.runs.at(-1),S=y?.transition??"not-cited";for(const w of g){const N=c.get(`${v.keyword}::${w}`),C=(v.providerRuns?.[w]?.length??0)>0;if(!N&&!C)continue;const E=N?.model??null,k=E?`${w}:${E}`:null,O=k?v.modelRuns?.[k]:void 0,T=v.providerRuns?.[w],z=(T?.length?T:null)??(O?.length?O:null),A=T?.length?"provider":O?.length?"model":"keyword",P=z?z.at(-1).transition:S,R=z?z.at(-1).visibilityTransition??(z.at(-1).visibilityState==="visible"?"visible":"not-visible"):y?.visibilityTransition??(y?.visibilityState==="visible"?"visible":"not-visible"),B=z?.at(-1)?.citationState,$=z?.at(-1)?.visibilityState,L=N?P==="lost"?"lost":P==="emerging"?"emerging":N.citationState==="cited"?"cited":"not-cited":B==="cited"?"cited":"not-cited",re=N?.visibilityState??($==="visible"?"visible":$==="pending"?"pending":"not-visible"),ge=Lw(z||v.runs),be=CE(z||v.runs),H=LQ(v,w),ee=(z??v.runs).map(D=>({runId:D.runId,citationState:D.citationState,createdAt:D.createdAt,model:H.get(D.runId)??null,answerMentioned:D.answerMentioned,visibilityState:D.visibilityState,visibilityTransition:D.visibilityTransition})),ye=$Q(ee),Se=A==="provider"&&ye.length<=1?"model":A,q=UQ(ee);i.push({id:`evidence_${e}_${s++}`,keyword:v.keyword,provider:N?.provider??w,model:N?.model??null,location:N?.location??null,citationState:L,answerMentioned:N?.answerMentioned,visibilityState:re,visibilityChangeLabel:OE(R,be,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:OE(P,ge),answerSnippet:N?.answerText??"",citedDomains:N?.citedDomains??[],evidenceUrls:[],competitorDomains:N?.competitorOverlap??[],recommendedCompetitors:N?.recommendedCompetitors??[],matchedTerms:N?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:N?.groundingSources??[],summary:BQ(re,R,v.keyword),runHistory:ee,historyScope:Se,modelsSeen:ye,modelTransitions:q})}}}for(const c of r)l.has(c.keyword)||i.push({id:`evidence_${e}_${s++}`,keyword:c.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function LQ(e,t){const n=new Map,r=`${t}:`;for(const[i,s]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),c=l==="unknown"?null:l;for(const f of s)n.set(f.runId,c)}return n}function $Q(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function UQ(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 Lw(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 CE(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 OE(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?`${hd(r.positive)} in latest run`:`${hd(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return hd(r.first);case"not-cited":case"not-visible":return t<=1?`${hd(r.negative)} in latest run`:`${hd(r.negative)} across ${t} runs`;default:return e}}function hd(e){return e.charAt(0).toUpperCase()+e.slice(1)}function BQ(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 _E(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const s of i.competitorOverlap){if(!n.has(s))continue;const l=r.get(s)??new Set;l.add(i.keyword),r.set(s,l)}return r}const Pb=3;function qQ(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:s}=e,l=[],c=[],f=new Set;for(const C of t)C.citationState==="lost"&&(f.has(C.keyword)||(f.add(C.keyword),c.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"lost"})));c.length>0&&l.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} key phrase${c.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const h=_E(r,s),p=_E(i,s);for(const C of s){const E=h.get(C)??new Set,k=p.get(C)??new Set,O=[...E].filter(T=>!k.has(T));O.length>0&&l.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:O.map(T=>{const z=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:z?.id??"",citationState:"cited"}})})}const g=new Map;for(const C of n){const E=C.runs.at(-1);E&&g.set(C.keyword,{transition:E.transition,citationState:E.citationState})}const v=[],y=[],S=new Set;for(const[C,{transition:E,citationState:k}]of g){if(!(E==="emerging"||E==="new"&&k==="cited"))continue;S.add(C);const T=t.find(z=>z.keyword===C&&(z.citationState==="emerging"||z.citationState==="cited"));v.push({keyword:C,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(S.has(C.keyword)||y.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(y.length>0){const C=new Set(y.map(E=>E.keyword)).size;l.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${C} key phrase${C>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:y})}v.length>0&&l.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${S.size} key phrase${S.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:v});const w=new Set(t.map(C=>C.keyword)),N=[];for(const C of n){if(!w.has(C.keyword)||C.runs.length<Pb||C.runs.at(-1)?.citationState!=="not-cited")continue;if(Lw(C.runs)>=Pb){const O=t.find(T=>T.keyword===C.keyword);N.push({keyword:C.keyword,evidenceId:O?.id??"",citationState:"not-cited"})}}N.length>0&&l.push({id:"insight_persistent_gap",tone:"caution",title:`${N.length} key phrase${N.length>1?"s":""} uncited for ${Pb}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:N});for(const C of s){const E=h.get(C)??new Set,O=[...p.get(C)??new Set].filter(T=>!E.has(T));O.length>0&&l.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:O.map(T=>{const z=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:z?.id??"",citationState:"not-cited"}})})}return l.length===0&&l.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),l}function FQ(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 KQ(e,t){if(t.length===0){const f=new Set(e.filter(h=>h.citationState==="cited").map(h=>h.keyword)).size;return{gained:f,lost:0,tone:f>0?"positive":"neutral",hasPreviousRun:!1}}const n=f=>{const h=new Set;for(const p of f)p.citationState==="cited"&&p.keyword&&h.add(p.keyword);return h},r=n(e),i=n(t);let s=0,l=0;for(const f of r)i.has(f)||s++;for(const f of i)r.has(f)||l++;const c=l>s?"negative":s>l?"positive":"neutral";return{gained:s,lost:l,tone:c,hasPreviousRun:!0}}function HQ(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(f=>f.kind===hr["answer-visibility"])??e[0],r=n.status===en.completed?"Healthy":n.status===en.running?"Running":n.status===en.queued?"Queued":n.status===en.partial?"Partial":"Failed",i=n.status===en.completed?"positive":n.status===en.failed?"negative":n.status===en.partial?"caution":"neutral",s=e.filter(f=>f.kind===hr["answer-visibility"]).length,l=e.length-s,c=l>0?`${s} ${s===1?"sweep":"sweeps"} · ${l} ${l===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${L1(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 GQ(e){const t=uI(e.project),n=IQ(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(A=>A.kind===hr["answer-visibility"]).sort((A,P)=>P.createdAt.localeCompare(A.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],s=fI(i),l=zQ(i),c=DQ(e.gscCoverage,e.bingCoverage),f=pI(i,e.competitors.map(A=>A.domain)),h=qQ({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(A=>A.domain)}),p=e.dbInsights!=null?OQ(e.dbInsights):null,g=p!=null?FQ(h,p):h,v=[...e.runs].sort((A,P)=>P.createdAt.localeCompare(A.createdAt)),y=v.find(A=>A.kind===hr["answer-visibility"]),S=v.find(A=>A.kind!==hr["answer-visibility"]);if(y&&S){const A=new Date(S.createdAt).getTime()-new Date(y.createdAt).getTime(),P=1440*60*1e3;A>P&&g.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${Iw(y.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const w=v.map(A=>$1(A,e.project.displayName||e.project.name)),N=new Map;for(const A of i){const P=A.provider||"gemini",R=A.model??null,B=`${P}::${R??"unknown"}`,$=N.get(B)??{provider:P,model:R,cited:0,total:0};$.total++,A.citationState==="cited"&&$.cited++,N.set(B,$)}const C=[...N.values()].sort((A,P)=>A.provider.localeCompare(P.provider)||(A.model??"").localeCompare(P.model??"")).map(({provider:A,model:P,cited:R,total:B})=>({provider:A,model:P,score:B>0?Math.round(R/B*100):0,cited:R,total:B})),E=e.project.providers.filter(A=>!A.startsWith("cdp:")),k=new Set(i.map(A=>A.provider)),O=E.filter(A=>k.has(A)).length,T=i.length>0&&E.length>1&&O<E.length,z=T?`${O} of ${E.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${s.score}`:"No data",delta:i.length>0?`${s.citedCount} of ${s.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?T?"caution":hI(s.score):"neutral",description:i.length>0?`${s.citedCount} of ${s.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:z},keywordCounts:{cited:s.citedCount,total:s.totalCount},gapKeyPhrases:l,indexCoverage:c,providerScores:C,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:TQ(f.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:HQ(v),movementSummary:KQ(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:g,visibilityEvidence:n,competitors:e.competitors.map((A,P)=>{const R=new Set;for(const ge of i)(ge.competitorOverlap.includes(A.domain)||ge.citedDomains.includes(A.domain))&&ge.keyword&&R.add(ge.keyword);const B=[...R],$=new Set(i.map(ge=>ge.keyword).filter(Boolean)),L=$.size>0?B.length/$.size:0,re=L>=.5?"High":L>=.2?"Moderate":B.length>0?"Low":"None";return{id:A.id||`comp_${P}`,domain:A.domain,citationCount:B.length,totalKeywords:$.size,pressureLabel:re,citedKeywords:B,movement:"",notes:""}}),recentRuns:w.slice(0,5)}}function VQ(e){const t=uI(e.project),n=e.runs.filter(S=>S.kind===hr["answer-visibility"]).sort((S,w)=>w.createdAt.localeCompare(S.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=fI(r),s=pI(r,e.competitors.map(S=>S.domain)),l=[...e.runs].sort((S,w)=>w.createdAt.localeCompare(S.createdAt)),c=l.find(S=>S.kind===hr["answer-visibility"])??l[0],f=e.project.displayName||e.project.name,h=c?$1(c,f):{id:"none",projectId:e.project.id,projectName:f,kind:hr["answer-visibility"],kindLabel:"No runs yet",status:en.queued,trigger:Qp.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(S=>!S.startsWith("cdp:")),g=new Set(r.map(S=>S.provider)),v=p.filter(S=>g.has(S)).length,y=r.length>0&&p.length>1&&v<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?y?"caution":hI(i.score):"neutral",providerCoverage:y?`${v} of ${p.length} providers`:void 0,lastRun:h,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(S=>S.provider)).size} provider${new Set(r.map(S=>S.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:s.label}}function ZQ(e,t){const n=[],r=[],i=[];for(const l of e){r.push(GQ(l)),i.push(VQ(l));const c=[...l.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt));for(const f of c)n.push($1(f,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const s=e.length>0;return{portfolioOverview:{projects:i,attentionItems:s?YQ(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...s?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:s,ctaLabel:s?"Trigger run":"Create a project first",summary:s?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function YQ(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(s=>s.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(s=>s.status===en.running||s.status===en.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 ti={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"]},mI=x.createContext(null);mI.Provider;function gf(){return x.useContext(mI)}function bl(e){const n=gf()?.dashboard??null,r=Go({queryKey:ti.projects.all,queryFn:tR,enabled:!n}),i=Go({queryKey:ti.runs.all,queryFn:rR,enabled:!n,refetchInterval:S=>S.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),s=Go({queryKey:ti.settings,queryFn:()=>v1().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],f=n8({queries:l.map(S=>{const w=c.filter(C=>C.projectId===S.id),N=w.filter(C=>(C.status==="completed"||C.status==="partial")&&C.kind==="answer-visibility").sort((C,E)=>E.createdAt.localeCompare(C.createdAt));return{queryKey:ti.projects.detail(S.id,N[0]?.id),queryFn:async()=>{const C=N[0]?.id,[E,k,O,T,z,A,P,R]=await Promise.all([d9(S.name).catch(()=>[]),iR(S.name).catch(()=>[]),aR(S.name).catch(()=>[]),C?Lc(C).catch(()=>null):Promise.resolve(null),N[1]?Lc(N[1].id).catch(()=>null):Promise.resolve(null),y1(S.name).catch(()=>null),b1(S.name).catch(()=>null),C?sF(S.name,C).catch(()=>null):Promise.resolve(null)]);return{project:S,runs:w,keywords:E,competitors:k,timeline:O,latestRunDetail:T,previousRunDetail:z,gscCoverage:A,bingCoverage:P,dbInsights:R}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),h=f.every(S=>S.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!h)return null;const S=f.map(w=>w.data).filter(w=>w!=null);return ZQ(S,s.data??null)},[n,r.data,i.data,s.data,h,f,l.length]),g=!n&&(r.isError||i.isError),v=!n&&!p&&!g,y=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),s.refetch()])},[r.refetch,i.refetch,s.refetch]);return{dashboard:p,isLoading:v,isError:g,refetch:y}}async function WQ(){const e=await oF("/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 Vg(e,t){return Go({queryKey:ti.health,queryFn:WQ,enabled:e,refetchInterval:15e3,initialData:t})}function QQ(e){return Go({queryKey:ti.runs.detail(e??""),queryFn:()=>Lc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function nu(){const e=Ys(),t=Pg({strict:!1}),n=vr({select:f=>f.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:f=>e({to:n,from:Ei.to,search:h=>({...h,runId:f,evidenceId:void 0})}),openEvidence:f=>e({to:n,from:Ei.to,search:h=>({...h,evidenceId:f,runId:void 0})}),closeDrawer:()=>e({to:n,from:Ei.to,search:f=>({...f,runId:void 0,evidenceId:void 0})})}}const XQ={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function JQ(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function eX(){const e=x.useSyncExternalStore(hF,CA,CA),t=Ys(),{openRun:n}=nu(),r=x.useCallback(s=>{Ow(s)},[]),i=x.useCallback(s=>{s.cta&&(s.cta.intent==="open-run-drawer"?n(s.cta.runId):t({to:"/runs"}),Ow(s.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(s=>u.jsxs("section",{role:s.tone==="negative"?"alert":"status","aria-live":s.tone==="negative"?"assertive":"polite","data-state":s.state,className:`toast-card ${XQ[s.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:s.title}),s.detail?u.jsx("p",{className:"toast-detail",children:s.detail}):null,s.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(s),"aria-label":JQ(s),children:s.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(s.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(Rg,{className:"size-3.5"})})]},s.id))})}const kE=[{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"}],AE=e=>({label:e,state:"checking",detail:"Checking service health"}),tX={apiStatus:AE("API"),workerStatus:AE("Worker")};function nX(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function rX(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function iX(e){const t=nX(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function aX(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function sX(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function oX(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 lX(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function cX(){const e=x.useSyncExternalStore(uK,rl,rl),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=Go({queryKey:ti.runs.all,queryFn:rR,enabled:t}),r=Go({queryKey:ti.projects.all,queryFn:tR,enabled:t}),i=x.useRef({}),s=x.useCallback(()=>{n.refetch()},[n.refetch]);return x.useEffect(()=>{t&&s()},[t,s]),x.useEffect(()=>{if(!t||typeof window>"u")return;const l=()=>{document.visibilityState==="visible"&&s()};return window.addEventListener("focus",s),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",l)}},[t,s]),x.useEffect(()=>{const l=n.data??[],c=r.data??[],f=Object.fromEntries(l.map(p=>[p.id,p])),h=Object.fromEntries(l.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const g=f[p.runId];if(!g||!hK(g.status)||(i.current[g.id]??p.lastAnnouncedStatus)===g.status)continue;if(p.sourceAction==="run-all"){TA(g.id);continue}const y=sX(g.projectId,p.projectLabel,c);it({title:iX(g),detail:aX(g,y),tone:rX(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),TA(g.id)}for(const p of Object.values(e.batches)){const g=pK(p.runIds,f);g.finished&&(it({title:"Run-all batch finished",detail:oX(g,p.skippedCount),tone:lX(g),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),fK(p.batchId))}i.current=h},[r.data,n.data,e]),null}function uX(){const e=gf(),{dashboard:t,isLoading:n,refetch:r}=bl(),l=Vg(!e,e?.health).data??e?.health??tX,c=i9(),{runId:f,evidenceId:h,closeDrawer:p}=nu(),[g,v]=x.useState(!1),y=QQ(f),S=y.data??null,w=y.isLoading;x.useEffect(()=>{S&&S.status!=="running"&&S.status!=="queued"&&r()},[S?.status,r]),x.useEffect(()=>{v(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!f&&!h)return;const O=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[f,h,p]);const N=t??e?.dashboard??null,C=f&&N?xQ(N,f):void 0,E=h&&N?wQ(N,h):void 0,k=(()=>{const O=c.pathname;if(O==="/")return"Portfolio";if(O==="/projects")return"Projects";if(O==="/runs")return"Runs";if(O==="/settings")return"Settings";if(O==="/setup")return"Setup";if(O.startsWith("/projects/")){const z=O.split("/").filter(Boolean)[1];if(z&&N){const A=N.projects.find(P=>P.project.id===z);if(A)return A.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(BA,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Ut,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(kF,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Ut,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(OF,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Ut,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(PF,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Ut,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(UF,{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(O=>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+O*15}%`}})]},O))]}):N&&N.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),N.projects.map(O=>{const T=O.visibilitySummary.tone;return u.jsxs(Ut,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[u.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),u.jsx("span",{children:O.project.name})]},O.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Ut,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(DF,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:kE.map(O=>u.jsx("a",{className:"sidebar-footer-link",href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.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(BA,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Ut,{to:"/",children:"Home"}),u.jsx(Mg,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:k})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,title:qs(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:qs(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),u.jsxs(ve,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":g,"aria-controls":"mobile-nav",onClick:()=>v(O=>!O),children:[u.jsx(EF,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${g?"mobile-nav-open":""}`,children:[u.jsxs(ve,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>v(!1),children:[u.jsx(Rg,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Ut,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Ut,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Ut,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Ut,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),N&&N.projects.length>0?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),N.projects.map(O=>u.jsx(Ut,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"mobile-nav-link",children:O.project.name},O.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(O=>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"})]},O))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(O=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-20"}),u.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>u.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},O))})]}):u.jsx(g1,{})}),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(NF,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:kE.map(O=>u.jsx("a",{href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.href))})]})]}),C?u.jsxs(J7,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:p,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx($g,{status:C.status}),u.jsx("span",{className:"text-zinc-400",children:C.startedAt}),u.jsx("span",{className:"text-zinc-500",children:C.duration}),u.jsx("span",{className:"text-zinc-600",children:C.triggerLabel})]}),C.status==="failed"&&C.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:C.statusDetail}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),w?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):S&&S.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[S.snapshots.map(O=>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:O.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Kd,{provider:O.provider}),u.jsx(DR,{variant:O.citationState==="cited"?"success":"neutral",children:O.citationState})]})]}),O.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:O.model}),O.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",O.citedDomains.join(", ")]}),O.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",O.competitorOverlap.join(", ")]}),O.groundingSources&&O.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:[O.groundingSources.length," grounding source",O.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:O.groundingSources.map((T,z)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:T.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},z))})]}),O.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:O.answerText})]})]},O.id)),S.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..."]})]}):S&&S.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..."]}):S&&S.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..."]}):S&&S.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:QF(S.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?u.jsx(hQ,{evidence:E.evidence,project:E.project,onClose:p}):null,u.jsx(cX,{}),u.jsx(eX,{})]})}class dX extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?u.jsx("div",{className:"page-container",children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[u.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:u.jsx(KF,{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(ve,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(LF,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const He=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("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}));He.displayName="Card";const $w=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("flex flex-col gap-1.5 p-5",e),...t}));$w.displayName="CardHeader";const Uw=x.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:di("font-medium tracking-tight text-zinc-50",e),...t}));Uw.displayName="CardTitle";const Bw=x.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:di("text-sm text-zinc-500",e),...t}));Bw.displayName="CardDescription";const Xp=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("p-5 pt-0",e),...t}));Xp.displayName="CardContent";function fX({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,s=5,l=Math.min(...e),f=Math.max(...e)-l||1,h=i-s*2,p=r-s*2,g=e.map((v,y)=>{const S=s+y/Math.max(e.length-1,1)*h,w=s+(1-(v-l)/f)*p;return`${S},${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:s,y:s,width:h,height:p,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:s,x2:i-s,y1:r-s,y2:r-s}),u.jsx("polyline",{clipPath:`url(#${n})`,points:g,vectorEffect:"non-scaling-stroke"})]})}function hX({project:e}){return u.jsxs(Ut,{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," · ",Dg(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(fX,{points:e.trend,tone:mR(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(Mg,{className:"h-4 w-4 text-zinc-500"})})]})}function pX(){const e=gf(),{dashboard:t,isLoading:n}=bl(),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=Vg(!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=rK(i.systemHealth,c,r.settings),{openRun:h}=nu();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(hX,{project:p},p.project.id))}):u.jsxs(He,{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(ve,{size:"sm",asChild:!0,children:u.jsx(Ut,{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(Ut,{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:()=>h(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($g,{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:f.map(p=>u.jsxs(He,{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(wt,{tone:p.tone,title:p.id==="api"?qs(c.apiStatus):p.id==="worker"?qs(c.workerStatus):void 0,children:p.label})]}),u.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const U1=Symbol.for("yaml.alias"),qw=Symbol.for("yaml.document"),Ls=Symbol.for("yaml.map"),gI=Symbol.for("yaml.pair"),Xi=Symbol.for("yaml.scalar"),ru=Symbol.for("yaml.seq"),si=Symbol.for("yaml.node.type"),xl=e=>!!e&&typeof e=="object"&&e[si]===U1,Zg=e=>!!e&&typeof e=="object"&&e[si]===qw,vf=e=>!!e&&typeof e=="object"&&e[si]===Ls,on=e=>!!e&&typeof e=="object"&&e[si]===gI,Pt=e=>!!e&&typeof e=="object"&&e[si]===Xi,yf=e=>!!e&&typeof e=="object"&&e[si]===ru;function an(e){if(e&&typeof e=="object")switch(e[si]){case Ls:case ru:return!0}return!1}function sn(e){if(e&&typeof e=="object")switch(e[si]){case U1:case Ls:case Xi:case ru:return!0}return!1}const vI=e=>(Pt(e)||an(e))&&!!e.anchor,Po=Symbol("break visit"),mX=Symbol("skip children"),Md=Symbol("remove node");function iu(e,t){const n=gX(t);Zg(e)?Sc(null,e.contents,n,Object.freeze([e]))===Md&&(e.contents=null):Sc(null,e,n,Object.freeze([]))}iu.BREAK=Po;iu.SKIP=mX;iu.REMOVE=Md;function Sc(e,t,n,r){const i=vX(e,t,n,r);if(sn(i)||on(i))return yX(e,r,i),Sc(e,i,n,r);if(typeof i!="symbol"){if(an(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){const l=Sc(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===Po)return Po;l===Md&&(t.items.splice(s,1),s-=1)}}}else if(on(t)){r=Object.freeze(r.concat(t));const s=Sc("key",t.key,n,r);if(s===Po)return Po;s===Md&&(t.key=null);const l=Sc("value",t.value,n,r);if(l===Po)return Po;l===Md&&(t.value=null)}}return i}function gX(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 vX(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(vf(t))return n.Map?.(e,t,r);if(yf(t))return n.Seq?.(e,t,r);if(on(t))return n.Pair?.(e,t,r);if(Pt(t))return n.Scalar?.(e,t,r);if(xl(t))return n.Alias?.(e,t,r)}function yX(e,t,n){const r=t[t.length-1];if(an(r))r.items[e]=n;else if(on(r))e==="key"?r.key=n:r.value=n;else if(Zg(r))r.contents=n;else{const i=xl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const bX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xX=e=>e.replace(/[!,[\]{}]/g,t=>bX[t]);class Xn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xn.defaultYaml,t),this.tags=Object.assign({},Xn.defaultTags,n)}clone(){const t=new Xn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xn.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,l]=r;return this.tags[s]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const l=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+xX(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&&sn(t.contents)){const s={};iu(t.contents,(l,c)=>{sn(c)&&c.tag&&(s[c.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,l]of r)s==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${s} ${l}`);return n.join(`
97
- `)}}Xn.defaultYaml={explicit:!1,version:"1.2"};Xn.defaultTags={"!!":"tag:yaml.org,2002:"};function yI(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 bI(e){const t=new Set;return iu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function xI(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function wX(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=bI(e));const l=xI(t,i);return i.add(l),l},setAnchors:()=>{for(const s of n){const l=r.get(s);if(typeof l=="object"&&l.anchor&&(Pt(l.node)||an(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=s,c}}},sourceObjects:r}}function jc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const l=r[i],c=jc(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),l=jc(e,r,i,s);l===void 0?r.delete(i):l!==s&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const s=jc(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const l=jc(e,r,i,s);l===void 0?delete r[i]:l!==s&&(r[i]=l)}return e.call(t,n,r)}function ai(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ai(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!vI(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class B1{constructor(t){Object.defineProperty(this,si,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Zg(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=ai(this,"",l);if(typeof i=="function")for(const{count:f,res:h}of l.anchors.values())i(h,f);return typeof s=="function"?jc(s,{"":c},"",c):c}}class q1 extends B1{constructor(t){super(U1),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=[],iu(t,{Node:(s,l)=>{(xl(l)||vI(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,l=this.resolve(i,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=r.get(l);if(c||(ai(l,null,n),c=r.get(l)),c?.res===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Jp(i,l,r)),c.count*c.aliasCount>s)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(yI(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Jp(e,t,n){if(xl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(an(t)){let r=0;for(const i of t.items){const s=Jp(e,i,n);s>r&&(r=s)}return r}else if(on(t)){const r=Jp(e,t.key,n),i=Jp(e,t.value,n);return Math.max(r,i)}return 1}const wI=e=>!e||typeof e!="function"&&typeof e!="object";class Ve extends B1{constructor(t){super(Xi),this.value=t}toJSON(t,n){return n?.keep?this.value:ai(this.value,t,n)}toString(){return String(this.value)}}Ve.BLOCK_FOLDED="BLOCK_FOLDED";Ve.BLOCK_LITERAL="BLOCK_LITERAL";Ve.PLAIN="PLAIN";Ve.QUOTE_DOUBLE="QUOTE_DOUBLE";Ve.QUOTE_SINGLE="QUOTE_SINGLE";const SX="tag:yaml.org,2002:";function jX(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Yd(e,t,n){if(Zg(e)&&(e=e.contents),sn(e))return e;if(on(e)){const g=n.schema[Ls].createNode?.(n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:l,sourceObjects:c}=n;let f;if(r&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=i(e)),new q1(f.anchor);f={anchor:null,node:null},c.set(e,f)}t?.startsWith("!!")&&(t=SX+t.slice(2));let h=jX(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Ve(e);return f&&(f.node=g),g}h=e instanceof Map?l[Ls]:Symbol.iterator in Object(e)?l[ru]:l[Ls]}s&&(s(h),delete n.onTagObj);const p=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new Ve(e);return t?p.tag=t:h.default||(p.tag=h.tag),f&&(f.node=p),p}function _m(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const l=[];l[s]=r,r=l}else r=new Map([[s,r]])}return Yd(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 _d=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class SI extends B1{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=>sn(r)||on(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(_d(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(an(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,_m(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(an(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&Pt(s)?s.value:s:an(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!on(n))return!1;const r=n.value;return r==null||t&&Pt(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 an(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(an(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,_m(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const NX=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Pa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Uo=(e,t,n)=>e.endsWith(`
98
- `)?Pa(n,t):n.includes(`
99
- `)?`
100
- `+Pa(n,t):(e.endsWith(" ")?"":" ")+n,jI="flow",Fw="block",em="quoted";function Yg(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:l,onOverflow:c}={}){if(!i||i<0)return e;i<s&&(s=0);const f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;const h=[],p={};let g=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?h.push(0):g=i-r);let v,y,S=!1,w=-1,N=-1,C=-1;n===Fw&&(w=EE(e,w,t.length),w!==-1&&(g=w+f));for(let k;k=e[w+=1];){if(n===em&&k==="\\"){switch(N=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}C=w}if(k===`
101
- `)n===Fw&&(w=EE(e,w,t.length)),g=w+t.length+f,v=void 0;else{if(k===" "&&y&&y!==" "&&y!==`
102
- `&&y!==" "){const O=e[w+1];O&&O!==" "&&O!==`
103
- `&&O!==" "&&(v=w)}if(w>=g)if(v)h.push(v),g=v+f,v=void 0;else if(n===em){for(;y===" "||y===" ";)y=k,k=e[w+=1],S=!0;const O=w>C+1?w-2:N-1;if(p[O])return e;h.push(O),p[O]=!0,g=O+f,v=void 0}else S=!0}y=k}if(S&&c&&c(),h.length===0)return e;l&&l();let E=e.slice(0,h[0]);for(let k=0;k<h.length;++k){const O=h[k],T=h[k+1]||e.length;O===0?E=`
104
- ${t}${e.slice(0,T)}`:(n===em&&p[O]&&(E+=`${e[O]}\\`),E+=`
105
- ${t}${e.slice(O+1,T)}`)}return E}function EE(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
106
- `);r=t,i=t+1,s=e[i]}return r}const Wg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Qg=e=>/^(%|---|\.\.\.)/m.test(e);function CX(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,l=0;s<i;++s)if(e[s]===`
107
- `){if(s-l>r)return!0;if(l=s+1,i-l<=r)return!1}return!0}function Rd(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(Qg(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const p=n.substr(f+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(r||n[f+2]==='"'||n.length<i)f+=1;else{for(l+=n.slice(c,f)+`
108
-
109
- `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
110
- `,f+=2;l+=s,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,r?l:Yg(l,s,em,Wg(t,!1))}function Kw(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
111
- `)||/[ \t]\n|\n[ \t]/.test(e))return Rd(e,t);const n=t.indent||(Qg(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
112
- ${n}`)+"'";return t.implicitKey?r:Yg(r,n,jI,Wg(t,!1))}function Nc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Rd;else{const i=e.includes('"'),s=e.includes("'");i&&!s?r=Kw:s&&!i?r=Rd:r=n?Kw:Rd}return r(e,t)}let Hw;try{Hw=new RegExp(`(^|(?<!
113
- ))
114
- +(?!
115
- |$)`,"g")}catch{Hw=/\n+(?!\n|$)/g}function tm({comment:e,type:t,value:n},r,i,s){const{blockQuote:l,commentString:c,lineWidth:f}=r.options;if(!l||/\n[\t ]+$/.test(n))return Nc(n,r);const h=r.indent||(r.forceBlockIndent||Qg(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===Ve.BLOCK_FOLDED?!1:t===Ve.BLOCK_LITERAL?!0:!CX(n,f,h.length);if(!n)return p?`|
116
- `:`>
117
- `;let g,v;for(v=n.length;v>0;--v){const T=n[v-1];if(T!==`
118
- `&&T!==" "&&T!==" ")break}let y=n.substring(v);const S=y.indexOf(`
119
- `);S===-1?g="-":n===y||S!==y.length-1?(g="+",s&&s()):g="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
120
- `&&(y=y.slice(0,-1)),y=y.replace(Hw,`$&${h}`));let w=!1,N,C=-1;for(N=0;N<n.length;++N){const T=n[N];if(T===" ")w=!0;else if(T===`
121
- `)C=N;else break}let E=n.substring(0,C<N?C+1:N);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${h}`));let O=(w?h?"2":"1":"")+g;if(e&&(O+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=n.replace(/\n+/g,`
122
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let z=!1;const A=Wg(r,!0);l!=="folded"&&t!==Ve.BLOCK_FOLDED&&(A.onOverflow=()=>{z=!0});const P=Yg(`${E}${T}${y}`,h,Fw,A);if(!z)return`>${O}
123
- ${h}${P}`}return n=n.replace(/\n+/g,`$&${h}`),`|${O}
124
- ${h}${E}${n}${y}`}function OX(e,t,n,r){const{type:i,value:s}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:p}=t;if(c&&s.includes(`
125
- `)||p&&/[[\]{},]/.test(s))return Nc(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||p||!s.includes(`
126
- `)?Nc(s,t):tm(e,t,n,r);if(!c&&!p&&i!==Ve.PLAIN&&s.includes(`
127
- `))return tm(e,t,n,r);if(Qg(s)){if(f==="")return t.forceBlockIndent=!0,tm(e,t,n,r);if(c&&f===h)return Nc(s,t)}const g=s.replace(/\n+/g,`$&
128
- ${f}`);if(l){const v=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(g),{compat:y,tags:S}=t.doc.schema;if(S.some(v)||y?.some(v))return Nc(s,t)}return c?g:Yg(g,f,jI,Wg(t,!1))}function F1(e,t,n,r){const{implicitKey:i,inFlow:s}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Ve.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Ve.QUOTE_DOUBLE);const f=p=>{switch(p){case Ve.BLOCK_FOLDED:case Ve.BLOCK_LITERAL:return i||s?Nc(l.value,t):tm(l,t,n,r);case Ve.QUOTE_DOUBLE:return Rd(l.value,t);case Ve.QUOTE_SINGLE:return Kw(l.value,t);case Ve.PLAIN:return OX(l,t,n,r);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:p,defaultStringType:g}=t.options,v=i&&p||g;if(h=f(v),h===null)throw new Error(`Unsupported default string type ${v}`)}return h}function NI(e,t){const n=Object.assign({blockQuote:!0,commentString:NX,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 _X(e,t){if(t.tag){const i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Pt(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){const s=i.filter(l=>l.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function kX(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(Pt(e)||an(e))&&e.anchor;s&&yI(s)&&(n.add(s),i.push(`&${s}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function Bc(e,t,n,r){if(on(e))return e.toString(t,n,r);if(xl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const s=sn(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=_X(t.doc.schema.tags,s));const l=kX(s,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(s,t,n,r):Pt(s)?F1(s,t,n,r):s.toString(t,n,r);return l?Pt(s)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
129
- ${t.indent}${c}`:c}function AX({key:e,value:t},n,r,i){const{allNullValues:s,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:p,simpleKeys:g}}=n;let v=sn(e)&&e.comment||null;if(g){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(an(e)||!sn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let y=!g&&(!e||v&&t==null&&!n.inFlow||an(e)||(Pt(e)?e.type===Ve.BLOCK_FOLDED||e.type===Ve.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(g||!s),indent:c+f});let S=!1,w=!1,N=Bc(e,n,()=>S=!0,()=>w=!0);if(!y&&!n.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(s||t==null)return S&&r&&r(),N===""?"?":y?`? ${N}`:N}else if(s&&!g||t==null&&y)return N=`? ${N}`,v&&!S?N+=Uo(N,n.indent,h(v)):w&&i&&i(),N;S&&(v=null),y?(v&&(N+=Uo(N,n.indent,h(v))),N=`? ${N}
130
- ${c}:`):(N=`${N}:`,v&&(N+=Uo(N,n.indent,h(v))));let C,E,k;sn(t)?(C=!!t.spaceBefore,E=t.commentBefore,k=t.comment):(C=!1,E=null,k=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!y&&!v&&Pt(t)&&(n.indentAtStart=N.length+1),w=!1,!p&&f.length>=2&&!n.inFlow&&!y&&yf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const T=Bc(t,n,()=>O=!0,()=>w=!0);let z=" ";if(v||C||E){if(z=C?`
131
- `:"",E){const A=h(E);z+=`
132
- ${Pa(A,n.indent)}`}T===""&&!n.inFlow?z===`
133
- `&&k&&(z=`
134
-
135
- `):z+=`
136
- ${n.indent}`}else if(!y&&an(t)){const A=T[0],P=T.indexOf(`
137
- `),R=P!==-1,B=n.inFlow??t.flow??t.items.length===0;if(R||!B){let $=!1;if(R&&(A==="&"||A==="!")){let L=T.indexOf(" ");A==="&"&&L!==-1&&L<P&&T[L+1]==="!"&&(L=T.indexOf(" ",L+1)),(L===-1||P<L)&&($=!0)}$||(z=`
138
- ${n.indent}`)}}else(T===""||T[0]===`
139
- `)&&(z="");return N+=z+T,n.inFlow?O&&r&&r():k&&!O?N+=Uo(N,n.indent,h(k)):w&&i&&i(),N}function EX(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Sp="<<",Ra={identify:e=>e===Sp||typeof e=="symbol"&&e.description===Sp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ve(Symbol(Sp)),{addToJSMap:CI}),stringify:()=>Sp},TX=(e,t)=>(Ra.identify(t)||Pt(t)&&(!t.type||t.type===Ve.PLAIN)&&Ra.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Ra.tag&&n.default);function CI(e,t,n){if(n=e&&xl(n)?n.resolve(e.doc):n,yf(n))for(const r of n.items)zb(e,t,r);else if(Array.isArray(n))for(const r of n)zb(e,t,r);else zb(e,t,n)}function zb(e,t,n){const r=e&&xl(n)?n.resolve(e.doc):n;if(!vf(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,l]of i)t instanceof Map?t.has(s)||t.set(s,l):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function OI(e,t,{key:n,value:r}){if(sn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(TX(e,n))CI(e,t,r);else{const i=ai(n,"",e);if(t instanceof Map)t.set(i,ai(r,i,e));else if(t instanceof Set)t.add(i);else{const s=PX(n,i,e),l=ai(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function PX(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(sn(e)&&n?.doc){const r=NI(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),EX(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function K1(e,t,n){const r=Yd(e,void 0,n),i=Yd(t,void 0,n);return new tr(r,i)}class tr{constructor(t,n=null){Object.defineProperty(this,si,{value:gI}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return sn(n)&&(n=n.clone(t)),sn(r)&&(r=r.clone(t)),new tr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return OI(n,r,this)}toString(t,n,r){return t?.doc?AX(this,t,n,r):JSON.stringify(this)}}function _I(e,t,n){return(t.inFlow??e.flow?MX:zX)(e,t,n)}function zX({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,p=Object.assign({},n,{indent:s,type:null});let g=!1;const v=[];for(let S=0;S<t.length;++S){const w=t[S];let N=null;if(sn(w))!g&&w.spaceBefore&&v.push(""),km(n,v,w.commentBefore,g),w.comment&&(N=w.comment);else if(on(w)){const E=sn(w.key)?w.key:null;E&&(!g&&E.spaceBefore&&v.push(""),km(n,v,E.commentBefore,g))}g=!1;let C=Bc(w,p,()=>N=null,()=>g=!0);N&&(C+=Uo(C,s,h(N))),g&&N&&(g=!1),v.push(r+C)}let y;if(v.length===0)y=i.start+i.end;else{y=v[0];for(let S=1;S<v.length;++S){const w=v[S];y+=w?`
140
- ${f}${w}`:`
141
- `}}return e?(y+=`
142
- `+Pa(h(e),f),c&&c()):g&&l&&l(),y}function MX({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:l,options:{commentString:c}}=t;r+=s;const f=Object.assign({},t,{indent:r,inFlow:!0,type:null});let h=!1,p=0;const g=[];for(let S=0;S<e.length;++S){const w=e[S];let N=null;if(sn(w))w.spaceBefore&&g.push(""),km(t,g,w.commentBefore,!1),w.comment&&(N=w.comment);else if(on(w)){const E=sn(w.key)?w.key:null;E&&(E.spaceBefore&&g.push(""),km(t,g,E.commentBefore,!1),E.comment&&(h=!0));const k=sn(w.value)?w.value:null;k?(k.comment&&(N=k.comment),k.commentBefore&&(h=!0)):w.value==null&&E?.comment&&(N=E.comment)}N&&(h=!0);let C=Bc(w,f,()=>N=null);S<e.length-1&&(C+=","),N&&(C+=Uo(C,r,c(N))),!h&&(g.length>p||C.includes(`
143
- `))&&(h=!0),g.push(C),p=g.length}const{start:v,end:y}=n;if(g.length===0)return v+y;if(!h){const S=g.reduce((w,N)=>w+N.length+2,2);h=t.options.lineWidth>0&&S>t.options.lineWidth}if(h){let S=v;for(const w of g)S+=w?`
144
- ${s}${i}${w}`:`
145
- `;return`${S}
146
- ${i}${y}`}else return`${v}${l}${g.join(" ")}${l}${y}`}function km({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=Pa(t(r),e);n.push(s.trimStart())}}function Bo(e,t){const n=Pt(t)?t.value:t;for(const r of e)if(on(r)&&(r.key===t||r.key===n||Pt(r.key)&&r.key.value===n))return r}class ei extends SI{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ls,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,l=new this(t),c=(f,h)=>{if(typeof s=="function")h=s.call(n,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&l.items.push(K1(f,h,r))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;on(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new tr(t,t?.value):r=new tr(t.key,t.value);const i=Bo(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Pt(i.value)&&wI(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const l=this.items.findIndex(c=>s(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Bo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Bo(this.items,t)?.value;return(!n&&Pt(i)?i.value:i)??void 0}has(t){return!!Bo(this.items,t)}set(t,n){this.add(new tr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const s of this.items)OI(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!on(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})),_I(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const au={collection:"map",default:!0,nodeClass:ei,tag:"tag:yaml.org,2002:map",resolve(e,t){return vf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>ei.from(e,t,n)};class al extends SI{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ru,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=jp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=jp(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Pt(i)?i.value:i}has(t){const n=jp(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=jp(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Pt(i)&&wI(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const s of this.items)r.push(ai(s,String(i++),n));return r}toString(t,n,r){return t?_I(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof i=="function"){const f=n instanceof Set?c:String(l++);c=i.call(n,f,c)}s.items.push(Yd(c,void 0,r))}}return s}}function jp(e){let t=Pt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const su={collection:"seq",default:!0,nodeClass:al,tag:"tag:yaml.org,2002:seq",resolve(e,t){return yf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>al.from(e,t,n)},Xg={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),F1(e,t,n,r)}},Jg={identify:e=>e==null,createNode:()=>new Ve(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ve(null),stringify:({source:e},t)=>typeof e=="string"&&Jg.test.test(e)?e:t.options.nullStr},H1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ve(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&H1.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 Ri({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let l=s.indexOf(".");l<0&&(l=s.length,s+=".");let c=t-(s.length-l-1);for(;c-- >0;)s+="0"}return s}const kI={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:Ri},AI={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():Ri(e)}},EI={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 Ve(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ri},ev=e=>typeof e=="bigint"||Number.isInteger(e),G1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function TI(e,t,n){const{value:r}=e;return ev(r)&&r>=0?n+r.toString(t):Ri(e)}const PI={identify:e=>ev(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>G1(e,2,8,n),stringify:e=>TI(e,8,"0o")},zI={identify:ev,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>G1(e,0,10,n),stringify:Ri},MI={identify:e=>ev(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>G1(e,2,16,n),stringify:e=>TI(e,16,"0x")},RX=[au,su,Xg,Jg,H1,PI,zI,MI,kI,AI,EI];function TE(e){return typeof e=="bigint"||Number.isInteger(e)}const Np=({value:e})=>JSON.stringify(e),DX=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Np},{identify:e=>e==null,createNode:()=>new Ve(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Np},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Np},{identify:TE,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})=>TE(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:Np}],IX={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},LX=[au,su].concat(DX,IX),V1={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ve.BLOCK_LITERAL),t!==Ve.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(c.length/f),p=new Array(h);for(let g=0,v=0;g<h;++g,v+=f)p[g]=c.substr(v,f);c=p.join(t===Ve.BLOCK_LITERAL?`
147
- `:" ")}return F1({comment:e,type:t,value:c},r,i,s)}};function RI(e,t){if(yf(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!on(r)){if(vf(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new tr(new Ve(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
148
- ${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment}
149
- ${s.comment}`:r.comment}r=i}e.items[n]=on(r)?r:new tr(r)}}else t("Expected a sequence for this tag");return e}function DI(e,t,n){const{replacer:r}=n,i=new al(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(s++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;i.items.push(K1(c,f,n))}return i}const Z1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:RI,createNode:DI};class Pc extends al{constructor(){super(),this.add=ei.prototype.add.bind(this),this.delete=ei.prototype.delete.bind(this),this.get=ei.prototype.get.bind(this),this.has=ei.prototype.has.bind(this),this.set=ei.prototype.set.bind(this),this.tag=Pc.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let s,l;if(on(i)?(s=ai(i.key,"",n),l=ai(i.value,s,n)):s=ai(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,l)}return r}static from(t,n,r){const i=DI(t,n,r),s=new this;return s.items=i.items,s}}Pc.tag="tag:yaml.org,2002:omap";const Y1={collection:"seq",identify:e=>e instanceof Map,nodeClass:Pc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=RI(e,t),r=[];for(const{key:i}of n.items)Pt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Pc,n)},createNode:(e,t,n)=>Pc.from(e,t,n)};function II({value:e,source:t},n){return t&&(e?LI:$I).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const LI={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 Ve(!0),stringify:II},$I={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 Ve(!1),stringify:II},$X={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:Ri},UX={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():Ri(e)}},BX={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 Ve(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:Ri},bf=e=>typeof e=="bigint"||Number.isInteger(e);function tv(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const s=parseInt(e,n);return i==="-"?-1*s:s}function W1(e,t,n){const{value:r}=e;if(bf(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Ri(e)}const qX={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>tv(e,2,2,n),stringify:e=>W1(e,2,"0b")},FX={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>tv(e,1,8,n),stringify:e=>W1(e,8,"0")},KX={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>tv(e,0,10,n),stringify:Ri},HX={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>tv(e,2,16,n),stringify:e=>W1(e,16,"0x")};class zc extends ei{constructor(t){super(t),this.tag=zc.tag}add(t){let n;on(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new tr(t.key,null):n=new tr(t,null),Bo(this.items,n.key)||this.items.push(n)}get(t,n){const r=Bo(this.items,t);return!n&&on(r)?Pt(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=Bo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new tr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),s.items.push(K1(l,null,r));return s}}zc.tag="tag:yaml.org,2002:set";const Q1={collection:"map",identify:e=>e instanceof Set,nodeClass:zc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>zc.from(e,t,n),resolve(e,t){if(vf(e)){if(e.hasAllNullValues(!0))return Object.assign(new zc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function X1(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),s=r.replace(/_/g,"").split(":").reduce((l,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*s:s}function UI(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return Ri(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const BI={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})=>X1(e,n),stringify:UI},qI={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=>X1(e,!1),stringify:UI},nv={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(nv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,r-1,i,s||0,l||0,c||0,f);const p=t[8];if(p&&p!=="Z"){let g=X1(p,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},PE=[au,su,Xg,Jg,LI,$I,qX,FX,KX,HX,$X,UX,BX,V1,Ra,Y1,Z1,Q1,BI,qI,nv],zE=new Map([["core",RX],["failsafe",[au,su,Xg]],["json",LX],["yaml11",PE],["yaml-1.1",PE]]),ME={binary:V1,bool:H1,float:EI,floatExp:AI,floatNaN:kI,floatTime:qI,int:zI,intHex:MI,intOct:PI,intTime:BI,map:au,merge:Ra,null:Jg,omap:Y1,pairs:Z1,seq:su,set:Q1,timestamp:nv},GX={"tag:yaml.org,2002:binary":V1,"tag:yaml.org,2002:merge":Ra,"tag:yaml.org,2002:omap":Y1,"tag:yaml.org,2002:pairs":Z1,"tag:yaml.org,2002:set":Q1,"tag:yaml.org,2002:timestamp":nv};function Mb(e,t,n){const r=zE.get(t);if(r&&!e)return n&&!r.includes(Ra)?r.concat(Ra):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(zE.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Ra)),i.reduce((s,l)=>{const c=typeof l=="string"?ME[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(ME).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(c)||s.push(c),s},[])}const VX=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class J1{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?Mb(t,"compat"):t?Mb(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?GX:{},this.tags=Mb(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Ls,{value:au}),Object.defineProperty(this,Xi,{value:Xg}),Object.defineProperty(this,ru,{value:su}),this.sortMapEntries=typeof l=="function"?l:l===!0?VX:null}clone(){const t=Object.create(J1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function ZX(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=NI(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=s(e.commentBefore);n.unshift(Pa(f,""))}let l=!1,c=null;if(e.contents){if(sn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=s(e.contents.commentBefore);n.push(Pa(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>l=!0;let h=Bc(e.contents,i,()=>c=null,f);c&&(h+=Uo(h,"",s(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Bc(e.contents,i));if(e.directives?.docEnd)if(e.comment){const f=s(e.comment);f.includes(`
150
- `)?(n.push("..."),n.push(Pa(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&l&&(f=f.replace(/^\n+/,"")),f&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Pa(s(f),"")))}return n.join(`
151
- `)+`
152
- `}class rv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,si,{value:qw});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:l}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Xn({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(rv.prototype,{[si]:{value:qw}});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=sn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){cc(this.contents)&&this.contents.add(t)}addIn(t,n){cc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=bI(this);t.anchor=!n||r.has(n)?xI(n||"a",r):n}return new q1(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const N=E=>typeof E=="number"||E instanceof String||E instanceof Number,C=n.filter(N).map(String);C.length>0&&(n=n.concat(C)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:p}=r??{},{onAnchor:g,setAnchors:v,sourceObjects:y}=wX(this,l||"a"),S={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:y},w=Yd(t,p,S);return c&&an(w)&&(w.flow=!0),v(),w}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new tr(i,s)}delete(t){return cc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return _d(t)?this.contents==null?!1:(this.contents=null,!0):cc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return an(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return _d(t)?!n&&Pt(this.contents)?this.contents.value:this.contents:an(this.contents)?this.contents.getIn(t,n):void 0}has(t){return an(this.contents)?this.contents.has(t):!1}hasIn(t){return _d(t)?this.contents!==void 0:an(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=_m(this.schema,[t],n):cc(this.contents)&&this.contents.set(t,n)}setIn(t,n){_d(t)?this.contents=n:this.contents==null?this.contents=_m(this.schema,Array.from(t),n):cc(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 Xn({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 Xn({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 J1(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=ai(this.contents,n??"",c);if(typeof s=="function")for(const{count:h,res:p}of c.anchors.values())s(p,h);return typeof l=="function"?jc(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return ZX(this,t)}}function cc(e){if(an(e))return!0;throw new Error("Expected a YAML collection as document contents")}class FI extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Cp extends FI{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class YX extends FI{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const RE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&l.length>80){const c=Math.min(s-39,l.length-79);l="…"+l.substring(c),s-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,s))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
153
- `),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];f?.line===r&&f.col>i&&(c=Math.max(1,Math.min(f.col-i,80-s)));const h=" ".repeat(s)+"^".repeat(c);n.message+=`:
154
-
155
- ${l}
156
- ${h}
157
- `}};function qc(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:l,startOnNewline:c}){let f=!1,h=c,p=c,g="",v="",y=!1,S=!1,w=null,N=null,C=null,E=null,k=null,O=null,T=null;for(const P of e)switch(S&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),w&&(h&&P.type!=="comment"&&P.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),P.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&P.source.includes(" ")&&(w=P),p=!0;break;case"comment":{p||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=P.source.substring(1)||" ";g?g+=v+R:g=R,v="",h=!1;break}case"newline":h?g?g+=P.source:(!O||n!=="seq-item-ind")&&(f=!0):v+=P.source,h=!0,y=!0,(N||C)&&(E=P),p=!0;break;case"anchor":N&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=P,T??(T=P.offset),h=!1,p=!1,S=!0;break;case"tag":{C&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),C=P,T??(T=P.offset),h=!1,p=!1,S=!0;break}case n:(N||C)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),O&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`),O=P,h=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){k&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=P,h=!1,p=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),h=!1,p=!1}const z=e[e.length-1],A=z?z.offset+z.source.length:i;return S&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(h&&w.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:O,spaceBefore:f,comment:g,hasNewline:y,anchor:N,tag:C,newlineAfterProp:E,end:A,start:T??A}}function Wd(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
158
- `))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(Wd(t.key)||Wd(t.value))return!0}return!1;default:return!0}}function Gw(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Wd(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function KI(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,l)=>s===l||Pt(s)&&Pt(l)&&s.value===l.value;return t.some(s=>i(s.key,n))}const DE="All mapping items must start at the same column";function WX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??ei,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const p of r.items){const{start:g,key:v,sep:y,value:S}=p,w=qc(g,{indicator:"explicit-key-ind",next:v??y?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0}),N=!w.found;if(N){if(v&&(v.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&i(f,"BAD_INDENT",DE)),!w.anchor&&!w.tag&&!y){h=w.end,w.comment&&(c.comment?c.comment+=`
159
- `+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||Wd(v))&&i(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&i(f,"BAD_INDENT",DE);n.atKey=!0;const C=w.end,E=v?e(n,v,w,i):t(n,C,g,null,w,i);n.schema.compat&&Gw(r.indent,v,i),n.atKey=!1,KI(n,c.items,E)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const k=qc(y??[],{indicator:"map-value-ind",next:S,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=k.end,k.found){N&&(S?.type==="block-map"&&!k.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<k.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const O=S?e(n,S,k,i):t(n,f,y,null,k,i);n.schema.compat&&Gw(r.indent,S,i),f=O.range[2];const T=new tr(E,O);n.options.keepSourceTokens&&(T.srcToken=p),c.items.push(T)}else{N&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(E.comment?E.comment+=`
160
- `+k.comment:E.comment=k.comment);const O=new tr(E);n.options.keepSourceTokens&&(O.srcToken=p),c.items.push(O)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,f,h??f],c}function QX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??al,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:p,value:g}of r.items){const v=qc(p,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||g)g?.type==="block-seq"?i(v.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=v.end,v.comment&&(c.comment=v.comment);continue}const y=g?e(n,g,v,i):t(n,v.end,p,null,v,i);n.schema.compat&&Gw(r.indent,g,i),f=y.range[2],c.items.push(y)}return c.range=[r.offset,f,h??f],c}function xf(e,t,n,r){let i="";if(e){let s=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":s=!0;break;case"comment":{n&&!s&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=f.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=f),s=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:i,offset:t}}const Rb="Block collections are not allowed within flow collections",Db=e=>e&&(e.type==="block-map"||e.type==="block-seq");function XX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=r.start.source==="{",c=l?"flow map":"flow sequence",f=s?.nodeClass??(l?ei:al),h=new f(n.schema);h.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let g=r.offset+r.start.source.length;for(let N=0;N<r.items.length;++N){const C=r.items[N],{start:E,key:k,sep:O,value:T}=C,z=qc(E,{flow:c,indicator:"explicit-key-ind",next:k??O?.[0],offset:g,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!z.found){if(!z.anchor&&!z.tag&&!O&&!T){N===0&&z.comma?i(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):N<r.items.length-1&&i(z.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),z.comment&&(h.comment?h.comment+=`
161
- `+z.comment:h.comment=z.comment),g=z.end;continue}!l&&n.options.strict&&Wd(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)z.comma&&i(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(z.comma||i(z.start,"MISSING_CHAR",`Missing , between ${c} items`),z.comment){let A="";e:for(const P of E)switch(P.type){case"comma":case"space":break;case"comment":A=P.source.substring(1);break e;default:break e}if(A){let P=h.items[h.items.length-1];on(P)&&(P=P.value??P.key),P.comment?P.comment+=`
162
- `+A:P.comment=A,z.comment=z.comment.substring(A.length+1)}}if(!l&&!O&&!z.found){const A=T?e(n,T,z,i):t(n,z.end,O,null,z,i);h.items.push(A),g=A.range[2],Db(T)&&i(A.range,"BLOCK_IN_FLOW",Rb)}else{n.atKey=!0;const A=z.end,P=k?e(n,k,z,i):t(n,A,E,null,z,i);Db(k)&&i(P.range,"BLOCK_IN_FLOW",Rb),n.atKey=!1;const R=qc(O??[],{flow:c,indicator:"map-value-ind",next:T,offset:P.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(R.found){if(!l&&!z.found&&n.options.strict){if(O)for(const L of O){if(L===R.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}}z.start<R.found.offset-1024&&i(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${c}`):i(R.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const B=T?e(n,T,R,i):R.found?t(n,R.end,O,null,R,i):null;B?Db(T)&&i(B.range,"BLOCK_IN_FLOW",Rb):R.comment&&(P.comment?P.comment+=`
163
- `+R.comment:P.comment=R.comment);const $=new tr(P,B);if(n.options.keepSourceTokens&&($.srcToken=C),l){const L=h;KI(n,L.items,P)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),L.items.push($)}else{const L=new ei(n.schema);L.flow=!0,L.items.push($);const re=(B??P).range;L.range=[P.range[0],re[1],re[2]],h.items.push(L)}g=B?B.range[2]:R.end}}const v=l?"}":"]",[y,...S]=r.end;let w=g;if(y?.source===v)w=y.offset+y.source.length;else{const N=c[0].toUpperCase()+c.substring(1),C=p?`${N} must end with a ${v}`:`${N} in block collection must be sufficiently indented and end with a ${v}`;i(g,p?"MISSING_CHAR":"BAD_INDENT",C),y&&y.source.length!==1&&S.unshift(y)}if(S.length>0){const N=xf(S,w,n.options.strict,i);N.comment&&(h.comment?h.comment+=`
164
- `+N.comment:h.comment=N.comment),h.range=[r.offset,w,N.offset]}else h.range=[r.offset,w,w];return h}function Ib(e,t,n,r,i,s){const l=n.type==="block-map"?WX(e,t,n,r,s):n.type==="block-seq"?QX(e,t,n,r,s):XX(e,t,n,r,s),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function JX(e,t,n,r,i){const s=r.tag,l=s?t.directives.tagName(s.source,v=>i(s,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:y}=r,S=v&&s?v.offset>s.offset?v:s:v??s;S&&(!y||y.offset<S.offset)&&i(S,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!l||l==="!"||l===ei.tagName&&c==="map"||l===al.tagName&&c==="seq")return Ib(e,t,n,i,l);let f=t.schema.tags.find(v=>v.tag===l&&v.collection===c);if(!f){const v=t.schema.knownTags[l];if(v?.collection===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?i(s,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Ib(e,t,n,i,l)}const h=Ib(e,t,n,i,l,f),p=f.resolve?.(h,v=>i(s,"TAG_RESOLVE_FAILED",v),t.options)??h,g=sn(p)?p:new Ve(p);return g.range=h.range,g.tag=l,f?.format&&(g.format=f.format),g}function eJ(e,t,n){const r=t.offset,i=tJ(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ve.BLOCK_FOLDED:Ve.BLOCK_LITERAL,l=t.source?nJ(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const N=l[w][1];if(N===""||N==="\r")c=w;else break}if(c===0){const w=i.chomp==="+"&&l.length>0?`
165
- `.repeat(Math.max(1,l.length-1)):"";let N=r+i.length;return t.source&&(N+=t.source.length),{value:w,type:s,comment:i.comment,range:[r,N,N]}}let f=t.indent+i.indent,h=t.offset+i.length,p=0;for(let w=0;w<c;++w){const[N,C]=l[w];if(C===""||C==="\r")i.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=N.length),p=w,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+C.length+1}for(let w=l.length-1;w>=c;--w)l[w][0].length>f&&(c=w+1);let g="",v="",y=!1;for(let w=0;w<p;++w)g+=l[w][0].slice(f)+`
166
- `;for(let w=p;w<c;++w){let[N,C]=l[w];h+=N.length+C.length+1;const E=C[C.length-1]==="\r";if(E&&(C=C.slice(0,-1)),C&&N.length<f){const O=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(h-C.length-(E?2:1),"BAD_INDENT",O),N=""}s===Ve.BLOCK_LITERAL?(g+=v+N.slice(f)+C,v=`
167
- `):N.length>f||C[0]===" "?(v===" "?v=`
168
- `:!y&&v===`
169
- `&&(v=`
170
-
171
- `),g+=v+N.slice(f)+C,v=`
172
- `,y=!0):C===""?v===`
173
- `?g+=`
174
- `:v=`
175
- `:(g+=v+C,v=" ",y=!1)}switch(i.chomp){case"-":break;case"+":for(let w=c;w<l.length;++w)g+=`
176
- `+l[w][0].slice(f);g[g.length-1]!==`
177
- `&&(g+=`
178
- `);break;default:g+=`
179
- `}const S=r+i.length+t.source.length;return{value:g,type:s,comment:i.comment,range:[r,S,S]}}function tJ({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let l=0,c="",f=-1;for(let v=1;v<i.length;++v){const y=i[v];if(!c&&(y==="-"||y==="+"))c=y;else{const S=Number(y);!l&&S?l=S:f===-1&&(f=e+v)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,p="",g=i.length;for(let v=1;v<t.length;++v){const y=t[v];switch(y.type){case"space":h=!0;case"newline":g+=y.source.length;break;case"comment":n&&!h&&r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=y.source.length,p=y.source.substring(1);break;case"error":r(y,"UNEXPECTED_TOKEN",y.message),g+=y.source.length;break;default:{const S=`Unexpected token in block scalar header: ${y.type}`;r(y,"UNEXPECTED_TOKEN",S);const w=y.source;w&&typeof w=="string"&&(g+=w.length)}}}return{mode:s,indent:l,chomp:c,comment:p,length:g}}function nJ(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)s.push([t[l],t[l+1]]);return s}function rJ(e,t,n){const{offset:r,type:i,source:s,end:l}=e;let c,f;const h=(v,y,S)=>n(r+v,y,S);switch(i){case"scalar":c=Ve.PLAIN,f=iJ(s,h);break;case"single-quoted-scalar":c=Ve.QUOTE_SINGLE,f=aJ(s,h);break;case"double-quoted-scalar":c=Ve.QUOTE_DOUBLE,f=sJ(s,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const p=r+s.length,g=xf(l,p,t,n);return{value:f,type:c,comment:g.comment,range:[r,p,g.offset]}}function iJ(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}`),HI(e)}function aJ(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),HI(e.slice(1,-1)).replace(/''/g,"'")}function HI(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
180
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
181
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?s===`
182
- `?i+=s:s=`
183
- `:(i+=s+r[1],s=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+s+(r?.[1]??"")}function sJ(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
184
- `))if(i===`
185
- `){const{fold:s,offset:l}=oJ(e,r);n+=s,r=l}else if(i==="\\"){let s=e[++r];const l=lJ[s];if(l)n+=l;else if(s===`
186
- `)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
187
- `)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){const c={x:2,u:4,U:8}[s];n+=cJ(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const s=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
188
- `&&!(l==="\r"&&e[r+2]===`
189
- `)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function oJ(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
190
- `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
191
- `);)r===`
192
- `&&(n+=`
193
- `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const lJ={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
194
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cJ(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function GI(e,t,n,r){const{value:i,type:s,comment:l,range:c}=t.type==="block-scalar"?eJ(e,t,r):rJ(t,e.options.strict,r),f=n?e.directives.tagName(n.source,g=>r(n,"TAG_RESOLVE_FAILED",g)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Xi]:f?h=uJ(e.schema,i,f,n,r):t.type==="scalar"?h=dJ(e,i,t,r):h=e.schema[Xi];let p;try{const g=h.resolve(i,v=>r(n??t,"TAG_RESOLVE_FAILED",v),e.options);p=Pt(g)?g:new Ve(g)}catch(g){const v=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",v),p=new Ve(i)}return p.range=c,p.source=i,s&&(p.type=s),f&&(p.tag=f),h.format&&(p.format=h.format),l&&(p.comment=l),p}function uJ(e,t,n,r,i){if(n==="!")return e[Xi];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if(c.test?.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Xi])}function dJ({atKey:e,directives:t,schema:n},r,i,s){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Xi];if(n.compat){const c=n.compat.find(f=>f.default&&f.test?.test(r))??n[Xi];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),p=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function fJ(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 hJ={composeNode:VI,composeEmptyNode:ej};function VI(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:l,anchor:c,tag:f}=n;let h,p=!0;switch(t.type){case"alias":h=pJ(e,t,r),(c||f)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=GI(e,t,f,r),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=JX(hJ,e,t,n,r),c&&(h.anchor=c.source.substring(1));break;default:{const g=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",g),h=ej(e,t.offset,void 0,null,n,r),p=!1}}return c&&h.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Pt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&p&&(h.srcToken=t),h}function ej(e,t,n,r,{spaceBefore:i,comment:s,anchor:l,tag:c,end:f},h){const p={type:"scalar",offset:fJ(t,n,r),indent:-1,source:""},g=GI(e,p,c,h);return l&&(g.anchor=l.source.substring(1),g.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function pJ({options:e},{offset:t,source:n,end:r},i){const s=new q1(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=xf(r,l,e.strict,i);return s.range=[t,l,c.offset],c.comment&&(s.comment=c.comment),s}function mJ(e,t,{offset:n,start:r,value:i,end:s},l){const c=Object.assign({_directives:t},e),f=new rv(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=qc(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?VI(h,i,p,l):ej(h,p.end,r,null,p,l);const g=f.contents.range[2],v=xf(s,g,!1,l);return v.comment&&(f.comment=v.comment),f.range=[n,g,v.offset],f}function pd(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 IE(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
195
-
196
- `:`
197
- `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class gJ{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const l=pd(n);s?this.warnings.push(new YX(l,r,i)):this.errors.push(new Cp(l,r,i))},this.directives=new Xn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=IE(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment}
198
- ${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(an(s)&&!s.flow&&s.items.length>0){let l=s.items[0];on(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
199
- ${c}`:r}else{const l=s.commentBefore;s.commentBefore=l?`${r}
200
- ${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:IE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const s=pd(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=mJ(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 Cp(pd(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 Cp(pd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=xf(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}
201
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Cp(pd(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 rv(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 ZI="\uFEFF",YI="",WI="",Vw="";function vJ(e){switch(e){case ZI:return"byte-order-mark";case YI:return"doc-mode";case WI:return"flow-error-end";case Vw:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
202
- `:case`\r
203
- `: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 ji(e){switch(e){case void 0:case" ":case`
204
- `:case"\r":case" ":return!0;default:return!1}}const LE=new Set("0123456789ABCDEFabcdef"),yJ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Op=new Set(",[]{}"),bJ=new Set(` ,[]{}
205
- \r `),Lb=e=>!e||bJ.has(e);class xJ{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===`
206
- `?!0:n==="\r"?this.buffer[t+1]===`
207
- `:!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===`
208
- `||!i&&!this.atEnd)return t+r+1}return n===`
209
- `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ji(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(`
210
- `,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]===ZI&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const s=t[n-1];if(s===" "||s===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield YI,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==="...")&&ji(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&&!ji(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===":")&&ji(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(Lb),"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("..."))&&ji(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield WI,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Lb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ji(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
211
- `,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
212
- `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ji(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
213
- `:t=s,n=0;break;case"\r":{const l=this.buffer[s+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
214
- `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
215
- `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
216
- `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,l=this.buffer[s];l==="\r"&&(l=this.buffer[--s]);const c=s;for(;l===" ";)l=this.buffer[--s];if(l===`
217
- `&&s>=this.pos&&s+1+n>c)t=s;else break}while(!0);return yield Vw,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(ji(s)||t&&Op.has(s))break;n=r}else if(ji(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
218
- `?(r+=1,i=`
219
- `,s=this.buffer[r+1]):n=r),s==="#"||t&&Op.has(s))break;if(i===`
220
- `){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&Op.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Vw,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(Lb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ji(n)||t&&Op.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(;!ji(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(yJ.has(n))n=this.buffer[++t];else if(n==="%"&&LE.has(this.buffer[t+1])&&LE.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===`
221
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
222
- `?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 wJ{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function Cs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function $E(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 QI(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 _p(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 uc(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 UE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Cs(t.start,"explicit-key-ind")&&!Cs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,QI(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 SJ{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 xJ,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=vJ(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"&&UE(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&&$E(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{$E(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=_p(this.peek(2)),r=uc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
223
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
224
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const f=n.sep[c];switch(f.type){case"newline":l.push(c);break;case"space":break;case"comment":f.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(s=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Cs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(QI(n.key)&&!Cs(n.sep,"newline")){const l=uc(n.start),c=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:f}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Cs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=uc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Cs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Cs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Cs(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=_p(r),s=uc(i);UE(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
225
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
226
- `,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=_p(t),r=uc(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=_p(t),r=uc(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 jJ(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new wJ||null,prettyErrors:t}}function NJ(e,t={}){const{lineCounter:n,prettyErrors:r}=jJ(t),i=new SJ(n?.addNewLine),s=new gJ(t),l=Array.from(s.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(RE(e,n)),c.warnings.forEach(RE(e,n));return l.length>0?l:Object.assign([],{empty:!0},s.streamInfo())}function CJ({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[s,l]=x.useState([]),[c,f]=x.useState([]),h=async()=>{if(!t.trim())return;i(!0),l([]),f([]);const p=NJ(t),g=[],v=[];for(let y=0;y<p.length;y++){const S=p[y];if(S.errors.length>0){g.push(`Document ${y+1}: ${S.errors[0]?.message}`);continue}const w=S.toJSON();if(!(!w||typeof w!="object"))try{const N=await z9(w);v.push(`Applied "${N.displayName||N.name}" (revision ${N.configRevision})`)}catch(N){g.push(`Document ${y+1}: ${N instanceof Error?N.message:String(N)}`)}}l(v),f(g),i(!1),v.length>0&&(it({title:"YAML applied",detail:`Applied ${v.length} document${v.length===1?"":"s"} successfully.`,tone:g.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return u.jsxs("section",{className:"mt-8",children:[u.jsx("div",{className:"page-section-divider"}),u.jsx("div",{className:"section-head mt-6",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),u.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",u.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",u.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),u.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
227
- kind: Project
228
- metadata:
229
- name: my-project
230
- spec:
231
- canonicalDomain: example.com
232
- country: US
233
- language: en
234
- keywords: []`,value:t,onChange:p=>n(p.target.value)}),s.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:s.map((p,g)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:p},g))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,g)=>u.jsx("li",{className:"text-rose-400 text-sm",children:p},g))}),u.jsx("div",{className:"mt-3",children:u.jsx(ve,{type:"button",disabled:!t.trim()||r,onClick:h,children:r?"Applying...":"Apply"})})]})}function OJ(){const{dashboard:e,isLoading:t,refetch:n}=bl();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(A=>u.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>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"})]},A))]})]});const r=e.projects,i=Ys(),[s,l]=x.useState(!1),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,S]=x.useState("US"),[w,N]=x.useState("en"),[C,E]=x.useState(!1),[k,O]=x.useState(null),T=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),z=async()=>{if(!(!T||!g)){E(!0),O(null);try{const A=await zg(T,{displayName:h||c,canonicalDomain:g,country:y,language:w});it({title:"Project created",detail:`${A.displayName||A.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${A.name}`,dedupeMode:"drop"}),n(),f(""),p(""),v(""),S("US"),N("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){O(A instanceof Error?A.message:"Failed to create project")}finally{E(!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(ve,{type:"button",onClick:()=>l(A=>!A),children:[u.jsx(_A,{className:"size-4 mr-1.5"}),"Add project"]})})]}),s?u.jsxs(He,{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:A=>f(A.target.value)}),T&&T!==c?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),u.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:h,onChange:A=>p(A.target.value)})]})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),u.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:g,onChange:A=>v(A.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:y,onChange:A=>S(A.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:A=>N(A.target.value.toLowerCase())})]})]})]}),k?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:k}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(ve,{type:"button",disabled:!T||!g||C,onClick:z,children:C?"Creating...":"Create project"}),u.jsx(ve,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?u.jsx("div",{className:"data-table-wrapper",children:u.jsxs("table",{className:"data-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Visibility"}),u.jsx("th",{children:"Last run"}),u.jsx("th",{className:"text-right",children:"Country"})]})}),u.jsx("tbody",{children:r.map(A=>{const P=A.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Ut,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:R=>R.stopPropagation(),children:A.project.displayName||A.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),u.jsx("td",{children:u.jsx(wt,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:P?u.jsx($g,{status:P.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):s?null:u.jsxs(He,{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(ve,{type:"button",onClick:()=>l(!0),children:[u.jsx(_A,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(CJ,{onApplied:()=>{n()}})]})}function Zw({state:e}){return u.jsx(wt,{tone:eK(e),children:Dg(e)})}function XI({run:e}){const{openRun:t}=nu();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($g,{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(ve,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function JI({value:e,label:t,delta:n,tone:r,description:i,tooltip:s,isNumeric:l=!0,progress:c,providerCoverage:f}){const g=2*Math.PI*48,v=Number.parseInt(e,10),y=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):l&&!Number.isNaN(v)?Math.min(v/100,1):.5,S=g*(1-y);return u.jsxs("div",{className:"score-gauge",children:[u.jsxs("div",{className:"gauge-ring-wrapper",children:[u.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[u.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),u.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:g,strokeDashoffset:S,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,s&&u.jsx(Dn,{text:s})]}),u.jsx("p",{className:"gauge-delta",children:n}),f&&u.jsx("p",{className:"gauge-provider-coverage",children:f}),u.jsx("p",{className:"gauge-description",children:i})]})}function BE({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return u.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),s=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),u.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:s})]})}function _J(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const s=t.get(i.createdAt);s?s.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:s}])=>({runId:s,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function kJ({evidence:e}){const{openEvidence:t}=nu(),[n,r]=x.useState(new Set),i=x.useMemo(()=>{const l=new Map;for(const c of e){const f=l.get(c.keyword)??[];l.set(c.keyword,[...f,c])}return[...l.entries()].map(([c,f])=>({phrase:c,items:f}))},[e]),s=l=>{r(c=>{const f=new Set(c);return f.has(l)?f.delete(l):f.add(l),f})};return u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"2rem"}}),u.jsx("th",{children:"Key Phrase"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Citation History"}),u.jsx("th",{children:"Change"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:i.map(({phrase:l,items:c})=>{const f=n.has(l),h=c.map(S=>S.citationState),p=h.includes("cited")?"cited":h.includes("emerging")?"emerging":h.includes("lost")?"lost":h.every(S=>S==="pending")?"pending":"not-cited",g=_J(c),v=c.filter(S=>S.citationState==="cited"||S.citationState==="emerging").length,y=(()=>{if(g.length===0)return"Awaiting first run";if(g.length===1)return"First observation";const S=g[g.length-1].citationState,w=g[g.length-2].citationState;if(w!=="cited"&&S==="cited")return"Newly cited";if(w==="cited"&&S!=="cited")return"Lost since last run";let N=0;for(let C=g.length-1;C>=0&&g[C].citationState===S;C--)N++;return S==="cited"?N<=1?"Cited in latest run":`Cited for ${N} runs`:N<=1?"Not cited in latest run":`Not cited across ${N} runs`})();return u.jsxs(x.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>s(l),"aria-expanded":f,children:[u.jsx("td",{children:u.jsx(Mg,{size:14,className:`transition-transform duration-150 text-zinc-500 ${f?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:l}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(S=>u.jsx(Kd,{provider:S.provider},S.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Zw,{state:p}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[v,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(BE,{history:g})}),u.jsx("td",{className:"evidence-change-cell",children:y}),u.jsx("td",{})]}),f&&c.map(S=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Kd,{provider:S.provider})}),u.jsx("td",{children:u.jsx(Zw,{state:S.citationState})}),u.jsx("td",{children:u.jsx(BE,{history:S.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:S.changeLabel}),u.jsx("td",{children:u.jsx(ve,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(S.id)},children:"View"})})]},S.id))]},l)})})]})})}function AJ({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(wt,{tone:tK(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 qE({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:s,coverageValue:l,note:c,updatedAt:f,active:h,onClick:p}){return u.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${h?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),u.jsx("h3",{children:t})]}),u.jsx(wt,{tone:r,children:n})]}),u.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),u.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:s})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[u.jsx("span",{children:c}),u.jsx("span",{children:f?`Updated ${Ci(f)}`:"No recent sync yet"})]})]})}function kp({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 EJ=["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 tj(e){if(typeof e!="string")return!1;var t=EJ;return t.includes(e)}var TJ=["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"],PJ=new Set(TJ);function eL(e){return typeof e!="string"?!1:PJ.has(e)}function tL(e){return typeof e=="string"&&e.startsWith("data-")}function Ti(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eL(n)||tL(n))&&(t[n]=e[n]);return t}function iv(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ti(t)}return typeof e=="object"&&!Array.isArray(e)?Ti(e):null}function yr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eL(n)||tL(n)||tj(n))&&(t[n]=e[n]);return t}function zJ(e){return e==null?null:x.isValidElement(e)?yr(e.props):typeof e=="object"&&!Array.isArray(e)?yr(e):null}var MJ=["children","width","height","viewBox","className","style","title","desc"];function Yw(){return Yw=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},Yw.apply(null,arguments)}function RJ(e,t){if(e==null)return{};var n,r,i=DJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DJ(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 nj=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:s,className:l,style:c,title:f,desc:h}=e,p=RJ(e,MJ),g=s||{width:r,height:i,x:0,y:0},v=vt("recharts-surface",l);return x.createElement("svg",Yw({},yr(p),{className:v,width:r,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),n)}),IJ=["children","className"];function Ww(){return Ww=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},Ww.apply(null,arguments)}function LJ(e,t){if(e==null)return{};var n,r,i=$J(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $J(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 Pi=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=LJ(e,IJ),s=vt("recharts-layer",r);return x.createElement("g",Ww({className:s},yr(i),{ref:t}),n)}),nL=x.createContext(null),UJ=()=>x.useContext(nL);function Et(e){return function(){return e}}const rL=Math.cos,Am=Math.sin,Di=Math.sqrt,Em=Math.PI,av=2*Em,Qw=Math.PI,Xw=2*Qw,zo=1e-6,BJ=Xw-zo;function iL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function qJ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iL;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class FJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?iL:qJ(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+l}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let l=this._x1,c=this._y1,f=r-t,h=i-n,p=l-t,g=c-n,v=p*p+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>zo)if(!(Math.abs(g*f-h*p)>zo)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-l,S=i-c,w=f*f+h*h,N=y*y+S*S,C=Math.sqrt(w),E=Math.sqrt(v),k=s*Math.tan((Qw-Math.acos((w+v-N)/(2*C*E)))/2),O=k/E,T=k/C;Math.abs(O-1)>zo&&this._append`L${t+O*p},${n+O*g}`,this._append`A${s},${s},0,0,${+(g*y>p*S)},${this._x1=t+T*f},${this._y1=n+T*h}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),h=t+c,p=n+f,g=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>zo||Math.abs(this._y1-p)>zo)&&this._append`L${h},${p}`,r&&(v<0&&(v=v%Xw+Xw),v>BJ?this._append`A${r},${r},0,1,${g},${t-c},${n-f}A${r},${r},0,1,${g},${this._x1=h},${this._y1=p}`:v>zo&&this._append`A${r},${r},0,${+(v>=Qw)},${g},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function rj(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 FJ(t)}function ij(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aL(e){this._context=e}aL.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 sv(e){return new aL(e)}function sL(e){return e[0]}function oL(e){return e[1]}function lL(e,t){var n=Et(!0),r=null,i=sv,s=null,l=rj(c);e=typeof e=="function"?e:e===void 0?sL:Et(e),t=typeof t=="function"?t:t===void 0?oL:Et(t);function c(f){var h,p=(f=ij(f)).length,g,v=!1,y;for(r==null&&(s=i(y=l())),h=0;h<=p;++h)!(h<p&&n(g=f[h],h,f))===v&&((v=!v)?s.lineStart():s.lineEnd()),v&&s.point(+e(g,h,f),+t(g,h,f));if(y)return s=null,y+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Et(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Et(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Et(!!f),c):n},c.curve=function(f){return arguments.length?(i=f,r!=null&&(s=i(r)),c):i},c.context=function(f){return arguments.length?(f==null?r=s=null:s=i(r=f),c):r},c}function Ap(e,t,n){var r=null,i=Et(!0),s=null,l=sv,c=null,f=rj(h);e=typeof e=="function"?e:e===void 0?sL:Et(+e),t=typeof t=="function"?t:Et(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?oL:Et(+n);function h(g){var v,y,S,w=(g=ij(g)).length,N,C=!1,E,k=new Array(w),O=new Array(w);for(s==null&&(c=l(E=f())),v=0;v<=w;++v){if(!(v<w&&i(N=g[v],v,g))===C)if(C=!C)y=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),S=v-1;S>=y;--S)c.point(k[S],O[S]);c.lineEnd(),c.areaEnd()}C&&(k[v]=+e(N,v,g),O[v]=+t(N,v,g),c.point(r?+r(N,v,g):k[v],n?+n(N,v,g):O[v]))}if(E)return c=null,E+""||null}function p(){return lL().defined(i).curve(l).context(s)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:Et(+g),r=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:Et(+g),h):e},h.x1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:Et(+g),h):r},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:Et(+g),n=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:Et(+g),h):t},h.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:Et(+g),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:Et(!!g),h):i},h.curve=function(g){return arguments.length?(l=g,s!=null&&(c=l(s)),h):l},h.context=function(g){return arguments.length?(g==null?s=c=null:c=l(s=g),h):s},h}class cL{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 KJ(e){return new cL(e,!0)}function HJ(e){return new cL(e,!1)}const aj={draw(e,t){const n=Di(t/Em);e.moveTo(n,0),e.arc(0,0,n,0,av)}},GJ={draw(e,t){const n=Di(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()}},uL=Di(1/3),VJ=uL*2,ZJ={draw(e,t){const n=Di(t/VJ),r=n*uL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},YJ={draw(e,t){const n=Di(t),r=-n/2;e.rect(r,r,n,n)}},WJ=.8908130915292852,dL=Am(Em/10)/Am(7*Em/10),QJ=Am(av/10)*dL,XJ=-rL(av/10)*dL,JJ={draw(e,t){const n=Di(t*WJ),r=QJ*n,i=XJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=av*s/5,c=rL(l),f=Am(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},$b=Di(3),eee={draw(e,t){const n=-Di(t/($b*3));e.moveTo(0,n*2),e.lineTo(-$b*n,-n),e.lineTo($b*n,-n),e.closePath()}},Vr=-.5,Zr=Di(3)/2,Jw=1/Di(12),tee=(Jw/2+1)*3,nee={draw(e,t){const n=Di(t/tee),r=n/2,i=n*Jw,s=r,l=n*Jw+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Vr*r-Zr*i,Zr*r+Vr*i),e.lineTo(Vr*s-Zr*l,Zr*s+Vr*l),e.lineTo(Vr*c-Zr*f,Zr*c+Vr*f),e.lineTo(Vr*r+Zr*i,Vr*i-Zr*r),e.lineTo(Vr*s+Zr*l,Vr*l-Zr*s),e.lineTo(Vr*c+Zr*f,Vr*f-Zr*c),e.closePath()}};function ree(e,t){let n=null,r=rj(i);e=typeof e=="function"?e:Et(e||aj),t=typeof t=="function"?t:Et(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Et(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Et(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function Tm(){}function Pm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fL(e){this._context=e}fL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iee(e){return new fL(e)}function hL(e){this._context=e}hL.prototype={areaStart:Tm,areaEnd:Tm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aee(e){return new hL(e)}function pL(e){this._context=e}pL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function see(e){return new pL(e)}function mL(e){this._context=e}mL.prototype={areaStart:Tm,areaEnd:Tm,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 oee(e){return new mL(e)}function FE(e){return e<0?-1:1}function KE(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(FE(s)+FE(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function HE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ub(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function zm(e){this._context=e}zm.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:Ub(this,this._t0,HE(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,Ub(this,HE(this,n=KE(this,e,t)),n);break;default:Ub(this,this._t0,n=KE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function gL(e){this._context=new vL(e)}(gL.prototype=Object.create(zm.prototype)).point=function(e,t){zm.prototype.point.call(this,t,e)};function vL(e){this._context=e}vL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function lee(e){return new zm(e)}function cee(e){return new gL(e)}function yL(e){this._context=e}yL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=GE(e),i=GE(t),s=0,l=1;l<n;++s,++l)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function GE(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),l=new Array(n);for(i[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function uee(e){return new yL(e)}function ov(e,t){this._context=e,this._t=t}ov.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 dee(e){return new ov(e,.5)}function fee(e){return new ov(e,0)}function hee(e){return new ov(e,1)}function sl(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n<l;++n)for(i=s,s=e[t[n]],r=0;r<c;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function eS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function pee(e,t){return e[t]}function mee(e){const t=[];return t.key=e,t}function gee(){var e=Et([]),t=eS,n=sl,r=pee;function i(s){var l=Array.from(e.apply(this,arguments),mee),c,f=l.length,h=-1,p;for(const g of s)for(c=0,++h;c<f;++c)(l[c][h]=[0,+r(g,l[c].key,h,s)]).data=g;for(c=0,p=ij(t(l));c<f;++c)l[p[c]].index=c;return n(l,p),l}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Et(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Et(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?eS:typeof s=="function"?s:Et(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??sl,i):n},i}function vee(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,l;i<s;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}sl(e,t)}}function yee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var l=0,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}sl(e,t)}}function bee(e,t){if(!(!((l=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r<s;++r){for(var c=0,f=0,h=0;c<l;++c){for(var p=e[t[c]],g=p[r][1]||0,v=p[r-1][1]||0,y=(g-v)/2,S=0;S<c;++S){var w=e[t[S]],N=w[r][1]||0,C=w[r-1][1]||0;y+=N-C}f+=g,h+=y*g}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,sl(e,t)}}var Bb={},qb={},VE;function xee(){return VE||(VE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(qb)),qb}var Fb={},ZE;function bL(){return ZE||(ZE=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})(Fb)),Fb}var Kb={},YE;function sj(){return YE||(YE=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})(Kb)),Kb}var Hb={},Gb={},WE;function wee(){return WE||(WE=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})(Gb)),Gb}var QE;function oj(){return QE||(QE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wee(),n=sj();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const s=[],l=i.length;if(l===0)return s;let c=0,f="",h="",p=!1;for(i.charCodeAt(0)===46&&(s.push(""),c++);c<l;){const g=i[c];h?g==="\\"&&c+1<l?(c++,f+=i[c]):g===h?h="":f+=g:p?g==='"'||g==="'"?h=g:g==="]"?(p=!1,s.push(f),f=""):f+=g:g==="["?(p=!0,f&&(s.push(f),f="")):g==="."?f&&(s.push(f),f=""):f+=g,c++}return f&&s.push(f),s}e.toPath=r})(Hb)),Hb}var XE;function lj(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xee(),n=bL(),r=sj(),i=oj();function s(c,f,h){if(c==null)return h;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?n.isDeepKey(f)?s(c,i.toPath(f),h):h:p}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const p=c[f];return p===void 0?h:p}default:{if(Array.isArray(f))return l(c,f,h);if(Object.is(f?.valueOf(),-0)?f="-0":f=String(f),t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?h:p}}}function l(c,f,h){if(f.length===0)return h;let p=c;for(let g=0;g<f.length;g++){if(p==null||t.isUnsafeProperty(f[g]))return h;p=p[f[g]]}return p===void 0?h:p}e.get=s})(Bb)),Bb}var Vb,JE;function See(){return JE||(JE=1,Vb=lj().get),Vb}var jee=See();const lv=Gs(jee);var Nee=4;function zs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nee,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Mn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,s,l)=>{var c=n[l-1];return typeof c=="string"?i+c+s:c!==void 0?i+zs(c)+s:i+s},"")}var ni=e=>e===0?0:e>0?1:-1,Ji=e=>typeof e=="number"&&e!=+e,ol=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,De=e=>(typeof e=="number"||e instanceof Number)&&!Ji(e),oi=e=>De(e)||typeof e=="string",Cee=0,Qd=e=>{var t=++Cee;return"".concat(e||"").concat(t)},Hs=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(!De(t)&&typeof t!="string")return r;var s;if(ol(t)){if(n==null)return r;var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Ji(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},xL=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 Gi(e,t,n){return De(e)&&De(t)?zs(e+n*(t-e)):t}function wL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):lv(r,t))===n)}var Ln=e=>e===null||typeof e>"u",wf=e=>Ln(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function mr(e){return e!=null}function ou(){}var Oee=["type","size","sizeType"];function tS(){return tS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tS.apply(null,arguments)}function eT(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 tT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eT(Object(n),!0).forEach(function(r){_ee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ee(e,t,n){return(t=kee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kee(e){var t=Aee(e,"string");return typeof t=="symbol"?t:t+""}function Aee(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 Eee(e,t){if(e==null)return{};var n,r,i=Tee(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tee(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 SL={symbolCircle:aj,symbolCross:GJ,symbolDiamond:ZJ,symbolSquare:YJ,symbolStar:JJ,symbolTriangle:eee,symbolWye:nee},Pee=Math.PI/180,zee=e=>{var t="symbol".concat(wf(e));return SL[t]||aj},Mee=(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*Pee;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}},Ree=(e,t)=>{SL["symbol".concat(wf(e))]=t},jL=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Eee(e,Oee),s=tT(tT({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var v=zee(l),y=ree().type(v).size(Mee(n,r,l)),S=y();if(S!==null)return S},{className:f,cx:h,cy:p}=s,g=yr(s);return De(h)&&De(p)&&De(n)?x.createElement("path",tS({},g,{className:vt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:c()})):null};jL.registerSymbol=Ree;var NL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,cj=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{tj(i)&&typeof n[i]=="function"&&(r[i]=(s=>n[i](n,s)))}),r},Dee=(e,t,n)=>r=>(e(t,n,r),null),CL=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var s=e[i];tj(i)&&typeof s=="function"&&(r||(r={}),r[i]=Dee(s,t,n))}),r};function nT(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 Iee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nT(Object(n),!0).forEach(function(r){Lee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lee(e,t,n){return(t=$ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ee(e){var t=Uee(e,"string");return typeof t=="symbol"?t:t+""}function Uee(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 rr(e,t){var n=Iee({},e),r=t,i=Object.keys(t),s=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return s}function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mm.apply(null,arguments)}function rT(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 OL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rT(Object(n),!0).forEach(function(r){Bee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bee(e,t,n){return(t=qee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qee(e){var t=Fee(e,"string");return typeof t=="symbol"?t:t+""}function Fee(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 Xr=32,Kee={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Hee(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Gee(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Xr/2,s=Xr/6,l=Xr/3,c=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:Hee(t.payload),x1:0,y1:i,x2:Xr,y2:i,className:"recharts-legend-icon"});if(f==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
235
- A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
236
- H`).concat(Xr,"M").concat(2*l,",").concat(i,`
237
- A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Xr/8,"h").concat(Xr,"v").concat(Xr*3/4,"h").concat(-Xr,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var h=OL({},t);return delete h.legendIcon,x.cloneElement(t.legendIcon,h)}return x.createElement(jL,{fill:c,cx:i,cy:i,size:Xr,sizeType:"diameter",type:f})}function Vee(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:s,iconType:l,labelStyle:c}=e,f={x:0,y:0,width:Xr,height:Xr},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((g,v)=>{var y=g.formatter||i,S=vt({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:g.inactive});if(g.type==="none")return null;var w=typeof c=="object"?OL({},c):{};w.color=g.inactive?s:w.color||g.color;var N=y?y(g.value,g,v):g.value;return x.createElement("li",Mm({className:S,style:h,key:"legend-item-".concat(v)},CL(e,g,v)),x.createElement(nj,{width:n,height:n,viewBox:f,style:p,"aria-label":"".concat(g.value," legend icon")},x.createElement(Gee,{data:g,iconType:l,inactiveColor:s})),x.createElement("span",{className:"recharts-legend-item-text",style:w},N))})}var Zee=e=>{var t=rr(e,Kee),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},x.createElement(Vee,Mm({},t,{payload:n})))},Zb={},Yb={},iT;function Yee(){return iT||(iT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let s=0;s<n.length;s++){const l=n[s],c=r(l,s,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(Yb)),Yb}var Wb={},aT;function Wee(){return aT||(aT=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})(Wb)),Wb}var Qb={},sT;function _L(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Qb)),Qb}var Xb={},Jb={},ex={},oT;function Qee(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(ex)),ex}var lT;function kL(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qee();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Jb)),Jb}var tx={},cT;function Xee(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(tx)),tx}var uT;function Jee(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kL(),n=Xee();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Xb)),Xb}var nx={},rx={},dT;function ete(){return dT||(dT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lj();function n(r){return function(i){return t.get(i,r)}}e.property=n})(rx)),rx}var ix={},ax={},sx={},ox={},fT;function AL(){return fT||(fT=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})(ox)),ox}var lx={},hT;function EL(){return hT||(hT=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})(lx)),lx}var cx={},pT;function TL(){return pT||(pT=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})(cx)),cx}var mT;function tte(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AL(),n=EL(),r=TL();function i(p,g,v){return typeof v!="function"?i(p,g,()=>{}):s(p,g,function y(S,w,N,C,E,k){const O=v(S,w,N,C,E,k);return O!==void 0?!!O:s(S,w,y,k)},new Map)}function s(p,g,v,y){if(g===p)return!0;switch(typeof g){case"object":return l(p,g,v,y);case"function":return Object.keys(g).length>0?s(p,{...g},v,y):r.isEqualsSameValueZero(p,g);default:return t.isObject(p)?typeof g=="string"?g==="":!0:r.isEqualsSameValueZero(p,g)}}function l(p,g,v,y){if(g==null)return!0;if(Array.isArray(g))return f(p,g,v,y);if(g instanceof Map)return c(p,g,v,y);if(g instanceof Set)return h(p,g,v,y);const S=Object.keys(g);if(p==null||n.isPrimitive(p))return S.length===0;if(S.length===0)return!0;if(y?.has(g))return y.get(g)===p;y?.set(g,p);try{for(let w=0;w<S.length;w++){const N=S[w];if(!n.isPrimitive(p)&&!(N in p)||g[N]===void 0&&p[N]!==void 0||g[N]===null&&p[N]!==null||!v(p[N],g[N],N,p,g,y))return!1}return!0}finally{y?.delete(g)}}function c(p,g,v,y){if(g.size===0)return!0;if(!(p instanceof Map))return!1;for(const[S,w]of g.entries()){const N=p.get(S);if(v(N,w,S,p,g,y)===!1)return!1}return!0}function f(p,g,v,y){if(g.length===0)return!0;if(!Array.isArray(p))return!1;const S=new Set;for(let w=0;w<g.length;w++){const N=g[w];let C=!1;for(let E=0;E<p.length;E++){if(S.has(E))continue;const k=p[E];let O=!1;if(v(k,N,w,p,g,y)&&(O=!0),O){S.add(E),C=!0;break}}if(!C)return!1}return!0}function h(p,g,v,y){return g.size===0?!0:p instanceof Set?f([...p],[...g],v,y):!1}e.isMatchWith=i,e.isSetMatch=h})(sx)),sx}var gT;function PL(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tte();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(ax)),ax}var ux={},dx={},fx={},vT;function nte(){return vT||(vT=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})(fx)),fx}var hx={},yT;function uj(){return yT||(yT=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})(hx)),hx}var px={},bT;function zL(){return bT||(bT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",l="[object Symbol]",c="[object Date]",f="[object Map]",h="[object Set]",p="[object Array]",g="[object Function]",v="[object ArrayBuffer]",y="[object Object]",S="[object Error]",w="[object DataView]",N="[object Uint8Array]",C="[object Uint8ClampedArray]",E="[object Uint16Array]",k="[object Uint32Array]",O="[object BigUint64Array]",T="[object Int8Array]",z="[object Int16Array]",A="[object Int32Array]",P="[object BigInt64Array]",R="[object Float32Array]",B="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=v,e.arrayTag=p,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=w,e.dateTag=c,e.errorTag=S,e.float32ArrayTag=R,e.float64ArrayTag=B,e.functionTag=g,e.int16ArrayTag=z,e.int32ArrayTag=A,e.int8ArrayTag=T,e.mapTag=f,e.numberTag=r,e.objectTag=y,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=k,e.uint8ArrayTag=N,e.uint8ClampedArrayTag=C})(px)),px}var mx={},xT;function rte(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(mx)),mx}var wT;function ML(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nte(),n=uj(),r=zL(),i=EL(),s=rte();function l(p,g){return c(p,void 0,p,new Map,g)}function c(p,g,v,y=new Map,S=void 0){const w=S?.(p,g,v,y);if(w!==void 0)return w;if(i.isPrimitive(p))return p;if(y.has(p))return y.get(p);if(Array.isArray(p)){const N=new Array(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,S);return Object.hasOwn(p,"index")&&(N.index=p.index),Object.hasOwn(p,"input")&&(N.input=p.input),N}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const N=new RegExp(p.source,p.flags);return N.lastIndex=p.lastIndex,N}if(p instanceof Map){const N=new Map;y.set(p,N);for(const[C,E]of p)N.set(C,c(E,C,v,y,S));return N}if(p instanceof Set){const N=new Set;y.set(p,N);for(const C of p)N.add(c(C,void 0,v,y,S));return N}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(s.isTypedArray(p)){const N=new(Object.getPrototypeOf(p)).constructor(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,S);return N}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const N=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return y.set(p,N),f(N,p,v,y,S),N}if(typeof File<"u"&&p instanceof File){const N=new File([p],p.name,{type:p.type});return y.set(p,N),f(N,p,v,y,S),N}if(typeof Blob<"u"&&p instanceof Blob){const N=new Blob([p],{type:p.type});return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof Error){const N=structuredClone(p);return y.set(p,N),N.message=p.message,N.name=p.name,N.stack=p.stack,N.cause=p.cause,N.constructor=p.constructor,f(N,p,v,y,S),N}if(p instanceof Boolean){const N=new Boolean(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof Number){const N=new Number(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof String){const N=new String(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(typeof p=="object"&&h(p)){const N=Object.create(Object.getPrototypeOf(p));return y.set(p,N),f(N,p,v,y,S),N}return p}function f(p,g,v=p,y,S){const w=[...Object.keys(g),...t.getSymbols(g)];for(let N=0;N<w.length;N++){const C=w[N],E=Object.getOwnPropertyDescriptor(p,C);(E==null||E.writable)&&(p[C]=c(g[C],C,v,y,S))}}function h(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=l,e.cloneDeepWithImpl=c,e.copyProperties=f})(dx)),dx}var ST;function ite(){return ST||(ST=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ML();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(ux)),ux}var jT;function ate(){return jT||(jT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PL(),n=ite();function r(i){return i=n.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=r})(ix)),ix}var gx={},vx={},yx={},NT;function ste(){return NT||(NT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ML(),n=uj(),r=zL();function i(s,l){return t.cloneDeepWith(s,(c,f,h,p)=>{const g=l?.(c,f,h,p);if(g!==void 0)return g;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const v={};return p.set(s,v),t.copyProperties(v,s,h,p),v}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new s.constructor(s?.valueOf());return t.copyProperties(v,s),v}case r.argumentsTag:{const v={};return t.copyProperties(v,s),v.length=s.length,v[Symbol.iterator]=s[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=i})(yx)),yx}var CT;function ote(){return CT||(CT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ste();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(vx)),vx}var bx={},xx={},OT;function RL(){return OT||(OT=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})(xx)),xx}var wx={},_T;function lte(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uj();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(wx)),wx}var kT;function cte(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bL(),n=RL(),r=lte(),i=oj();function s(l,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?f=i.toPath(c):f=[c],f.length===0)return!1;let h=l;for(let p=0;p<f.length;p++){const g=f[p];if((h==null||!Object.hasOwn(h,g))&&!((Array.isArray(h)||r.isArguments(h))&&n.isIndex(g)&&g<h.length))return!1;h=h[g]}return!0}e.has=s})(bx)),bx}var AT;function ute(){return AT||(AT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PL(),n=sj(),r=ote(),i=lj(),s=cte();function l(c,f){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return f=r.cloneDeep(f),function(h){const p=i.get(h,c);return p===void 0?s.has(h,c):f===void 0?p===void 0:t.isMatch(p,f)}}e.matchesProperty=l})(gx)),gx}var ET;function dte(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_L(),n=ete(),r=ate(),i=ute();function s(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=s})(nx)),nx}var TT;function fte(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yee(),n=Wee(),r=_L(),i=Jee(),s=dte();function l(c,f=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(s.iteratee(f),1)):[]}e.uniqBy=l})(Zb)),Zb}var Sx,PT;function hte(){return PT||(PT=1,Sx=fte().uniqBy),Sx}var pte=hte();const zT=Gs(pte);function DL(e,t,n){return t===!0?zT(e,n):typeof t=="function"?zT(e,t):e}var dj=x.createContext(null),mte=e=>e,Wt=()=>{var e=x.useContext(dj);return e?e.store.dispatch:mte},nm=()=>{},gte=()=>nm,vte=(e,t)=>e===t;function Le(e){var t=x.useContext(dj),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:nm,[t,e]);return XM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:gte,t?t.store.getState:nm,t?t.store.getState:nm,n,vte)}function yte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function bte(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xte(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 MT=e=>Array.isArray(e)?e:[e];function wte(e){const t=Array.isArray(e[0])?e[0]:e;return xte(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ste(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var jte=class{constructor(e){this.value=e}deref(){return this.value}},Nte=typeof WeakRef<"u"?WeakRef:jte,Cte=0,RT=1;function Ep(){return{s:Cte,v:void 0,o:null,p:null}}function IL(e,t={}){let n=Ep();const{resultEqualityCheck:r}=t;let i,s=0;function l(){let c=n;const{length:f}=arguments;for(let g=0,v=f;g<v;g++){const y=arguments[g];if(typeof y=="function"||typeof y=="object"&&y!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);const w=S.get(y);w===void 0?(c=Ep(),S.set(y,c)):c=w}else{let S=c.p;S===null&&(c.p=S=new Map);const w=S.get(y);w===void 0?(c=Ep(),S.set(y,c)):c=w}}const h=c;let p;if(c.s===RT)p=c.v;else if(p=e.apply(null,arguments),s++,r){const g=i?.deref?.()??i;g!=null&&r(g,p)&&(p=g,s!==0&&s--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Nte(p):p}return h.s=RT,h.v=p,p}return l.clearCache=()=>{n=Ep(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function Ote(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,l=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),yte(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...n,...f},{memoize:g,memoizeOptions:v=[],argsMemoize:y=IL,argsMemoizeOptions:S=[]}=p,w=MT(v),N=MT(S),C=wte(i),E=g(function(){return s++,h.apply(null,arguments)},...w),k=y(function(){l++;const T=Ste(C,arguments);return c=E.apply(null,T),c},...N);return Object.assign(k,{resultFunc:h,memoizedResultFunc:E,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:g,argsMemoize:y})};return Object.assign(r,{withTypes:()=>r}),r}var te=Ote(IL),_te=Object.assign((e,t=te)=>{bte(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>_te}),jx={},Nx={},Cx={},DT;function kte(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const l=t(r),c=t(i);if(l===c&&l===0){if(r<i)return s==="desc"?1:-1;if(r>i)return s==="desc"?-1:1}return s==="desc"?c-l:l-c}return 0};e.compareValues=n})(Cx)),Cx}var Ox={},_x={},IT;function LL(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(_x)),_x}var LT;function Ate(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LL(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||l!=null&&Object.hasOwn(l,s)}e.isKey=i})(Ox)),Ox}var $T;function Ete(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kte(),n=Ate(),r=oj();function i(s,l,c,f){if(s==null)return[];c=f?void 0:c,Array.isArray(s)||(s=Object.values(s)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(y=>String(y));const h=(y,S)=>{let w=y;for(let N=0;N<S.length&&w!=null;++N)w=w[S[N]];return w},p=(y,S)=>S==null||y==null?S:typeof y=="object"&&"key"in y?Object.hasOwn(S,y.key)?S[y.key]:h(S,y.path):typeof y=="function"?y(S):Array.isArray(y)?h(S,y):typeof S=="object"?S[y]:S,g=l.map(y=>(Array.isArray(y)&&y.length===1&&(y=y[0]),y==null||typeof y=="function"||Array.isArray(y)||n.isKey(y)?y:{key:y,path:r.toPath(y)}));return s.map(y=>({original:y,criteria:g.map(S=>p(S,y))})).slice().sort((y,S)=>{for(let w=0;w<g.length;w++){const N=t.compareValues(y.criteria[w],S.criteria[w],c[w]);if(N!==0)return N}return 0}).map(y=>y.original)}e.orderBy=i})(Nx)),Nx}var kx={},UT;function Tte(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],s=Math.floor(r),l=(c,f)=>{for(let h=0;h<c.length;h++){const p=c[h];Array.isArray(p)&&f<s?l(p,f+1):i.push(p)}};return l(n,0),i}e.flatten=t})(kx)),kx}var Ax={},BT;function $L(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RL(),n=kL(),r=AL(),i=TL();function s(l,c,f){return r.isObject(f)&&(typeof c=="number"&&n.isArrayLike(f)&&t.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?i.isEqualsSameValueZero(f[c],l):!1}e.isIterateeCall=s})(Ax)),Ax}var qT;function Pte(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ete(),n=Tte(),r=$L();function i(s,...l){const c=l.length;return c>1&&r.isIterateeCall(s,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(s,n.flatten(l),["asc"])}e.sortBy=i})(jx)),jx}var Ex,FT;function zte(){return FT||(FT=1,Ex=Pte().sortBy),Ex}var Mte=zte();const cv=Gs(Mte);var UL=e=>e.legend.settings,Rte=e=>e.legend.size,Dte=e=>e.legend.payload,Ite=te([Dte,UL],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?cv(r,n):r});function Lte(){return Le(Ite)}var Tp=1;function BL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),l={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(l.height-t.height)>Tp||Math.abs(l.left-t.left)>Tp||Math.abs(l.top-t.top)>Tp||Math.abs(l.width-t.width)>Tp)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function zn(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 $te=typeof Symbol=="function"&&Symbol.observable||"@@observable",KT=$te,Tx=()=>Math.random().toString(36).substring(7).split("").join("."),Ute={INIT:`@@redux/INIT${Tx()}`,REPLACE:`@@redux/REPLACE${Tx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Tx()}`},Rm=Ute;function fj(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 qL(e,t,n){if(typeof e!="function")throw new Error(zn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(zn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(zn(1));return n(qL)(e,t)}let r=e,i=t,s=new Map,l=s,c=0,f=!1;function h(){l===s&&(l=new Map,s.forEach((N,C)=>{l.set(C,N)}))}function p(){if(f)throw new Error(zn(3));return i}function g(N){if(typeof N!="function")throw new Error(zn(4));if(f)throw new Error(zn(5));let C=!0;h();const E=c++;return l.set(E,N),function(){if(C){if(f)throw new Error(zn(6));C=!1,h(),l.delete(E),s=null}}}function v(N){if(!fj(N))throw new Error(zn(7));if(typeof N.type>"u")throw new Error(zn(8));if(typeof N.type!="string")throw new Error(zn(17));if(f)throw new Error(zn(9));try{f=!0,i=r(i,N)}finally{f=!1}return(s=l).forEach(E=>{E()}),N}function y(N){if(typeof N!="function")throw new Error(zn(10));r=N,v({type:Rm.REPLACE})}function S(){const N=g;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(zn(11));function E(){const O=C;O.next&&O.next(p())}return E(),{unsubscribe:N(E)}},[KT](){return this}}}return v({type:Rm.INIT}),{dispatch:v,subscribe:g,getState:p,replaceReducer:y,[KT]:S}}function Bte(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Rm.INIT})>"u")throw new Error(zn(12));if(typeof n(void 0,{type:Rm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(zn(13))})}function FL(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Bte(n)}catch(s){i=s}return function(l={},c){if(i)throw i;let f=!1;const h={};for(let p=0;p<r.length;p++){const g=r[p],v=n[g],y=l[g],S=v(y,c);if(typeof S>"u")throw c&&c.type,new Error(zn(14));h[g]=S,f=f||S!==y}return f=f||r.length!==Object.keys(l).length,f?h:l}}function Dm(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function qte(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(zn(15))};const l={getState:i.getState,dispatch:(f,...h)=>s(f,...h)},c=e.map(f=>f(l));return s=Dm(...c)(i.dispatch),{...i,dispatch:s}}}function KL(e){return fj(e)&&"type"in e&&typeof e.type=="string"}var HL=Symbol.for("immer-nothing"),HT=Symbol.for("immer-draftable"),nr=Symbol.for("immer-state");function _i(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Er=Object,Fc=Er.getPrototypeOf,Im="constructor",uv="prototype",nS="configurable",Lm="enumerable",rm="writable",Xd="value",La=e=>!!e&&!!e[nr];function zi(e){return e?GL(e)||fv(e)||!!e[HT]||!!e[Im]?.[HT]||hv(e)||pv(e):!1}var Fte=Er[uv][Im].toString(),GT=new WeakMap;function GL(e){if(!e||!hj(e))return!1;const t=Fc(e);if(t===null||t===Er[uv])return!0;const n=Er.hasOwnProperty.call(t,Im)&&t[Im];if(n===Object)return!0;if(!bc(n))return!1;let r=GT.get(n);return r===void 0&&(r=Function.toString.call(n),GT.set(n,r)),r===Fte}function dv(e,t,n=!0){Sf(e)===0?(n?Reflect.ownKeys(e):Er.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Sf(e){const t=e[nr];return t?t.type_:fv(e)?1:hv(e)?2:pv(e)?3:0}var VT=(e,t,n=Sf(e))=>n===2?e.has(t):Er[uv].hasOwnProperty.call(e,t),rS=(e,t,n=Sf(e))=>n===2?e.get(t):e[t],$m=(e,t,n,r=Sf(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Kte(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var fv=Array.isArray,hv=e=>e instanceof Map,pv=e=>e instanceof Set,hj=e=>typeof e=="object",bc=e=>typeof e=="function",Px=e=>typeof e=="boolean";function Hte(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Aa=e=>e.copy_||e.base_,pj=e=>e.modified_?e.copy_:e.base_;function iS(e,t){if(hv(e))return new Map(e);if(pv(e))return new Set(e);if(fv(e))return Array[uv].slice.call(e);const n=GL(e);if(t===!0||t==="class_only"&&!n){const r=Er.getOwnPropertyDescriptors(e);delete r[nr];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c[rm]===!1&&(c[rm]=!0,c[nS]=!0),(c.get||c.set)&&(r[l]={[nS]:!0,[rm]:!0,[Lm]:c[Lm],[Xd]:e[l]})}return Er.create(Fc(e),r)}else{const r=Fc(e);if(r!==null&&n)return{...e};const i=Er.create(r);return Er.assign(i,e)}}function mj(e,t=!1){return mv(e)||La(e)||!zi(e)||(Sf(e)>1&&Er.defineProperties(e,{set:Pp,add:Pp,clear:Pp,delete:Pp}),Er.freeze(e),t&&dv(e,(n,r)=>{mj(r,!0)},!1)),e}function Gte(){_i(2)}var Pp={[Xd]:Gte};function mv(e){return e===null||!hj(e)?!0:Er.isFrozen(e)}var Um="MapSet",aS="Patches",ZT="ArrayMethods",VL={};function ll(e){const t=VL[e];return t||_i(0,e),t}var YT=e=>!!VL[e],Jd,ZL=()=>Jd,Vte=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:YT(Um)?ll(Um):void 0,arrayMethodsPlugin_:YT(ZT)?ll(ZT):void 0});function WT(e,t){t&&(e.patchPlugin_=ll(aS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sS(e){oS(e),e.drafts_.forEach(Zte),e.drafts_=null}function oS(e){e===Jd&&(Jd=e.parent_)}var QT=e=>Jd=Vte(Jd,e);function Zte(e){const t=e[nr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function XT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[nr].modified_&&(sS(t),_i(4)),zi(e)&&(e=JT(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[nr].base_,e,t)}else e=JT(t,n);return Yte(t,e,!0),sS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==HL?e:void 0}function JT(e,t){if(mv(t))return t;const n=t[nr];if(!n)return Bm(t,e.handledSet_,e);if(!gv(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);QL(n,e)}return n.copy_}function Yte(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mj(t,n)}function YL(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gv=(e,t)=>e.scope_===t,Wte=[];function WL(e,t,n,r){const i=Aa(e),s=e.type_;if(r!==void 0&&rS(i,r,s)===t){$m(i,r,n,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;dv(i,(f,h)=>{if(La(h)){const p=c.get(h)||[];p.push(f),c.set(h,p)}})}const l=e.draftLocations_.get(t)??Wte;for(const c of l)$m(i,c,n,s)}function Qte(e,t,n){e.callbacks_.push(function(i){const s=t;if(!s||!gv(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const l=pj(s);WL(e,s.draft_??s,l,n),QL(s,i)})}function QL(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)}YL(e)}}function Xte(e,t,n){const{scope_:r}=e;if(La(n)){const i=n[nr];gv(i,r)&&i.callbacks_.push(function(){im(e);const l=pj(i);WL(e,n,l,t)})}else zi(n)&&e.callbacks_.push(function(){const s=Aa(e);e.type_===3?s.has(n)&&Bm(n,r.handledSet_,r):rS(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Bm(rS(e.copy_,t,e.type_),r.handledSet_,r)})}function Bm(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||La(e)||t.has(e)||!zi(e)||mv(e)||(t.add(e),dv(e,(r,i)=>{if(La(i)){const s=i[nr];if(gv(s,n)){const l=pj(s);$m(e,r,l,e.type_),YL(s)}}else zi(i)&&Bm(i,t,n)})),e}function Jte(e,t){const n=fv(e),r={type_:n?1:0,scope_:t?t.scope_:ZL(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=qm;n&&(i=[r],s=ef);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,[c,r]}var qm={get(e,t){if(t===nr)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=Aa(e);if(!VT(i,t,e.type_))return ene(e,i,t);const s=i[t];if(e.finalized_||!zi(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Hte(t))return s;if(s===zx(e.base_,t)){im(e);const l=e.type_===1?+t:t,c=cS(e.scope_,s,e,l);return e.copy_[l]=c}return s},has(e,t){return t in Aa(e)},ownKeys(e){return Reflect.ownKeys(Aa(e))},set(e,t,n){const r=XL(Aa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=zx(Aa(e),t),s=i?.[nr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Kte(n,i)&&(n!==void 0||VT(e.base_,t,e.type_)))return!0;im(e),lS(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),Xte(e,t,n)),!0},deleteProperty(e,t){return im(e),zx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),lS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Aa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[rm]:!0,[nS]:e.type_!==1||t!=="length",[Lm]:r[Lm],[Xd]:n[t]}},defineProperty(){_i(11)},getPrototypeOf(e){return Fc(e.base_)},setPrototypeOf(){_i(12)}},ef={};for(let e in qm){let t=qm[e];ef[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ef.deleteProperty=function(e,t){return ef.set.call(this,e,t,void 0)};ef.set=function(e,t,n){return qm.set.call(this,e[0],t,n,e[0])};function zx(e,t){const n=e[nr];return(n?Aa(n):e)[t]}function ene(e,t,n){const r=XL(t,n);return r?Xd in r?r[Xd]:r.get?.call(e.draft_):void 0}function XL(e,t){if(!(t in e))return;let n=Fc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Fc(n)}}function lS(e){e.modified_||(e.modified_=!0,e.parent_&&lS(e.parent_))}function im(e){e.copy_||(e.assigned_=new Map,e.copy_=iS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var tne=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(bc(n)&&!bc(r)){const l=r;r=n;const c=this;return function(h=l,...p){return c.produce(h,g=>r.call(this,g,...p))}}bc(r)||_i(6),i!==void 0&&!bc(i)&&_i(7);let s;if(zi(n)){const l=QT(this),c=cS(l,n,void 0);let f=!0;try{s=r(c),f=!1}finally{f?sS(l):oS(l)}return WT(l,i),XT(s,l)}else if(!n||!hj(n)){if(s=r(n),s===void 0&&(s=n),s===HL&&(s=void 0),this.autoFreeze_&&mj(s,!0),i){const l=[],c=[];ll(aS).generateReplacementPatches_(n,s,{patches_:l,inversePatches_:c}),i(l,c)}return s}else _i(1,n)},this.produceWithPatches=(n,r)=>{if(bc(n))return(c,...f)=>this.produceWithPatches(c,h=>n(h,...f));let i,s;return[this.produce(n,r,(c,f)=>{i=c,s=f}),i,s]},Px(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Px(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Px(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){zi(t)||_i(8),La(t)&&(t=ri(t));const n=QT(this),r=cS(n,t,void 0);return r[nr].isManual_=!0,oS(n),r}finishDraft(t,n){const r=t&&t[nr];(!r||!r.isManual_)&&_i(9);const{scope_:i}=r;return WT(i,n),XT(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(n=n.slice(r+1));const i=ll(aS).applyPatches_;return La(t)?i(t,n):this.produce(t,s=>i(s,n))}};function cS(e,t,n,r){const[i,s]=hv(t)?ll(Um).proxyMap_(t,n):pv(t)?ll(Um).proxySet_(t,n):Jte(t,n);return(n?.scope_??ZL()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?Qte(n,s,r):s.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:h}=f;s.modified_&&h&&h.generatePatches_(s,[],f)}),i}function ri(e){return La(e)||_i(10,e),JL(e)}function JL(e){if(!zi(e)||mv(e))return e;const t=e[nr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=iS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=iS(e,!0);return dv(n,(i,s)=>{$m(n,i,JL(s))},r),t&&(t.finalized_=!1),n}var nne=new tne,e$=nne.produce;function t$(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var rne=t$(),ine=t$,ane=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Dm:Dm.apply(null,arguments)};function Pr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Tr(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=>KL(r)&&r.type===e,n}var n$=class kd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,kd.prototype)}static get[Symbol.species](){return kd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new kd(...t[0].concat(this)):new kd(...t.concat(this))}};function eP(e){return zi(e)?e$(e,()=>{}):e}function zp(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function sne(e){return typeof e=="boolean"}var one=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let l=new n$;return n&&(sne(n)?l.push(rne):l.push(ine(n.extraArgument))),l},r$="RTK_autoBatch",Rt=()=>e=>({payload:e,meta:{[r$]:!0}}),tP=e=>t=>{setTimeout(t,e)},i$=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,l=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tP(10):e.type==="callback"?e.queueNotification:tP(e.timeout),h=()=>{l=!1,s&&(s=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const g=()=>i&&p(),v=r.subscribe(g);return c.add(p),()=>{v(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[r$],s=!i,s&&(l||(l=!0,f(h))),r.dispatch(p)}finally{i=!0}}})},lne=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new n$(e);return r&&i.push(i$(typeof r=="object"?r:void 0)),i};function cne(e){const t=one(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(fj(n))c=FL(n);else throw new Error(Tr(1));let f;typeof r=="function"?f=r(t):f=t();let h=Dm;i&&(h=ane({trace:!1,...typeof i=="object"&&i}));const p=qte(...f),g=lne(p);let v=typeof l=="function"?l(g):g();const y=h(...v);return qL(c,s,y)}function a$(e){const t={},n=[];let r;const i={addCase(s,l){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(Tr(28));if(c in t)throw new Error(Tr(29));return t[c]=l,i},addAsyncThunk(s,l){return l.pending&&(t[s.pending.type]=l.pending),l.rejected&&(t[s.rejected.type]=l.rejected),l.fulfilled&&(t[s.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:s.settled,reducer:l.settled}),i},addMatcher(s,l){return n.push({matcher:s,reducer:l}),i},addDefaultCase(s){return r=s,i}};return e(i),[t,n,r]}function une(e){return typeof e=="function"}function dne(e,t){let[n,r,i]=a$(t),s;if(une(e))s=()=>eP(e());else{const c=eP(e);s=()=>c}function l(c=s(),f){let h=[n[f.type],...r.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[i]),h.reduce((p,g)=>{if(g)if(La(p)){const y=g(p,f);return y===void 0?p:y}else{if(zi(p))return e$(p,v=>g(v,f));{const v=g(p,f);if(v===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return p},c)}return l.getInitialState=s,l}var fne="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",hne=(e=21)=>{let t="",n=e;for(;n--;)t+=fne[Math.random()*64|0];return t},pne=Symbol.for("rtk-slice-createasyncthunk");function mne(e,t){return`${e}/${t}`}function gne({creators:e}={}){const t=e?.asyncThunk?.[pne];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(Tr(11));const l=(typeof r.reducers=="function"?r.reducers(yne()):r.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,O){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(Tr(12));if(T in f.sliceCaseReducersByType)throw new Error(Tr(13));return f.sliceCaseReducersByType[T]=O,h},addMatcher(k,O){return f.sliceMatchers.push({matcher:k,reducer:O}),h},exposeAction(k,O){return f.actionCreators[k]=O,h},exposeCaseReducer(k,O){return f.sliceCaseReducersByName[k]=O,h}};c.forEach(k=>{const O=l[k],T={reducerName:k,type:mne(i,k),createNotation:typeof r.reducers=="function"};xne(O)?Sne(T,O,h,t):bne(T,O,h)});function p(){const[k={},O=[],T=void 0]=typeof r.extraReducers=="function"?a$(r.extraReducers):[r.extraReducers],z={...k,...f.sliceCaseReducersByType};return dne(r.initialState,A=>{for(let P in z)A.addCase(P,z[P]);for(let P of f.sliceMatchers)A.addMatcher(P.matcher,P.reducer);for(let P of O)A.addMatcher(P.matcher,P.reducer);T&&A.addDefaultCase(T)})}const g=k=>k,v=new Map,y=new WeakMap;let S;function w(k,O){return S||(S=p()),S(k,O)}function N(){return S||(S=p()),S.getInitialState()}function C(k,O=!1){function T(A){let P=A[k];return typeof P>"u"&&O&&(P=zp(y,T,N)),P}function z(A=g){const P=zp(v,O,()=>new WeakMap);return zp(P,A,()=>{const R={};for(const[B,$]of Object.entries(r.selectors??{}))R[B]=vne($,A,()=>zp(y,A,N),O);return R})}return{reducerPath:k,getSelectors:z,get selectors(){return z(T)},selectSlice:T}}const E={name:i,reducer:w,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...C(s),injectInto(k,{reducerPath:O,...T}={}){const z=O??s;return k.inject({reducerPath:z,reducer:w},T),{...E,...C(z,!0)}}};return E}}function vne(e,t,n,r){function i(s,...l){let c=t(s);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Zn=gne();function yne(){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 bne({type:e,reducerName:t,createNotation:n},r,i){let s,l;if("reducer"in r){if(n&&!wne(r))throw new Error(Tr(17));s=r.reducer,l=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,l?Pr(e,l):Pr(e))}function xne(e){return e._reducerDefinitionType==="asyncThunk"}function wne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Tr(18));const{payloadCreator:s,fulfilled:l,pending:c,rejected:f,settled:h,options:p}=n,g=i(e,s,p);r.exposeAction(t,g),l&&r.addCase(g.fulfilled,l),c&&r.addCase(g.pending,c),f&&r.addCase(g.rejected,f),h&&r.addMatcher(g.settled,h),r.exposeCaseReducer(t,{fulfilled:l||Mp,pending:c||Mp,rejected:f||Mp,settled:h||Mp})}function Mp(){}var jne="task",s$="listener",o$="completed",gj="cancelled",Nne=`task-${gj}`,Cne=`task-${o$}`,uS=`${s$}-${gj}`,One=`${s$}-${o$}`,vv=class{constructor(e){this.code=e,this.message=`${jne} ${gj} (reason: ${e})`}name="TaskAbortError";message},vj=(e,t)=>{if(typeof e!="function")throw new TypeError(Tr(32))},Fm=()=>{},l$=(e,t=Fm)=>(e.catch(t),e),c$=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Qo=e=>{if(e.aborted)throw new vv(e.reason)};function u$(e,t){let n=Fm;return new Promise((r,i)=>{const s=()=>i(new vv(e.reason));if(e.aborted){s();return}n=c$(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Fm})}var _ne=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof vv?"cancelled":"rejected",error:n}}finally{t?.()}},Km=e=>t=>l$(u$(e,t).then(n=>(Qo(e),n))),d$=e=>{const t=Km(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Mc}=Object,nP={},yv="listenerMiddleware",kne=(e,t)=>{const n=r=>c$(e,()=>r.abort(e.reason));return(r,i)=>{vj(r);const s=new AbortController;n(s);const l=_ne(async()=>{Qo(e),Qo(s.signal);const c=await r({pause:Km(s.signal),delay:d$(s.signal),signal:s.signal});return Qo(s.signal),c},()=>s.abort(Cne));return i?.autoJoin&&t.push(l.catch(Fm)),{result:Km(e)(l),cancel(){s.abort(Nne)}}}},Ane=(e,t)=>{const n=async(r,i)=>{Qo(t);let s=()=>{};const c=[new Promise((f,h)=>{let p=e({predicate:r,effect:(g,v)=>{v.unsubscribe(),f([g,v.getState(),v.getOriginalState()])}});s=()=>{p(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await u$(t,Promise.race(c));return Qo(t),f}finally{s()}};return(r,i)=>l$(n(r,i))},f$=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=Pr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Tr(21));return vj(s),{predicate:i,type:t,effect:s}},h$=Mc(e=>{const{type:t,predicate:n,effect:r}=f$(e);return{id:hne(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Tr(22))}}},{withTypes:()=>h$}),rP=(e,t)=>{const{type:n,effect:r,predicate:i}=f$(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},dS=e=>{e.pending.forEach(t=>{t.abort(uS)})},Ene=(e,t)=>()=>{for(const n of t.keys())dS(n);e.clear()},iP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},p$=Mc(Pr(`${yv}/add`),{withTypes:()=>p$}),Tne=Pr(`${yv}/removeAll`),m$=Mc(Pr(`${yv}/remove`),{withTypes:()=>m$}),Pne=(...e)=>{console.error(`${yv}/error`,...e)},jf=(e={})=>{const t=new Map,n=new Map,r=y=>{const S=n.get(y)??0;n.set(y,S+1)},i=y=>{const S=n.get(y)??1;S===1?n.delete(y):n.set(y,S-1)},{extra:s,onError:l=Pne}=e;vj(l);const c=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),S=>{y.unsubscribe(),S?.cancelActive&&dS(y)}),f=y=>{const S=rP(t,y)??h$(y);return c(S)};Mc(f,{withTypes:()=>f});const h=y=>{const S=rP(t,y);return S&&(S.unsubscribe(),y.cancelActive&&dS(S)),!!S};Mc(h,{withTypes:()=>h});const p=async(y,S,w,N)=>{const C=new AbortController,E=Ane(f,C.signal),k=[];try{y.pending.add(C),r(y),await Promise.resolve(y.effect(S,Mc({},w,{getOriginalState:N,condition:(O,T)=>E(O,T).then(Boolean),take:E,delay:d$(C.signal),pause:Km(C.signal),extra:s,signal:C.signal,fork:kne(C.signal,k),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((O,T,z)=>{O!==C&&(O.abort(uS),z.delete(O))})},cancel:()=>{C.abort(uS),y.pending.delete(C)},throwIfCancelled:()=>{Qo(C.signal)}})))}catch(O){O instanceof vv||iP(l,O,{raisedBy:"effect"})}finally{await Promise.all(k),C.abort(One),i(y),y.pending.delete(C)}},g=Ene(t,n);return{middleware:y=>S=>w=>{if(!KL(w))return S(w);if(p$.match(w))return f(w.payload);if(Tne.match(w)){g();return}if(m$.match(w))return h(w.payload);let N=y.getState();const C=()=>{if(N===nP)throw new Error(Tr(23));return N};let E;try{if(E=S(w),t.size>0){const k=y.getState(),O=Array.from(t.values());for(const T of O){let z=!1;try{z=T.predicate(w,k,N)}catch(A){z=!1,iP(l,A,{raisedBy:"predicate"})}z&&p(T,w,y,C)}}}finally{N=nP}return E},startListening:f,stopListening:h,clearListeners:g}};function Tr(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 zne={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},g$=Zn({name:"chartLayout",initialState:zne,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,s;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Mne,setLayout:Rne,setChartSize:Dne,setScale:Ine}=g$.actions,Lne=g$.reducer;function v$(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ye(e){return Number.isFinite(e)}function ea(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function aP(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 Cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aP(Object(n),!0).forEach(function(r){$ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ne(e,t,n){return(t=Une(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Une(e){var t=Bne(e,"string");return typeof t=="symbol"?t:t+""}function Bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nn(e,t,n){return Ln(e)||Ln(t)?n:oi(t)?lv(e,t,n):typeof t=="function"?t(e):n}var qne=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:s,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&s!=="center"&&De(e[s]))return Cc(Cc({},e),{},{[s]:e[s]+(r||0)});if((c==="horizontal"||c==="vertical"&&s==="center")&&l!=="middle"&&De(e[l]))return Cc(Cc({},e),{},{[l]:e[l]+(i||0)})}return e},ra=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",y$=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,s,l=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate));return i||l.push(t),s||l.push(n),l},b$=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:s,scale:l,realScaleType:c,isCategorical:f,categoricalDomain:h,tickCount:p,ticks:g,niceTicks:v,axisType:y}=e;if(!l)return null;var S=c==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,w=i==="category"&&l.bandwidth?l.bandwidth()/S:0;if(w=y==="angleAxis"&&s&&s.length>=2?ni(s[0]-s[1])*2*w:w,g||v){var N=(g||v||[]).map((C,E)=>{var k=r?r.indexOf(C):C,O=l.map(k);return Ye(O)?{coordinate:O+w,value:C,offset:w,index:E}:null}).filter(mr);return N}return f&&h?h.map((C,E)=>{var k=l.map(C);return Ye(k)?{coordinate:k+w,value:C,index:E,offset:w}:null}).filter(mr):l.ticks&&p!=null?l.ticks(p).map((C,E)=>{var k=l.map(C);return Ye(k)?{coordinate:k+w,value:C,index:E,offset:w}:null}).filter(mr):l.domain().map((C,E)=>{var k=l.map(C);return Ye(k)?{coordinate:k+w,value:r?r[C]:C,index:E,offset:w}:null}).filter(mr)},Fne=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0,c=0;c<n;++c){var f=e[c],h=f?.[i];if(h!=null){var p=h[1],g=h[0],v=Ji(p)?g:p;v>=0?(h[0]=s,s+=v,h[1]=s):(h[0]=l,l+=v,h[1]=l)}}}},Kne=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0;l<n;++l){var c=e[l],f=c?.[i];if(f!=null){var h=Ji(f[1])?f[0]:f[1];h>=0?(f[0]=s,s+=h,f[1]=s):(f[0]=0,f[1]=0)}}}},Hne={sign:Fne,expand:vee,none:sl,silhouette:yee,wiggle:bee,positive:Kne},Gne=(e,t,n)=>{var r,i=(r=Hne[n])!==null&&r!==void 0?r:sl,s=gee().keys(t).value((c,f)=>Number(Nn(c,f,0))).order(eS).offset(i),l=s(e);return l.forEach((c,f)=>{c.forEach((h,p)=>{var g=Nn(e[p],t[f],0);Array.isArray(g)&&g.length===2&&De(g[0])&&De(g[1])&&(h[0]=g[0],h[1]=g[1])})}),l};function Vne(e){return e==null?void 0:String(e)}function sP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ln(i[t.dataKey])){var c=wL(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var f=Nn(i,Ln(l)?t.dataKey:l),h=t.scale.map(f);return De(h)?h:null}var Zne=e=>{var t=e.flat(2).filter(De);return[Math.min(...t),Math.max(...t)]},Yne=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Wne=(e,t,n)=>{if(e!=null)return Yne(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:l}=s,c=l.reduce((f,h)=>{var p=v$(h,t,n),g=Zne(p);return!Ye(g[0])||!Ye(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},oP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Hm=(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=cv(t,p=>p.coordinate),s=1/0,l=1,c=i.length;l<c;l++){var f=i[l],h=i[l-1];s=Math.min((f?.coordinate||0)-(h?.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0};function cP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:s}=e;return Cc(Cc({},t),{},{dataKey:n,payload:r,value:i,name:s})}function x$(e,t){if(e)return String(e);if(typeof t=="string")return t}var Qne=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Xne=(e,t)=>t==="centric"?e.angle:e.radius,Fa=e=>e.layout.width,Ka=e=>e.layout.height,Jne=e=>e.layout.scale,w$=e=>e.layout.margin,bv=te(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),xv=te(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),ere="data-recharts-item-index",tre="data-recharts-item-id",Nf=60;function uP(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 Rp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(r){nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nre(e,t,n){return(t=rre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rre(e){var t=ire(e,"string");return typeof t=="symbol"?t:t+""}function ire(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 are=e=>e.brush.height;function sre(e){var t=xv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Nf;return n+i}return n},0)}function ore(e){var t=xv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Nf;return n+i}return n},0)}function lre(e){var t=bv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function cre(e){var t=bv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Un=te([Fa,Ka,w$,are,sre,ore,lre,cre,UL,Rte],(e,t,n,r,i,s,l,c,f,h)=>{var p={left:(n.left||0)+i,right:(n.right||0)+s},g={top:(n.top||0)+l,bottom:(n.bottom||0)+c},v=Rp(Rp({},g),p),y=v.bottom;v.bottom+=r,v=qne(v,f,h);var S=e-v.left-v.right,w=t-v.top-v.bottom;return Rp(Rp({brushBottom:y},v),{},{width:Math.max(S,0),height:Math.max(w,0)})}),ure=te(Un,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),S$=te(Fa,Ka,(e,t)=>({x:0,y:0,width:e,height:t})),dre=x.createContext(null),ir=()=>x.useContext(dre)!=null,wv=e=>e.brush,Sv=te([wv,Un,w$],(e,t,n)=>({height:e.height,x:De(e.x)?e.x:t.left,y:De(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:De(e.width)?e.width:t.width})),Mx={},Rx={},Dx={},dP;function fre(){return dP||(dP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:s}={}){let l,c=null;const f=s!=null&&s.includes("leading"),h=s==null||s.includes("trailing"),p=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},g=()=>{h&&p(),w()};let v=null;const y=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,g()},r)},S=()=>{v!==null&&(clearTimeout(v),v=null)},w=()=>{S(),l=void 0,c=null},N=()=>{p()},C=function(...E){if(i?.aborted)return;l=this,c=E;const k=v==null;y(),f&&k&&p()};return C.schedule=y,C.cancel=w,C.flush=N,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(Dx)),Dx}var fP;function hre(){return fP||(fP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fre();function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:l=!1,trailing:c=!0,maxWait:f}=s,h=Array(2);l&&(h[0]="leading"),c&&(h[1]="trailing");let p,g=null;const v=t.debounce(function(...w){p=r.apply(this,w),g=null},i,{edges:h}),y=function(...w){return f!=null&&(g===null&&(g=Date.now()),Date.now()-g>=f)?(p=r.apply(this,w),g=Date.now(),v.cancel(),v.schedule(),p):(v.apply(this,w),p)},S=()=>(v.flush(),p);return y.cancel=v.cancel,y.flush=S,y}e.debounce=n})(Rx)),Rx}var hP;function pre(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hre();function n(r,i=0,s={}){const{leading:l=!0,trailing:c=!0}=s;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(Mx)),Mx}var Ix,pP;function mre(){return pP||(pP=1,Ix=pre().throttle),Ix}var gre=mre();const vre=Gs(gre);var Gm=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Zi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},j$=(e,t,n)=>{var{width:r=Zi.width,height:i=Zi.height,aspect:s,maxHeight:l}=n,c=ol(r)?e:Number(r),f=ol(i)?t:Number(i);return s&&s>0&&(c?f=c/s:f&&(c=f*s),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:c,calculatedHeight:f}},yre={width:0,height:0,overflow:"visible"},bre={width:0,overflowX:"visible"},xre={height:0,overflowY:"visible"},wre={},Sre=e=>{var{width:t,height:n}=e,r=ol(t),i=ol(n);return r&&i?yre:r?bre:i?xre:wre};function jre(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=Zi.width,s=Zi.height):i===void 0?i=r&&r>0?void 0:Zi.width:s===void 0&&(s=r&&r>0?void 0:Zi.height),{width:i,height:s}}function fS(){return fS=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},fS.apply(null,arguments)}function mP(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 gP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mP(Object(n),!0).forEach(function(r){Nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nre(e,t,n){return(t=Cre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=Ore(e,"string");return typeof t=="symbol"?t:t+""}function Ore(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 N$=x.createContext(Zi.initialDimension);function _re(e){return ea(e.width)&&ea(e.height)}function C$(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return _re(i)?x.createElement(N$.Provider,{value:i},t):null}var yj=()=>x.useContext(N$),kre=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Zi.initialDimension,width:i,height:s,minWidth:l=Zi.minWidth,minHeight:c,maxHeight:f,children:h,debounce:p=Zi.debounce,id:g,className:v,onResize:y,style:S={}}=e,w=x.useRef(null),N=x.useRef();N.current=y,x.useImperativeHandle(t,()=>w.current);var[C,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),k=x.useCallback((P,R)=>{E(B=>{var $=Math.round(P),L=Math.round(R);return B.containerWidth===$&&B.containerHeight===L?B:{containerWidth:$,containerHeight:L}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return ou;var P=L=>{var re,ge=L[0];if(ge!=null){var{width:be,height:H}=ge.contentRect;k(be,H),(re=N.current)===null||re===void 0||re.call(N,be,H)}};p>0&&(P=vre(P,p,{trailing:!0,leading:!1}));var R=new ResizeObserver(P),{width:B,height:$}=w.current.getBoundingClientRect();return k(B,$),R.observe(w.current),()=>{R.disconnect()}},[k,p]);var{containerWidth:O,containerHeight:T}=C;Gm(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:z,calculatedHeight:A}=j$(O,T,{width:i,height:s,aspect:n,maxHeight:f});return Gm(z!=null&&z>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
238
- please check the style of container, or the props width(%s) and height(%s),
239
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
240
- height and width.`,z,A,i,s,l,c,n),x.createElement("div",{id:g?"".concat(g):void 0,className:vt("recharts-responsive-container",v),style:gP(gP({},S),{},{width:i,height:s,minWidth:l,minHeight:c,maxHeight:f}),ref:w},x.createElement("div",{style:Sre({width:i,height:s})},x.createElement(C$,{width:z,height:A},h)))}),hS=x.forwardRef((e,t)=>{var n=yj();if(ea(n.width)&&ea(n.height))return e.children;var{width:r,height:i}=jre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:l}=j$(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return De(s)&&De(l)?x.createElement(C$,{width:s,height:l},e.children):x.createElement(kre,fS({},e,{width:r,height:i,ref:t}))});function bj(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 Cf=()=>{var e,t=ir(),n=Le(ure),r=Le(Sv),i=(e=Le(wv))===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}},Are={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},O$=()=>{var e;return(e=Le(Un))!==null&&e!==void 0?e:Are},xj=()=>Le(Fa),wj=()=>Le(Ka),Ere=()=>Le(e=>e.layout.margin),Kt=e=>e.layout.layoutType,lu=()=>Le(Kt),Sj=()=>{var e=lu();if(e==="horizontal"||e==="vertical")return e},_$=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Tre=()=>{var e=lu();return e!==void 0},Of=e=>{var t=Wt(),n=ir(),{width:r,height:i}=e,s=yj(),l=r,c=i;return s&&(l=s.width>0?s.width:r,c=s.height>0?s.height:i),x.useEffect(()=>{!n&&ea(l)&&ea(c)&&t(Dne({width:l,height:c}))},[t,n,l,c]),null},k$=Symbol.for("immer-nothing"),vP=Symbol.for("immer-draftable"),zr=Symbol.for("immer-state");function ki(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tf=Object.getPrototypeOf;function Kc(e){return!!e&&!!e[zr]}function cl(e){return e?A$(e)||Array.isArray(e)||!!e[vP]||!!e.constructor?.[vP]||_f(e)||Nv(e):!1}var Pre=Object.prototype.constructor.toString(),yP=new WeakMap;function A$(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=yP.get(n);return r===void 0&&(r=Function.toString.call(n),yP.set(n,r)),r===Pre}function Vm(e,t,n=!0){jv(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 jv(e){const t=e[zr];return t?t.type_:Array.isArray(e)?1:_f(e)?2:Nv(e)?3:0}function pS(e,t){return jv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function E$(e,t,n){const r=jv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function zre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function _f(e){return e instanceof Map}function Nv(e){return e instanceof Set}function Mo(e){return e.copy_||e.base_}function mS(e,t){if(_f(e))return new Map(e);if(Nv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=A$(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[zr];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(tf(e),r)}else{const r=tf(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function jj(e,t=!1){return Cv(e)||Kc(e)||!cl(e)||(jv(e)>1&&Object.defineProperties(e,{set:Dp,add:Dp,clear:Dp,delete:Dp}),Object.freeze(e),t&&Object.values(e).forEach(n=>jj(n,!0))),e}function Mre(){ki(2)}var Dp={value:Mre};function Cv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Rre={};function ul(e){const t=Rre[e];return t||ki(0,e),t}var nf;function T$(){return nf}function Dre(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function bP(e,t){t&&(ul("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gS(e){vS(e),e.drafts_.forEach(Ire),e.drafts_=null}function vS(e){e===nf&&(nf=e.parent_)}function xP(e){return nf=Dre(nf,e)}function Ire(e){const t=e[zr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[zr].modified_&&(gS(t),ki(4)),cl(e)&&(e=Zm(t,e),t.parent_||Ym(t,e)),t.patches_&&ul("Patches").generateReplacementPatches_(n[zr].base_,e,t.patches_,t.inversePatches_)):e=Zm(t,n,[]),gS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==k$?e:void 0}function Zm(e,t,n){if(Cv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[zr];if(!i)return Vm(t,(s,l)=>SP(e,i,t,s,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Ym(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let l=s,c=!1;i.type_===3&&(l=new Set(s),s.clear(),c=!0),Vm(l,(f,h)=>SP(e,i,s,f,h,n,c),r),Ym(e,s,!1),n&&e.patches_&&ul("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function SP(e,t,n,r,i,s,l){if(i==null||typeof i!="object"&&!l)return;const c=Cv(i);if(!(c&&!l)){if(Kc(i)){const f=s&&t&&t.type_!==3&&!pS(t.assigned_,r)?s.concat(r):void 0,h=Zm(e,i,f);if(E$(n,r,h),Kc(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(cl(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Zm(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(_f(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Ym(e,i)}}}function Ym(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jj(t,n)}function Lre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:T$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=Nj;n&&(i=[r],s=rf);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,c}var Nj={get(e,t){if(t===zr)return e;const n=Mo(e);if(!pS(n,t))return $re(e,n,t);const r=n[t];return e.finalized_||!cl(r)?r:r===Lx(e.base_,t)?($x(e),e.copy_[t]=bS(r,e)):r},has(e,t){return t in Mo(e)},ownKeys(e){return Reflect.ownKeys(Mo(e))},set(e,t,n){const r=P$(Mo(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Lx(Mo(e),t),s=i?.[zr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(zre(n,i)&&(n!==void 0||pS(e.base_,t)))return!0;$x(e),yS(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 Lx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,$x(e),yS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Mo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ki(11)},getPrototypeOf(e){return tf(e.base_)},setPrototypeOf(){ki(12)}},rf={};Vm(Nj,(e,t)=>{rf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});rf.deleteProperty=function(e,t){return rf.set.call(this,e,t,void 0)};rf.set=function(e,t,n){return Nj.set.call(this,e[0],t,n,e[0])};function Lx(e,t){const n=e[zr];return(n?Mo(n):e)[t]}function $re(e,t,n){const r=P$(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function P$(e,t){if(!(t in e))return;let n=tf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tf(n)}}function yS(e){e.modified_||(e.modified_=!0,e.parent_&&yS(e.parent_))}function $x(e){e.copy_||(e.copy_=mS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ure=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(f=s,...h){return l.produce(f,p=>n.call(this,p,...h))}}typeof n!="function"&&ki(6),r!==void 0&&typeof r!="function"&&ki(7);let i;if(cl(t)){const s=xP(this),l=bS(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?gS(s):vS(s)}return bP(s,r),wP(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===k$&&(i=void 0),this.autoFreeze_&&jj(i,!0),r){const s=[],l=[];ul("Patches").generateReplacementPatches_(t,i,s,l),r(s,l)}return i}else ki(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,f=>t(f,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){cl(e)||ki(8),Kc(e)&&(e=Bre(e));const t=xP(this),n=bS(e,void 0);return n[zr].isManual_=!0,vS(t),n}finishDraft(e,t){const n=e&&e[zr];(!n||!n.isManual_)&&ki(9);const{scope_:r}=n;return bP(r,t),wP(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=ul("Patches").applyPatches_;return Kc(e)?r(e,t):this.produce(e,i=>r(i,t))}};function bS(e,t){const n=_f(e)?ul("MapSet").proxyMap_(e,t):Nv(e)?ul("MapSet").proxySet_(e,t):Lre(e,t);return(t?t.scope_:T$()).drafts_.push(n),n}function Bre(e){return Kc(e)||ki(10,e),z$(e)}function z$(e){if(!cl(e)||Cv(e))return e;const t=e[zr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=mS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=mS(e,!0);return Vm(n,(i,s)=>{E$(n,i,z$(s))},r),t&&(t.finalized_=!1),n}var qre=new Ure;qre.produce;var Fre={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},M$=Zn({name:"legend",initialState:Fre,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:Rt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Rt()},removeLegendPayload:{reducer(e,t){var n=ri(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Rt()}}}),{setLegendSize:jP,setLegendSettings:Kre,addLegendPayload:Hre,replaceLegendPayload:Gre,removeLegendPayload:Vre}=M$.actions,Zre=M$.reducer,Ux={exports:{}},Bx={};var NP;function Yre(){if(NP)return Bx;NP=1;var e=Xc();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Bx.useSyncExternalStoreWithSelector=function(f,h,p,g,v){var y=i(null);if(y.current===null){var S={hasValue:!1,value:null};y.current=S}else S=y.current;y=l(function(){function N(T){if(!C){if(C=!0,E=T,T=g(T),v!==void 0&&S.hasValue){var z=S.value;if(v(z,T))return k=z}return k=T}if(z=k,n(E,T))return z;var A=g(T);return v!==void 0&&v(z,A)?(E=T,z):(E=T,k=A)}var C=!1,E,k,O=p===void 0?null:p;return[function(){return N(h())},O===null?void 0:function(){return N(O())}]},[h,p,g,v]);var w=r(f,y[0],y[1]);return s(function(){S.hasValue=!0,S.value=w},[w]),c(w),w},Bx}var CP;function Wre(){return CP||(CP=1,Ux.exports=Yre()),Ux.exports}Wre();function Qre(e){e()}function Xre(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Qre(()=>{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 OP={notify(){},get:()=>[]};function Jre(e,t){let n,r=OP,i=0,s=!1;function l(w){p();const N=r.subscribe(w);let C=!1;return()=>{C||(C=!0,N(),g())}}function c(){r.notify()}function f(){S.onStateChange&&S.onStateChange()}function h(){return s}function p(){i++,n||(n=e.subscribe(f),r=Xre())}function g(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=OP)}function v(){s||(s=!0,p())}function y(){s&&(s=!1,g())}const S={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:y,getListeners:()=>r};return S}var eie=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tie=eie(),nie=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rie=nie(),iie=()=>tie||rie?x.useLayoutEffect:x.useEffect,aie=iie();function _P(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sie(e,t){if(_P(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])||!_P(e[n[i]],t[n[i]]))return!1;return!0}var oie=Symbol.for("react-redux-context"),lie=typeof globalThis<"u"?globalThis:{};function cie(){if(!x.createContext)return{};const e=lie[oie]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var uie=cie();function die(e){const{children:t,context:n,serverState:r,store:i}=e,s=x.useMemo(()=>{const f=Jre(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);aie(()=>{const{subscription:f}=s;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[s,l]);const c=n||uie;return x.createElement(c.Provider,{value:s},t)}var fie=die,hie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function pie(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function kf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(hie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!sie(e[r],t[r]))return!1}else if(!pie(e[r],t[r]))return!1;return!0}var mie=["contextPayload"];function xS(){return xS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xS.apply(null,arguments)}function kP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kP(Object(n),!0).forEach(function(r){gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gie(e,t,n){return(t=vie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vie(e){var t=yie(e,"string");return typeof t=="symbol"?t:t+""}function yie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bie(e,t){if(e==null)return{};var n,r,i=xie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wie(e){return e.value}function Sie(e){var{contextPayload:t}=e,n=bie(e,mie),r=DL(t,e.payloadUniqBy,wie),i=Hc(Hc({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Zee,i)}function jie(e,t,n,r,i,s){var{layout:l,align:c,verticalAlign:f}=t,h,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?h={left:((r||0)-s.width)/2}:h=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?p={top:((i||0)-s.height)/2}:p=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Hc(Hc({},h),p)}function Nie(e){var t=Wt();return x.useEffect(()=>{t(Kre(e))},[t,e]),null}function Cie(e){var t=Wt();return x.useEffect(()=>(t(jP(e)),()=>{t(jP({width:0,height:0}))}),[t,e]),null}function Oie(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var _ie={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function kie(e){var t=rr(e,_ie),n=Lte(),r=UJ(),i=Ere(),{width:s,height:l,wrapperStyle:c,portal:f}=t,[h,p]=BL([n]),g=xj(),v=wj();if(g==null||v==null)return null;var y=g-(i?.left||0)-(i?.right||0),S=Oie(t.layout,l,s,y),w=f?c:Hc(Hc({position:"absolute",width:S?.width||s||"auto",height:S?.height||l||"auto"},jie(c,t,i,g,v,h)),c),N=f??r;if(N==null||n==null)return null;var C=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},x.createElement(Nie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement(Cie,{width:h.width,height:h.height}),x.createElement(Sie,xS({},t,S,{margin:i,chartWidth:g,chartHeight:v,contextPayload:n})));return ml.createPortal(C,N)}var wS=x.memo(kie,kf);wS.displayName="Legend";function SS(){return SS=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},SS.apply(null,arguments)}function AP(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 md(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AP(Object(n),!0).forEach(function(r){Aie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aie(e,t,n){return(t=Eie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eie(e){var t=Tie(e,"string");return typeof t=="symbol"?t:t+""}function Tie(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 Pie(e){return Array.isArray(e)&&oi(e[0])&&oi(e[1])?e.join(" ~ "):e}var dc={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 zie(e,t){return t==null?e:cv(e,t)}var Mie=e=>{var{separator:t=dc.separator,contentStyle:n,itemStyle:r,labelStyle:i=dc.labelStyle,payload:s,formatter:l,itemSorter:c,wrapperClassName:f,labelClassName:h,label:p,labelFormatter:g,accessibilityLayer:v=dc.accessibilityLayer}=e,y=()=>{if(s&&s.length){var T={padding:0,margin:0},z=zie(s,c),A=z.map((P,R)=>{if(!P||P.type==="none")return null;var B=P.formatter||l||Pie,{value:$,name:L}=P,re=$,ge=L;if(B){var be=B($,L,P,R,s);if(Array.isArray(be))[re,ge]=be;else if(be!=null)re=be;else return null}var H=md(md({},dc.itemStyle),{},{color:P.color||dc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:H},oi(ge)?x.createElement("span",{className:"recharts-tooltip-item-name"},ge):null,oi(ge)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},re),x.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:T},A)}return null},S=md(md({},dc.contentStyle),n),w=md({margin:0},i),N=!Ln(p),C=N?p:"",E=vt("recharts-default-tooltip",f),k=vt("recharts-tooltip-label",h);N&&g&&s!==void 0&&s!==null&&(C=g(p,s));var O=v?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",SS({className:E,style:S},O),x.createElement("p",{className:k,style:w},x.isValidElement(C)?C:"".concat(C)),y())},gd="recharts-tooltip-wrapper",Rie={visibility:"hidden"};function Die(e){var{coordinate:t,translateX:n,translateY:r}=e;return vt(gd,{["".concat(gd,"-right")]:De(n)&&t&&De(t.x)&&n>=t.x,["".concat(gd,"-left")]:De(n)&&t&&De(t.x)&&n<t.x,["".concat(gd,"-bottom")]:De(r)&&t&&De(t.y)&&r>=t.y,["".concat(gd,"-top")]:De(r)&&t&&De(t.y)&&r<t.y})}function EP(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:s,reverseDirection:l,tooltipDimension:c,viewBox:f,viewBoxDimension:h}=e;if(s&&De(s[r]))return s[r];var p=n[r]-c-(i>0?i:0),g=n[r]+i;if(t[r])return l[r]?p:g;var v=f[r];if(v==null)return 0;if(l[r]){var y=p,S=v;return y<S?Math.max(g,v):Math.max(p,v)}if(h==null)return 0;var w=g+c,N=v+h;return w>N?Math.max(p,v):Math.max(g,v)}function Iie(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 Lie(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:l,tooltipBox:c,useTranslate3d:f,viewBox:h}=e,p,g,v;return c.height>0&&c.width>0&&n?(g=EP({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:l,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),v=EP({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:l,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),p=Iie({translateX:g,translateY:v,useTranslate3d:f})):p=Rie,{cssProperties:p,cssClasses:Die({translateX:g,translateY:v,coordinate:n})}}var $ie=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Af={isSsr:$ie()};function R$(){var[e,t]=x.useState(()=>Af.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function TP(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 fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TP(Object(n),!0).forEach(function(r){Uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uie(e,t,n){return(t=Bie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bie(e){var t=qie(e,"string");return typeof t=="symbol"?t:t+""}function qie(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 Fie(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Kie(e){var t,n,r,i,s,l,c=R$(),[f,h]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var S=w=>{if(w.key==="Escape"){var N,C,E,k;h({dismissed:!0,dismissedAtCoordinate:{x:(N=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&N!==void 0?N:0,y:(E=(k=e.coordinate)===null||k===void 0?void 0:k.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((s=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&s!==void 0?s:0)!==f.dismissedAtCoordinate.y)&&h(fc(fc({},f),{},{dismissed:!1}));var{cssClasses:p,cssProperties:g}=Lie({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}),v=e.hasPortalFromProps?{}:fc(fc({transition:Fie({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=fc(fc({},v),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:y,ref:e.innerRef},e.children)}var Hie=x.memo(Kie),D$=()=>{var e;return(e=Le(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function jS(){return jS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jS.apply(null,arguments)}function PP(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 zP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PP(Object(n),!0).forEach(function(r){Gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gie(e,t,n){return(t=Vie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vie(e){var t=Zie(e,"string");return typeof t=="symbol"?t:t+""}function Zie(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 MP={curveBasisClosed:aee,curveBasisOpen:see,curveBasis:iee,curveBumpX:KJ,curveBumpY:HJ,curveLinearClosed:oee,curveLinear:sv,curveMonotoneX:lee,curveMonotoneY:cee,curveNatural:uee,curveStep:dee,curveStepAfter:hee,curveStepBefore:fee},Wm=e=>Ye(e.x)&&Ye(e.y),RP=e=>e.base!=null&&Wm(e.base)&&Wm(e),vd=e=>e.x,yd=e=>e.y,Yie=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(wf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=MP["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return MP[n]||sv},DP={connectNulls:!1,type:"linear"},Wie=e=>{var{type:t=DP.type,points:n=[],baseLine:r,layout:i,connectNulls:s=DP.connectNulls}=e,l=Yie(t,i),c=s?n.filter(Wm):n;if(Array.isArray(r)){var f,h=n.map((S,w)=>zP(zP({},S),{},{base:r[w]}));i==="vertical"?f=Ap().y(yd).x1(vd).x0(S=>S.base.x):f=Ap().x(vd).y1(yd).y0(S=>S.base.y);var p=f.defined(RP).curve(l),g=s?h.filter(RP):h;return p(g)}var v;i==="vertical"&&De(r)?v=Ap().y(yd).x1(vd).x0(r):De(r)?v=Ap().x(vd).y1(yd).y0(r):v=lL().x(vd).y(yd);var y=v.defined(Wm).curve(l);return y(c)},am=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=lu();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||s,connectNulls:e.connectNulls},c=n&&n.length?Wie(l):r;return x.createElement("path",jS({},Ti(e),cj(e),{className:vt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},Qie=["x","y","top","left","width","height","className"];function NS(){return NS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NS.apply(null,arguments)}function IP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){Jie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jie(e,t,n){return(t=eae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eae(e){var t=tae(e,"string");return typeof t=="symbol"?t:t+""}function tae(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 nae(e,t){if(e==null)return{};var n,r,i=rae(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rae(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 iae=(e,t,n,r,i,s)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),aae=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:l=0,className:c}=e,f=nae(e,Qie),h=Xie({x:t,y:n,top:r,left:i,width:s,height:l},f);return!De(t)||!De(n)||!De(s)||!De(l)||!De(r)||!De(i)?null:x.createElement("path",NS({},yr(h),{className:vt("recharts-cross",c),d:iae(t,n,s,l,r,i)}))};function sae(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 LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(r){oae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oae(e,t,n){return(t=lae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lae(e){var t=cae(e,"string");return typeof t=="symbol"?t:t+""}function cae(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 uae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),dae=(e,t,n)=>e.map(r=>"".concat(uae(r)," ").concat(t,"ms ").concat(n)).join(","),fae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),af=(e,t)=>Object.keys(t).reduce((n,r)=>$P($P({},n),{},{[r]:e(r,t[r])}),{});function UP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(n),!0).forEach(function(r){hae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hae(e,t,n){return(t=pae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pae(e){var t=mae(e,"string");return typeof t=="symbol"?t:t+""}function mae(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 Qm=(e,t,n)=>e+(t-e)*n,CS=e=>{var{from:t,to:n}=e;return t!==n},I$=(e,t,n)=>{var r=af((i,s)=>{if(CS(s)){var[l,c]=e(s.from,s.to,s.velocity);return bn(bn({},s),{},{from:l,velocity:c})}return s},t);return n<1?af((i,s)=>CS(s)&&r[i]!=null?bn(bn({},s),{},{velocity:Qm(s.velocity,r[i].velocity,n),from:Qm(s.from,r[i].from,n)}):s,t):I$(e,r,n-1)};function gae(e,t,n,r,i,s){var l,c=r.reduce((v,y)=>bn(bn({},v),{},{[y]:{from:e[y],velocity:0,to:t[y]}}),{}),f=()=>af((v,y)=>y.from,c),h=()=>!Object.values(c).filter(CS).length,p=null,g=v=>{l||(l=v);var y=v-l,S=y/n.dt;c=I$(n,c,S),i(bn(bn(bn({},e),t),f())),l=v,h()||(p=s.setTimeout(g))};return()=>(p=s.setTimeout(g),()=>{var v;(v=p)===null||v===void 0||v()})}function vae(e,t,n,r,i,s,l){var c=null,f=i.reduce((g,v)=>{var y=e[v],S=t[v];return y==null||S==null?g:bn(bn({},g),{},{[v]:[y,S]})},{}),h,p=g=>{h||(h=g);var v=(g-h)/r,y=af((w,N)=>Qm(...N,n(v)),f);if(s(bn(bn(bn({},e),t),y)),v<1)c=l.setTimeout(p);else{var S=af((w,N)=>Qm(...N,n(1)),f);s(bn(bn(bn({},e),t),S))}};return()=>(c=l.setTimeout(p),()=>{var g;(g=c)===null||g===void 0||g()})}const yae=(e,t,n,r,i,s)=>{var l=fae(e,t);return n==null?()=>(i(bn(bn({},e),t)),()=>{}):n.isStepper===!0?gae(e,t,n,l,i,s):vae(e,t,n,r,l,i,s)};var Xm=1e-4,L$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],$$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),BP=(e,t)=>n=>{var r=L$(e,t);return $$(r,n)},bae=(e,t)=>n=>{var r=L$(e,t),i=[...r.map((s,l)=>s*l).slice(1),0];return $$(i,n)},xae=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(s=>parseFloat(s));return[i[0],i[1],i[2],i[3]]},wae=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=xae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Sae=(e,t,n,r)=>{var i=BP(e,n),s=BP(t,r),l=bae(e,n),c=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,g=p,v=0;v<8;++v){var y=i(g)-p,S=l(g);if(Math.abs(y-p)<Xm||S<Xm)return s(g);g=c(g-y/S)}return s(g)};return f.isStepper=!1,f},qP=function(){return Sae(...wae(...arguments))},jae=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,s=(l,c,f)=>{var h=-(l-c)*n,p=f*r,g=f+(h-p)*i/1e3,v=f*i/1e3+l;return Math.abs(v-c)<Xm&&Math.abs(g)<Xm?[c,0]:[v,g]};return s.isStepper=!0,s.dt=i,s},Nae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return qP(e);case"spring":return jae();default:if(e.split("(")[0]==="cubic-bezier")return qP(e)}return typeof e=="function"?e:null};function Cae(e){var t,n=()=>null,r=!1,i=null,s=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[f,...h]=c;if(typeof f=="number"){i=e.setTimeout(s.bind(null,h),f);return}s(f),i=e.setTimeout(s.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),s(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class Oae{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,s=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function _ae(){return Cae(new Oae)}var kae=x.createContext(_ae);function Aae(e,t){var n=x.useContext(kae);return x.useMemo(()=>t??n(e),[e,t,n])}var Eae={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},FP={t:0},qx={t:1};function U$(e){var t=rr(e,Eae),{isActive:n,canBegin:r,duration:i,easing:s,begin:l,onAnimationEnd:c,onAnimationStart:f,children:h}=t,p=R$(),g=n==="auto"?!Af.isSsr&&!p:n,v=Aae(t.animationId,t.animationManager),[y,S]=x.useState(g?FP:qx),w=x.useRef(null);return x.useEffect(()=>{g||S(qx)},[g]),x.useEffect(()=>{if(!g||!r)return ou;var N=yae(FP,qx,Nae(s),i,S,v.getTimeoutController()),C=()=>{w.current=N()};return v.start([f,l,C,i,c]),()=>{v.stop(),w.current&&w.current(),c()}},[g,r,i,s,l,f,c,v]),h(y.t)}function B$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Qd(t)),r=x.useRef(e);return r.current!==e&&(n.current=Qd(t),r.current=e),n.current}var Tae=["radius"],Pae=["radius"],KP,HP,GP,VP,ZP,YP,WP,QP,XP,JP;function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function t2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){zae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zae(e,t,n){return(t=Mae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mae(e){var t=Rae(e,"string");return typeof t=="symbol"?t:t+""}function Rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jm.apply(null,arguments)}function n2(e,t){if(e==null)return{};var n,r,i=Dae(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dae(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 qi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var r2=(e,t,n,r,i)=>{var s=zs(n),l=zs(r),c=Math.min(Math.abs(s)/2,Math.abs(l)/2),f=l>=0?1:-1,h=s>=0?1:-1,p=l>=0&&s>=0||l<0&&s<0?1:0,g;if(c>0&&Array.isArray(i)){for(var v=[0,0,0,0],y=0,S=4;y<S;y++){var w,N=(w=i[y])!==null&&w!==void 0?w:0;v[y]=N>c?c:N}g=Mn(KP||(KP=qi(["M",",",""])),e,t+f*v[0]),v[0]>0&&(g+=Mn(HP||(HP=qi(["A ",",",",0,0,",",",",",""])),v[0],v[0],p,e+h*v[0],t)),g+=Mn(GP||(GP=qi(["L ",",",""])),e+n-h*v[1],t),v[1]>0&&(g+=Mn(VP||(VP=qi(["A ",",",",0,0,",`,
241
- `,",",""])),v[1],v[1],p,e+n,t+f*v[1])),g+=Mn(ZP||(ZP=qi(["L ",",",""])),e+n,t+r-f*v[2]),v[2]>0&&(g+=Mn(YP||(YP=qi(["A ",",",",0,0,",`,
242
- `,",",""])),v[2],v[2],p,e+n-h*v[2],t+r)),g+=Mn(WP||(WP=qi(["L ",",",""])),e+h*v[3],t+r),v[3]>0&&(g+=Mn(QP||(QP=qi(["A ",",",",0,0,",`,
243
- `,",",""])),v[3],v[3],p,e,t+r-f*v[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var C=Math.min(c,i);g=Mn(XP||(XP=qi(["M ",",",`
244
- A `,",",",0,0,",",",",",`
245
- L `,",",`
246
- A `,",",",0,0,",",",",",`
247
- L `,",",`
248
- A `,",",",0,0,",",",",",`
249
- L `,",",`
250
- A `,",",",0,0,",",",","," Z"])),e,t+f*C,C,C,p,e+h*C,t,e+n-h*C,t,C,C,p,e+n,t+f*C,e+n,t+r-f*C,C,C,p,e+n-h*C,t+r,e+h*C,t+r,C,C,p,e,t+r-f*C)}else g=Mn(JP||(JP=qi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return g},i2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Iae=e=>{var t=rr(e,i2),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ee=n.current.getTotalLength();ee&&i(ee)}catch{}},[]);var{x:s,y:l,width:c,height:f,radius:h,className:p}=t,{animationEasing:g,animationDuration:v,animationBegin:y,isAnimationActive:S,isUpdateAnimationActive:w}=t,N=x.useRef(c),C=x.useRef(f),E=x.useRef(s),k=x.useRef(l),O=x.useMemo(()=>({x:s,y:l,width:c,height:f,radius:h}),[s,l,c,f,h]),T=B$(O,"rectangle-");if(s!==+s||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var z=vt("recharts-rectangle",p);if(!w){var A=yr(t),{radius:P}=A,R=n2(A,Tae);return x.createElement("path",Jm({},R,{x:zs(s),y:zs(l),width:zs(c),height:zs(f),radius:typeof h=="number"?h:void 0,className:z,d:r2(s,l,c,f,h)}))}var B=N.current,$=C.current,L=E.current,re=k.current,ge="0px ".concat(r===-1?1:r,"px"),be="".concat(r,"px ").concat(r,"px"),H=dae(["strokeDasharray"],v,typeof g=="string"?g:i2.animationEasing);return x.createElement(U$,{animationId:T,key:T,canBegin:r>0,duration:v,easing:g,isActive:w,begin:y},ee=>{var ye=Gi(B,c,ee),Se=Gi($,f,ee),q=Gi(L,s,ee),D=Gi(re,l,ee);n.current&&(N.current=ye,C.current=Se,E.current=q,k.current=D);var G;S?ee>0?G={transition:H,strokeDasharray:be}:G={strokeDasharray:ge}:G={strokeDasharray:be};var ae=yr(t),{radius:Y}=ae,ie=n2(ae,Pae);return x.createElement("path",Jm({},ie,{radius:typeof h=="number"?h:void 0,className:z,d:r2(q,D,ye,Se,h),ref:n,style:t2(t2({},G),t.style)}))})};function a2(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 s2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a2(Object(n),!0).forEach(function(r){Lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lae(e,t,n){return(t=$ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ae(e){var t=Uae(e,"string");return typeof t=="symbol"?t:t+""}function Uae(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 eg=Math.PI/180,Bae=e=>e*180/Math.PI,In=(e,t,n,r)=>({x:e+Math.cos(-eg*r)*n,y:t+Math.sin(-eg*r)*n}),qae=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},Fae=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},Kae=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,l=Fae({x:n,y:r},{x:i,y:s});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,f=Math.acos(c);return r>s&&(f=2*Math.PI-f),{radius:l,angle:Bae(f),angleInRadian:f}},Hae=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},Gae=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return e+l*360},Vae=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:s}=Kae({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:f,endAngle:h}=Hae(t),p=s,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?s2(s2({},t),{},{radius:i,angle:Gae(p,t)}):null};function q$(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,l=In(t,n,r,i),c=In(t,n,r,s);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var o2,l2,c2,u2,d2,f2,h2;function OS(){return OS=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},OS.apply(null,arguments)}function qo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Zae=(e,t)=>{var n=ni(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Ip=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:s,isExternal:l,cornerRadius:c,cornerIsExternal:f}=e,h=c*(l?1:-1)+r,p=Math.asin(c/h)/eg,g=f?i:i+s*p,v=In(t,n,h,g),y=In(t,n,r,g),S=f?i-s*p:i,w=In(t,n,h*Math.cos(p*eg),S);return{center:v,circleTangency:y,lineTangency:w,theta:p}},F$=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:l}=e,c=Zae(s,l),f=s+c,h=In(t,n,i,s),p=In(t,n,i,f),g=Mn(o2||(o2=qo(["M ",",",`
251
- A `,",",`,0,
252
- `,",",`,
253
- `,",",`
254
- `])),h.x,h.y,i,i,+(Math.abs(c)>180),+(s>f),p.x,p.y);if(r>0){var v=In(t,n,r,s),y=In(t,n,r,f);g+=Mn(l2||(l2=qo(["L ",",",`
255
- A `,",",`,0,
256
- `,",",`,
257
- `,","," Z"])),y.x,y.y,r,r,+(Math.abs(c)>180),+(s<=f),v.x,v.y)}else g+=Mn(c2||(c2=qo(["L ",","," Z"])),t,n);return g},Yae=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}=e,p=ni(h-f),{circleTangency:g,lineTangency:v,theta:y}=Ip({cx:t,cy:n,radius:i,angle:f,sign:p,cornerRadius:s,cornerIsExternal:c}),{circleTangency:S,lineTangency:w,theta:N}=Ip({cx:t,cy:n,radius:i,angle:h,sign:-p,cornerRadius:s,cornerIsExternal:c}),C=c?Math.abs(f-h):Math.abs(f-h)-y-N;if(C<0)return l?Mn(u2||(u2=qo(["M ",",",`
258
- a`,",",",0,0,1,",`,0
259
- a`,",",",0,0,1,",`,0
260
- `])),v.x,v.y,s,s,s*2,s,s,-s*2):F$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var E=Mn(d2||(d2=qo(["M ",",",`
261
- A`,",",",0,0,",",",",",`
262
- A`,",",",0,",",",",",",",`
263
- A`,",",",0,0,",",",",",`
264
- `])),v.x,v.y,s,s,+(p<0),g.x,g.y,i,i,+(C>180),+(p<0),S.x,S.y,s,s,+(p<0),w.x,w.y);if(r>0){var{circleTangency:k,lineTangency:O,theta:T}=Ip({cx:t,cy:n,radius:r,angle:f,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:z,lineTangency:A,theta:P}=Ip({cx:t,cy:n,radius:r,angle:h,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),R=c?Math.abs(f-h):Math.abs(f-h)-T-P;if(R<0&&s===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=Mn(f2||(f2=qo(["L",",",`
265
- A`,",",",0,0,",",",",",`
266
- A`,",",",0,",",",",",",",`
267
- A`,",",",0,0,",",",",","Z"])),A.x,A.y,s,s,+(p<0),z.x,z.y,r,r,+(R>180),+(p>0),k.x,k.y,s,s,+(p<0),O.x,O.y)}else E+=Mn(h2||(h2=qo(["L",",","Z"])),t,n);return E},Wae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Qae=e=>{var t=rr(e,Wae),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p,className:g}=t;if(s<i||h===p)return null;var v=vt("recharts-sector",g),y=s-i,S=Hs(l,y,0,!0),w;return S>0&&Math.abs(h-p)<360?w=Yae({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(S,y/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p}):w=F$({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:h,endAngle:p}),x.createElement("path",OS({},yr(t),{className:v,d:w}))};function Xae(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(NL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:l,angle:c}=t,f=In(r,i,s,c),h=In(r,i,l,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return q$(t)}}var Fx={},Kx={},Hx={},p2;function Jae(){return p2||(p2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LL();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Hx)),Hx}var m2;function ese(){return m2||(m2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jae();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})(Kx)),Kx}var g2;function tse(){return g2||(g2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$L(),n=ese();function r(i,s,l){l&&typeof l!="number"&&t.isIterateeCall(i,s,l)&&(s=l=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),l=l===void 0?i<s?1:-1:n.toFinite(l);const c=Math.max(Math.ceil((s-i)/(l||1)),0),f=new Array(c);for(let h=0;h<c;h++)f[h]=i,i+=l;return f}e.range=r})(Fx)),Fx}var Gx,v2;function nse(){return v2||(v2=1,Gx=tse().range),Gx}var rse=nse();const K$=Gs(rse);var Ii=e=>e.chartData,Cj=te([Ii],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Ov=(e,t,n,r)=>r?Cj(e):Ii(e),ise=(e,t,n)=>n?Cj(e):Ii(e),ase=te([Ov],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});te([Cj],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var sse=te([Ii],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Wi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ye(t)&&Ye(n))return!0}return!1}function y2(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function H$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(Ye(n))i=n;else if(typeof n=="function")return;if(Ye(r))s=r;else if(typeof r=="function")return;var l=[i,s];if(Wi(l))return l}}function ose(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Wi(r))return y2(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(De(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&oP.test(i)){var f=oP.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t?.[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(De(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t?.[1]))}catch{}else if(typeof s=="string"&&lP.test(s)){var p=lP.exec(s);if(p==null||p[1]==null||t==null)c=void 0;else{var g=+p[1];c=t[1]+g}}else c=t?.[1];var v=[l,c];if(Wi(v))return t==null?v:y2(v,t,n)}}}var cu=1e9,lse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_j,qt=!0,li="[DecimalError] ",Xo=li+"Invalid argument: ",Oj=li+"Exponent out of range: ",uu=Math.floor,Ro=Math.pow,cse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ar,jn=1e7,Dt=7,G$=9007199254740991,tg=uu(G$/Dt),Ae={};Ae.absoluteValue=Ae.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ae.comparedTo=Ae.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};Ae.decimalPlaces=Ae.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Dt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ae.dividedBy=Ae.div=function(e){return Da(this,new this.constructor(e))};Ae.dividedToIntegerBy=Ae.idiv=function(e){var t=this,n=t.constructor;return At(Da(t,new n(e),0,1),n.precision)};Ae.equals=Ae.eq=function(e){return!this.cmp(e)};Ae.exponent=function(){return pn(this)};Ae.greaterThan=Ae.gt=function(e){return this.cmp(e)>0};Ae.greaterThanOrEqualTo=Ae.gte=function(e){return this.cmp(e)>=0};Ae.isInteger=Ae.isint=function(){return this.e>this.d.length-2};Ae.isNegative=Ae.isneg=function(){return this.s<0};Ae.isPositive=Ae.ispos=function(){return this.s>0};Ae.isZero=function(){return this.s===0};Ae.lessThan=Ae.lt=function(e){return this.cmp(e)<0};Ae.lessThanOrEqualTo=Ae.lte=function(e){return this.cmp(e)<1};Ae.logarithm=Ae.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ar))throw Error(li+"NaN");if(n.s<1)throw Error(li+(n.s?"NaN":"-Infinity"));return n.eq(Ar)?new r(0):(qt=!1,t=Da(sf(n,s),sf(e,s),s),qt=!0,At(t,i))};Ae.minus=Ae.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Y$(t,e):V$(t,(e.s=-e.s,e))};Ae.modulo=Ae.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(li+"NaN");return n.s?(qt=!1,t=Da(n,e,0,1).times(e),qt=!0,n.minus(t)):At(new r(n),i)};Ae.naturalExponential=Ae.exp=function(){return Z$(this)};Ae.naturalLogarithm=Ae.ln=function(){return sf(this)};Ae.negated=Ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ae.plus=Ae.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?V$(t,e):Y$(t,(e.s=-e.s,e))};Ae.precision=Ae.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xo+e);if(t=pn(i)+1,r=i.d.length-1,n=r*Dt+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};Ae.squareRoot=Ae.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(li+"NaN")}for(e=pn(c),qt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Yi(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=uu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Da(c,s,l+2)).times(.5),Yi(s.d).slice(0,l)===(t=Yi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(At(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return qt=!0,At(r,n)};Ae.times=Ae.mul=function(e){var t,n,r,i,s,l,c,f,h,p=this,g=p.constructor,v=p.d,y=(e=new g(e)).d;if(!p.s||!e.s)return new g(0);for(e.s*=p.s,n=p.e+e.e,f=v.length,h=y.length,f<h&&(s=v,v=y,y=s,l=f,f=h,h=l),s=[],l=f+h,r=l;r--;)s.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)c=s[i]+y[r]*v[i-r-1]+t,s[i--]=c%jn|0,t=c/jn|0;s[i]=(s[i]+t)%jn|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,qt?At(e,g.precision):e};Ae.toDecimalPlaces=Ae.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ta(e,0,cu),t===void 0?t=r.rounding:ta(t,0,8),At(n,e+pn(n)+1,t))};Ae.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=dl(r,!0):(ta(e,0,cu),t===void 0?t=i.rounding:ta(t,0,8),r=At(new i(r),e+1,t),n=dl(r,!0,e+1)),n};Ae.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?dl(i):(ta(e,0,cu),t===void 0?t=s.rounding:ta(t,0,8),r=At(new s(i),e+pn(i)+1,t),n=dl(r.abs(),!1,e+pn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ae.toInteger=Ae.toint=function(){var e=this,t=e.constructor;return At(new t(e),pn(e)+1,t.rounding)};Ae.toNumber=function(){return+this};Ae.toPower=Ae.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Ar);if(c=new f(c),!c.s){if(e.s<1)throw Error(li+"Infinity");return c}if(c.eq(Ar))return c;if(r=f.precision,e.eq(Ar))return At(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=p<0?-p:p)<=G$){for(i=new f(Ar),t=Math.ceil(r/Dt+4),qt=!1;n%2&&(i=i.times(c),x2(i.d,t)),n=uu(n/2),n!==0;)c=c.times(c),x2(c.d,t);return qt=!0,e.s<0?new f(Ar).div(i):At(i,r)}}else if(s<0)throw Error(li+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,qt=!1,i=e.times(sf(c,r+h)),qt=!0,i=Z$(i),i.s=s,i};Ae.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=pn(i),r=dl(i,n<=s.toExpNeg||n>=s.toExpPos)):(ta(e,1,cu),t===void 0?t=s.rounding:ta(t,0,8),i=At(new s(i),e,t),n=pn(i),r=dl(i,e<=n||n<=s.toExpNeg,e)),r};Ae.toSignificantDigits=Ae.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ta(e,1,cu),t===void 0?t=r.rounding:ta(t,0,8)),At(new r(n),e,t)};Ae.toString=Ae.valueOf=Ae.val=Ae.toJSON=Ae[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=pn(e),n=e.constructor;return dl(e,t<=n.toExpNeg||t>=n.toExpPos)};function V$(e,t){var n,r,i,s,l,c,f,h,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),qt?At(t,g):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=h.length):(r=h,i=l,c=f.length),l=Math.ceil(g/Dt),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=h.length,c-s<0&&(s=c,r=h,h=f,f=r),n=0;s;)n=(f[--s]=f[s]+h[s]+n)/jn|0,f[s]%=jn;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,qt?At(t,g):t}function ta(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Xo+e)}function Yi(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;t<i;t++)r=e[t]+"",n=Dt-r.length,n&&(s+=Os(n)),s+=r;l=e[t],r=l+"",n=Dt-r.length,n&&(s+=Os(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return s+l}var Da=(function(){function e(r,i){var s,l=0,c=r.length;for(r=r.slice();c--;)s=r[c]*i+l,r[c]=s%jn|0,l=s/jn|0;return l&&r.unshift(l),r}function t(r,i,s,l){var c,f;if(s!=l)f=s>l?1:-1;else for(c=f=0;c<s;c++)if(r[c]!=i[c]){f=r[c]>i[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]<i[s]?1:0,r[s]=l*jn+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,l){var c,f,h,p,g,v,y,S,w,N,C,E,k,O,T,z,A,P,R=r.constructor,B=r.s==i.s?1:-1,$=r.d,L=i.d;if(!r.s)return new R(r);if(!i.s)throw Error(li+"Division by zero");for(f=r.e-i.e,A=L.length,T=$.length,y=new R(B),S=y.d=[],h=0;L[h]==($[h]||0);)++h;if(L[h]>($[h]||0)&&--f,s==null?E=s=R.precision:l?E=s+(pn(r)-pn(i))+1:E=s,E<0)return new R(0);if(E=E/Dt+2|0,h=0,A==1)for(p=0,L=L[0],E++;(h<T||p)&&E--;h++)k=p*jn+($[h]||0),S[h]=k/L|0,p=k%L|0;else{for(p=jn/(L[0]+1)|0,p>1&&(L=e(L,p),$=e($,p),A=L.length,T=$.length),O=A,w=$.slice(0,A),N=w.length;N<A;)w[N++]=0;P=L.slice(),P.unshift(0),z=L[0],L[1]>=jn/2&&++z;do p=0,c=t(L,w,A,N),c<0?(C=w[0],A!=N&&(C=C*jn+(w[1]||0)),p=C/z|0,p>1?(p>=jn&&(p=jn-1),g=e(L,p),v=g.length,N=w.length,c=t(g,w,v,N),c==1&&(p--,n(g,A<v?P:L,v))):(p==0&&(c=p=1),g=L.slice()),v=g.length,v<N&&g.unshift(0),n(w,g,N),c==-1&&(N=w.length,c=t(L,w,A,N),c<1&&(p++,n(w,A<N?P:L,N))),N=w.length):c===0&&(p++,w=[0]),S[h++]=p,c&&w[0]?w[N++]=$[O]||0:(w=[$[O]],N=1);while((O++<T||w[0]!==void 0)&&E--)}return S[0]||S.shift(),y.e=f,At(y,l?s+pn(y)+1:s)}})();function Z$(e,t){var n,r,i,s,l,c,f=0,h=0,p=e.constructor,g=p.precision;if(pn(e)>16)throw Error(Oj+pn(e));if(!e.s)return new p(Ar);for(qt=!1,c=g,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(Ro(2,h))/Math.LN10*2+5|0,c+=r,n=i=s=new p(Ar),p.precision=c;;){if(i=At(i.times(e),c),n=n.times(++f),l=s.plus(Da(i,n,c)),Yi(l.d).slice(0,c)===Yi(s.d).slice(0,c)){for(;h--;)s=At(s.times(s),c);return p.precision=g,t==null?(qt=!0,At(s,g)):s}s=l}}function pn(e){for(var t=e.e*Dt,n=e.d[0];n>=10;n/=10)t++;return t}function Vx(e,t,n){if(t>e.LN10.sd())throw qt=!0,n&&(e.precision=n),Error(li+"LN10 precision limit exceeded");return At(new e(e.LN10),t)}function Os(e){for(var t="";e--;)t+="0";return t}function sf(e,t){var n,r,i,s,l,c,f,h,p,g=1,v=10,y=e,S=y.d,w=y.constructor,N=w.precision;if(y.s<1)throw Error(li+(y.s?"NaN":"-Infinity"));if(y.eq(Ar))return new w(0);if(t==null?(qt=!1,h=N):h=t,y.eq(10))return t==null&&(qt=!0),Vx(w,h);if(h+=v,w.precision=h,n=Yi(S),r=n.charAt(0),s=pn(y),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=Yi(y.d),r=n.charAt(0),g++;s=pn(y),r>1?(y=new w("0."+n),s++):y=new w(r+"."+n.slice(1))}else return f=Vx(w,h+2,N).times(s+""),y=sf(new w(r+"."+n.slice(1)),h-v).plus(f),w.precision=N,t==null?(qt=!0,At(y,N)):y;for(c=l=y=Da(y.minus(Ar),y.plus(Ar),h),p=At(y.times(y),h),i=3;;){if(l=At(l.times(p),h),f=c.plus(Da(l,new w(i),h)),Yi(f.d).slice(0,h)===Yi(c.d).slice(0,h))return c=c.times(2),s!==0&&(c=c.plus(Vx(w,h+2,N).times(s+""))),c=Da(c,new w(g),h),w.precision=N,t==null?(qt=!0,At(c,N)):c;c=f,i+=2}}function b2(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=uu(n/Dt),e.d=[],r=(n+1)%Dt,n<0&&(r+=Dt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Dt;r<i;)e.d.push(+t.slice(r,r+=Dt));t=t.slice(r),r=Dt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),qt&&(e.e>tg||e.e<-tg))throw Error(Oj+n)}else e.s=0,e.e=0,e.d=[0];return e}function At(e,t,n){var r,i,s,l,c,f,h,p,g=e.d;for(l=1,s=g[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=Dt,i=t,h=g[p=0];else{if(p=Math.ceil((r+1)/Dt),s=g.length,p>=s)return e;for(h=s=g[p],l=1;s>=10;s/=10)l++;r%=Dt,i=r-Dt+l}if(n!==void 0&&(s=Ro(10,l-i-1),c=h/s%10|0,f=t<0||g[p+1]!==void 0||h%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?h/Ro(10,l-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return f?(s=pn(e),g.length=1,t=t-s-1,g[0]=Ro(10,(Dt-t%Dt)%Dt),e.e=uu(-t/Dt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=p,s=1,p--):(g.length=p+1,s=Ro(10,Dt-r),g[p]=i>0?(h/Ro(10,l-i)%Ro(10,i)|0)*s:0),f)for(;;)if(p==0){(g[0]+=s)==jn&&(g[0]=1,++e.e);break}else{if(g[p]+=s,g[p]!=jn)break;g[p--]=0,s=1}for(r=g.length;g[--r]===0;)g.pop();if(qt&&(e.e>tg||e.e<-tg))throw Error(Oj+pn(e));return e}function Y$(e,t){var n,r,i,s,l,c,f,h,p,g,v=e.constructor,y=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),qt?At(t,y):t;if(f=e.d,g=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(p=l<0,p?(n=f,l=-l,c=g.length):(n=g,r=h,c=f.length),i=Math.max(Math.ceil(y/Dt),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=g.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(f[i]!=g[i]){p=f[i]<g[i];break}l=0}for(p&&(n=f,f=g,g=n,t.s=-t.s),c=f.length,i=g.length-c;i>0;--i)f[c++]=0;for(i=g.length;i>l;){if(f[--i]<g[i]){for(s=i;s&&f[--s]===0;)f[s]=jn-1;--f[s],f[i]+=jn}f[i]-=g[i]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,qt?At(t,y):t):new v(0)}function dl(e,t,n){var r,i=pn(e),s=Yi(e.d),l=s.length;return t?(n&&(r=n-l)>0?s=s.charAt(0)+"."+s.slice(1)+Os(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Os(-i-1)+s,n&&(r=n-l)>0&&(s+=Os(r))):i>=l?(s+=Os(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+Os(r))):((r=i+1)<l&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(s+="."),s+=Os(r))),e.s<0?"-"+s:s}function x2(e,t){if(e.length>t)return e.length=t,!0}function W$(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Xo+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return b2(l,s.toString())}else if(typeof s!="string")throw Error(Xo+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,cse.test(s))b2(l,s);else throw Error(Xo+s)}if(i.prototype=Ae,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=W$,i.config=i.set=use,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 use(e){if(!e||typeof e!="object")throw Error(li+"Object expected");var t,n,r,i=["precision",1,cu,"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(uu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Xo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Xo+n+": "+r);return this}var _j=W$(lse);Ar=new _j(1);const ct=_j;function Q$(e){var t;return e===0?t=1:t=Math.floor(new ct(e).abs().log(10).toNumber())+1,t}function X$(e,t,n){for(var r=new ct(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var J$=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},kj=(e,t,n)=>{if(e.lte(0))return new ct(0);var r=Q$(e.toNumber()),i=new ct(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new ct(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?new ct(f.toNumber()):new ct(Math.ceil(f.toNumber()))},e5=(e,t,n)=>{var r;if(e.lte(0))return new ct(0);var i=[1,2,2.5,5],s=e.toNumber(),l=Math.floor(new ct(s).abs().log(10).toNumber()),c=new ct(10).pow(l),f=e.div(c).toNumber(),h=i.findIndex(y=>y>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=n,h>=i.length){var p=Math.floor(h/i.length);h%=i.length,c=c.mul(new ct(10).pow(p))}var g=(r=i[h])!==null&&r!==void 0?r:1,v=new ct(g).mul(c);return t?v:new ct(Math.ceil(v.toNumber()))},dse=(e,t,n)=>{var r=new ct(1),i=new ct(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new ct(10).pow(Q$(e)-1),i=new ct(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new ct(Math.floor(e)))}else e===0?i=new ct(Math.floor((t-1)/2)):n||(i=new ct(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(i.add(new ct(f-l).mul(r)).toNumber());return c},t5=function(t,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:kj;if(!Number.isFinite((n-t)/(r-1)))return{step:new ct(0),tickMin:new ct(0),tickMax:new ct(0)};var c=l(new ct(n).sub(t).div(r-1),i,s),f;t<=0&&n>=0?f=new ct(0):(f=new ct(t).add(n).div(2),f=f.sub(new ct(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),p=Math.ceil(new ct(n).sub(f).div(c).toNumber()),g=h+p+1;return g>r?t5(t,n,r,i,s+1,l):(g<r&&(p=n>0?p+(r-g):p,h=n>0?h:h+(r-g)),{step:c,tickMin:f.sub(new ct(h).mul(c)),tickMax:f.add(new ct(p).mul(c))})},w2=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[f,h]=J$([n,r]);if(f===-1/0||h===1/0){var p=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?p.reverse():p}if(f===h)return dse(f,i,s);var g=l==="snap125"?e5:kj,{step:v,tickMin:y,tickMax:S}=t5(f,h,c,s,0,g),w=X$(y,S.add(new ct(.1).mul(v)),v);return n>r?w.reverse():w},S2=function(t,n){var[r,i]=t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,f]=J$([r,i]);if(c===-1/0||f===1/0)return[r,i];if(c===f)return[c];var h=l==="snap125"?e5:kj,p=Math.max(n,2),g=h(new ct(f).sub(c).div(p-1),s,0),v=[...X$(new ct(c),new ct(f),g),f];return s===!1&&(v=v.map(y=>Math.round(y))),r>i?v.reverse():v},fse=e=>e.rootProps.barCategoryGap,_v=e=>e.rootProps.stackOffset,n5=e=>e.rootProps.reverseStackOrder,Aj=e=>e.options.chartName,Ej=e=>e.rootProps.syncId,r5=e=>e.rootProps.syncMethod,Tj=e=>e.options.eventEmitter,hse=e=>e.rootProps.baseValue,Vn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},ko={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Fi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},kv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Av(e,t,n){if(n!=="auto")return n;if(e!=null)return ra(e,t)?"category":"number"}function j2(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 ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){pse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pse(e,t,n){return(t=mse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mse(e){var t=gse(e,"string");return typeof t=="symbol"?t:t+""}function gse(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 N2={allowDataOverflow:ko.allowDataOverflow,allowDecimals:ko.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:ko.angleAxisId,includeHidden:!1,name:void 0,reversed:ko.reversed,scale:ko.scale,tick:ko.tick,tickCount:void 0,ticks:void 0,type:ko.type,unit:void 0,niceTicks:"auto"},C2={allowDataOverflow:Fi.allowDataOverflow,allowDecimals:Fi.allowDecimals,allowDuplicatedCategory:Fi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Fi.radiusAxisId,includeHidden:Fi.includeHidden,name:void 0,reversed:Fi.reversed,scale:Fi.scale,tick:Fi.tick,tickCount:Fi.tickCount,ticks:void 0,type:Fi.type,unit:void 0,niceTicks:"auto"},vse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Pj=te([vse,_$],(e,t)=>{var n;if(e!=null)return e;var r=(n=Av(t,"angleAxis",N2.type))!==null&&n!==void 0?n:"category";return ng(ng({},N2),{},{type:r})}),yse=(e,t)=>e.polarAxis.radiusAxis[t],zj=te([yse,_$],(e,t)=>{var n;if(e!=null)return e;var r=(n=Av(t,"radiusAxis",C2.type))!==null&&n!==void 0?n:"category";return ng(ng({},C2),{},{type:r})}),Ev=e=>e.polarOptions,Mj=te([Fa,Ka,Un],qae),i5=te([Ev,Mj],(e,t)=>{if(e!=null)return Hs(e.innerRadius,t,0)}),a5=te([Ev,Mj],(e,t)=>{if(e!=null)return Hs(e.outerRadius,t,t*.8)}),bse=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},s5=te([Ev],bse);te([Pj,s5],kv);var o5=te([Mj,i5,a5],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});te([zj,o5],kv);var l5=te([Kt,Ev,i5,a5,Fa,Ka],(e,t,n,r,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:f,endAngle:h}=t;return{cx:Hs(l,i,i/2),cy:Hs(c,s,s/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),Cn=(e,t)=>t,Tv=(e,t,n)=>n;function Rj(e){return e?.id}function c5(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=n,l=new Map;return e.forEach(c=>{var f,h=(f=c.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var p=Rj(c);h.forEach((g,v)=>{var y=s==null||i?v:String(Nn(g,s,null)),S=Nn(g,c.dataKey,0),w;l.has(y)?w=l.get(y):w={},Object.assign(w,{[p]:S}),l.set(y,w)})}}),Array.from(l.values())}function Dj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Pv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function zv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function xse(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 On=e=>{var t=Kt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},du=e=>e.tooltip.settings.axisId;function Ij(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(s){function l(){return s.apply(this,arguments)}return l.toString=function(){return s.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(s){var l=i[0],c=i[1];return l<=c?s>=l&&s<=c:s>=c&&s<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?s=>t.call(e,s):void 0,map:(s,l)=>{var c=e(s);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var wse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Wi(t)){for(var n,r,i=0;i<t.length;i++){var s=t[i];Ye(s)&&((n===void 0||s<n)&&(n=s),(r===void 0||s>r)&&(r=s))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function $s(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Sse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Lj(e){let t,n,r;e.length!==2?(t=$s,n=(c,f)=>$s(e(c),f),r=(c,f)=>e(c)-f):(t=e===$s||e===Sse?e:jse,n=e,r=e);function i(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<0?h=g+1:p=g}while(h<p)}return h}function s(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<=0?h=g+1:p=g}while(h<p)}return h}function l(c,f,h=0,p=c.length){const g=i(c,f,h,p-1);return g>h&&r(c[g-1],f)>-r(c[g],f)?g-1:g}return{left:i,center:l,right:s}}function jse(){return 0}function u5(e){return e===null?NaN:+e}function*Nse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Cse=Lj($s),Ef=Cse.right;Lj(u5).center;class O2 extends Map{constructor(t,n=kse){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(_2(this,t))}has(t){return super.has(_2(this,t))}set(t,n){return super.set(Ose(this,t),n)}delete(t){return super.delete(_se(this,t))}}function _2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ose({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function _se({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function kse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ase(e=$s){if(e===$s)return d5;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 d5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Ese=Math.sqrt(50),Tse=Math.sqrt(10),Pse=Math.sqrt(2);function rg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=Ese?10:s>=Tse?5:s>=Pse?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/l,c=Math.round(e*h),f=Math.round(t*h),c/h<e&&++c,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,c=Math.round(e/h),f=Math.round(t/h),c*h<e&&++c,f*h>t&&--f),f<c&&.5<=n&&n<2?rg(e,t,n*2):[c,f,h]}function _S(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,l]=r?rg(t,e,n):rg(e,t,n);if(!(s>=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let h=0;h<c;++h)f[h]=(s-h)/-l;else for(let h=0;h<c;++h)f[h]=(s-h)*l;else if(l<0)for(let h=0;h<c;++h)f[h]=(i+h)/-l;else for(let h=0;h<c;++h)f[h]=(i+h)*l;return f}function kS(e,t,n){return t=+t,e=+e,n=+n,rg(e,t,n)[2]}function AS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?kS(t,e,n):kS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function k2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function A2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function f5(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?d5:Ase(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),g=.5*Math.exp(2*p/3),v=.5*Math.sqrt(p*g*(f-g)/f)*(h-f/2<0?-1:1),y=Math.max(n,Math.floor(t-h*g/f+v)),S=Math.min(r,Math.floor(t+(f-h)*g/f+v));f5(e,t,y,S,i)}const s=e[t];let l=n,c=r;for(bd(e,n,t),i(e[r],s)>0&&bd(e,n,r);l<c;){for(bd(e,l,c),++l,--c;i(e[l],s)<0;)++l;for(;i(e[c],s)>0;)--c}i(e[n],s)===0?bd(e,n,c):(++c,bd(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function bd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function zse(e,t,n){if(e=Float64Array.from(Nse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return A2(e);if(t>=1)return k2(e);var r,i=(r-1)*t,s=Math.floor(i),l=k2(f5(e,s).subarray(0,s+1)),c=A2(e.subarray(s+1));return l+(c-l)*(i-s)}}function Mse(e,t,n=u5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function Rse(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function hi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ha(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 ES=Symbol("implicit");function $j(){var e=new O2,t=[],n=[],r=ES;function i(s){let l=e.get(s);if(l===void 0){if(r!==ES)return r;e.set(s,l=t.push(s)-1)}return n[l%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new O2;for(const l of s)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return $j(t,n).unknown(r)},hi.apply(i,arguments),i}function Uj(){var e=$j().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,l,c=!1,f=0,h=0,p=.5;delete e.unknown;function g(){var v=t().length,y=i<r,S=y?i:r,w=y?r:i;s=(w-S)/Math.max(1,v-f+h*2),c&&(s=Math.floor(s)),S+=(w-S-s*(v-f))*p,l=s*(1-f),c&&(S=Math.round(S),l=Math.round(l));var N=Rse(v).map(function(C){return S+s*C});return n(y?N.reverse():N)}return e.domain=function(v){return arguments.length?(t(v),g()):t()},e.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,g()):[r,i]},e.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,c=!0,g()},e.bandwidth=function(){return l},e.step=function(){return s},e.round=function(v){return arguments.length?(c=!!v,g()):c},e.padding=function(v){return arguments.length?(f=Math.min(1,h=+v),g()):f},e.paddingInner=function(v){return arguments.length?(f=Math.min(1,v),g()):f},e.paddingOuter=function(v){return arguments.length?(h=+v,g()):h},e.align=function(v){return arguments.length?(p=Math.max(0,Math.min(1,v)),g()):p},e.copy=function(){return Uj(t(),[r,i]).round(c).paddingInner(f).paddingOuter(h).align(p)},hi.apply(g(),arguments)}function h5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return h5(t())},e}function Dse(){return h5(Uj.apply(null,arguments).paddingInner(1))}function Bj(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function p5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Tf(){}var of=.7,ig=1/of,Rc="\\s*([+-]?\\d+)\\s*",lf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ise=/^#([0-9a-f]{3,8})$/,Lse=new RegExp(`^rgb\\(${Rc},${Rc},${Rc}\\)$`),$se=new RegExp(`^rgb\\(${Qi},${Qi},${Qi}\\)$`),Use=new RegExp(`^rgba\\(${Rc},${Rc},${Rc},${lf}\\)$`),Bse=new RegExp(`^rgba\\(${Qi},${Qi},${Qi},${lf}\\)$`),qse=new RegExp(`^hsl\\(${lf},${Qi},${Qi}\\)$`),Fse=new RegExp(`^hsla\\(${lf},${Qi},${Qi},${lf}\\)$`),E2={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};Bj(Tf,cf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:T2,formatHex:T2,formatHex8:Kse,formatHsl:Hse,formatRgb:P2,toString:P2});function T2(){return this.rgb().formatHex()}function Kse(){return this.rgb().formatHex8()}function Hse(){return m5(this).formatHsl()}function P2(){return this.rgb().formatRgb()}function cf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ise.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?z2(t):n===3?new gr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lp(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=Lse.exec(e))?new gr(t[1],t[2],t[3],1):(t=$se.exec(e))?new gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Use.exec(e))?Lp(t[1],t[2],t[3],t[4]):(t=Bse.exec(e))?Lp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qse.exec(e))?D2(t[1],t[2]/100,t[3]/100,1):(t=Fse.exec(e))?D2(t[1],t[2]/100,t[3]/100,t[4]):E2.hasOwnProperty(e)?z2(E2[e]):e==="transparent"?new gr(NaN,NaN,NaN,0):null}function z2(e){return new gr(e>>16&255,e>>8&255,e&255,1)}function Lp(e,t,n,r){return r<=0&&(e=t=n=NaN),new gr(e,t,n,r)}function Gse(e){return e instanceof Tf||(e=cf(e)),e?(e=e.rgb(),new gr(e.r,e.g,e.b,e.opacity)):new gr}function TS(e,t,n,r){return arguments.length===1?Gse(e):new gr(e,t,n,r??1)}function gr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bj(gr,TS,p5(Tf,{brighter(e){return e=e==null?ig:Math.pow(ig,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?of:Math.pow(of,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gr(Jo(this.r),Jo(this.g),Jo(this.b),ag(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:M2,formatHex:M2,formatHex8:Vse,formatRgb:R2,toString:R2}));function M2(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function Vse(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function R2(){const e=ag(this.opacity);return`${e===1?"rgb(":"rgba("}${Jo(this.r)}, ${Jo(this.g)}, ${Jo(this.b)}${e===1?")":`, ${e})`}`}function ag(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Jo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=Jo(e),(e<16?"0":"")+e.toString(16)}function D2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ai(e,t,n,r)}function m5(e){if(e instanceof Ai)return new Ai(e.h,e.s,e.l,e.opacity);if(e instanceof Tf||(e=cf(e)),!e)return new Ai;if(e instanceof Ai)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n<r)*6:n===s?l=(r-t)/c+2:l=(t-n)/c+4,c/=f<.5?s+i:2-s-i,l*=60):c=f>0&&f<1?0:l,new Ai(l,c,f,e.opacity)}function Zse(e,t,n,r){return arguments.length===1?m5(e):new Ai(e,t,n,r??1)}function Ai(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bj(Ai,Zse,p5(Tf,{brighter(e){return e=e==null?ig:Math.pow(ig,e),new Ai(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?of:Math.pow(of,e),new Ai(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 gr(Zx(e>=240?e-240:e+120,i,r),Zx(e,i,r),Zx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ai(I2(this.h),$p(this.s),$p(this.l),ag(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=ag(this.opacity);return`${e===1?"hsl(":"hsla("}${I2(this.h)}, ${$p(this.s)*100}%, ${$p(this.l)*100}%${e===1?")":`, ${e})`}`}}));function I2(e){return e=(e||0)%360,e<0?e+360:e}function $p(e){return Math.max(0,Math.min(1,e||0))}function Zx(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 qj=e=>()=>e;function Yse(e,t){return function(n){return e+n*t}}function Wse(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 Qse(e){return(e=+e)==1?g5:function(t,n){return n-t?Wse(t,n,e):qj(isNaN(t)?n:t)}}function g5(e,t){var n=t-e;return n?Yse(e,n):qj(isNaN(e)?t:e)}const L2=(function e(t){var n=Qse(t);function r(i,s){var l=n((i=TS(i)).r,(s=TS(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),h=g5(i.opacity,s.opacity);return function(p){return i.r=l(p),i.g=c(p),i.b=f(p),i.opacity=h(p),i+""}}return r.gamma=e,r})(1);function Xse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Jse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eoe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),l;for(l=0;l<r;++l)i[l]=fu(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(c){for(l=0;l<r;++l)s[l]=i[l](c);return s}}function toe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function sg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function noe(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]=fu(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var PS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yx=new RegExp(PS.source,"g");function roe(e){return function(){return e}}function ioe(e){return function(t){return e(t)+""}}function aoe(e,t){var n=PS.lastIndex=Yx.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(r=PS.exec(e))&&(i=Yx.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:sg(r,i)})),n=Yx.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?ioe(f[0].x):roe(t):(t=f.length,function(h){for(var p=0,g;p<t;++p)c[(g=f[p]).i]=g.x(h);return c.join("")})}function fu(e,t){var n=typeof t,r;return t==null||n==="boolean"?qj(t):(n==="number"?sg:n==="string"?(r=cf(t))?(t=r,L2):aoe:t instanceof cf?L2:t instanceof Date?toe:Jse(t)?Xse:Array.isArray(t)?eoe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?noe:sg)(e,t)}function Fj(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function soe(e,t){t===void 0&&(t=e,e=fu);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(l){var c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return s[c](l-c)}}function ooe(e){return function(){return e}}function og(e){return+e}var $2=[0,1];function Jn(e){return e}function zS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ooe(isNaN(t)?NaN:.5)}function loe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function coe(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i<r?(r=zS(i,r),s=n(l,s)):(r=zS(r,i),s=n(s,l)),function(c){return s(r(c))}}function uoe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=zS(e[l],e[l+1]),s[l]=n(t[l],t[l+1]);return function(c){var f=Ef(e,c,1,r)-1;return s[f](i[f](c))}}function Pf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Mv(){var e=$2,t=$2,n=fu,r,i,s,l=Jn,c,f,h;function p(){var v=Math.min(e.length,t.length);return l!==Jn&&(l=loe(e[0],e[v-1])),c=v>2?uoe:coe,f=h=null,g}function g(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return g.invert=function(v){return l(i((h||(h=c(t,e.map(r),sg)))(v)))},g.domain=function(v){return arguments.length?(e=Array.from(v,og),p()):e.slice()},g.range=function(v){return arguments.length?(t=Array.from(v),p()):t.slice()},g.rangeRound=function(v){return t=Array.from(v),n=Fj,p()},g.clamp=function(v){return arguments.length?(l=v?!0:Jn,p()):l!==Jn},g.interpolate=function(v){return arguments.length?(n=v,p()):n},g.unknown=function(v){return arguments.length?(s=v,g):s},function(v,y){return r=v,i=y,p()}}function Kj(){return Mv()(Jn,Jn)}function doe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lg(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 Gc(e){return e=lg(Math.abs(e)),e?e[1]:NaN}function foe(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function hoe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var poe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uf(e){if(!(t=poe.exec(e)))throw new Error("invalid format: "+e);var t;return new Hj({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]})}uf.prototype=Hj.prototype;function Hj(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+""}Hj.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 moe(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 cg;function goe(e,t){var n=lg(e,t);if(!n)return cg=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(cg=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+lg(e,Math.max(0,t+s-1))[0]}function U2(e,t){var n=lg(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 B2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:doe,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)=>U2(e*100,t),r:U2,s:goe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function q2(e){return e}var F2=Array.prototype.map,K2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function voe(e){var t=e.grouping===void 0||e.thousands===void 0?q2:foe(F2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?q2:hoe(F2.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,v){g=uf(g);var y=g.fill,S=g.align,w=g.sign,N=g.symbol,C=g.zero,E=g.width,k=g.comma,O=g.precision,T=g.trim,z=g.type;z==="n"?(k=!0,z="g"):B2[z]||(O===void 0&&(O=12),T=!0,z="g"),(C||y==="0"&&S==="=")&&(C=!0,y="0",S="=");var A=(v&&v.prefix!==void 0?v.prefix:"")+(N==="$"?n:N==="#"&&/[boxX]/.test(z)?"0"+z.toLowerCase():""),P=(N==="$"?r:/[%p]/.test(z)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),R=B2[z],B=/[defgprs%]/.test(z);O=O===void 0?6:/[gprs]/.test(z)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function $(L){var re=A,ge=P,be,H,ee;if(z==="c")ge=R(L)+ge,L="";else{L=+L;var ye=L<0||1/L<0;if(L=isNaN(L)?f:R(Math.abs(L),O),T&&(L=moe(L)),ye&&+L==0&&w!=="+"&&(ye=!1),re=(ye?w==="("?w:c:w==="-"||w==="("?"":w)+re,ge=(z==="s"&&!isNaN(L)&&cg!==void 0?K2[8+cg/3]:"")+ge+(ye&&w==="("?")":""),B){for(be=-1,H=L.length;++be<H;)if(ee=L.charCodeAt(be),48>ee||ee>57){ge=(ee===46?i+L.slice(be+1):L.slice(be))+ge,L=L.slice(0,be);break}}}k&&!C&&(L=t(L,1/0));var Se=re.length+L.length+ge.length,q=Se<E?new Array(E-Se+1).join(y):"";switch(k&&C&&(L=t(q+L,q.length?E-ge.length:1/0),q=""),S){case"<":L=re+L+ge+q;break;case"=":L=re+q+L+ge;break;case"^":L=q.slice(0,Se=q.length>>1)+re+L+ge+q.slice(Se);break;default:L=q+re+L+ge;break}return s(L)}return $.toString=function(){return g+""},$}function p(g,v){var y=Math.max(-8,Math.min(8,Math.floor(Gc(v)/3)))*3,S=Math.pow(10,-y),w=h((g=uf(g),g.type="f",g),{suffix:K2[8+y/3]});return function(N){return w(S*N)}}return{format:h,formatPrefix:p}}var Up,Gj,v5;yoe({thousands:",",grouping:[3],currency:["$",""]});function yoe(e){return Up=voe(e),Gj=Up.format,v5=Up.formatPrefix,Up}function boe(e){return Math.max(0,-Gc(Math.abs(e)))}function xoe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gc(t)/3)))*3-Gc(Math.abs(e)))}function woe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gc(t)-Gc(e))+1}function y5(e,t,n,r){var i=AS(e,t,n),s;switch(r=uf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=xoe(i,l))&&(r.precision=s),v5(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=woe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=boe(i))&&(r.precision=s-(r.type==="%")*2);break}}return Gj(r)}function Js(e){var t=e.domain;return e.ticks=function(n){var r=t();return _S(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return y5(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,h,p=10;for(c<l&&(h=l,l=c,c=h,h=i,i=s,s=h);p-- >0;){if(h=kS(l,c,n),h===f)return r[i]=l,r[s]=c,t(r);if(h>0)l=Math.floor(l/h)*h,c=Math.ceil(c/h)*h;else if(h<0)l=Math.ceil(l*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function b5(){var e=Kj();return e.copy=function(){return Pf(e,b5())},hi.apply(e,arguments),Js(e)}function x5(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,og),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return x5(e).unknown(t)},e=arguments.length?Array.from(e,og):[0,1],Js(n)}function w5(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return s<i&&(l=n,n=r,r=l,l=i,i=s,s=l),e[n]=t.floor(i),e[r]=t.ceil(s),e}function H2(e){return Math.log(e)}function G2(e){return Math.exp(e)}function Soe(e){return-Math.log(-e)}function joe(e){return-Math.exp(-e)}function Noe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Coe(e){return e===10?Noe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ooe(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 V2(e){return(t,n)=>-e(-t,n)}function Vj(e){const t=e(H2,G2),n=t.domain;let r=10,i,s;function l(){return i=Ooe(r),s=Coe(r),n()[0]<0?(i=V2(i),s=V2(s),e(Soe,joe)):e(H2,G2),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let h=f[0],p=f[f.length-1];const g=p<h;g&&([h,p]=[p,h]);let v=i(h),y=i(p),S,w;const N=c==null?10:+c;let C=[];if(!(r%1)&&y-v<N){if(v=Math.floor(v),y=Math.ceil(y),h>0){for(;v<=y;++v)for(S=1;S<r;++S)if(w=v<0?S/s(-v):S*s(v),!(w<h)){if(w>p)break;C.push(w)}}else for(;v<=y;++v)for(S=r-1;S>=1;--S)if(w=v>0?S/s(-v):S*s(v),!(w<h)){if(w>p)break;C.push(w)}C.length*2<N&&(C=_S(h,p,N))}else C=_S(v,y,Math.min(y-v,N)).map(s);return g?C.reverse():C},t.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=uf(f)).precision==null&&(f.trim=!0),f=Gj(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return p=>{let g=p/s(Math.round(i(p)));return g*r<r-.5&&(g*=r),g<=h?f(p):""}},t.nice=()=>n(w5(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function S5(){const e=Vj(Mv()).domain([1,10]);return e.copy=()=>Pf(e,S5()).base(e.base()),hi.apply(e,arguments),e}function Z2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Y2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Zj(e){var t=1,n=e(Z2(t),Y2(t));return n.constant=function(r){return arguments.length?e(Z2(t=+r),Y2(t)):t},Js(n)}function j5(){var e=Zj(Mv());return e.copy=function(){return Pf(e,j5()).constant(e.constant())},hi.apply(e,arguments)}function W2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function _oe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function koe(e){return e<0?-e*e:e*e}function Yj(e){var t=e(Jn,Jn),n=1;function r(){return n===1?e(Jn,Jn):n===.5?e(_oe,koe):e(W2(n),W2(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Js(t)}function Wj(){var e=Yj(Mv());return e.copy=function(){return Pf(e,Wj()).exponent(e.exponent())},hi.apply(e,arguments),e}function Aoe(){return Wj.apply(null,arguments).exponent(.5)}function Q2(e){return Math.sign(e)*e*e}function Eoe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function N5(){var e=Kj(),t=[0,1],n=!1,r;function i(s){var l=Eoe(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(Q2(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,og)).map(Q2)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return N5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},hi.apply(i,arguments),Js(i)}function C5(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=Mse(e,l/c);return s}function s(l){return l==null||isNaN(l=+l)?r:t[Ef(n,l)]}return s.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},s.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort($s),i()},s.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},s.unknown=function(l){return arguments.length?(r=l,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return C5().domain(e).range(t).unknown(r)},hi.apply(s,arguments)}function O5(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function l(f){return f!=null&&f<=f?i[Ef(r,f,0,n)]:s}function c(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,c()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,c()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return O5().domain([e,t]).range(i).unknown(s)},hi.apply(Js(l),arguments)}function _5(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[Ef(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return _5().domain(e).range(t).unknown(n)},hi.apply(i,arguments)}const Wx=new Date,Qx=new Date;function xn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l<c-s?l:c},i.offset=(s,l)=>(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s<l)||!(c>0))return f;let h;do f.push(h=new Date(+s)),t(s,c),e(s);while(h<s&&s<l);return f},i.filter=s=>xn(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(Wx.setTime(+s),Qx.setTime(+l),e(Wx),e(Qx),Math.floor(n(Wx,Qx))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const ug=xn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ug.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ug);ug.range;const za=1e3,ii=za*60,Ma=ii*60,$a=Ma*24,Qj=$a*7,X2=$a*30,Xx=$a*365,Ko=xn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*za)},(e,t)=>(t-e)/za,e=>e.getUTCSeconds());Ko.range;const Xj=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*za)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getMinutes());Xj.range;const Jj=xn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCMinutes());Jj.range;const eN=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*za-e.getMinutes()*ii)},(e,t)=>{e.setTime(+e+t*Ma)},(e,t)=>(t-e)/Ma,e=>e.getHours());eN.range;const tN=xn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ma)},(e,t)=>(t-e)/Ma,e=>e.getUTCHours());tN.range;const zf=xn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ii)/$a,e=>e.getDate()-1);zf.range;const Rv=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);Rv.range;const k5=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));k5.range;function wl(e){return xn(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())*ii)/Qj)}const Dv=wl(0),dg=wl(1),Toe=wl(2),Poe=wl(3),Vc=wl(4),zoe=wl(5),Moe=wl(6);Dv.range;dg.range;Toe.range;Poe.range;Vc.range;zoe.range;Moe.range;function Sl(e){return xn(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)/Qj)}const Iv=Sl(0),fg=Sl(1),Roe=Sl(2),Doe=Sl(3),Zc=Sl(4),Ioe=Sl(5),Loe=Sl(6);Iv.range;fg.range;Roe.range;Doe.range;Zc.range;Ioe.range;Loe.range;const nN=xn(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());nN.range;const rN=xn(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());rN.range;const Ua=xn(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());Ua.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(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)});Ua.range;const Ba=xn(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());Ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(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)});Ba.range;function A5(e,t,n,r,i,s){const l=[[Ko,1,za],[Ko,5,5*za],[Ko,15,15*za],[Ko,30,30*za],[s,1,ii],[s,5,5*ii],[s,15,15*ii],[s,30,30*ii],[i,1,Ma],[i,3,3*Ma],[i,6,6*Ma],[i,12,12*Ma],[r,1,$a],[r,2,2*$a],[n,1,Qj],[t,1,X2],[t,3,3*X2],[e,1,Xx]];function c(h,p,g){const v=p<h;v&&([h,p]=[p,h]);const y=g&&typeof g.range=="function"?g:f(h,p,g),S=y?y.range(h,+p+1):[];return v?S.reverse():S}function f(h,p,g){const v=Math.abs(p-h)/g,y=Lj(([,,N])=>N).right(l,v);if(y===l.length)return e.every(AS(h/Xx,p/Xx,g));if(y===0)return ug.every(Math.max(AS(h,p,g),1));const[S,w]=l[v/l[y-1][2]<l[y][2]/v?y-1:y];return S.every(w)}return[c,f]}const[$oe,Uoe]=A5(Ba,rN,Iv,k5,tN,Jj),[Boe,qoe]=A5(Ua,nN,Dv,zf,eN,Xj);function Jx(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 ew(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 xd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Foe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,l=e.shortDays,c=e.months,f=e.shortMonths,h=wd(i),p=Sd(i),g=wd(s),v=Sd(s),y=wd(l),S=Sd(l),w=wd(c),N=Sd(c),C=wd(f),E=Sd(f),k={a:ee,A:ye,b:Se,B:q,c:null,d:iz,e:iz,f:fle,g:Sle,G:Nle,H:cle,I:ule,j:dle,L:E5,m:hle,M:ple,p:D,q:G,Q:oz,s:lz,S:mle,u:gle,U:vle,V:yle,w:ble,W:xle,x:null,X:null,y:wle,Y:jle,Z:Cle,"%":sz},O={a:ae,A:Y,b:ie,B:oe,c:null,d:az,e:az,f:Ale,g:$le,G:Ble,H:Ole,I:_le,j:kle,L:P5,m:Ele,M:Tle,p:ue,q:we,Q:oz,s:lz,S:Ple,u:zle,U:Mle,V:Rle,w:Dle,W:Ile,x:null,X:null,y:Lle,Y:Ule,Z:qle,"%":sz},T={a:B,A:$,b:L,B:re,c:ge,d:nz,e:nz,f:ale,g:tz,G:ez,H:rz,I:rz,j:tle,L:ile,m:ele,M:nle,p:R,q:Joe,Q:ole,s:lle,S:rle,u:Zoe,U:Yoe,V:Woe,w:Voe,W:Qoe,x:be,X:H,y:tz,Y:ez,Z:Xoe,"%":sle};k.x=z(n,k),k.X=z(r,k),k.c=z(t,k),O.x=z(n,O),O.X=z(r,O),O.c=z(t,O);function z(W,le){return function(je){var V=[],Be=-1,ze=0,Je=W.length,et,Ot,It;for(je instanceof Date||(je=new Date(+je));++Be<Je;)W.charCodeAt(Be)===37&&(V.push(W.slice(ze,Be)),(Ot=J2[et=W.charAt(++Be)])!=null?et=W.charAt(++Be):Ot=et==="e"?" ":"0",(It=le[et])&&(et=It(je,Ot)),V.push(et),ze=Be+1);return V.push(W.slice(ze,Be)),V.join("")}}function A(W,le){return function(je){var V=xd(1900,void 0,1),Be=P(V,W,je+="",0),ze,Je;if(Be!=je.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(le&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(ze=ew(xd(V.y,0,1)),Je=ze.getUTCDay(),ze=Je>4||Je===0?fg.ceil(ze):fg(ze),ze=Rv.offset(ze,(V.V-1)*7),V.y=ze.getUTCFullYear(),V.m=ze.getUTCMonth(),V.d=ze.getUTCDate()+(V.w+6)%7):(ze=Jx(xd(V.y,0,1)),Je=ze.getDay(),ze=Je>4||Je===0?dg.ceil(ze):dg(ze),ze=zf.offset(ze,(V.V-1)*7),V.y=ze.getFullYear(),V.m=ze.getMonth(),V.d=ze.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Je="Z"in V?ew(xd(V.y,0,1)).getUTCDay():Jx(xd(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Je+5)%7:V.w+V.U*7-(Je+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,ew(V)):Jx(V)}}function P(W,le,je,V){for(var Be=0,ze=le.length,Je=je.length,et,Ot;Be<ze;){if(V>=Je)return-1;if(et=le.charCodeAt(Be++),et===37){if(et=le.charAt(Be++),Ot=T[et in J2?le.charAt(Be++):et],!Ot||(V=Ot(W,je,V))<0)return-1}else if(et!=je.charCodeAt(V++))return-1}return V}function R(W,le,je){var V=h.exec(le.slice(je));return V?(W.p=p.get(V[0].toLowerCase()),je+V[0].length):-1}function B(W,le,je){var V=y.exec(le.slice(je));return V?(W.w=S.get(V[0].toLowerCase()),je+V[0].length):-1}function $(W,le,je){var V=g.exec(le.slice(je));return V?(W.w=v.get(V[0].toLowerCase()),je+V[0].length):-1}function L(W,le,je){var V=C.exec(le.slice(je));return V?(W.m=E.get(V[0].toLowerCase()),je+V[0].length):-1}function re(W,le,je){var V=w.exec(le.slice(je));return V?(W.m=N.get(V[0].toLowerCase()),je+V[0].length):-1}function ge(W,le,je){return P(W,t,le,je)}function be(W,le,je){return P(W,n,le,je)}function H(W,le,je){return P(W,r,le,je)}function ee(W){return l[W.getDay()]}function ye(W){return s[W.getDay()]}function Se(W){return f[W.getMonth()]}function q(W){return c[W.getMonth()]}function D(W){return i[+(W.getHours()>=12)]}function G(W){return 1+~~(W.getMonth()/3)}function ae(W){return l[W.getUTCDay()]}function Y(W){return s[W.getUTCDay()]}function ie(W){return f[W.getUTCMonth()]}function oe(W){return c[W.getUTCMonth()]}function ue(W){return i[+(W.getUTCHours()>=12)]}function we(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var le=z(W+="",k);return le.toString=function(){return W},le},parse:function(W){var le=A(W+="",!1);return le.toString=function(){return W},le},utcFormat:function(W){var le=z(W+="",O);return le.toString=function(){return W},le},utcParse:function(W){var le=A(W+="",!0);return le.toString=function(){return W},le}}}var J2={"-":"",_:" ",0:"0"},_n=/^\s*\d+/,Koe=/^%/,Hoe=/[\\^$*+?|[\]().{}]/g;function mt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Goe(e){return e.replace(Hoe,"\\$&")}function wd(e){return new RegExp("^(?:"+e.map(Goe).join("|")+")","i")}function Sd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Voe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Zoe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Yoe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Woe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Qoe(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ez(e,t,n){var r=_n.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tz(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xoe(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 Joe(e,t,n){var r=_n.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ele(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nz(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function tle(e,t,n){var r=_n.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function rz(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function nle(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function rle(e,t,n){var r=_n.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ile(e,t,n){var r=_n.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ale(e,t,n){var r=_n.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function sle(e,t,n){var r=Koe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ole(e,t,n){var r=_n.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function lle(e,t,n){var r=_n.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function iz(e,t){return mt(e.getDate(),t,2)}function cle(e,t){return mt(e.getHours(),t,2)}function ule(e,t){return mt(e.getHours()%12||12,t,2)}function dle(e,t){return mt(1+zf.count(Ua(e),e),t,3)}function E5(e,t){return mt(e.getMilliseconds(),t,3)}function fle(e,t){return E5(e,t)+"000"}function hle(e,t){return mt(e.getMonth()+1,t,2)}function ple(e,t){return mt(e.getMinutes(),t,2)}function mle(e,t){return mt(e.getSeconds(),t,2)}function gle(e){var t=e.getDay();return t===0?7:t}function vle(e,t){return mt(Dv.count(Ua(e)-1,e),t,2)}function T5(e){var t=e.getDay();return t>=4||t===0?Vc(e):Vc.ceil(e)}function yle(e,t){return e=T5(e),mt(Vc.count(Ua(e),e)+(Ua(e).getDay()===4),t,2)}function ble(e){return e.getDay()}function xle(e,t){return mt(dg.count(Ua(e)-1,e),t,2)}function wle(e,t){return mt(e.getFullYear()%100,t,2)}function Sle(e,t){return e=T5(e),mt(e.getFullYear()%100,t,2)}function jle(e,t){return mt(e.getFullYear()%1e4,t,4)}function Nle(e,t){var n=e.getDay();return e=n>=4||n===0?Vc(e):Vc.ceil(e),mt(e.getFullYear()%1e4,t,4)}function Cle(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+mt(t/60|0,"0",2)+mt(t%60,"0",2)}function az(e,t){return mt(e.getUTCDate(),t,2)}function Ole(e,t){return mt(e.getUTCHours(),t,2)}function _le(e,t){return mt(e.getUTCHours()%12||12,t,2)}function kle(e,t){return mt(1+Rv.count(Ba(e),e),t,3)}function P5(e,t){return mt(e.getUTCMilliseconds(),t,3)}function Ale(e,t){return P5(e,t)+"000"}function Ele(e,t){return mt(e.getUTCMonth()+1,t,2)}function Tle(e,t){return mt(e.getUTCMinutes(),t,2)}function Ple(e,t){return mt(e.getUTCSeconds(),t,2)}function zle(e){var t=e.getUTCDay();return t===0?7:t}function Mle(e,t){return mt(Iv.count(Ba(e)-1,e),t,2)}function z5(e){var t=e.getUTCDay();return t>=4||t===0?Zc(e):Zc.ceil(e)}function Rle(e,t){return e=z5(e),mt(Zc.count(Ba(e),e)+(Ba(e).getUTCDay()===4),t,2)}function Dle(e){return e.getUTCDay()}function Ile(e,t){return mt(fg.count(Ba(e)-1,e),t,2)}function Lle(e,t){return mt(e.getUTCFullYear()%100,t,2)}function $le(e,t){return e=z5(e),mt(e.getUTCFullYear()%100,t,2)}function Ule(e,t){return mt(e.getUTCFullYear()%1e4,t,4)}function Ble(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zc(e):Zc.ceil(e),mt(e.getUTCFullYear()%1e4,t,4)}function qle(){return"+0000"}function sz(){return"%"}function oz(e){return+e}function lz(e){return Math.floor(+e/1e3)}var hc,M5,R5;Fle({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 Fle(e){return hc=Foe(e),M5=hc.format,hc.parse,R5=hc.utcFormat,hc.utcParse,hc}function Kle(e){return new Date(e)}function Hle(e){return e instanceof Date?+e:+new Date(+e)}function iN(e,t,n,r,i,s,l,c,f,h){var p=Kj(),g=p.invert,v=p.domain,y=h(".%L"),S=h(":%S"),w=h("%I:%M"),N=h("%I %p"),C=h("%a %d"),E=h("%b %d"),k=h("%B"),O=h("%Y");function T(z){return(f(z)<z?y:c(z)<z?S:l(z)<z?w:s(z)<z?N:r(z)<z?i(z)<z?C:E:n(z)<z?k:O)(z)}return p.invert=function(z){return new Date(g(z))},p.domain=function(z){return arguments.length?v(Array.from(z,Hle)):v().map(Kle)},p.ticks=function(z){var A=v();return e(A[0],A[A.length-1],z??10)},p.tickFormat=function(z,A){return A==null?T:h(A)},p.nice=function(z){var A=v();return(!z||typeof z.range!="function")&&(z=t(A[0],A[A.length-1],z??10)),z?v(w5(A,z)):p},p.copy=function(){return Pf(p,iN(e,t,n,r,i,s,l,c,f,h))},p}function Gle(){return hi.apply(iN(Boe,qoe,Ua,nN,Dv,zf,eN,Xj,Ko,M5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Vle(){return hi.apply(iN($oe,Uoe,Ba,rN,Iv,Rv,tN,Jj,Ko,R5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lv(){var e=0,t=1,n,r,i,s,l=Jn,c=!1,f;function h(g){return g==null||isNaN(g=+g)?f:l(i===0?.5:(g=(s(g)-n)*i,c?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t]=g,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(g){return arguments.length?(c=!!g,h):c},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(v){var y,S;return arguments.length?([y,S]=v,l=g(y,S),h):[l(0),l(1)]}}return h.range=p(fu),h.rangeRound=p(Fj),h.unknown=function(g){return arguments.length?(f=g,h):f},function(g){return s=g,n=g(e),r=g(t),i=n===r?0:1/(r-n),h}}function eo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function D5(){var e=Js(Lv()(Jn));return e.copy=function(){return eo(e,D5())},Ha.apply(e,arguments)}function I5(){var e=Vj(Lv()).domain([1,10]);return e.copy=function(){return eo(e,I5()).base(e.base())},Ha.apply(e,arguments)}function L5(){var e=Zj(Lv());return e.copy=function(){return eo(e,L5()).constant(e.constant())},Ha.apply(e,arguments)}function aN(){var e=Yj(Lv());return e.copy=function(){return eo(e,aN()).exponent(e.exponent())},Ha.apply(e,arguments)}function Zle(){return aN.apply(null,arguments).exponent(.5)}function $5(){var e=[],t=Jn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ef(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($s),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>zse(e,s/r))},n.copy=function(){return $5(t).domain(e)},Ha.apply(n,arguments)}function $v(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,h=Jn,p,g=!1,v;function y(w){return isNaN(w=+w)?v:(w=.5+((w=+p(w))-s)*(r*w<r*s?c:f),h(g?Math.max(0,Math.min(1,w)):w))}y.domain=function(w){return arguments.length?([e,t,n]=w,i=p(e=+e),s=p(t=+t),l=p(n=+n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y):[e,t,n]},y.clamp=function(w){return arguments.length?(g=!!w,y):g},y.interpolator=function(w){return arguments.length?(h=w,y):h};function S(w){return function(N){var C,E,k;return arguments.length?([C,E,k]=N,h=soe(w,[C,E,k]),y):[h(0),h(.5),h(1)]}}return y.range=S(fu),y.rangeRound=S(Fj),y.unknown=function(w){return arguments.length?(v=w,y):v},function(w){return p=w,i=w(e),s=w(t),l=w(n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y}}function U5(){var e=Js($v()(Jn));return e.copy=function(){return eo(e,U5())},Ha.apply(e,arguments)}function B5(){var e=Vj($v()).domain([.1,1,10]);return e.copy=function(){return eo(e,B5()).base(e.base())},Ha.apply(e,arguments)}function q5(){var e=Zj($v());return e.copy=function(){return eo(e,q5()).constant(e.constant())},Ha.apply(e,arguments)}function sN(){var e=Yj($v());return e.copy=function(){return eo(e,sN()).exponent(e.exponent())},Ha.apply(e,arguments)}function Yle(){return sN.apply(null,arguments).exponent(.5)}const F5=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Uj,scaleDiverging:U5,scaleDivergingLog:B5,scaleDivergingPow:sN,scaleDivergingSqrt:Yle,scaleDivergingSymlog:q5,scaleIdentity:x5,scaleImplicit:ES,scaleLinear:b5,scaleLog:S5,scaleOrdinal:$j,scalePoint:Dse,scalePow:Wj,scaleQuantile:C5,scaleQuantize:O5,scaleRadial:N5,scaleSequential:D5,scaleSequentialLog:I5,scaleSequentialPow:aN,scaleSequentialQuantile:$5,scaleSequentialSqrt:Zle,scaleSequentialSymlog:L5,scaleSqrt:Aoe,scaleSymlog:j5,scaleThreshold:_5,scaleTime:Gle,scaleUtc:Vle,tickFormat:y5},Symbol.toStringTag,{value:"Module"}));function Wle(e){var t=F5;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(wf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function cz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Wle(e);if(r!=null)return r.domain(t).range(n),r}}function oN(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?cz(e.scale,n,r):cz(t,n,r)}function Qle(e){return"scale".concat(wf(e))}function Xle(e){return Qle(e)in F5}var K5=(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 Xle(r)?r:"point"}};function Jle(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var s=Math.floor((n+r)/2);(i?e[s]<t:e[s]>t)?n=s+1:r=s}return n}function H5(e,t){if(e){var n=t??e.domain(),r=n.map(s=>{var l;return(l=e(s))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return s=>{var l,c,f=Jle(r,s);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,p=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(s-h)<=Math.abs(s-p)?n[f-1]:n[f]}}}function ece(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):H5(e,void 0)}function uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uz(Object(n),!0).forEach(function(r){tce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tce(e,t,n){return(t=nce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nce(e){var t=rce(e,"string");return typeof t=="symbol"?t:t+""}function rce(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 MS=[0,"auto"],vn={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"},G5=(e,t)=>e.cartesianAxis.xAxis[t],ia=(e,t)=>{var n=G5(e,t);return n??vn},yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:MS,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:Nf},V5=(e,t)=>e.cartesianAxis.yAxis[t],aa=(e,t)=>{var n=V5(e,t);return n??yn},ice={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:""},lN=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??ice},ar=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);case"zAxis":return lN(e,n);case"angleAxis":return Pj(e,n);case"radiusAxis":return zj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},ace=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Mf=(e,t,n)=>{switch(t){case"xAxis":return ia(e,n);case"yAxis":return aa(e,n);case"angleAxis":return Pj(e,n);case"radiusAxis":return zj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Z5=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Y5(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 W5=e=>e.graphicalItems.cartesianItems,sce=te([Cn,Tv],Y5),Q5=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),hu=te([W5,ar,sce],Q5,{memoizeOptions:{resultEqualityCheck:zv}}),X5=te([hu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Dj)),J5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),oce=te([hu],J5),e3=e=>e.map(t=>t.data).filter(Boolean).flat(1),lce=te([hu],e=>e.some(t=>!t.data)),t3=te([hu],e3,{memoizeOptions:{resultEqualityCheck:zv}}),n3=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},cN=te([t3,Ov],n3),cce=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Nn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Nn(i,r)}))):e.map(r=>({value:r})),r3=(e,t,n,r,i,s)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:f}=r,h=cce(e,t,n);if(i&&t?.dataKey!=null&&s.length>0){var p=l.slice(c,f+1),g=p.map(v=>({value:Nn(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...h]}return h},Rf=te([cN,ar,hu,Ov,lce,t3],r3);function Dc(e){if(oi(e)||e instanceof Date){var t=Number(e);if(Ye(t))return t}}function dz(e){if(Array.isArray(e)){var t=[Dc(e[0]),Dc(e[1])];return Wi(t)?t:void 0}var n=Dc(e);if(n!=null)return[n,n]}function na(e){return e.map(Dc).filter(mr)}function uce(e,t){var n=Dc(e),r=Dc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var dce=te([Rf],e=>e?.map(t=>t.value).sort(uce));function i3(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function fce(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Ji(t))r=t;else if(Array.isArray(t)){var i=na(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:na(n.flatMap(s=>{var l=Nn(e,s.dataKey),c,f;if(Array.isArray(l)?[c,f]=l:c=f=l,!(!Ye(c)||!Ye(f)))return[r-c,r+f]}))}var wn=e=>{var t=On(e),n=du(e);return Mf(e,t,n)},Yc=te([wn],e=>e?.dataKey),hce=te([X5,Ov,wn],c5),a3=(e,t,n,r)=>{var i={},s=t.reduce((l,c)=>{if(c.stackId==null)return l;var f=l[c.stackId];return f==null&&(f=[]),f.push(c),l[c.stackId]=f,l},i);return Object.fromEntries(Object.entries(s).map(l=>{var[c,f]=l,h=r?[...f].reverse():f,p=h.map(Rj);return[c,{stackedData:Gne(e,p,n),graphicalItems:h}]}))},s3=te([hce,X5,_v,n5],a3),o3=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var l=Wne(e,i,s);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},pce=te([ar],e=>e.allowDataOverflow),uN=e=>{var t;if(e==null||!("domain"in e))return MS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=na(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:MS},l3=te([ar],uN),c3=te([l3,pce],H$),mce=te([s3,Ii,Cn,c3],o3,{memoizeOptions:{resultEqualityCheck:Pv}}),dN=e=>e.errorBars,gce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>i3(n,r)),pg=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var s=i.flat(),l=Math.min(...s),c=Math.max(...s);return[l,c]}},u3=function(t,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(r.length>0&&r.forEach(h=>{var p,g=h.data!=null?[...h.data]:l,v=(p=i[h.id])===null||p===void 0?void 0:p.filter(y=>i3(s,y));g.forEach(y=>{var S,w=Nn(y,(S=n.dataKey)!==null&&S!==void 0?S:h.dataKey),N=fce(y,w,v);if(N.length>=2){var C=Math.min(...N),E=Math.max(...N);(c==null||C<c)&&(c=C),(f==null||E>f)&&(f=E)}var k=dz(w);k!=null&&(c=c==null?k[0]:Math.min(c,k[0]),f=f==null?k[1]:Math.max(f,k[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(h=>{var p=dz(Nn(h,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),Ye(c)&&Ye(f))return[c,f]},vce=te([cN,ar,oce,dN,Cn,ase],u3,{memoizeOptions:{resultEqualityCheck:Pv}});function yce(e){var{value:t}=e;if(oi(t)||t instanceof Date)return t}var bce=(e,t,n)=>{var r=e.map(yce).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&xL(r))?K$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},d3=e=>e.referenceElements.dots,pu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),xce=te([d3,Cn,Tv],pu),f3=e=>e.referenceElements.areas,wce=te([f3,Cn,Tv],pu),h3=e=>e.referenceElements.lines,Sce=te([h3,Cn,Tv],pu),p3=(e,t)=>{if(e!=null){var n=na(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},jce=te(xce,Cn,p3),m3=(e,t)=>{if(e!=null){var n=na(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)]}},Nce=te([wce,Cn],m3);function Cce(e){var t;if(e.x!=null)return na([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:na(n)}function Oce(e){var t;if(e.y!=null)return na([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:na(n)}var g3=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Cce(r):Oce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},_ce=te([Sce,Cn],g3),kce=te(jce,_ce,Nce,(e,t,n)=>pg(e,n,t)),v3=(e,t,n,r,i,s,l,c)=>{if(n!=null)return n;var f=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",h=f?pg(r,s,i):pg(s,i);return ose(t,h,e.allowDataOverflow)},Ace=te([ar,l3,c3,mce,vce,kce,Kt,Cn],v3,{memoizeOptions:{resultEqualityCheck:Pv}}),Ece=[0,1],y3=(e,t,n,r,i,s,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:f}=e,h=ra(t,s);if(h&&c==null){var p;return K$(0,(p=n?.length)!==null&&p!==void 0?p:0)}return f==="category"?bce(r,e,h):i==="expand"&&!h?Ece:l}},fN=te([ar,Kt,cN,Rf,_v,Cn,Ace],y3),mu=te([ar,Z5,Aj],K5),b3=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=uN(t),s=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Wi(e)){if(s)return w2(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return S2(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(s&&Wi(e))return w2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Wi(e))return S2(e,t.tickCount,t.allowDecimals,"adaptive")}}},hN=te([fN,Mf,mu],b3),x3=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Wi(t)&&Array.isArray(n)&&n.length>0){var i,s,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(s=n[n.length-1])!==null&&s!==void 0?s:0;return[Math.min(l,c),Math.max(f,h)]}return t},Tce=te([ar,fN,hN,Cn],x3),Pce=te(Rf,ar,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(na(e.map(g=>g.value))).sort((g,v)=>g-v),i=r[0],s=r[r.length-1];if(i==null||s==null)return 1/0;var l=s-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var f=r[c],h=r[c+1];if(!(f==null||h==null)){var p=h-f;n=Math.min(n,p)}}return n/l}}),w3=te(Pce,Kt,fse,Un,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ye(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var l=Hs(n,e*s),c=e*s/2;return c-l-(c-l)/s*l}return 0}),zce=(e,t,n)=>{var r=ia(e,t);return r==null||typeof r.padding!="string"?0:w3(e,"xAxis",t,n,r.padding)},Mce=(e,t,n)=>{var r=aa(e,t);return r==null||typeof r.padding!="string"?0:w3(e,"yAxis",t,n,r.padding)},Rce=te(ia,zce,(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}}),Dce=te(aa,Mce,(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}}),Ice=te([Un,Rce,Sv,wv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:s}=r;return i?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),Lce=te([Un,Kt,Dce,Sv,wv,(e,t,n)=>n],(e,t,n,r,i,s)=>{var{padding:l}=i;return s?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Df=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Ice(e,n,r);case"yAxis":return Lce(e,n,r);case"zAxis":return(i=lN(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return s5(e);case"radiusAxis":return o5(e,n);default:return}},S3=te([ar,Df],kv),$ce=te([mu,Tce],wse),pN=te([ar,mu,$ce,S3],oN),j3=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,l=ra(e,r);if(l&&(i==="number"||s!=="auto"))return t.map(c=>c.value)}},mN=te([Kt,Rf,Mf,Cn],j3),Wc=te([pN],Ij);te([pN],ece);te([pN,dce],H5);te([hu,dN,Cn],gce);function N3(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Uv=(e,t)=>t,Bv=(e,t,n)=>n,Uce=te(bv,Uv,Bv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(N3)),Bce=te(xv,Uv,Bv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(N3)),C3=(e,t)=>({width:e.width,height:t.height}),qce=(e,t)=>{var n=typeof t.width=="number"?t.width:Nf;return{width:n,height:e.height}},Fce=te(Un,ia,C3),Kce=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Hce=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Gce=te(Ka,Un,Uce,Uv,Bv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=C3(t,c);l==null&&(l=Kce(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;s[c.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),s}),Vce=te(Fa,Un,Bce,Uv,Bv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=qce(t,c);l==null&&(l=Hce(t,r,e));var h=r==="left"&&!i||r==="right"&&i;s[c.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),s}),Zce=(e,t)=>{var n=ia(e,t);if(n!=null)return Gce(e,n.orientation,n.mirror)},Yce=te([Un,ia,Zce,(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}}}),Wce=(e,t)=>{var n=aa(e,t);if(n!=null)return Vce(e,n.orientation,n.mirror)},Qce=te([Un,aa,Wce,(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}}}),Xce=te(Un,aa,(e,t)=>{var n=typeof t.width=="number"?t.width:Nf;return{width:n,height:e.height}}),O3=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:l}=n,c=ra(e,r),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(l&&c&&s==="category"&&i&&xL(h))return f}},gN=te([Kt,Rf,ar,Cn],O3),fz=te([Kt,ace,mu,Wc,gN,mN,Df,hN,Cn],(e,t,n,r,i,s,l,c,f)=>{if(t!=null){var h=ra(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:s,duplicateDomain:i,isCategorical:h,niceTicks:c,range:l,realScaleType:n,scale:r}}}),Jce=(e,t,n,r,i,s,l,c,f)=>{if(!(t==null||r==null)){var h=ra(e,f),{type:p,ticks:g,tickCount:v}=t,y=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,S=p==="category"&&r.bandwidth?r.bandwidth()/y:0;S=f==="angleAxis"&&s!=null&&s.length>=2?ni(s[0]-s[1])*2*S:S;var w=g||i;return w?w.map((N,C)=>{var E=l?l.indexOf(N):N,k=r.map(E);return Ye(k)?{index:C,coordinate:k+S,value:N,offset:S}:null}).filter(mr):h&&c?c.map((N,C)=>{var E=r.map(N);return Ye(E)?{coordinate:E+S,value:N,index:C,offset:S}:null}).filter(mr):r.ticks?r.ticks(v).map((N,C)=>{var E=r.map(N);return Ye(E)?{coordinate:E+S,value:N,index:C,offset:S}:null}).filter(mr):r.domain().map((N,C)=>{var E=r.map(N);return Ye(E)?{coordinate:E+S,value:l?l[N]:N,index:C,offset:S}:null}).filter(mr)}},_3=te([Kt,Mf,mu,Wc,hN,Df,gN,mN,Cn],Jce),eue=(e,t,n,r,i,s,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=ra(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&r?.length>=2?ni(r[0]-r[1])*2*h:h,c&&s?s.map((p,g)=>{var v=n.map(p);return Ye(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(mr):n.ticks?n.ticks(f).map((p,g)=>{var v=n.map(p);return Ye(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(mr):n.domain().map((p,g)=>{var v=n.map(p);return Ye(v)?{coordinate:v+h,value:i?i[p]:p,index:g,offset:h}:null}).filter(mr)}},k3=te([Kt,Mf,Wc,Df,gN,mN,Cn],eue),A3=te(ar,Wc,(e,t)=>{if(!(e==null||t==null))return hg(hg({},e),{},{scale:t})}),tue=te([ar,mu,fN,S3],oN),nue=te([tue],Ij);te((e,t,n)=>lN(e,n),nue,(e,t)=>{if(!(e==null||t==null))return hg(hg({},e),{},{scale:t})});var rue=te([Kt,bv,xv],(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}}),iue=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};te([iue],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var s of e){var l=Math.abs(s.coordinate-t);l<r&&(r=l,i=s)}return(n=i)===null||n===void 0?void 0:n.value}});var E3=e=>e.options.defaultTooltipEventType,T3=e=>e.options.validateTooltipEventTypes;function P3(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function If(e,t){var n=E3(e),r=T3(e);return P3(t,n,r)}function aue(e){return Le(t=>If(t,e))}var z3=(e,t)=>{var n,r=Number(t);if(!(Ji(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},sue=e=>e.tooltip.settings,ks={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},oue={itemInteraction:{click:ks,hover:ks},axisInteraction:{click:ks,hover:ks},keyboardInteraction:ks,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}},M3=Zn({name:"tooltip",initialState:oue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Rt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Rt()},removeTooltipEntrySettings:{reducer(e,t){var n=ri(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Rt()},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:lue,replaceTooltipEntrySettings:cue,removeTooltipEntrySettings:uue,setTooltipSettingsState:due,setActiveMouseOverItemIndex:fue,mouseLeaveItem:qye,mouseLeaveChart:R3,setActiveClickItemIndex:Fye,setMouseOverAxisIndex:D3,setMouseClickAxisIndex:hue,setSyncInteraction:Ad,setKeyboardInteraction:mg}=M3.actions,pue=M3.reducer;function hz(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 Bp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hz(Object(n),!0).forEach(function(r){mue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mue(e,t,n){return(t=gue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gue(e){var t=vue(e,"string");return typeof t=="symbol"?t:t+""}function vue(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 yue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function bue(e){return e.index!=null}var I3=(e,t,n,r)=>{if(t==null)return ks;var i=yue(e,t,n);if(i==null)return ks;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(bue(i)){if(s)return Bp(Bp({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Bp(Bp({},ks),{},{coordinate:i.coordinate})};function xue(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 wue(e,t){var n=xue(e),r=t[0],i=t[1];if(n===void 0)return!1;var s=Math.min(r,i),l=Math.max(r,i);return n>=s&&n<=l}function Sue(e,t,n){if(n==null||t==null)return!0;var r=Nn(e,t);return r==null||!Wi(n)?!0:wue(r,n)}var Dd=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var s=Number(i);if(!Ye(s))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(l,Math.min(s,c)),h=t[f];return h==null||Sue(h,n,r)?String(f):null},L3=(e,t,n,r,i,s,l)=>{if(s!=null){var c=l[0],f=c?.getPosition(s);if(f!=null)return f;var h=i?.[Number(s)];if(h)return n==="horizontal"?{x:h.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:h.coordinate}}},$3=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var s=e.tooltipItemPayloads[0];return s!=null?[s]:[]}return e.tooltipItemPayloads.filter(l=>{var c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},U3=e=>e.options.tooltipPayloadSearcher,gu=e=>e.tooltip;function pz(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 mz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pz(Object(n),!0).forEach(function(r){jue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jue(e,t,n){return(t=Nue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nue(e){var t=Cue(e,"string");return typeof t=="symbol"?t:t+""}function Cue(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 Oue(e){if(typeof e=="string"||typeof e=="number")return e}function _ue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function kue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function gz(e){if(typeof e=="string")return e}function Aue(e){if(!(e==null||typeof e!="object")){var t="name"in e?Oue(e.name):void 0,n="unit"in e?_ue(e.unit):void 0,r="dataKey"in e?kue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,s="color"in e?gz(e.color):void 0,l="fill"in e?gz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:s,fill:l}}}function Eue(e,t){return e??t}var B3=(e,t,n,r,i,s,l)=>{if(!(t==null||s==null)){var{chartData:c,computedData:f,dataStartIndex:h,dataEndIndex:p}=n,g=[];return e.reduce((v,y)=>{var S,{dataDefinedOnItem:w,settings:N}=y,C=Eue(w,c),E=Array.isArray(C)?v$(C,h,p):C,k=(S=N?.dataKey)!==null&&S!==void 0?S:r,O=N?.nameKey,T;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?T=wL(E,r,i):T=s(E,t,f,O),Array.isArray(T))T.forEach(A=>{var P,R,B=Aue(A),$=B?.name,L=B?.dataKey,re=B?.payload,ge=mz(mz({},N),{},{name:$,unit:B?.unit,color:(P=B?.color)!==null&&P!==void 0?P:N?.color,fill:(R=B?.fill)!==null&&R!==void 0?R:N?.fill});v.push(cP({tooltipEntrySettings:ge,dataKey:L,payload:re,value:Nn(re,L),name:$==null?void 0:String($)}))});else{var z;v.push(cP({tooltipEntrySettings:N,dataKey:k,payload:T,value:Nn(T,k),name:(z=Nn(T,O))!==null&&z!==void 0?z:N?.name}))}return v},g)}},vN=te([wn,Z5,Aj],K5),Tue=te([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Pue=te([On,du],Y5),jl=te([Tue,wn,Pue],Q5,{memoizeOptions:{resultEqualityCheck:zv}}),zue=te([jl],e=>e.filter(Dj)),q3=te([jl],e3,{memoizeOptions:{resultEqualityCheck:zv}}),Mue=te([jl],e=>e.some(t=>!t.data)),fl=te([q3,Ii],n3),Rue=te([zue,Ii,wn],c5),yN=te([fl,wn,jl,Ii,Mue,q3],r3),F3=te([wn],uN),Due=te([wn],e=>e.allowDataOverflow),K3=te([F3,Due],H$),Iue=te([jl],e=>e.filter(Dj)),Lue=te([Rue,Iue,_v,n5],a3),$ue=te([Lue,Ii,On,K3],o3),Uue=te([jl],J5),Bue=te([fl,wn,Uue,dN,On,sse],u3,{memoizeOptions:{resultEqualityCheck:Pv}}),que=te([d3,On,du],pu),Fue=te([que,On],p3),Kue=te([f3,On,du],pu),Hue=te([Kue,On],m3),Gue=te([h3,On,du],pu),Vue=te([Gue,On],g3),Zue=te([Fue,Vue,Hue],pg),Yue=te([wn,F3,K3,$ue,Bue,Zue,Kt,On],v3),Qc=te([wn,Kt,fl,yN,_v,On,Yue],y3),Wue=te([Qc,wn,vN],b3),Que=te([wn,Qc,Wue,On],x3),H3=e=>{var t=On(e),n=du(e),r=!1;return Df(e,t,n,r)},G3=te([wn,H3],kv),Xue=te([wn,vN,Que,G3],oN),V3=te([Xue],Ij),Jue=te([Kt,yN,wn,On],O3),ede=te([Kt,yN,wn,On],j3),tde=(e,t,n,r,i,s,l,c)=>{if(t){var{type:f}=t,h=ra(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/p:0;return g=c==="angleAxis"&&i!=null&&i?.length>=2?ni(i[0]-i[1])*2*g:g,h&&l?l.map((v,y)=>{var S=r.map(v);return Ye(S)?{coordinate:S+g,value:v,index:y,offset:g}:null}).filter(mr):r.domain().map((v,y)=>{var S=r.map(v);return Ye(S)?{coordinate:S+g,value:s?s[v]:v,index:y,offset:g}:null}).filter(mr)}}},Ga=te([Kt,wn,vN,V3,H3,Jue,ede,On],tde),bN=te([E3,T3,sue],(e,t,n)=>P3(n.shared,e,t)),Z3=e=>e.tooltip.settings.trigger,xN=e=>e.tooltip.settings.defaultIndex,Lf=te([gu,bN,Z3,xN],I3),df=te([Lf,fl,Yc,Qc],Dd),Y3=te([Ga,df],z3),nde=te([Lf],e=>{if(e)return e.dataKey}),rde=te([Lf],e=>{if(e)return e.graphicalItemId}),W3=te([gu,bN,Z3,xN],$3),ide=te([Fa,Ka,Kt,Un,Ga,xN,W3],L3),ade=te([Lf,ide],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),sde=te([Lf],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),ode=te([W3,df,Ii,Yc,Y3,U3,bN],B3),lde=te([ode],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function vz(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 yz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vz(Object(n),!0).forEach(function(r){cde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cde(e,t,n){return(t=ude(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ude(e){var t=dde(e,"string");return typeof t=="symbol"?t:t+""}function dde(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 fde=()=>Le(wn),hde=()=>{var e=fde(),t=Le(Ga),n=Le(V3);return Hm(!e||!n?void 0:yz(yz({},e),{},{scale:n}),t)};function bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bz(Object(n),!0).forEach(function(r){pde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pde(e,t,n){return(t=mde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mde(e){var t=gde(e,"string");return typeof t=="symbol"?t:t+""}function gde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vde=(e,t,n,r)=>{var i=t.find(s=>s&&s.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},yde=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var s=i.coordinate,{radius:l}=r;return pc(pc(pc({},r),In(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,{angle:f}=r;return pc(pc(pc({},r),In(r.cx,r.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function bde(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 Q3=(e,t,n,r,i)=>{var s,l=(s=t?.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var f,h,p,g,v,y=c>0?(f=n[c-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,S=(p=n[c])===null||p===void 0?void 0:p.coordinate,w=c>=l-1?(g=n[0])===null||g===void 0?void 0:g.coordinate:(v=n[c+1])===null||v===void 0?void 0:v.coordinate,N=void 0;if(!(y==null||S==null||w==null))if(ni(S-y)!==ni(w-S)){var C=[];if(ni(w-S)===ni(i[1]-i[0])){N=w;var E=S+i[1]-i[0];C[0]=Math.min(E,(E+y)/2),C[1]=Math.max(E,(E+y)/2)}else{N=y;var k=w+i[1]-i[0];C[0]=Math.min(S,(k+S)/2),C[1]=Math.max(S,(k+S)/2)}var O=[Math.min(S,(N+S)/2),Math.max(S,(N+S)/2)];if(e>O[0]&&e<=O[1]||e>=C[0]&&e<=C[1]){var T;return(T=n[c])===null||T===void 0?void 0:T.index}}else{var z=Math.min(y,w),A=Math.max(y,w);if(e>(z+S)/2&&e<=(A+S)/2){var P;return(P=n[c])===null||P===void 0?void 0:P.index}}}else if(t)for(var R=0;R<l;R++){var B=t[R];if(B!=null){var $=t[R+1],L=t[R-1];if(R===0&&$!=null&&e<=(B.coordinate+$.coordinate)/2||R===l-1&&L!=null&&e>(B.coordinate+L.coordinate)/2||R>0&&R<l-1&&L!=null&&$!=null&&e>(B.coordinate+L.coordinate)/2&&e<=(B.coordinate+$.coordinate)/2)return B.index}}return-1},X3=()=>Le(Aj),wN=(e,t)=>t,J3=(e,t,n)=>n,SN=(e,t,n,r)=>r,xde=te(Ga,e=>cv(e,t=>t.coordinate)),jN=te([gu,wN,J3,SN],I3),NN=te([jN,fl,Yc,Qc],Dd),wde=(e,t,n)=>{if(t!=null){var r=gu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},e4=te([gu,wN,J3,SN],$3),gg=te([Fa,Ka,Kt,Un,Ga,SN,e4],L3),Sde=te([jN,gg],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),t4=te([Ga,NN],z3),jde=te([e4,NN,Ii,Yc,t4,U3,wN],B3),Nde=te([jN,NN],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Cde=(e,t,n,r,i,s,l)=>{if(!(!e||!n||!r||!i)&&bde(e,l)){var c=Qne(e,t),f=Q3(c,s,i,n,r),h=vde(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},Ode=(e,t,n,r,i,s,l)=>{if(!(!e||!r||!i||!s||!n)){var c=Vae(e,n);if(c){var f=Xne(c,t),h=Q3(f,l,s,r,i),p=yde(t,s,h,c);return{activeIndex:String(h),activeCoordinate:p}}}},_de=(e,t,n,r,i,s,l,c)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?Cde(e,t,r,i,s,l,c):Ode(e,t,n,r,i,s,l)},kde=te(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}}),Ade=te(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Vn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:xse}});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 wz(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){Ede(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 Ede(e,t,n){return(t=Tde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tde(e){var t=Pde(e,"string");return typeof t=="symbol"?t:t+""}function Pde(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 zde={},Mde={zIndexMap:Object.values(Vn).reduce((e,t)=>wz(wz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),zde)},Rde=new Set(Object.values(Vn));function Dde(e){return Rde.has(e)}var n4=Zn({name:"zIndex",initialState:Mde,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:Rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Dde(n)&&delete e.zIndexMap[n])},prepare:Rt()},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:Rt()},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:Rt()}}}),{registerZIndexPortal:Ide,unregisterZIndexPortal:tw,registerZIndexPortalElement:Lde,unregisterZIndexPortalElement:$de}=n4.actions,Ude=n4.reducer;function sa(e){var{zIndex:t,children:n}=e,r=Tre(),i=r&&t!==void 0&&t!==0,s=ir(),l=x.useRef(void 0),c=x.useRef(new Set),f=Wt(),h=Le(g=>kde(g,t,s));if(x.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(y=>{f(tw({zIndex:y}))}),g.clear(),l.current=void 0;return}if(c.current.has(t)||(f(Ide({zIndex:t})),c.current.add(t)),h){l.current=h;var v=c.current;v.forEach(y=>{y!==t&&(f(tw({zIndex:y})),v.delete(y))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(v=>{f(tw({zIndex:v}))}),g.clear()}},[f]),!i)return n;var p=h??l.current;return p?ml.createPortal(n,p):null}function RS(){return RS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RS.apply(null,arguments)}function Sz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sz(Object(n),!0).forEach(function(r){Bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bde(e,t,n){return(t=qde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qde(e){var t=Fde(e,"string");return typeof t=="symbol"?t:t+""}function Fde(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 Kde(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Hde(e){var t,{coordinate:n,payload:r,index:i,offset:s,tooltipAxisBandSize:l,layout:c,cursor:f,tooltipEventType:h,chartName:p}=e,g=n,v=r,y=i;if(!f||!g||p!=="ScatterChart"&&h!=="axis")return null;var S,w,N;if(p==="ScatterChart")S=g,w=aae,N=Vn.cursorLine;else if(p==="BarChart")S=sae(c,g,s,l),w=Iae,N=Vn.cursorRectangle;else if(c==="radial"&&NL(g)){var{cx:C,cy:E,radius:k,startAngle:O,endAngle:T}=q$(g);S={cx:C,cy:E,startAngle:O,endAngle:T,innerRadius:k,outerRadius:k},w=Qae,N=Vn.cursorLine}else S={points:Xae(c,g,s)},w=am,N=Vn.cursorLine;var z=typeof f=="object"&&"className"in f?f.className:void 0,A=qp(qp(qp(qp({stroke:"#ccc",pointerEvents:"none"},s),S),iv(f)),{},{payload:v,payloadIndex:y,className:vt("recharts-tooltip-cursor",z)});return x.createElement(sa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:N},x.createElement(Kde,{cursor:f,cursorComp:w,cursorProps:A}))}function Gde(e){var t=hde(),n=O$(),r=lu(),i=X3();return t==null||n==null||r==null||i==null?null:x.createElement(Hde,RS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var r4=x.createContext(null),Vde=()=>x.useContext(r4),nw={exports:{}},jz;function Zde(){return jz||(jz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function s(f,h,p,g,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new i(p,g||f,v),S=n?n+h:h;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],y]:f._events[S].push(y):(f._events[S]=y,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],p,g;if(this._eventsCount===0)return h;for(g in p=this._events)t.call(p,g)&&h.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},c.prototype.listeners=function(h){var p=n?n+h:h,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var v=0,y=g.length,S=new Array(y);v<y;v++)S[v]=g[v].fn;return S},c.prototype.listenerCount=function(h){var p=n?n+h:h,g=this._events[p];return g?g.fn?1:g.length:0},c.prototype.emit=function(h,p,g,v,y,S){var w=n?n+h:h;if(!this._events[w])return!1;var N=this._events[w],C=arguments.length,E,k;if(N.fn){switch(N.once&&this.removeListener(h,N.fn,void 0,!0),C){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,p),!0;case 3:return N.fn.call(N.context,p,g),!0;case 4:return N.fn.call(N.context,p,g,v),!0;case 5:return N.fn.call(N.context,p,g,v,y),!0;case 6:return N.fn.call(N.context,p,g,v,y,S),!0}for(k=1,E=new Array(C-1);k<C;k++)E[k-1]=arguments[k];N.fn.apply(N.context,E)}else{var O=N.length,T;for(k=0;k<O;k++)switch(N[k].once&&this.removeListener(h,N[k].fn,void 0,!0),C){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,p);break;case 3:N[k].fn.call(N[k].context,p,g);break;case 4:N[k].fn.call(N[k].context,p,g,v);break;default:if(!E)for(T=1,E=new Array(C-1);T<C;T++)E[T-1]=arguments[T];N[k].fn.apply(N[k].context,E)}}return!0},c.prototype.on=function(h,p,g){return s(this,h,p,g,!1)},c.prototype.once=function(h,p,g){return s(this,h,p,g,!0)},c.prototype.removeListener=function(h,p,g,v){var y=n?n+h:h;if(!this._events[y])return this;if(!p)return l(this,y),this;var S=this._events[y];if(S.fn)S.fn===p&&(!v||S.once)&&(!g||S.context===g)&&l(this,y);else{for(var w=0,N=[],C=S.length;w<C;w++)(S[w].fn!==p||v&&!S[w].once||g&&S[w].context!==g)&&N.push(S[w]);N.length?this._events[y]=N.length===1?N[0]:N:l(this,y)}return this},c.prototype.removeAllListeners=function(h){var p;return h?(p=n?n+h:h,this._events[p]&&l(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})(nw)),nw.exports}var Yde=Zde();const Wde=Gs(Yde);var ff=new Wde,DS="recharts.syncEvent.tooltip",Nz="recharts.syncEvent.brush",Qde=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ji(n))return e[n]}},Xde={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},i4=Zn({name:"options",initialState:Xde,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Jde=i4.reducer,{createEventEmitter:efe}=i4.actions;function tfe(e){return e.tooltip.syncInteraction}var nfe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},a4=Zn({name:"chartData",initialState:nfe,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:Cz,setDataStartEndIndexes:rfe,setComputedData:Kye}=a4.actions,ife=a4.reducer,afe=["x","y"];function Oz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oz(Object(n),!0).forEach(function(r){sfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sfe(e,t,n){return(t=ofe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ofe(e){var t=lfe(e,"string");return typeof t=="symbol"?t:t+""}function lfe(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 cfe(e,t){if(e==null)return{};var n,r,i=ufe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ufe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function dfe(){var e=Le(Ej),t=Le(Tj),n=Wt(),r=Le(r5),i=Le(Ga),s=lu(),l=Cf(),c=Le(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return ou;var f=(h,p,g)=>{if(t!==g&&e===h){if(p.payload.active===!1){n(Ad({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var v;if(l&&p!==null&&p!==void 0&&(v=p.payload)!==null&&v!==void 0&&v.coordinate&&p.payload.sourceViewBox){var y=p.payload.coordinate,{x:S,y:w}=y,N=cfe(y,afe),{x:C,y:E,width:k,height:O}=p.payload.sourceViewBox,T=mc(mc({},N),{},{x:l.x+(k?(S-C)/k:0)*l.width,y:l.y+(O?(w-E)/O:0)*l.height});n(mc(mc({},p),{},{payload:mc(mc({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var z;if(typeof r=="function"){var A={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},P=r(i,A);z=i[P]}else r==="value"&&(z=i.find(H=>String(H.value)===p.payload.label));var{coordinate:R}=p.payload;if(R==null||l==null){n(Ad({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(z==null){n(Ad({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:B,y:$}=R,L=Math.min(B,l.x+l.width),re=Math.min($,l.y+l.height),ge={x:s==="horizontal"?z.coordinate:L,y:s==="horizontal"?re:z.coordinate},be=Ad({active:p.payload.active,coordinate:ge,dataKey:p.payload.dataKey,index:String(z.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(be)}}};return ff.on(DS,f),()=>{ff.off(DS,f)}},[c,n,t,e,r,i,s,l])}function ffe(){var e=Le(Ej),t=Le(Tj),n=Wt();x.useEffect(()=>{if(e==null)return ou;var r=(i,s,l)=>{t!==l&&e===i&&n(rfe(s))};return ff.on(Nz,r),()=>{ff.off(Nz,r)}},[n,t,e])}function hfe(){var e=Wt();x.useEffect(()=>{e(efe())},[e]),dfe(),ffe()}function pfe(e,t,n,r,i,s){var l=Le(S=>wde(S,e,t)),c=Le(rde),f=Le(Tj),h=Le(Ej),p=Le(r5),g=Le(tfe),v=g?.sourceViewBox!=null,y=Cf();x.useEffect(()=>{if(!v&&h!=null&&f!=null){var S=Ad({active:s,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:y,graphicalItemId:c});ff.emit(DS,h,S,f)}},[v,n,l,c,i,r,f,h,p,s,y])}function _z(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 kz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_z(Object(n),!0).forEach(function(r){mfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_z(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mfe(e,t,n){return(t=gfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gfe(e){var t=vfe(e,"string");return typeof t=="symbol"?t:t+""}function vfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yfe(e){return e.dataKey}function bfe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Mie,t)}var Az=[],xfe={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 IS(e){var t,n,r=rr(e,xfe),{active:i,allowEscapeViewBox:s,animationDuration:l,animationEasing:c,content:f,filterNull:h,isAnimationActive:p,offset:g,payloadUniqBy:v,position:y,reverseDirection:S,useTranslate3d:w,wrapperStyle:N,cursor:C,shared:E,trigger:k,defaultIndex:O,portal:T,axisId:z}=r,A=Wt(),P=typeof O=="number"?String(O):O;x.useEffect(()=>{A(due({shared:E,trigger:k,axisId:z,active:i,defaultIndex:P}))},[A,E,k,z,i,P]);var R=Cf(),B=D$(),$=aue(E),{activeIndex:L,isActive:re}=(t=Le(we=>Nde(we,$,k,P)))!==null&&t!==void 0?t:{},ge=Le(we=>jde(we,$,k,P)),be=Le(we=>t4(we,$,k,P)),H=Le(we=>Sde(we,$,k,P)),ee=ge,ye=Vde(),Se=(n=i??re)!==null&&n!==void 0?n:!1,[q,D]=BL([ee,Se]),G=$==="axis"?be:void 0;pfe($,k,H,G,L,Se);var ae=T??ye;if(ae==null||R==null||$==null)return null;var Y=ee??Az;Se||(Y=Az),h&&Y.length&&(Y=DL(Y.filter(we=>we.value!=null&&(we.hide!==!0||r.includeHidden)),v,yfe));var ie=Y.length>0,oe=kz(kz({},r),{},{payload:Y,label:G,active:Se,activeIndex:L,coordinate:H,accessibilityLayer:B}),ue=x.createElement(Hie,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:p,active:Se,coordinate:H,hasPayload:ie,offset:g,position:y,reverseDirection:S,useTranslate3d:w,viewBox:R,wrapperStyle:N,lastBoundingBox:q,innerRef:D,hasPortalFromProps:!!T},bfe(f,oe));return x.createElement(x.Fragment,null,ml.createPortal(ue,ae),Se&&x.createElement(Gde,{cursor:C,tooltipEventType:$,coordinate:H,payload:Y,index:L}))}function wfe(e,t,n){return(t=Sfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sfe(e){var t=jfe(e,"string");return typeof t=="symbol"?t:t+""}function jfe(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 Nfe{constructor(t){wfe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function Ez(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cfe(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){Ofe(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 Ofe(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=kfe(e,"string");return typeof t=="symbol"?t:t+""}function kfe(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 Afe={cacheSize:2e3,enableCache:!0},s4=Cfe({},Afe),Tz=new Nfe(s4.cacheSize),Efe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Pz="recharts_measurement_span";function Tfe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",s=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(s,"|").concat(l,"|").concat(c)}var zz=(e,t)=>{try{var n=document.getElementById(Pz);n||(n=document.createElement("span"),n.setAttribute("id",Pz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Efe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Id=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Af.isSsr)return{width:0,height:0};if(!s4.enableCache)return zz(t,n);var r=Tfe(t,n),i=Tz.get(r);if(i)return i;var s=zz(t,n);return Tz.set(r,s),s},o4;function Pfe(e,t,n){return(t=zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zfe(e){var t=Mfe(e,"string");return typeof t=="symbol"?t:t+""}function Mfe(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 Mz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Rz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Rfe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Dfe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Ife={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Lfe=["cm","mm","pt","pc","in","Q","px"];function $fe(e){return Lfe.includes(e)}var Oc="NaN";function Ufe(e,t){return e*Ife[t]}class Rn{static parse(t){var n,[,r,i]=(n=Dfe.exec(t))!==null&&n!==void 0?n:[];return r==null?Rn.NaN:new Rn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ji(t)&&(this.unit=""),n!==""&&!Rfe.test(n)&&(this.num=NaN,this.unit=""),$fe(n)&&(this.num=Ufe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Rn(NaN,""):new Rn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Rn(NaN,""):new Rn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Rn(NaN,""):new Rn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Rn(NaN,""):new Rn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ji(this.num)}}o4=Rn;Pfe(Rn,"NaN",new o4(NaN,""));function l4(e){if(e==null||e.includes(Oc))return Oc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=Mz.exec(t))!==null&&n!==void 0?n:[],l=Rn.parse(r??""),c=Rn.parse(s??""),f=i==="*"?l.multiply(c):l.divide(c);if(f.isNaN())return Oc;t=t.replace(Mz,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,p,g,v]=(h=Rz.exec(t))!==null&&h!==void 0?h:[],y=Rn.parse(p??""),S=Rn.parse(v??""),w=g==="+"?y.add(S):y.subtract(S);if(w.isNaN())return Oc;t=t.replace(Rz,w.toString())}return t}var Dz=/\(([^()]*)\)/;function Bfe(e){for(var t=e,n;(n=Dz.exec(t))!=null;){var[,r]=n;t=t.replace(Dz,l4(r))}return t}function qfe(e){var t=e.replace(/\s+/g,"");return t=Bfe(t),t=l4(t),t}function Ffe(e){try{return qfe(e)}catch{return Oc}}function rw(e){var t=Ffe(e.slice(5,-1));return t===Oc?"":t}var Kfe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Hfe=["dx","dy","angle","className","breakAll"];function LS(){return LS=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},LS.apply(null,arguments)}function Iz(e,t){if(e==null)return{};var n,r,i=Gfe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gfe(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 c4=/[ \f\n\r\t\v\u2028\u2029]+/,u4=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Ln(t)||(n?i=t.toString().split(""):i=t.toString().split(c4));var s=i.map(c=>({word:c,width:Id(c,r).width})),l=n?0:Id(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}};function d4(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Vfe(e){return Ln(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var f4=(e,t,n,r)=>e.reduce((i,s)=>{var{word:l,width:c}=s,f=i[i.length-1];if(f&&c!=null&&(t==null||r||f.width+c+n<Number(t)))f.words.push(l),f.width+=c+n;else{var h={words:[l],width:c};i.push(h)}return i},[]),h4=e=>e.reduce((t,n)=>t.width>n.width?t:n),Zfe="…",Lz=(e,t,n,r,i,s,l,c)=>{var f=e.slice(0,t),h=u4({breakAll:n,style:r,children:f+Zfe});if(!h)return[!1,[]];var p=f4(h.wordsWithComputedWidth,s,l,c),g=p.length>i||h4(p).width>Number(s);return[g,p]},Yfe=(e,t,n,r,i)=>{var{maxLines:s,children:l,style:c,breakAll:f}=e,h=De(s),p=String(l),g=f4(t,r,n,i);if(!h||i)return g;var v=g.length>s||h4(g).width>Number(r);if(!v)return g;for(var y=0,S=p.length-1,w=0,N;y<=S&&w<=p.length-1;){var C=Math.floor((y+S)/2),E=C-1,[k,O]=Lz(p,E,f,c,s,r,n,i),[T]=Lz(p,C,f,c,s,r,n,i);if(!k&&!T&&(y=C+1),k&&T&&(S=C-1),!k&&T){N=O;break}w++}return N||g},$z=e=>{var t=Ln(e)?[]:e.toString().split(c4);return[{words:t,width:void 0}]},Wfe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:l}=e;if((t||n)&&!Af.isSsr){var c,f,h=u4({breakAll:s,children:r,style:i});if(h){var{wordsWithComputedWidth:p,spaceWidth:g}=h;c=p,f=g}else return $z(r);return Yfe({breakAll:s,children:r,maxLines:l,style:i},c,f,t,!!n)}return $z(r)},p4="#808080",Qfe={angle:0,breakAll:!1,capHeight:"0.71em",fill:p4,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},CN=x.forwardRef((e,t)=>{var n=rr(e,Qfe),{x:r,y:i,lineHeight:s,capHeight:l,fill:c,scaleToFit:f,textAnchor:h,verticalAnchor:p}=n,g=Iz(n,Kfe),v=x.useMemo(()=>Wfe({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),{dx:y,dy:S,angle:w,className:N,breakAll:C}=g,E=Iz(g,Hfe);if(!oi(r)||!oi(i)||v.length===0)return null;var k=Number(r)+(De(y)?y:0),O=Number(i)+(De(S)?S:0);if(!Ye(k)||!Ye(O))return null;var T;switch(p){case"start":T=rw("calc(".concat(l,")"));break;case"middle":T=rw("calc(".concat((v.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:T=rw("calc(".concat(v.length-1," * -").concat(s,")"));break}var z=[],A=v[0];if(f&&A!=null){var P=A.width,{width:R}=g;z.push("scale(".concat(De(R)&&De(P)?R/P:1,")"))}return w&&z.push("rotate(".concat(w,", ").concat(k,", ").concat(O,")")),z.length&&(E.transform=z.join(" ")),x.createElement("text",LS({},yr(E),{ref:t,x:k,y:O,className:vt("recharts-text",N),textAnchor:h,fill:c.includes("url")?p4:c}),v.map((B,$)=>{var L=B.words.join(C?"":" ");return x.createElement("tspan",{x:k,dy:$===0?T:s,key:"".concat(L,"-").concat($)},L)}))});CN.displayName="Text";function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uz(Object(n),!0).forEach(function(r){Xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xfe(e,t,n){return(t=Jfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jfe(e){var t=ehe(e,"string");return typeof t=="symbol"?t:t+""}function ehe(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 the=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:l,height:c,upperWidth:f,lowerWidth:h}=bj(t),p=s,g=s+(f-h)/2,v=(p+g)/2,y=(f+h)/2,S=p+f/2,w=c>=0?1:-1,N=w*r,C=w>0?"end":"start",E=w>0?"start":"end",k=f>=0?1:-1,O=k*r,T=k>0?"end":"start",z=k>0?"start":"end",A=i;if(n==="top"){var P={x:p+f/2,y:l-N,horizontalAnchor:"middle",verticalAnchor:C};return A&&(P.height=Math.max(l-A.y,0),P.width=f),P}if(n==="bottom"){var R={x:g+h/2,y:l+c+N,horizontalAnchor:"middle",verticalAnchor:E};return A&&(R.height=Math.max(A.y+A.height-(l+c),0),R.width=h),R}if(n==="left"){var B={x:v-O,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return A&&(B.width=Math.max(B.x-A.x,0),B.height=c),B}if(n==="right"){var $={x:v+y+O,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"};return A&&($.width=Math.max(A.x+A.width-$.x,0),$.height=c),$}var L=A?{width:y,height:c}:{};return n==="insideLeft"?Ki({x:v+O,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"},L):n==="insideRight"?Ki({x:v+y-O,y:l+c/2,horizontalAnchor:T,verticalAnchor:"middle"},L):n==="insideTop"?Ki({x:p+f/2,y:l+N,horizontalAnchor:"middle",verticalAnchor:E},L):n==="insideBottom"?Ki({x:g+h/2,y:l+c-N,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideTopLeft"?Ki({x:p+O,y:l+N,horizontalAnchor:z,verticalAnchor:E},L):n==="insideTopRight"?Ki({x:p+f-O,y:l+N,horizontalAnchor:T,verticalAnchor:E},L):n==="insideBottomLeft"?Ki({x:g+O,y:l+c-N,horizontalAnchor:z,verticalAnchor:C},L):n==="insideBottomRight"?Ki({x:g+h-O,y:l+c-N,horizontalAnchor:T,verticalAnchor:C},L):n&&typeof n=="object"&&(De(n.x)||ol(n.x))&&(De(n.y)||ol(n.y))?Ki({x:s+Hs(n.x,y),y:l+Hs(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},L):Ki({x:S,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},nhe=["labelRef"],rhe=["content"];function Bz(e,t){if(e==null)return{};var n,r,i=ihe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ihe(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 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 Ed(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){ahe(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 ahe(e,t,n){return(t=she(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function she(e){var t=ohe(e,"string");return typeof t=="symbol"?t:t+""}function ohe(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 Ta(){return Ta=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},Ta.apply(null,arguments)}var m4=x.createContext(null),g4=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l,children:c}=e,f=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l}),[t,n,r,i,s,l]);return x.createElement(m4.Provider,{value:f},c)},v4=()=>{var e=x.useContext(m4),t=Cf();return e||(t?bj(t):void 0)},lhe=x.createContext(null),che=()=>{var e=x.useContext(lhe),t=Le(l5);return e||t},uhe=e=>{var{value:t,formatter:n}=e,r=Ln(e.children)?t:e.children;return typeof n=="function"?n(r):r},ON=e=>e!=null&&typeof e=="function",dhe=(e,t)=>{var n=ni(t-e),r=Math.min(Math.abs(t-e),360);return n*r},fhe=(e,t,n,r,i)=>{var{offset:s,className:l}=e,{cx:c,cy:f,innerRadius:h,outerRadius:p,startAngle:g,endAngle:v,clockWise:y}=i,S=(h+p)/2,w=dhe(g,v),N=w>=0?1:-1,C,E;switch(t){case"insideStart":C=g+N*s,E=y;break;case"insideEnd":C=v-N*s,E=!y;break;case"end":C=v+N*s,E=y;break;default:throw new Error("Unsupported position ".concat(t))}E=w<=0?E:!E;var k=In(c,f,S,C),O=In(c,f,S,C+(E?1:-1)*359),T="M".concat(k.x,",").concat(k.y,`
268
- A`).concat(S,",").concat(S,",0,1,").concat(E?0:1,`,
269
- `).concat(O.x,",").concat(O.y),z=Ln(e.id)?Qd("recharts-radial-line-"):e.id;return x.createElement("text",Ta({},r,{dominantBaseline:"central",className:vt("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:z,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(z)},n))},hhe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:c,endAngle:f}=e,h=(c+f)/2;if(n==="outside"){var{x:p,y:g}=In(r,i,l+t,h);return{x:p,y:g,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 v=(s+l)/2,{x:y,y:S}=In(r,i,v,h);return{x:y,y:S,textAnchor:"middle",verticalAnchor:"middle"}},sm=e=>e!=null&&"cx"in e&&De(e.cx),phe={angle:0,offset:5,zIndex:Vn.label,position:"middle",textBreakAll:!1};function mhe(e){if(!sm(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 _s(e){var t=rr(e,phe),{viewBox:n,parentViewBox:r,position:i,value:s,children:l,content:c,className:f="",textBreakAll:h,labelRef:p}=t,g=che(),v=v4(),y=i==="center"?v:g??v,S,w,N;n==null?S=y:sm(n)?S=n:S=bj(n);var C=mhe(S);if(!S||Ln(s)&&Ln(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=Ed(Ed({},t),{},{viewBox:S});if(x.isValidElement(c)){var{labelRef:k}=E,O=Bz(E,nhe);return x.cloneElement(c,O)}if(typeof c=="function"){var{content:T}=E,z=Bz(E,rhe);if(w=x.createElement(c,z),x.isValidElement(w))return w}else w=uhe(t);var A=yr(t);if(sm(S)){if(i==="insideStart"||i==="insideEnd"||i==="end")return fhe(t,i,w,A,S);N=hhe(S,t.offset,t.position)}else{if(!C)return null;var P=the({viewBox:C,position:i,offset:t.offset,parentViewBox:sm(r)?void 0:r});N=Ed(Ed({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return x.createElement(sa,{zIndex:t.zIndex},x.createElement(CN,Ta({ref:p,className:vt("recharts-label",f)},A,N,{textAnchor:d4(A.textAnchor)?A.textAnchor:N.textAnchor,breakAll:h}),w))}_s.displayName="Label";var ghe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(_s,Ta({key:"label-implicit"},r)):oi(e)?x.createElement(_s,Ta({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===_s?x.cloneElement(e,Ed({key:"label-implicit"},r)):x.createElement(_s,Ta({key:"label-implicit",content:e},r)):ON(e)?x.createElement(_s,Ta({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(_s,Ta({},e,{key:"label-implicit"},r)):null};function y4(e){var{label:t,labelRef:n}=e,r=v4();return ghe(t,r,n)||null}var vhe=["valueAccessor"],yhe=["dataKey","clockWise","id","textBreakAll","zIndex"];function vg(){return vg=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},vg.apply(null,arguments)}function Fz(e,t){if(e==null)return{};var n,r,i=bhe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bhe(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 xhe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Vfe(t))return t},b4=x.createContext(void 0),whe=b4.Provider,x4=x.createContext(void 0);x4.Provider;function She(){return x.useContext(b4)}function jhe(){return x.useContext(x4)}function om(e){var{valueAccessor:t=xhe}=e,n=Fz(e,vhe),{dataKey:r,clockWise:i,id:s,textBreakAll:l,zIndex:c}=n,f=Fz(n,yhe),h=She(),p=jhe(),g=h||p;return!g||!g.length?null:x.createElement(sa,{zIndex:c??Vn.label},x.createElement(Pi,{className:"recharts-label-list"},g.map((v,y)=>{var S,w=Ln(r)?t(v,y):Nn(v.payload,r),N=Ln(s)?{}:{id:"".concat(s,"-").concat(y)};return x.createElement(_s,vg({key:"label-".concat(y)},yr(v),f,N,{fill:(S=n.fill)!==null&&S!==void 0?S:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:l,viewBox:v.viewBox,index:y,zIndex:0}))})))}om.displayName="LabelList";function Nhe(e){var{label:t}=e;return t?t===!0?x.createElement(om,{key:"labelList-implicit"}):x.isValidElement(t)||ON(t)?x.createElement(om,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(om,vg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function $S(){return $S=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},$S.apply(null,arguments)}var w4=e=>{var{cx:t,cy:n,r,className:i}=e,s=vt("recharts-dot",i);return De(t)&&De(n)&&De(r)?x.createElement("circle",$S({},Ti(e),cj(e),{className:s,cx:t,cy:n,r})):null},Che={radiusAxis:{},angleAxis:{}},S4=Zn({name:"polarAxis",initialState:Che,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:Hye,removeRadiusAxis:Gye,addAngleAxis:Vye,removeAngleAxis:Zye}=S4.actions,Ohe=S4.reducer;function _he(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var j4=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function khe(e){var{tooltipEntrySettings:t}=e,n=Wt(),r=ir(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(lue(t)):i.current!==t&&n(cue({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(uue(i.current)),i.current=null)},[n]),null}function Ahe(e){var{legendPayload:t}=e,n=Wt(),r=ir(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Hre(t)):i.current!==t&&n(Gre({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Vre(i.current)),i.current=null)},[n]),null}var iw,Ehe=()=>{var[e]=x.useState(()=>Qd("uid-"));return e},The=(iw=Og.useId)!==null&&iw!==void 0?iw:Ehe;function Phe(e,t){var n=The();return t||(e?"".concat(e,"-").concat(n):n)}var zhe=x.createContext(void 0),Mhe=e=>{var{id:t,type:n,children:r}=e,i=Phe("recharts-".concat(n),t);return x.createElement(zhe.Provider,{value:i},r(i))},Rhe={cartesianItems:[],polarItems:[]},N4=Zn({name:"graphicalItems",initialState:Rhe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=ri(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Rt()},removePolarGraphicalItem:{reducer(e,t){var n=ri(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Rt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Rt()}}}),{addCartesianGraphicalItem:Dhe,replaceCartesianGraphicalItem:Ihe,removeCartesianGraphicalItem:Lhe,addPolarGraphicalItem:Yye,removePolarGraphicalItem:Wye,replacePolarGraphicalItem:Qye}=N4.actions,$he=N4.reducer,Uhe=e=>{var t=Wt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(Dhe(e)):n.current!==e&&t(Ihe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(Lhe(n.current)),n.current=null)},[t]),null},Bhe=x.memo(Uhe),qhe=["points"];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 aw(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){Fhe(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 Fhe(e,t,n){return(t=Khe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Khe(e){var t=Hhe(e,"string");return typeof t=="symbol"?t:t+""}function Hhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yg(){return yg=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},yg.apply(null,arguments)}function Ghe(e,t){if(e==null)return{};var n,r,i=Vhe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vhe(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 Zhe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=vt(r,typeof t!="boolean"?t.className:""),s=n??{},{points:l}=s,c=Ghe(s,qhe);return x.createElement(w4,yg({},c,{className:i}))}function Yhe(e,t){return e==null?!1:t?!0:e.length===1}function Whe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:s,baseProps:l,needClip:c,clipPathId:f,zIndex:h=Vn.scatter}=e;if(!Yhe(t,n))return null;var p=j4(n),g=zJ(n),v=t.map((S,w)=>{var N,C,E=aw(aw(aw({r:3},l),g),{},{index:w,cx:(N=S.x)!==null&&N!==void 0?N:void 0,cy:(C=S.y)!==null&&C!==void 0?C:void 0,dataKey:s,value:S.value,payload:S.payload,points:t});return x.createElement(Zhe,{key:"dot-".concat(w),option:n,dotProps:E,className:i})}),y={};return c&&f!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),x.createElement(sa,{zIndex:h},x.createElement(Pi,yg({className:r},y),v))}function Hz(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 Gz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hz(Object(n),!0).forEach(function(r){Qhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qhe(e,t,n){return(t=Xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xhe(e){var t=Jhe(e,"string");return typeof t=="symbol"?t:t+""}function Jhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C4=0,epe={xAxis:{},yAxis:{},zAxis:{}},O4=Zn({name:"cartesianAxis",initialState:epe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Rt()},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:Rt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Rt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Rt()},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:Rt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Rt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Rt()},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:Rt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Rt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var s,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,r].slice(-3);e.yAxis[n]=Gz(Gz({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:tpe,replaceXAxis:npe,removeXAxis:rpe,addYAxis:ipe,replaceYAxis:ape,removeYAxis:spe,addZAxis:Xye,replaceZAxis:Jye,removeZAxis:e0e,updateYAxisWidth:ope}=O4.actions,lpe=O4.reducer,cpe=te([Un],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),upe=te([cpe,Fa,Ka],(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)}}),_N=()=>Le(upe),dpe=()=>Le(lde);function Vz(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 sw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vz(Object(n),!0).forEach(function(r){fpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fpe(e,t,n){return(t=hpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hpe(e){var t=ppe(e,"string");return typeof t=="symbol"?t:t+""}function ppe(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 mpe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:s,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=sw(sw(sw({},c),iv(i)),cj(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(w4,f),x.createElement(Pi,{className:"recharts-active-dot",clipPath:l},h)};function Zz(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:l=Vn.activeDot}=e,c=Le(df),f=dpe();if(t==null||f==null)return null;var h=t.find(p=>f.includes(p.payload));return Ln(h)?null:x.createElement(sa,{zIndex:l},x.createElement(mpe,{point:h,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var gpe=e=>{var{chartData:t}=e,n=Wt(),r=ir();return x.useEffect(()=>r?()=>{}:(n(Cz(t)),()=>{n(Cz(void 0))}),[t,n,r]),null},Yz={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},_4=Zn({name:"brush",initialState:Yz,reducers:{setBrushSettings(e,t){return t.payload==null?Yz:t.payload}}}),{setBrushSettings:t0e}=_4.actions,vpe=_4.reducer,ype=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return{x:Math.min(n,i),y:Math.min(r,s),width:Math.abs(i-n),height:Math.abs(s-r)}},bpe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return ype({x:t,y:n},{x:r,y:i})};function xpe(e){return(e%180+180)%180}var wpe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=xpe(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},Spe={dots:[],areas:[],lines:[]},k4=Zn({name:"referenceElements",initialState:Spe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ri(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=ri(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=ri(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:n0e,removeDot:r0e,addArea:i0e,removeArea:a0e,addLine:jpe,removeLine:Npe}=k4.actions,Cpe=k4.reducer,A4=x.createContext(void 0),Ope=e=>{var{children:t}=e,[n]=x.useState("".concat(Qd("recharts"),"-clip")),r=_N();if(r==null)return null;var{x:i,y:s,width:l,height:c}=r;return x.createElement(A4.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:s,height:c,width:l}))),t)},_pe=()=>x.useContext(A4);class kpe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:s}=n;return{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:s,fallback:l}=n,c,f;return l==="rangeMin"?c=this.yAxisScale.rangeMin():l==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,l==="rangeMin"?f=this.xAxisScale.rangeMin():l==="rangeMax"?f=this.xAxisScale.rangeMax():f=0,{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:f,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:c}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),s=r==null||this.yAxisScale.isInRange(r);return i&&s}}function Wz(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 Qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wz(Object(n),!0).forEach(function(r){Ape(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ape(e,t,n){return(t=Epe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Epe(e){var t=Tpe(e,"string");return typeof t=="symbol"?t:t+""}function Tpe(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 bg(){return bg=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},bg.apply(null,arguments)}var Ppe=(e,t)=>{var n;if(x.isValidElement(e))n=x.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!Ye(t.x1)||!Ye(t.y1)||!Ye(t.x2)||!Ye(t.y2))return null;n=x.createElement("line",bg({},t,{className:"recharts-reference-line-line"}))}return n},zpe=(e,t,n,r,i,s)=>{var{x:l,width:c}=s,f=i.map(e,{position:n});if(!Ye(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:l+c,y:f},{x:l,y:f}];return r==="left"?h.reverse():h},Mpe=(e,t,n,r,i,s)=>{var{y:l,height:c}=s,f=i.map(e,{position:n});if(!Ye(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:f,y:l+c},{x:f,y:l}];return r==="top"?h.reverse():h},Rpe=(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(s=>!r.isInRange(s))?null:i},Dpe=(e,t,n,r,i,s,l)=>{var{x:c,y:f,segment:h,ifOverflow:p}=l,g=oi(c),v=oi(f);return v?zpe(f,p,r,s,t,n):g?Mpe(c,p,r,i,e,n):h!=null&&h.length===2?Rpe(h,p,r,new kpe({x:e,y:t})):null};function Ipe(e){var t=Wt();return x.useEffect(()=>(t(jpe(e)),()=>{t(Npe(e))})),null}function Lpe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:s}=e,l=ir(),c=_pe(),f=Le(A=>ia(A,t)),h=Le(A=>aa(A,n)),p=Le(A=>Wc(A,"xAxis",t,l)),g=Le(A=>Wc(A,"yAxis",n,l)),v=Cf();if(!c||!v||f==null||h==null||p==null||g==null)return null;var y=Dpe(p,g,v,e.position,f.orientation,h.orientation,e);if(!y)return null;var S=y[0],w=y[1];if(S==null||w==null)return null;var{x:N,y:C}=S,{x:E,y:k}=w,O=s==="hidden"?"url(#".concat(c,")"):void 0,T=Qz(Qz({clipPath:O},yr(e)),{},{x1:N,y1:C,x2:E,y2:k}),z=bpe({x1:N,y1:C,x2:E,y2:k});return x.createElement(sa,{zIndex:e.zIndex},x.createElement(Pi,{className:vt("recharts-reference-line",i)},Ppe(r,T),x.createElement(g4,bg({},z,{lowerWidth:z.width,upperWidth:z.width}),x.createElement(y4,{label:e.label}),e.children)))}var $pe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:Vn.line};function E4(e){var t=rr(e,$pe);return x.createElement(x.Fragment,null,x.createElement(Ipe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),x.createElement(Lpe,t))}E4.displayName="ReferenceLine";function T4(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 Upe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return wpe(r,n)}function Bpe(e,t,n){var r=n==="width",{x:i,y:s,width:l,height:c}=e;return t===1?{start:r?i:s,end:r?i+l:s+c}:{start:r?i+l:s+c,end:r?i:s}}function hf(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function qpe(e,t){return T4(e,t+1)}function Fpe(e,t,n,r,i){for(var s=(r||[]).slice(),{start:l,end:c}=t,f=0,h=1,p=l,g=function(){var S=r?.[f];if(S===void 0)return{v:T4(r,h)};var w=f,N,C=()=>(N===void 0&&(N=n(S,w)),N),E=S.coordinate,k=f===0||hf(e,E,C,p,c);k||(f=0,p=l,h+=1),k&&(p=E+e*(C()/2+i),f+=h)},v;h<=s.length;)if(v=g(),v)return v.v;return[]}function Kpe(e,t,n,r,i){var s=(r||[]).slice(),l=s.length;if(l===0)return[];for(var{start:c,end:f}=t,h=1;h<=l;h++){for(var p=(l-1)%h,g=c,v=!0,y=function(){var O=r[w];if(O==null)return 0;var T=w,z,A=()=>(z===void 0&&(z=n(O,T)),z),P=O.coordinate,R=w===p||hf(e,P,A,g,f);if(!R)return v=!1,1;R&&(g=P+e*(A()/2+i))},S,w=p;w<l&&(S=y(),!(S!==0&&S===1));w+=h);if(v){for(var N=[],C=p;C<l;C+=h){var E=r[C];E!=null&&N.push(E)}return N}}return[]}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 Fn(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){Hpe(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 Hpe(e,t,n){return(t=Gpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gpe(e){var t=Vpe(e,"string");return typeof t=="symbol"?t:t+""}function Vpe(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 Zpe(e,t,n,r,i){for(var s=(r||[]).slice(),l=s.length,{start:c}=t,{end:f}=t,h=function(v){var y=s[v];if(y==null)return 1;var S=y,w,N=()=>(w===void 0&&(w=n(y,v)),w);if(v===l-1){var C=e*(S.coordinate+e*N()/2-f);s[v]=S=Fn(Fn({},S),{},{tickCoord:C>0?S.coordinate-C*e:S.coordinate})}else s[v]=S=Fn(Fn({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=hf(e,S.tickCoord,N,c,f);E&&(f=S.tickCoord-e*(N()/2+i),s[v]=Fn(Fn({},S),{},{isShow:!0}))}},p=l-1;p>=0;p--)h(p);return s}function Ype(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,{start:f,end:h}=t;if(s){var p=r[c-1];if(p!=null){var g=n(p,c-1),v=e*(p.coordinate+e*g/2-h);if(l[c-1]=p=Fn(Fn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate}),p.tickCoord!=null){var y=hf(e,p.tickCoord,()=>g,f,h);y&&(h=p.tickCoord-e*(g/2+i),l[c-1]=Fn(Fn({},p),{},{isShow:!0}))}}}for(var S=s?c-1:c,w=function(E){var k=l[E];if(k==null)return 1;var O=k,T,z=()=>(T===void 0&&(T=n(k,E)),T);if(E===0){var A=e*(O.coordinate-e*z()/2-f);l[E]=O=Fn(Fn({},O),{},{tickCoord:A<0?O.coordinate-A*e:O.coordinate})}else l[E]=O=Fn(Fn({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var P=hf(e,O.tickCoord,z,f,h);P&&(f=O.tickCoord+e*(z()/2+i),l[E]=Fn(Fn({},O),{},{isShow:!0}))}},N=0;N<S;N++)w(N);return l}function kN(e,t,n){var{tick:r,ticks:i,viewBox:s,minTickGap:l,orientation:c,interval:f,tickFormatter:h,unit:p,angle:g}=e;if(!i||!i.length||!r)return[];if(De(f)||Af.isSsr){var v;return(v=qpe(i,De(f)?f:0))!==null&&v!==void 0?v:[]}var y=[],S=c==="top"||c==="bottom"?"width":"height",w=p&&S==="width"?Id(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},N=(T,z)=>{var A=typeof h=="function"?h(T.value,z):T.value;return S==="width"?Upe(Id(A,{fontSize:t,letterSpacing:n}),w,g):Id(A,{fontSize:t,letterSpacing:n})[S]},C=i[0],E=i[1],k=i.length>=2&&C!=null&&E!=null?ni(E.coordinate-C.coordinate):1,O=Bpe(s,k,S);return f==="equidistantPreserveStart"?Fpe(k,O,N,i,l):f==="equidistantPreserveEnd"?Kpe(k,O,N,i,l):(f==="preserveStart"||f==="preserveStartEnd"?y=Ype(k,O,N,i,l,f==="preserveStartEnd"):y=Zpe(k,O,N,i,l),y.filter(T=>T.isShow))}var Wpe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:s=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var g=p.getBoundingClientRect();g.width>l&&(l=g.width)}});var c=n?n.getBoundingClientRect().width:0,f=i+s,h=l+f+c+(n?r:0);return Math.round(h)}return 0},Qpe={xAxis:{},yAxis:{}},P4=Zn({name:"renderedTicks",initialState:Qpe,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:Xpe,removeRenderedTicks:Jpe}=P4.actions,eme=P4.reducer,tme=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function nme(e,t){if(e==null)return{};var n,r,i=rme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rme(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 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 Jz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jz(Object(n),!0).forEach(function(r){ime(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ime(e,t,n){return(t=ame(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ame(e){var t=sme(e,"string");return typeof t=="symbol"?t:t+""}function sme(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 Ia={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:Vn.axis};function ome(e){var{x:t,y:n,width:r,height:i,orientation:s,mirror:l,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var h=Jt(Jt(Jt({},f),Ti(c)),{},{fill:"none"});if(s==="top"||s==="bottom"){var p=+(s==="top"&&!l||s==="bottom"&&l);h=Jt(Jt({},h),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var g=+(s==="left"&&!l||s==="right"&&l);h=Jt(Jt({},h),{},{x1:t+g*r,y1:n,x2:t+g*r,y2:n+i})}return x.createElement("line",hl({},h,{className:vt("recharts-cartesian-axis-line",lv(c,"className"))}))}function lme(e,t,n,r,i,s,l,c,f){var h,p,g,v,y,S,w=c?-1:1,N=e.tickSize||l,C=De(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":h=p=e.coordinate,v=n+ +!c*i,g=v-w*N,S=g-w*f,y=C;break;case"left":g=v=e.coordinate,p=t+ +!c*r,h=p-w*N,y=h-w*f,S=C;break;case"right":g=v=e.coordinate,p=t+ +c*r,h=p+w*N,y=h+w*f,S=C;break;default:h=p=e.coordinate,v=n+ +c*i,g=v+w*N,S=g+w*f,y=C;break}return{line:{x1:h,y1:g,x2:p,y2:v},tick:{x:y,y:S}}}function cme(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ume(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function dme(e){var{option:t,tickProps:n,value:r}=e,i,s=vt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Jt(Jt({},n),{},{className:s}));else if(typeof t=="function")i=t(Jt(Jt({},n),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=vt(l,_he(t))),i=x.createElement(CN,hl({},n,{className:l}),r)}return i}function fme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Wt();return x.useEffect(()=>{if(r==null||n==null)return ou;var s=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Xpe({ticks:s,axisId:r,axisType:n})),()=>{i(Jpe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var hme=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:s,tickFormatter:l,unit:c,padding:f,tickTextProps:h,orientation:p,mirror:g,x:v,y,width:S,height:w,tickSize:N,tickMargin:C,fontSize:E,letterSpacing:k,getTicksConfig:O,events:T,axisType:z,axisId:A}=e,P=kN(Jt(Jt({},O),{},{ticks:n}),E,k),R=Ti(O),B=iv(r),$=d4(R.textAnchor)?R.textAnchor:cme(p,g),L=ume(p,g),re={};typeof i=="object"&&(re=i);var ge=Jt(Jt({},R),{},{fill:"none"},re),be=P.map(ye=>Jt({entry:ye},lme(ye,v,y,S,w,p,N,g,C))),H=be.map(ye=>{var{entry:Se,line:q}=ye;return x.createElement(Pi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Se.value,"-").concat(Se.coordinate,"-").concat(Se.tickCoord)},i&&x.createElement("line",hl({},ge,q,{className:vt("recharts-cartesian-axis-tick-line",lv(i,"className"))})))}),ee=be.map((ye,Se)=>{var q,D,{entry:G,tick:ae}=ye,Y=Jt(Jt(Jt(Jt({verticalAnchor:L},R),{},{textAnchor:$,stroke:"none",fill:s},ae),{},{index:Se,payload:G,visibleTicksCount:P.length,tickFormatter:l,padding:f},h),{},{angle:(q=(D=h?.angle)!==null&&D!==void 0?D:R.angle)!==null&&q!==void 0?q:0}),ie=Jt(Jt({},Y),B);return x.createElement(Pi,hl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},CL(T,G,Se)),r&&x.createElement(dme,{option:r,tickProps:ie,value:"".concat(typeof l=="function"?l(G.value,Se):G.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(z,"-ticks")},x.createElement(fme,{ticks:P,axisId:A,axisType:z}),ee.length>0&&x.createElement(sa,{zIndex:Vn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(z,"-tick-labels"),ref:t},ee)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(z,"-tick-lines")},H))}),pme=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:s,hide:l,ticks:c,axisType:f,axisId:h}=e,p=nme(e,tme),[g,v]=x.useState(""),[y,S]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var C;return Wpe({ticks:w.current,label:(C=e.labelRef)===null||C===void 0?void 0:C.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var N=x.useCallback(C=>{if(C){var E=C.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=E;var k=E[0];if(k){var O=window.getComputedStyle(k),T=O.fontSize,z=O.letterSpacing;(T!==g||z!==y)&&(v(T),S(z))}}},[g,y]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(sa,{zIndex:e.zIndex},x.createElement(Pi,{className:vt("recharts-cartesian-axis",s)},x.createElement(ome,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ti(e)}),x.createElement(hme,{ref:N,axisType:f,events:p,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:y,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(g4,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(y4,{label:e.label,labelRef:e.labelRef}),e.children)))}),AN=x.forwardRef((e,t)=>{var n=rr(e,Ia);return x.createElement(pme,hl({},n,{ref:t}))});AN.displayName="CartesianAxis";var mme=["x1","y1","x2","y2","key"],gme=["offset"],vme=["xAxisId","yAxisId"],yme=["xAxisId","yAxisId"];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 Gn(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){bme(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 bme(e,t,n){return(t=xme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xme(e){var t=wme(e,"string");return typeof t=="symbol"?t:t+""}function wme(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 Ho(){return Ho=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},Ho.apply(null,arguments)}function xg(e,t){if(e==null)return{};var n,r,i=Sme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sme(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 jme=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:s,height:l,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:s,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function z4(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:s,y1:l,x2:c,y2:f,key:h}=n,p=xg(n,mme),g=(i=Ti(p))!==null&&i!==void 0?i:{},{offset:v}=g,y=xg(g,gme);r=x.createElement("line",Ho({},y,{x1:s,y1:l,x2:c,y2:f,fill:"none",key:h}))}return r}function Nme(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=xg(e,vme),f=i.map((h,p)=>{var g=Gn(Gn({},c),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(p),index:p});return x.createElement(z4,{key:"line-".concat(p),option:r,lineItemProps:g})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function Cme(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=xg(e,yme),f=i.map((h,p)=>{var g=Gn(Gn({},c),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(z4,{option:r,lineItemProps:g,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function Ome(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:s,height:l,horizontalPoints:c,horizontal:f=!0}=e;if(!f||!t||!t.length||c==null)return null;var h=c.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],S=y==null,w=S?i+l-g:y-g;if(w<=0)return null;var N=v%t.length;return x.createElement("rect",{key:"react-".concat(v),y:g,x:r,height:w,width:s,stroke:"none",fill:t[N],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function _me(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:s,width:l,height:c,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var h=f.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],S=y==null,w=S?i+l-g:y-g;if(w<=0)return null;var N=v%n.length;return x.createElement("rect",{key:"react-".concat(v),x:g,y:s,width:w,height:c,stroke:"none",fill:n[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var kme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:s}=e;return y$(kN(Gn(Gn(Gn({},Ia),n),{},{ticks:b$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.left,s.left+s.width,t)},Ame=(e,t)=>{var{yAxis:n,width:r,height:i,offset:s}=e;return y$(kN(Gn(Gn(Gn({},Ia),n),{},{ticks:b$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.top,s.top+s.height,t)},Eme={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vn.grid};function M4(e){var t=xj(),n=wj(),r=O$(),i=Gn(Gn({},rr(e,Eme)),{},{x:De(e.x)?e.x:r.left,y:De(e.y)?e.y:r.top,width:De(e.width)?e.width:r.width,height:De(e.height)?e.height:r.height}),{xAxisId:s,yAxisId:l,x:c,y:f,width:h,height:p,syncWithTicks:g,horizontalValues:v,verticalValues:y}=i,S=ir(),w=Le(R=>fz(R,"xAxis",s,S)),N=Le(R=>fz(R,"yAxis",l,S));if(!ea(h)||!ea(p)||!De(c)||!De(f))return null;var C=i.verticalCoordinatesGenerator||kme,E=i.horizontalCoordinatesGenerator||Ame,{horizontalPoints:k,verticalPoints:O}=i;if((!k||!k.length)&&typeof E=="function"){var T=v&&v.length,z=E({yAxis:N?Gn(Gn({},N),{},{ticks:T?v:N.ticks}):void 0,width:t??h,height:n??p,offset:r},T?!0:g);Gm(Array.isArray(z),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(k=z)}if((!O||!O.length)&&typeof C=="function"){var A=y&&y.length,P=C({xAxis:w?Gn(Gn({},w),{},{ticks:A?y:w.ticks}):void 0,width:t??h,height:n??p,offset:r},A?!0:g);Gm(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(O=P)}return x.createElement(sa,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(jme,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(Ome,Ho({},i,{horizontalPoints:k})),x.createElement(_me,Ho({},i,{verticalPoints:O})),x.createElement(Nme,Ho({},i,{offset:r,horizontalPoints:k,xAxis:w,yAxis:N})),x.createElement(Cme,Ho({},i,{offset:r,verticalPoints:O,xAxis:w,yAxis:N}))))}M4.displayName="CartesianGrid";var Tme={},R4=Zn({name:"errorBars",initialState:Tme,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(s=>s.dataKey===r.dataKey&&s.direction===r.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:s0e,replaceErrorBar:o0e,removeErrorBar:l0e}=R4.actions,Pme=R4.reducer;function D4(e,t){var n,r,i=Le(h=>ia(h,e)),s=Le(h=>aa(h,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:vn.allowDataOverflow,c=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:yn.allowDataOverflow,f=l||c;return{needClip:f,needClipX:l,needClipY:c}}function zme(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=_N(),{needClipX:s,needClipY:l,needClip:c}=D4(t,n);if(!c||!i)return null;var{x:f,y:h,width:p,height:g}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:s?f:f-p/2,y:l?h:h-g/2,width:s?p:p*2,height:l?g:g*2}))}function Mme(e){var t=iv(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:s}=t,l=Number(i),c=Number(s);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}function EN(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:C4}function TN(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:C4}var I4=(e,t,n)=>A3(e,"xAxis",EN(e,t),n),L4=(e,t,n)=>k3(e,"xAxis",EN(e,t),n),$4=(e,t,n)=>A3(e,"yAxis",TN(e,t),n),U4=(e,t,n)=>k3(e,"yAxis",TN(e,t),n),Rme=te([Kt,I4,$4,L4,U4],(e,t,n,r,i)=>ra(e,"xAxis")?Hm(t,r,!1):Hm(n,i,!1)),Dme=(e,t)=>t,B4=te([W5,Dme],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),q4=e=>{var t=Kt(e),n=ra(t,"xAxis");return n?"yAxis":"xAxis"},Ime=(e,t)=>{var n=q4(e);return n==="yAxis"?TN(e,t):EN(e,t)},Lme=(e,t,n)=>s3(e,q4(e),Ime(e,t),n),$me=te([B4,Lme],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Rj(e);if(!(r==null||i==null)){var s=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=s?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),Ume=te([Kt,I4,$4,L4,U4,$me,ise,Rme,B4,hse],(e,t,n,r,i,s,l,c,f,h)=>{var{chartData:p,dataStartIndex:g,dataEndIndex:v}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:y}=f,S;if(y&&y.length>0?S=y:S=p?.slice(g,v+1),S!=null)return sge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:s,displayedData:S,chartBaseValue:h,bandSize:c})}}),Bme=["id"],qme=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function el(){return el=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},el.apply(null,arguments)}function F4(e,t){if(e==null)return{};var n,r,i=Fme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fme(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 tM(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?tM(Object(n),!0).forEach(function(r){Kme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kme(e,t,n){return(t=Hme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hme(e){var t=Gme(e,"string");return typeof t=="symbol"?t:t+""}function Gme(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 wg(e,t){return e&&e!=="none"?e:t}var Vme=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:l}=e;return[{inactive:l,dataKey:t,type:s,color:wg(r,i),value:x$(n,t),payload:e}]},Zme=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:l,hide:c,unit:f,tooltipType:h,id:p}=e,g={dataDefinedOnItem:n,getPosition:ou,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:x$(l,t),hide:c,type:h,color:wg(r,s),unit:f,graphicalItemId:p}};return x.createElement(khe,{tooltipEntrySettings:g})});function Yme(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:l}=r,c=Ti(r);return x.createElement(Whe,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function Wme(e){var{showLabels:t,children:n,points:r}=e,i=r.map(s=>{var l,c,f={x:(l=s.x)!==null&&l!==void 0?l:0,y:(c=s.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return _c(_c({},f),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(whe,{value:t?i:void 0},n)}function nM(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:l,type:c,stroke:f,connectNulls:h,isRange:p}=s,{id:g}=s,v=F4(s,Bme),y=Ti(v),S=yr(v);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Pi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(am,el({},S,{id:g,points:t,connectNulls:h,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&x.createElement(am,el({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:t})),f!=="none"&&p&&Array.isArray(n)&&x.createElement(am,el({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:n}))),x.createElement(Yme,{points:t,props:v,clipPathId:i}))}function Qme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.y,f=(n=s[s.length-1])===null||n===void 0?void 0:n.y;if(!Ye(c)||!Ye(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.x||0));return De(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.x||0),p)),De(p)?x.createElement("rect",{x:0,y:c<f?c:c-h,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function Xme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.x,f=(n=s[s.length-1])===null||n===void 0?void 0:n.x;if(!Ye(c)||!Ye(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.y||0));return De(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.y||0),p)),De(p)?x.createElement("rect",{x:c<f?c:c-h,y:0,width:h,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function Jme(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:s}=e;return n==="vertical"?x.createElement(Qme,{alpha:t,points:r,baseLine:i,strokeWidth:s}):x.createElement(Xme,{alpha:t,points:r,baseLine:i,strokeWidth:s})}function ege(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s}=e,{points:l,baseLine:c,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:g,onAnimationStart:v,onAnimationEnd:y}=r,S=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),w=B$(S,"recharts-area-"),N=Sj(),[C,E]=x.useState(!1),k=!C,O=x.useCallback(()=>{typeof y=="function"&&y(),E(!1)},[y]),T=x.useCallback(()=>{typeof v=="function"&&v(),E(!0)},[v]);if(N==null)return null;var z=i.current,A=s.current;return x.createElement(Wme,{showLabels:k,points:l},r.children,x.createElement(U$,{animationId:w,begin:h,duration:p,isActive:f,easing:g,onAnimationEnd:O,onAnimationStart:T,key:w},P=>{if(z){var R=z.length/l.length,B=P===1?l:l.map((L,re)=>{var ge=Math.floor(re*R);if(z[ge]){var be=z[ge];return _c(_c({},L),{},{x:Gi(be.x,L.x,P),y:Gi(be.y,L.y,P)})}return L}),$;return De(c)?$=Gi(A,c,P):Ln(c)||Ji(c)?$=Gi(A,0,P):$=c.map((L,re)=>{var ge=Math.floor(re*R);if(Array.isArray(A)&&A[ge]){var be=A[ge];return _c(_c({},L),{},{x:Gi(be.x,L.x,P),y:Gi(be.y,L.y,P)})}return L}),P>0&&(i.current=B,s.current=$),x.createElement(nM,{points:B,baseLine:$,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=l,s.current=c),x.createElement(Pi,null,f&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(Jme,{alpha:P,points:l,baseLine:c,layout:N,strokeWidth:r.strokeWidth}))),x.createElement(Pi,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(nM,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(Nhe,{label:r.label}))}function tge(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),s=x.useRef();return x.createElement(ege,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class nge extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:l,needClip:c,xAxisId:f,yAxisId:h,width:p,height:g,id:v,baseLine:y,zIndex:S}=this.props;if(t)return null;var w=vt("recharts-area",i),N=v,{r:C,strokeWidth:E}=Mme(n),k=j4(n),O=C*2+E,T=c?"url(#clipPath-".concat(k?"":"dots-").concat(N,")"):void 0;return x.createElement(sa,{zIndex:S},x.createElement(Pi,{className:w},c&&x.createElement("defs",null,x.createElement(zme,{clipPathId:N,xAxisId:f,yAxisId:h}),!k&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:l-O/2,y:s-O/2,width:p+O,height:g+O}))),x.createElement(tge,{needClip:c,clipPathId:N,props:this.props})),x.createElement(Zz,{points:r,mainColor:wg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(y)&&x.createElement(Zz,{points:y,mainColor:wg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var rge={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:Vn.area};function ige(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:f,fillOpacity:h,hide:p,isAnimationActive:g,legendType:v,stroke:y,xAxisId:S,yAxisId:w}=e,N=F4(e,qme),C=lu(),E=X3(),{needClip:k}=D4(S,w),O=ir(),{points:T,isRange:z,baseLine:A}=(t=Le(re=>Ume(re,e.id,O)))!==null&&t!==void 0?t:{},P=_N();if(C!=="horizontal"&&C!=="vertical"||P==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:R,width:B,x:$,y:L}=P;return!T||!T.length?null:x.createElement(nge,el({},N,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,baseLine:A,connectNulls:l,dot:c,fill:f,fillOpacity:h,height:R,hide:p,layout:C,isAnimationActive:g,isRange:z,legendType:v,needClip:k,points:T,stroke:y,width:B,left:$,top:L,xAxisId:S,yAxisId:w}))}var age=(e,t,n,r,i)=>{var s=n??t;if(De(s))return s;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return s==="dataMin"?h:s==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]};function sge(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:l,xAxis:c,yAxis:f,displayedData:h,dataStartIndex:p,xAxisTicks:g,yAxisTicks:v,bandSize:y}=e,S=i&&i.length,w=age(s,l,n,c,f),N=s==="horizontal",C=!1,E=h.map((O,T)=>{var z,A,P,R;if(S)R=i[p+T];else{var B=Nn(O,r);Array.isArray(B)?(R=B,C=!0):R=[w,B]}var $=(z=(A=R)===null||A===void 0?void 0:A[1])!==null&&z!==void 0?z:null,L=$==null||S&&!t&&Nn(O,r)==null;if(N){var re;return{x:sP({axis:c,ticks:g,bandSize:y,entry:O,index:T}),y:L?null:(re=f.scale.map($))!==null&&re!==void 0?re:null,value:R,payload:O}}return{x:L?null:(P=c.scale.map($))!==null&&P!==void 0?P:null,y:sP({axis:f,ticks:v,bandSize:y,entry:O,index:T}),value:R,payload:O}}),k;return S||C?k=E.map(O=>{var T,z=Array.isArray(O.value)?O.value[0]:null;if(N){var A;return{x:O.x,y:z!=null&&O.y!=null&&(A=f.scale.map(z))!==null&&A!==void 0?A:null,payload:O.payload}}return{x:z!=null&&(T=c.scale.map(z))!==null&&T!==void 0?T:null,y:O.y,payload:O.payload}}):k=N?f.scale.map(w):c.scale.map(w),{points:E,baseLine:k??0,isRange:C}}function oge(e){var t=rr(e,rge),n=ir();return x.createElement(Mhe,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(Ahe,{legendPayload:Vme(t)}),x.createElement(Zme,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(Bhe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Vne(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(ige,el({},t,{id:r}))))}var kc=x.memo(oge,kf);kc.displayName="Area";var lge=["domain","range"],cge=["domain","range"];function rM(e,t){if(e==null)return{};var n,r,i=uge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iM(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 K4(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=rM(e,lge),{domain:s,range:l}=t,c=rM(t,cge);return!iM(n,s)||!iM(r,l)?!1:kf(i,c)}var dge=["type"],fge=["dangerouslySetInnerHTML","ticks","scale"],hge=["id","scale"];function US(){return US=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},US.apply(null,arguments)}function aM(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 sM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){pge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pge(e,t,n){return(t=mge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mge(e){var t=gge(e,"string");return typeof t=="symbol"?t:t+""}function gge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BS(e,t){if(e==null)return{};var n,r,i=vge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vge(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 yge(e){var t=Wt(),n=x.useRef(null),r=Sj(),{type:i}=e,s=BS(e,dge),l=Av(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return sM(sM({},s),{},{type:l})},[s,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(tpe(c)):n.current!==c&&t(npe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(rpe(n.current)),n.current=null)},[t]),null}var bge=e=>{var{xAxisId:t,className:n}=e,r=Le(S$),i=ir(),s="xAxis",l=Le(C=>_3(C,s,t,i)),c=Le(C=>Fce(C,t)),f=Le(C=>Yce(C,t)),h=Le(C=>G5(C,t));if(c==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:v}=e,y=BS(e,fge),{id:S,scale:w}=h,N=BS(h,hge);return x.createElement(AN,US({},y,N,{x:f.x,y:f.y,width:c.width,height:c.height,className:vt("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l,axisType:s,axisId:t}))},xge={allowDataOverflow:vn.allowDataOverflow,allowDecimals:vn.allowDecimals,allowDuplicatedCategory:vn.allowDuplicatedCategory,angle:vn.angle,axisLine:Ia.axisLine,height:vn.height,hide:!1,includeHidden:vn.includeHidden,interval:vn.interval,label:!1,minTickGap:vn.minTickGap,mirror:vn.mirror,orientation:vn.orientation,padding:vn.padding,reversed:vn.reversed,scale:vn.scale,tick:vn.tick,tickCount:vn.tickCount,tickLine:Ia.tickLine,tickSize:Ia.tickSize,type:vn.type,niceTicks:vn.niceTicks,xAxisId:0},wge=e=>{var t=rr(e,xge);return x.createElement(x.Fragment,null,x.createElement(yge,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(bge,t))},Sg=x.memo(wge,K4);Sg.displayName="XAxis";var Sge=["type"],jge=["dangerouslySetInnerHTML","ticks","scale"],Nge=["id","scale"];function qS(){return qS=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},qS.apply(null,arguments)}function oM(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?oM(Object(n),!0).forEach(function(r){Cge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cge(e,t,n){return(t=Oge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oge(e){var t=_ge(e,"string");return typeof t=="symbol"?t:t+""}function _ge(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 FS(e,t){if(e==null)return{};var n,r,i=kge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kge(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 Age(e){var t=Wt(),n=x.useRef(null),r=Sj(),{type:i}=e,s=FS(e,Sge),l=Av(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return lM(lM({},s),{},{type:l})},[l,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(ipe(c)):n.current!==c&&t(ape({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(spe(n.current)),n.current=null)},[t]),null}function Ege(e){var{yAxisId:t,className:n,width:r,label:i}=e,s=x.useRef(null),l=x.useRef(null),c=Le(S$),f=ir(),h=Wt(),p="yAxis",g=Le(z=>Xce(z,t)),v=Le(z=>Qce(z,t)),y=Le(z=>_3(z,p,t,f)),S=Le(z=>V5(z,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!g||ON(i)||x.isValidElement(i)||S==null)){var z=s.current;if(z){var A=z.getCalculatedWidth();Math.round(g.width)!==Math.round(A)&&h(ope({id:t,width:A}))}}},[y,g,h,i,t,r,S]),g==null||v==null||S==null)return null;var{dangerouslySetInnerHTML:w,ticks:N,scale:C}=e,E=FS(e,jge),{id:k,scale:O}=S,T=FS(S,Nge);return x.createElement(AN,qS({},E,T,{ref:s,labelRef:l,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:g.width,height:g.height,className:vt("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:y,axisType:p,axisId:t}))}var Tge={allowDataOverflow:yn.allowDataOverflow,allowDecimals:yn.allowDecimals,allowDuplicatedCategory:yn.allowDuplicatedCategory,angle:yn.angle,axisLine:Ia.axisLine,hide:!1,includeHidden:yn.includeHidden,interval:yn.interval,label:!1,minTickGap:yn.minTickGap,mirror:yn.mirror,orientation:yn.orientation,padding:yn.padding,reversed:yn.reversed,scale:yn.scale,tick:yn.tick,tickCount:yn.tickCount,tickLine:Ia.tickLine,tickSize:Ia.tickSize,type:yn.type,niceTicks:yn.niceTicks,width:yn.width,yAxisId:0},Pge=e=>{var t=rr(e,Tge);return x.createElement(x.Fragment,null,x.createElement(Age,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(Ege,t))},jg=x.memo(Pge,K4);jg.displayName="YAxis";var zge=(e,t)=>t,PN=te([zge,Kt,l5,On,G3,Ga,xde,Un],_de);function Mge(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function zN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Mge(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var s=e.currentTarget;n=s.offsetWidth>0?t.width/s.offsetWidth:1,r=s.offsetHeight>0?t.height/s.offsetHeight:1}var l=(c,f)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var H4=Pr("mouseClick"),G4=jf();G4.startListening({actionCreator:H4,effect:(e,t)=>{var n=e.payload,r=PN(t.getState(),zN(n));r?.activeIndex!=null&&t.dispatch(hue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var KS=Pr("mouseMove"),V4=jf(),gc=null,Ao=null,ow=null;V4.startListening({actionCreator:KS,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s?.includes("mousemove");gc!==null&&(cancelAnimationFrame(gc),gc=null),Ao!==null&&(typeof i!="number"||!l)&&(clearTimeout(Ao),Ao=null),ow=zN(n);var c=()=>{var f=t.getState(),h=If(f,f.tooltip.settings.shared);if(!ow){gc=null,Ao=null;return}if(h==="axis"){var p=PN(f,ow);p?.activeIndex!=null?t.dispatch(D3({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(R3())}gc=null,Ao=null};if(!l){c();return}i==="raf"?gc=requestAnimationFrame(c):typeof i=="number"&&Ao===null&&(Ao=setTimeout(c,i))}});function Rge(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 cM={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},Z4=Zn({name:"rootProps",initialState:cM,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:cM.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}}}),Dge=Z4.reducer,{updateOptions:Ige}=Z4.actions,Lge=null,$ge={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)},Y4=Zn({name:"polarOptions",initialState:Lge,reducers:$ge}),{updatePolarOptions:c0e}=Y4.actions,Uge=Y4.reducer,W4=Pr("keyDown"),Q4=Pr("focus"),X4=Pr("blur"),qv=jf(),vc=null,Eo=null,Fp=null;qv.startListening({actionCreator:W4,effect:(e,t)=>{Fp=e.payload,vc!==null&&(cancelAnimationFrame(vc),vc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,s=i==="all"||i.includes("keydown");Eo!==null&&(typeof r!="number"||!s)&&(clearTimeout(Eo),Eo=null);var l=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=c.tooltip,p=Fp;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=Dd(h,fl(c),Yc(c),Qc(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,S=Ga(c),w=fl(c),N=If(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var C=gg(c,N,"hover",String(h.index));t.dispatch(mg({active:!h.active,activeIndex:h.index,activeCoordinate:C}));return}var E=rue(c),k=E==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,T;if(y){var z=Yc(c),A=Qc(c),P=O*k,R=ge=>({active:!1,index:String(ge),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,P>0){for(var B=0;B<w.length;B++)if(Dd(R(B),w,z,A)!=null){T=B;break}}else for(var $=w.length-1;$>=0;$--)if(Dd(R($),w,z,A)!=null){T=$;break}if(T<0)return}else{T=v+O*k;var L=S?.length||w.length;if(L===0||T>=L||T<0)return}var re=gg(c,N,"hover",String(T));t.dispatch(mg({active:!0,activeIndex:T.toString(),activeCoordinate:re}))}finally{vc=null,Eo=null}};if(!s){l();return}r==="raf"?vc=requestAnimationFrame(l):typeof r=="number"&&Eo===null&&(l(),Fp=null,Eo=setTimeout(()=>{Fp?l():(Eo=null,vc=null)},r))}});qv.startListening({actionCreator:Q4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var s="0",l=If(n,n.tooltip.settings.shared),c=gg(n,l,"hover",String(s));t.dispatch(mg({active:!0,activeIndex:s,activeCoordinate:c}))}}}});qv.startListening({actionCreator:X4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(mg({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function J4(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 Qr=Pr("externalEvent"),eU=jf(),Kp=new Map,jd=new Map,lw=new Map;eU.startListening({actionCreator:Qr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,s=J4(r);lw.set(i,{handler:n,reactEvent:s});var l=Kp.get(i);l!==void 0&&(cancelAnimationFrame(l),Kp.delete(i));var c=t.getState(),{throttleDelay:f,throttledEvents:h}=c.eventSettings,p=h,g=p==="all"||p?.includes(i),v=jd.get(i);v!==void 0&&(typeof f!="number"||!g)&&(clearTimeout(v),jd.delete(i));var y=()=>{var N=lw.get(i);try{if(!N)return;var{handler:C,reactEvent:E}=N,k=t.getState(),O={activeCoordinate:ade(k),activeDataKey:nde(k),activeIndex:df(k),activeLabel:Y3(k),activeTooltipIndex:df(k),isTooltipActive:sde(k)};C&&C(O,E)}finally{Kp.delete(i),jd.delete(i),lw.delete(i)}};if(!g){y();return}if(f==="raf"){var S=requestAnimationFrame(y);Kp.set(i,S)}else if(typeof f=="number"){if(!jd.has(i)){y();var w=setTimeout(y,f);jd.set(i,w)}}else y()}}});var Bge=te([gu],e=>e.tooltipItemPayloads),qge=te([Bge,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(s=>s.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),tU=Pr("touchMove"),nU=jf(),To=null,ws=null,uM=null,Nd=null;nU.startListening({actionCreator:tU,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Nd=J4(n);var r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s.includes("touchmove");To!==null&&(cancelAnimationFrame(To),To=null),ws!==null&&(typeof i!="number"||!l)&&(clearTimeout(ws),ws=null),uM=Array.from(n.touches).map(f=>zN({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(Nd!=null){var f=t.getState(),h=If(f,f.tooltip.settings.shared);if(h==="axis"){var p,g=(p=uM)===null||p===void 0?void 0:p[0];if(g==null){To=null,ws=null;return}var v=PN(f,g);v?.activeIndex!=null&&t.dispatch(D3({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(h==="item"){var y,S=Nd.touches[0];if(document.elementFromPoint==null||S==null)return;var w=document.elementFromPoint(S.clientX,S.clientY);if(!w||!w.getAttribute)return;var N=w.getAttribute(ere),C=(y=w.getAttribute(tre))!==null&&y!==void 0?y:void 0,E=jl(f).find(T=>T.id===C);if(N==null||E==null||C==null)return;var{dataKey:k}=E,O=qge(f,N,C);t.dispatch(fue({activeDataKey:k,activeIndex:N,activeCoordinate:O,activeGraphicalItemId:C}))}To=null,ws=null}};if(!l){c();return}i==="raf"?To=requestAnimationFrame(c):typeof i=="number"&&ws===null&&(c(),Nd=null,ws=setTimeout(()=>{Nd?c():(ws=null,To=null)},i))}}});var rU={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},iU=Zn({name:"eventSettings",initialState:rU,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Fge}=iU.actions,Kge=iU.reducer,Hge=FL({brush:vpe,cartesianAxis:lpe,chartData:ife,errorBars:Pme,eventSettings:Kge,graphicalItems:$he,layout:Lne,legend:Zre,options:Jde,polarAxis:Ohe,polarOptions:Uge,referenceElements:Cpe,renderedTicks:eme,rootProps:Dge,tooltip:pue,zIndex:Ude}),Gge=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return cne({reducer:Hge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([G4.middleware,V4.middleware,qv.middleware,eU.middleware,nU.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(i$({type:"raf"}))},devTools:{serialize:{replacer:Rge},name:"recharts-".concat(n)}})};function Vge(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=ir(),s=x.useRef(null);if(i)return n;s.current==null&&(s.current=Gge(t,r));var l=dj;return x.createElement(fie,{context:l,store:s.current},n)}function Zge(e){var{layout:t,margin:n}=e,r=Wt(),i=ir();return x.useEffect(()=>{i||(r(Rne(t)),r(Mne(n)))},[r,i,t,n]),null}var Yge=x.memo(Zge,kf);function Wge(e){var t=Wt();return x.useEffect(()=>{t(Ige(e))},[t,e]),null}var Qge=e=>{var t=Wt();return x.useEffect(()=>{t(Fge(e))},[t,e]),null},Xge=x.memo(Qge,kf);function dM(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Wt();return x.useLayoutEffect(()=>(r.current&&i(Lde({zIndex:t,element:r.current,isPanorama:n})),()=>{i($de({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function fM(e){var{children:t,isPanorama:n}=e,r=Le(Ade);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),s=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(dM,{key:l,zIndex:l,isPanorama:n})),t,s.map(l=>x.createElement(dM,{key:l,zIndex:l,isPanorama:n})))}var Jge=["children"];function eve(e,t){if(e==null)return{};var n,r,i=tve(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tve(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 Ng(){return Ng=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},Ng.apply(null,arguments)}var nve={width:"100%",height:"100%",display:"block"},rve=x.forwardRef((e,t)=>{var n=xj(),r=wj(),i=D$();if(!ea(n)||!ea(r))return null;var{children:s,otherAttributes:l,title:c,desc:f}=e,h,p;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(nj,Ng({},l,{title:c,desc:f,role:p,tabIndex:h,width:n,height:r,style:nve,ref:t}),s)}),ive=e=>{var{children:t}=e,n=Le(Sv);if(!n)return null;var{width:r,height:i,y:s,x:l}=n;return x.createElement(nj,{width:r,height:i,x:l,y:s},t)},hM=x.forwardRef((e,t)=>{var{children:n}=e,r=eve(e,Jge),i=ir();return i?x.createElement(ive,null,x.createElement(fM,{isPanorama:!0},n)):x.createElement(rve,Ng({ref:t},r),x.createElement(fM,{isPanorama:!1},n))});function ave(){var e=Wt(),[t,n]=x.useState(null),r=Le(Jne);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;Ye(s)&&s!==r&&e(Ine(s))}},[t,e,r]),n}function pM(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 sve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){ove(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ove(e,t,n){return(t=lve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lve(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 Us(){return Us=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},Us.apply(null,arguments)}var uve=()=>(hfe(),null);function Cg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var dve=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[s,l]=x.useState({containerWidth:Cg((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Cg((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((h,p)=>{l(g=>{var v=Math.round(h),y=Math.round(p);return g.containerWidth===v&&g.containerHeight===y?g:{containerWidth:v,containerHeight:y}})},[]),f=x.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:p,height:g}=h.getBoundingClientRect();c(p,g);var v=S=>{var w=S[0];if(w!=null){var{width:N,height:C}=w.contentRect;c(N,C)}},y=new ResizeObserver(v);y.observe(h),i.current=y}},[t,c]);return x.useEffect(()=>()=>{var h=i.current;h?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(Of,{width:s.containerWidth,height:s.containerHeight}),x.createElement("div",Us({ref:f},e)))}),fve=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=x.useState({containerWidth:Cg(n),containerHeight:Cg(r)}),l=x.useCallback((f,h)=>{s(p=>{var g=Math.round(f),v=Math.round(h);return p.containerWidth===g&&p.containerHeight===v?p:{containerWidth:g,containerHeight:v}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:p}=f.getBoundingClientRect();l(h,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(Of,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Us({ref:c},e)))}),hve=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Of,{width:n,height:r}),x.createElement("div",Us({ref:t},e)))}),pve=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(fve,Us({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(hve,Us({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Of,{width:n,height:r}),x.createElement("div",Us({ref:t},e)))});function mve(e){return e?dve:pve}var gve=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:l,onDoubleClick:c,onMouseDown:f,onMouseEnter:h,onMouseLeave:p,onMouseMove:g,onMouseUp:v,onTouchEnd:y,onTouchMove:S,onTouchStart:w,style:N,width:C,responsive:E,dispatchTouchEvents:k=!0}=e,O=x.useRef(null),T=Wt(),[z,A]=x.useState(null),[P,R]=x.useState(null),B=ave(),$=yj(),L=$?.width>0?$.width:C,re=$?.height>0?$.height:i,ge=x.useCallback(le=>{B(le),typeof t=="function"&&t(le),A(le),R(le),le!=null&&(O.current=le)},[B,t,A,R]),be=x.useCallback(le=>{T(H4(le)),T(Qr({handler:s,reactEvent:le}))},[T,s]),H=x.useCallback(le=>{T(KS(le)),T(Qr({handler:h,reactEvent:le}))},[T,h]),ee=x.useCallback(le=>{T(R3()),T(Qr({handler:p,reactEvent:le}))},[T,p]),ye=x.useCallback(le=>{T(KS(le)),T(Qr({handler:g,reactEvent:le}))},[T,g]),Se=x.useCallback(()=>{T(Q4())},[T]),q=x.useCallback(()=>{T(X4())},[T]),D=x.useCallback(le=>{T(W4(le.key))},[T]),G=x.useCallback(le=>{T(Qr({handler:l,reactEvent:le}))},[T,l]),ae=x.useCallback(le=>{T(Qr({handler:c,reactEvent:le}))},[T,c]),Y=x.useCallback(le=>{T(Qr({handler:f,reactEvent:le}))},[T,f]),ie=x.useCallback(le=>{T(Qr({handler:v,reactEvent:le}))},[T,v]),oe=x.useCallback(le=>{T(Qr({handler:w,reactEvent:le}))},[T,w]),ue=x.useCallback(le=>{k&&T(tU(le)),T(Qr({handler:S,reactEvent:le}))},[T,k,S]),we=x.useCallback(le=>{T(Qr({handler:y,reactEvent:le}))},[T,y]),W=mve(E);return x.createElement(r4.Provider,{value:z},x.createElement(nL.Provider,{value:P},x.createElement(W,{width:L??N?.width,height:re??N?.height,className:vt("recharts-wrapper",r),style:sve({position:"relative",cursor:"default",width:L,height:re},N),onClick:be,onContextMenu:G,onDoubleClick:ae,onFocus:Se,onBlur:q,onKeyDown:D,onMouseDown:Y,onMouseEnter:H,onMouseLeave:ee,onMouseMove:ye,onMouseUp:ie,onTouchEnd:we,onTouchMove:ue,onTouchStart:oe,ref:ge},x.createElement(uve,null),n)))}),vve=["width","height","responsive","children","className","style","compact","title","desc"];function yve(e,t){if(e==null)return{};var n,r,i=bve(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bve(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 xve=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:s,className:l,style:c,compact:f,title:h,desc:p}=e,g=yve(e,vve),v=Ti(g);return f?x.createElement(x.Fragment,null,x.createElement(Of,{width:n,height:r}),x.createElement(hM,{otherAttributes:v,title:h,desc:p},s)):x.createElement(gve,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(hM,{otherAttributes:v,title:h,desc:p,ref:t},x.createElement(Ope,null,s)))});function HS(){return HS=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},HS.apply(null,arguments)}function mM(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 wve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mM(Object(n),!0).forEach(function(r){Sve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sve(e,t,n){return(t=jve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jve(e){var t=Nve(e,"string");return typeof t=="symbol"?t:t+""}function Nve(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 Cve={top:5,right:5,bottom:5,left:5},Ove=wve({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Cve,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},rU),_ve=x.forwardRef(function(t,n){var r,i=rr(t.categoricalChartProps,Ove),{chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,p={chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(Vge,{preloadedState:{options:p},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:s},x.createElement(gpe,{chartData:h.data}),x.createElement(Yge,{layout:i.layout,margin:i.margin}),x.createElement(Xge,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(Wge,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(xve,HS({},i,{ref:n})))}),kve=["axis"],GS=x.forwardRef((e,t)=>x.createElement(_ve,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:kve,tooltipPayloadSearcher:Qde,categoricalChartProps:e,ref:t}));const VS={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Ac={fill:"#71717a",fontSize:11},Ave="#27272a",ZS="#27272a",Td=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function aU(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function YS(e){return aU(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function WS(e){const t=aU(e);return`${t.getMonth()+1}/${t.getDate()}`}const Eve=["7d","30d","90d","all"],Tve=["gap","cited","uncited"],sU={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"},Pve={[Ps.answer]:"Answer",[Ps.citation]:"Sources"};function zve({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(Ps.answer),[s,l]=x.useState(null),[c,f]=x.useState(null),[h,p]=x.useState(null),[g,v]=x.useState(null),[y,S]=x.useState(!0);if(x.useEffect(()=>{let P=!1;return S(!0),Promise.all([tF(e,t),nF(e,t),rF(e,t)]).then(([R,B,$])=>{P||(l(R),f(B),p($),S(!1))}).catch(()=>{P||S(!1)}),()=>{P=!0}},[e,t]),x.useEffect(()=>{v(null)},[r]),y&&!s)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const w=r===Ps.answer,N=s?w?s.overall.answerRate:s.overall.citationRate:0,C=s?w?s.overall.answerMentionedCount:s.overall.cited:0,E=s?.overall.total??0,k=s?w?s.answerTrend:s.trend:"stable",O=k==="improving"?"positive":k==="declining"?"negative":"neutral",T=c?w?c.mentionedKeywords:c.cited:[],z=c?w?c.mentionGap:c.gap:[],A=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(Dn,{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:[Ps.answer,Ps.citation].map(P=>u.jsx("button",{type:"button",className:`sidebar-tab ${r===P?"sidebar-tab--active":""}`,onClick:()=>i(P),children:Pve[P]},P))})]}),u.jsx("div",{className:"flex gap-1",children:Eve.map(P=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===P?"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(P),children:P==="all"?"All":P},P))})]}),s&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(JI,{value:`${Math.round(N*100)}`,label:w?"Answer Rate":"Citation Rate",delta:`${C} / ${E}`,tone:O,description:`Trend: ${k}`,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(wt,{tone:O,children:k})]}),Object.keys(s.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(s.byProvider).map(([P,R])=>{const B=w?R.answerRate:R.citationRate,$=w?R.answerMentionedCount:R.cited;return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:P}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(B*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[$," / ",R.total]})]},P)})})]})]})]}),s.buckets.length>=1&&u.jsx(Mve,{buckets:s.buckets,keywordChanges:s.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(Dn,{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:Tve.map(P=>{const R=P==="cited"?T.length:P==="gap"?z.length:A.length,B=g===P,$=P==="gap"?"Gap":P==="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 ${B?P==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":P==="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:()=>v(B?null:P),children:[$," (",R,")"]},P)})}),u.jsx(Rve,{citedRows:T,gapRows:z,uncitedRows:A,filter:g,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(Dn,{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."})]})]}),h&&h.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(Dve,{categories:h.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:h.overall.map(P=>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 ${sU[P.category]??"bg-zinc-600"}`}),P.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:P.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(P.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:P.topDomains.slice(0,3).map(R=>R.domain).join(", ")})]},P.category))})]})]}),h&&h.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 Mve({buckets:e,keywordChanges:t,metricMode:n}){const r=n===Ps.answer,i=r?"answerRate":"citationRate",s=r?"Answer Rate":"Citation Rate",l=e.map(f=>({date:f.startDate,answerRate:Math.round(f.answerRate*1e3)/10,citationRate:Math.round(f.citationRate*1e3)/10,keywordCount:f.keywordCount??0})),c=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const f=new Date(e[0].startDate).getTime(),h=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const g=new Date(p.date).getTime();return g>=f&&g<=h}).map(p=>{const g=new Date(p.date).getTime();let v=e[0].startDate,y=Math.abs(g-new Date(v).getTime());for(const S of e){const w=Math.abs(g-new Date(S.startDate).getTime());w<y&&(v=S.startDate,y=w)}return{...p,date:v}})},[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":`${s} trend chart`,children:u.jsx(hS,{width:"100%",height:"100%",children:u.jsxs(GS,{data:l,margin:{top:8,right:8,bottom:0,left:0},children:[u.jsx(M4,{strokeDasharray:"3 3",stroke:Ave,vertical:!1}),u.jsx(Sg,{dataKey:"date",tick:Ac,tickLine:!1,axisLine:{stroke:ZS},tickFormatter:WS}),u.jsx(jg,{tick:Ac,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:f=>`${f}%`,width:40}),u.jsx(IS,{...VS,labelFormatter:YS,formatter:(f,h)=>{const p=typeof f=="number"?f:Number(f??0);return String(h)===i?[`${p.toFixed(1)}%`,s]:[String(p),String(h)]}}),c.map(f=>u.jsx(E4,{x:f.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:f.label,position:"top",fill:"#71717a",fontSize:9}},f.date)),u.jsx(kc,{type:"monotone",dataKey:i,stroke:Td[0],fill:Td[0],fillOpacity:.15,strokeWidth:2,dot:{fill:Td[0],r:3,strokeWidth:0},activeDot:{fill:Td[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Rve({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const s=i===Ps.answer,l=x.useMemo(()=>{const c=[...t.map(f=>({...f,_sort:0})),...e.map(f=>({...f,_sort:1})),...n.map(f=>({...f,_sort:2}))];return r?c.filter(f=>f.category===r):c.sort((f,h)=>f._sort-h._sort)},[e,t,n,r]);return l.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:s?"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:l.map(c=>{const f=c.category==="cited"?"positive":c.category==="gap"?"caution":"neutral",h=c.category==="gap"?"Gap":c.category==="cited"?s?"Mentioned":"Cited":s?"Not Mentioned":"Not Cited",p=s?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(wt,{tone:f,children:h})}),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 Dve({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:`${sU[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Ive=["7d","30d","90d","all"],Ss=Td;function Cd(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Lve(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 $ve({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[s,l]=x.useState(!0),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,S]=x.useState(null),[w,N]=x.useState("sessions"),[C,E]=x.useState("desc"),[k,O]=x.useState("sessions"),[T,z]=x.useState("desc"),[A,P]=x.useState("sessions"),[R,B]=x.useState("desc"),[$,L]=x.useState([]),[re,ge]=x.useState([]),[be,H]=x.useState([]),[ee,ye]=x.useState("30d");function Se(me){l(!0),bA(e).then(Ee=>{if(!me.current)return n(Ee),Ee.connected?Promise.all([xA(e,void 0,ee),wA(e,ee).catch(()=>[]),jA(e,ee).catch(()=>[]),SA(e,ee).catch(()=>[])]):null}).then(Ee=>{me.current||(Array.isArray(Ee)?(i(Ee[0]),L(Ee[1]),ge(Ee[2]),H(Ee[3])):(i(null),L([]),ge([]),H([])),l(!1))}).catch(Ee=>{me.current||(v(Ee instanceof Error?Ee.message:"Failed to load GA4 data"),l(!1))})}x.useEffect(()=>{const me={current:!1};return Se(me),()=>{me.current=!0}},[e,ee]);async function q(){f(!0),v(null),S(null);try{const me=await fR(e);S(`Synced ${me.rowCount.toLocaleString()} page rows, ${me.aiReferralCount.toLocaleString()} AI and ${me.socialReferralCount.toLocaleString()} social referral rows (${me.days} days)`);const[Ee,Te,Ne,Ke]=await Promise.all([xA(e,void 0,ee),wA(e,ee).catch(()=>[]),jA(e,ee).catch(()=>[]),SA(e,ee).catch(()=>[])]);i(Ee),L(Te),ge(Ne),H(Ke);const _t=await bA(e);n(_t)}catch(me){v(me instanceof Error?me.message:"Sync failed")}finally{f(!1)}}async function D(){p(!0),v(null),S(null);try{await aF(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),S("GA4 disconnected")}catch(me){v(me instanceof Error?me.message:"Disconnect failed")}finally{p(!1)}}function G(me){w===me?E(Ee=>Ee==="desc"?"asc":"desc"):(N(me),E("desc"))}function ae(me){k===me?z(Ee=>Ee==="desc"?"asc":"desc"):(O(me),z("desc"))}function Y(me){A===me?B(Ee=>Ee==="desc"?"asc":"desc"):(P(me),B("desc"))}const ie=x.useMemo(()=>r?.topPages?[...r.topPages].sort((me,Ee)=>{const Te=me[w],Ne=Ee[w];return typeof Te=="string"&&typeof Ne=="string"?C==="asc"?Te.localeCompare(Ne):Ne.localeCompare(Te):C==="asc"?Te-Ne:Ne-Te}):[],[r?.topPages,w,C]),oe=x.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((me,Ee)=>{const Te=me[k],Ne=Ee[k];return typeof Te=="string"&&typeof Ne=="string"?T==="asc"?Te.localeCompare(Ne):Ne.localeCompare(Te):T==="asc"?Te-Ne:Ne-Te}):[],[r?.aiReferrals,k,T]),ue=x.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((me,Ee)=>{const Te=me[A],Ne=Ee[A];return typeof Te=="string"&&typeof Ne=="string"?R==="asc"?Te.localeCompare(Ne):Ne.localeCompare(Te):R==="asc"?Te-Ne:Ne-Te}):[],[r?.socialReferrals,A,R]),{socialChartData:we,socialChartSources:W}=x.useMemo(()=>{const me=[...new Set(be.map(Ne=>Ne.source))],Ee=new Map;for(const Ne of be){let Ke=Ee.get(Ne.date);Ke||(Ke={_socialTotal:0},Ee.set(Ne.date,Ke)),Ke[Ne.source]=(Ke[Ne.source]??0)+Ne.sessions,Ke._socialTotal=(Ke._socialTotal??0)+Ne.sessions}return{socialChartData:[...Ee.entries()].sort(([Ne],[Ke])=>Ne.localeCompare(Ke)).map(([Ne,Ke])=>({date:Ne,...Ke})),socialChartSources:me}},[be]),{chartData:le,chartSources:je,dateRange:V}=x.useMemo(()=>{const me=[...new Set($.map(dt=>dt.source))],Ee=new Map;for(const dt of re)Ee.set(dt.date,{_totalSessions:dt.sessions,_organicSessions:dt.organicSessions});const Te=new Map;for(const dt of $){const Bn=`${dt.date}::${dt.source}`,Yn=Te.get(Bn)??0;Te.set(Bn,Math.max(Yn,dt.sessions))}for(const[dt,Bn]of Te){const[Yn,pi]=dt.split("::");let Mr=Ee.get(Yn);Mr||(Mr={_totalSessions:0,_organicSessions:0},Ee.set(Yn,Mr)),Mr[pi]=(Mr[pi]??0)+Bn}const Ne=[...Ee.entries()].sort(([dt],[Bn])=>dt.localeCompare(Bn)).map(([dt,Bn])=>({date:dt,...Bn})),Ke=Ne.map(dt=>dt.date),_t=Ke.length>0?{start:Ke[0],end:Ke[Ke.length-1]}:null;return{chartData:Ne,chartSources:me,dateRange:_t}},[$,re]);if(s&&!t)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return u.jsx(Uve,{projectName:e,onConnected:()=>Se({current:!1})});const Be=r?.organicSharePct??0,ze=r?.aiSessionsDeduped??0,Je=r?.aiSharePct??0,et=r?new Set(r.aiReferrals.map(me=>me.source.toLowerCase())).size:0,Ot=oe[0]??null,It=r?.socialSessions??0,kn=r?.socialSharePct??0,pe=r?new Set(r.socialReferrals.map(me=>me.source.toLowerCase())).size:0,Fe=ue[0]??null;return u.jsxs(u.Fragment,{children:[g&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),y&&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:y}),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(ve,{variant:"outline",size:"sm",disabled:c,onClick:q,children:[u.jsx(kA,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(ve,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:h,onClick:D,children:[u.jsx(GF,{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(Dn,{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:Ive.map(me=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${ee===me?"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(me),children:me==="all"?"All":me},me))})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(cw,{value:Cd(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(cw,{value:Cd(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Be}% of total`,tone:"positive"}),u.jsx(cw,{value:Cd(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(ve,{variant:"outline",size:"sm",disabled:c,onClick:q,children:[u.jsx(kA,{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(Dn,{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."})]})]}),V&&u.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(V.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(V.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),le.length>0&&u.jsxs(He,{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:je.length>0?"AI vs. total sessions":"All sessions (baseline)"}),je.length===0&&u.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),je.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(hS,{width:"100%",height:"100%",children:u.jsxs(GS,{data:le,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(Sg,{dataKey:"date",tick:Ac,tickLine:!1,axisLine:{stroke:ZS},tickFormatter:WS}),u.jsx(jg,{tick:Ac,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(IS,{...VS,labelFormatter:YS,formatter:(me,Ee)=>{const Te=typeof me=="number"?me.toLocaleString():String(me??0),Ne=String(Ee??"");return Ne==="_totalSessions"?[Te,"Total Sessions"]:Ne==="_organicSessions"?[Te,"Organic Sessions"]:[Te,Ne]}}),u.jsx(wS,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:me=>me==="_totalSessions"?"Total Sessions":me==="_organicSessions"?"Organic Sessions":me}),u.jsx(kc,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),je.map((me,Ee)=>u.jsx(kc,{type:"monotone",dataKey:me,stackId:"ai",stroke:Ss[Ee%Ss.length],fill:Ss[Ee%Ss.length],fillOpacity:.4,strokeWidth:1.5},me))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(He,{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(Wr,{label:"AI Sessions",value:Cd(ze),hint:`${ze.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(Wr,{label:"Share of Traffic",value:`${Je}%`,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(Wr,{label:"Tracked Sources",value:String(et),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."})]}),Ot&&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:Ot.source})," via ",Ot.medium,", accounting for ",Ot.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(Wr,{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(Wr,{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(Wr,{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(He,{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(Yr,{label:"Source",sortKey:"source",current:k,dir:T,onSort:ae,align:"left"}),u.jsx(Yr,{label:"Medium",sortKey:"medium",current:k,dir:T,onSort:ae,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),u.jsx(Yr,{label:"Sessions",sortKey:"sessions",current:k,dir:T,onSort:ae,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(Yr,{label:"Users",sortKey:"users",current:k,dir:T,onSort:ae,align:"right"})]})}),u.jsx("tbody",{children:oe.map(me=>u.jsx(Kve,{referral:me,totalSessions:ze},`${me.source}:${me.medium}:${me.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(Dn,{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."})]})]}),we.length>0&&u.jsxs(He,{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(hS,{width:"100%",height:"100%",children:u.jsxs(GS,{data:we,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(Sg,{dataKey:"date",tick:Ac,tickLine:!1,axisLine:{stroke:ZS},tickFormatter:WS}),u.jsx(jg,{tick:Ac,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(IS,{...VS,labelFormatter:YS,formatter:(me,Ee)=>{const Te=typeof me=="number"?me.toLocaleString():String(me??0),Ne=String(Ee??"");return Ne==="_socialTotal"?[Te,"Total Social"]:[Te,Ne]}}),u.jsx(wS,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:me=>me==="_socialTotal"?"Total Social":me}),u.jsx(kc,{type:"monotone",dataKey:"_socialTotal",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),W.map((me,Ee)=>u.jsx(kc,{type:"monotone",dataKey:me,stackId:"social",stroke:Ss[Ee%Ss.length],fill:Ss[Ee%Ss.length],fillOpacity:.4,strokeWidth:1.5},me))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(He,{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(Wr,{label:"Social Sessions",value:Cd(It),hint:`${It.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),u.jsx(Wr,{label:"Share of Traffic",value:`${kn}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),u.jsx(Wr,{label:"Platforms",value:String(pe),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."})]}),Fe&&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:Fe.source})," via ",Fe.medium,", accounting for ",Fe.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(Wr,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),u.jsx(Wr,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),u.jsx(Wr,{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(He,{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(Yr,{label:"Source",sortKey:"source",current:A,dir:R,onSort:Y,align:"left"}),u.jsx(Yr,{label:"Medium",sortKey:"medium",current:A,dir:R,onSort:Y,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),u.jsx(Yr,{label:"Sessions",sortKey:"sessions",current:A,dir:R,onSort:Y,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(Yr,{label:"Users",sortKey:"users",current:A,dir:R,onSort:Y,align:"right"})]})}),u.jsx("tbody",{children:ue.map(me=>u.jsx(Hve,{referral:me,totalSessions:It},`${me.source}:${me.medium}:${me.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(Dn,{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(Yr,{label:"Landing Page",sortKey:"landingPage",current:w,dir:C,onSort:G,align:"left"}),u.jsx(Yr,{label:"Sessions",sortKey:"sessions",current:w,dir:C,onSort:G,align:"right"}),u.jsx(Yr,{label:"Organic",sortKey:"organicSessions",current:w,dir:C,onSort:G,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(Yr,{label:"Users",sortKey:"users",current:w,dir:C,onSort:G,align:"right"})]})}),u.jsx("tbody",{children:ie.map(me=>u.jsx(Bve,{page:me},me.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 ${Lve(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function Uve({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,s]=x.useState(null),[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(null),v=x.useRef(null),y=x.useCallback(w=>{const N=w.target.files?.[0];if(!N)return;g(null),s(N.name);const C=new FileReader;C.onload=()=>{const E=C.result;try{const k=JSON.parse(E);if(!k.client_email||!k.private_key){g("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(E)}catch{g("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},C.onerror=()=>{g("Failed to read file."),c(null)},C.readAsText(N)},[]);async function S(){if(g(null),!n.trim()){g("Property ID is required.");return}if(!l){g("Please upload a service account key file.");return}h(!0);try{await iF(e,{propertyId:n.trim(),keyJson:l});try{await fR(e)}catch{}t()}catch(w){g(w instanceof Error?w.message:"Failed to connect GA4")}finally{h(!1)}}return u.jsxs(He,{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:v,type:"file",accept:".json,application/json",onChange:y,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>v.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(ZF,{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(ve,{variant:"default",size:"sm",disabled:f||!n.trim()||!l,onClick:S,children:f?"Connecting & syncing…":"Connect GA4"})]})}function Yr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:s}){const l=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${s==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const oU={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function cw({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 ${oU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Wr({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(Dn,{text:i})]}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${oU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Bve({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 qve={session:"Session",first_user:"First Visit",manual_utm:"UTM"},Fve={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 Kve({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=qve[e.sourceDimension]??e.sourceDimension,i=Fve[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 Hve({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 $f(e){e.invalidateQueries({queryKey:ti.runs.all}),e.invalidateQueries({queryKey:ti.projects.all})}function Gve(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Vve(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 Fv(e,t){yR({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),it({title:Gve(e.kind),detail:Vve(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function Zve(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){it({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)yR({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=dK({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});it({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 Kv(e,t){if(e instanceof Fd&&e.code==="RUN_IN_PROGRESS"){it({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}it({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function lU(){const e=Vs();return pf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>m9(t,n),onSuccess:(t,n)=>{$f(e),Fv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Kv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function Yve(){const e=Vs();return pf({meta:{skipGlobalErrorToast:!0},mutationFn:t=>M9(t),onSuccess:t=>{$f(e),Zve(t)},onError:t=>{it({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Wve(){const e=Vs();return pf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>lR(t,n),onSuccess:(t,n)=>{$f(e),Fv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Kv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function Qve(){const e=Vs();return pf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>V9(t),onSuccess:(t,n)=>{$f(e),Fv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Kv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Xve(){const e=Vs();return pf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>H9(t,n),onSuccess:(t,n)=>{$f(e),Fv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Kv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const Jve=["7d","30d","90d","all"];function eye({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState([]),[s,l]=x.useState([]),[c,f]=x.useState([]),[h,p]=x.useState([]),[g,v]=x.useState([]),[y,S]=x.useState(null),[w,N]=x.useState(""),[C,E]=x.useState(""),[k,O]=x.useState("30"),[T,z]=x.useState(!1),[A,P]=x.useState("30d"),[R,B]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[$,L]=x.useState(""),[re,ge]=x.useState(!0),[be,H]=x.useState(!1),[ee,ye]=x.useState(!1),[Se,q]=x.useState(!1),[D,G]=x.useState(!1),[ae,Y]=x.useState(!1),[ie,oe]=x.useState(!1),[ue,we]=x.useState(null),[W,le]=x.useState(!1),[je,V]=x.useState(!1),[Be,ze]=x.useState(null),[Je,et]=x.useState(""),[Ot,It]=x.useState(!1),[kn,pe]=x.useState(!1),[Fe,me]=x.useState("indexed"),[Ee,Te]=x.useState(null),Ne=x.useMemo(()=>{if(!Ee)return c;const{key:F,dir:xe}=Ee;return[...c].sort((ut,tt)=>{const yt=F===Ts.CTR?Number.isFinite(ut.ctr)?ut.ctr:0:ut[F],xr=F===Ts.CTR?Number.isFinite(tt.ctr)?tt.ctr:0:tt[F];return xe==="asc"?yt-xr:xr-yt})},[c,Ee]),[Ke,_t]=x.useState([]),[dt,Bn]=x.useState(null),[Yn,pi]=x.useState(!1),[Mr,ot]=x.useState(null),[Lt,ln]=x.useState(null),ce=r.find(F=>F.connectionType==="gsc"),mi=c.length>0||h.length>0||g.length>0,vu=Wve(),to=Qve(),Va=Xve();async function no(F){if(!F){l([]),N("");return}ye(!0);try{const{sites:xe}=await I9(e);l(xe),N(F.propertyId??xe[0]?.siteUrl??"")}catch(xe){l([]),ot(xe instanceof Error?xe.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function oa(){G(!0);try{const F=await U9(e,{startDate:R.startDate||void 0,endDate:R.endDate||void 0,query:R.query||void 0,page:R.page||void 0,limit:parseInt(R.limit,10)||20,window:A});f(F)}catch(F){f([]),ot(F instanceof Error?F.message:"Failed to load GSC performance data")}finally{G(!1)}}async function Rr(){Y(!0);try{const[F,xe]=await Promise.all([q9(e,{url:$.trim()||void 0,limit:20}),F9(e)]);p(F),v(xe)}catch(F){p([]),v([]),ot(F instanceof Error?F.message:"Failed to load GSC inspection history")}finally{Y(!1)}}async function ro(){le(!0);try{const[F,xe]=await Promise.all([y1(e),K9(e).catch(()=>[])]);we(F),_t(xe)}catch(F){we(null),_t([]),ot(F instanceof Error?F.message:"Failed to load coverage data")}finally{le(!1)}}async function Za(F){pi(!0),ot(null);try{const xe=await vA(e,{urls:F}),{succeeded:ut,failed:tt,total:yt}=xe.summary;it({title:"Indexing requested",detail:tt===0?`${ut} URL${ut!==1?"s":""} submitted for indexing.`:`${ut}/${yt} submitted successfully, ${tt} failed.`,tone:tt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(xe){ot(xe instanceof Error?xe.message:"Failed to request indexing")}finally{pi(!1)}}async function Gv(){pi(!0),ot(null);try{const F=await vA(e,{urls:[],allUnindexed:!0}),{succeeded:xe,failed:ut,total:tt}=F.summary;it({title:"Indexing requested",detail:ut===0?`${xe} unindexed URL${xe!==1?"s":""} submitted for indexing.`:`${xe}/${tt} submitted successfully, ${ut} failed.`,tone:ut===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(F){ot(F instanceof Error?F.message:"Failed to request indexing")}finally{pi(!1)}}async function io(){if(Je.trim()){It(!0),ot(null);try{await $9(e,"gsc",Je.trim()),i(F=>F.map(xe=>xe.connectionType==="gsc"?{...xe,sitemapUrl:Je.trim()}:xe)),it({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),et("")}catch(F){ot(F instanceof Error?F.message:"Failed to save sitemap URL")}finally{It(!1)}}}async function Nl(){ot(null);try{const F=await to.mutateAsync({projectName:e,projectLabel:e});ze(F.sitemaps),i(xe=>xe.map(ut=>ut.connectionType==="gsc"?{...ut,sitemapUrl:F.primarySitemapUrl}:ut))}catch{}}async function ao(){V(!0),ot(null);try{const F=await G9(e);ze(F.sitemaps),F.sitemaps.length===0&&ln("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(F){ot(F instanceof Error?F.message:"Failed to list sitemaps")}finally{V(!1)}}async function Bf(){ge(!0),ot(null);try{const[F,xe]=await Promise.all([v1().catch(()=>null),oR(e).catch(()=>[])]);n(!!F?.google?.configured),i(xe);const ut=xe.find(tt=>tt.connectionType==="gsc");await Promise.all([no(ut),oa(),Rr(),ro()])}finally{ge(!1)}}x.useEffect(()=>{Bf()},[e]),x.useEffect(()=>{oa()},[A]);async function qf(){if(!t){ot("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}H(!0),ot(null),ln(null);try{const{authUrl:F}=await R9(e,"gsc");if(!F.startsWith("https://accounts.google.com/")){ot("Unexpected OAuth redirect URL. Please try again.");return}const xe=window.open(F,"_blank","width=600,height=700");if(!xe){window.location.assign(F);return}ln("Finish the Google consent flow in the popup, then close it to refresh this project.");const ut=window.setInterval(()=>{xe.closed&&(window.clearInterval(ut),ln(null),Bf())},1e3)}catch(F){ot(F instanceof Error?F.message:"Failed to start OAuth flow")}finally{H(!1)}}async function Ff(){ot(null),ln(null);try{await D9(e,"gsc"),i(F=>F.filter(xe=>xe.connectionType!=="gsc")),l([]),N("")}catch(F){ot(F instanceof Error?F.message:"Failed to disconnect")}}async function Kf(){if(w){q(!0),ot(null);try{await L9(e,"gsc",w),i(F=>F.map(xe=>xe.connectionType==="gsc"?{...xe,propertyId:w}:xe)),it({title:"GSC property updated",detail:`${e} is now linked to ${w}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(F){ot(F instanceof Error?F.message:"Failed to save GSC property")}finally{q(!1)}}}async function yu(){ot(null),ln(null);try{await vu.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(k,10)||void 0,full:T||void 0}})}catch{}}async function Cl(){if(C.trim()){oe(!0),ot(null),ln(null);try{const F=await B9(e,C.trim());S(F),E(""),await Rr()}catch(F){ot(F instanceof Error?F.message:"Failed to inspect URL")}finally{oe(!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:Jve.map(F=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${A===F?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>P(F),children:F==="all"?"All":F},F))}),ce&&u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{oa()},children:D?"Refreshing…":"Refresh data"})]})]}),Mr&&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:[Mr,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>ot(null),children:"×"})]}),Lt&&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:[Lt,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>ln(null),children:"×"})]}),re?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(He,{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(wt,{tone:ce?"positive":t?"caution":"negative",children:ce?"Connected":t?"Ready to connect":"App credentials missing"})]}),ce?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:ce.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Ff,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:ce.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:ce.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:Ci(ce.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(ve,{type:"button",variant:"outline",size:"sm",disabled:be,onClick:qf,children:be?"Opening…":"Connect Google Search Console"}):u.jsx(ve,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Ut,{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."})]})]})]}),ce&&!ce.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(ve,{type:"button",size:"sm",disabled:to.isPending||!ce.propertyId,onClick:Nl,children:to.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:Je,onChange:F=>et(F.target.value),onKeyDown:F=>F.key==="Enter"&&void io()}),u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:Ot||!Je.trim(),onClick:io,children:Ot?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ce||mi)&&u.jsxs(u.Fragment,{children:[u.jsxs(He,{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:[ue&&ue.notIndexed.length>0&&u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:Yn,onClick:()=>{Gv()},children:Yn?"Requesting…":`Request indexing (${ue.notIndexed.length})`}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:W,onClick:()=>{ro()},children:W?"Loading…":"Refresh coverage"})]})]}),ue&&ue.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const F=ue.summary.indexed+ue.summary.notIndexed,xe=F>0?ue.summary.indexed/F:0,ut=F>0?ue.summary.notIndexed/F:0,tt=54,yt=2*Math.PI*tt,xr=yt*(1-xe),gi=yt*ut,Ya=yt*xe;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:tt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:tt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:yt,strokeDashoffset:xr,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),ue.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:tt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${gi} ${yt-gi}`,strokeDashoffset:-Ya,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:[(xe*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:ue.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:ue.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(ue.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(ue.reasonGroups??[]).length," ",(ue.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),ue.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:ue.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(F=>{const xe=F==="indexed"?ue.indexed.length:F==="notIndexed"?ue.notIndexed.length:ue.deindexed.length,ut=F==="indexed"?"Indexed":F==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Fe===F?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{me(F),Bn(null)},children:[ut," (",xe,")"]},F)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Fe==="indexed"&&ue.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:ue.indexed.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.crawlTime?F.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:F.isMobileFriendly===!0?"Yes":F.isMobileFriendly===!1?"No":"—"})]},F.id))})]}),Fe==="notIndexed"&&!dt&&(ue.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:(ue.reasonGroups??[]).map(F=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Bn(F.reason),children:[u.jsx("td",{className:"text-zinc-200",children:F.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.count})]},F.reason))})]}),Fe==="notIndexed"&&!dt&&(ue.reasonGroups??[]).length===0&&ue.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:ue.notIndexed.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.coverageState??"Unknown"})]},F.id))})]}),Fe==="notIndexed"&&dt&&(()=>{const F=(ue.reasonGroups??[]).find(xe=>xe.reason===dt);return F?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:()=>Bn(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:F.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[F.count," affected page",F.count!==1?"s":""]})]}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:Yn,onClick:()=>{Za(F.urls.map(xe=>xe.url))},children:Yn?"Requesting…":`Request indexing (${F.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:F.urls.map(xe=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:xe.url}),u.jsx("td",{className:"text-zinc-400",children:xe.crawlTime?xe.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:Yn,onClick:()=>{Za([xe.url])},title:"Request indexing",children:"Index"})})]},xe.id))})]})]}):null})(),Fe==="deindexed"&&ue.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:ue.deindexed.map((F,xe)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.previousState}),u.jsx("td",{className:"text-zinc-400",children:F.currentState}),u.jsx("td",{className:"text-zinc-400",children:F.transitionDate.split("T")[0]})]},`${F.url}-${xe}`))})]}),(Fe==="indexed"&&ue.indexed.length===0||Fe==="notIndexed"&&!dt&&ue.notIndexed.length===0||Fe==="deindexed"&&ue.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:W?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(He,{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(ve,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{oa()},children:D?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const F=new Map;for(const We of c){const ft=F.get(We.date);ft?(ft.clicks+=We.clicks,ft.impressions+=We.impressions):F.set(We.date,{clicks:We.clicks,impressions:We.impressions})}const xe=[...F.entries()].sort(([We],[ft])=>We.localeCompare(ft));if(xe.length===0)return null;const ut=Math.max(...xe.map(([,We])=>We.impressions),1),tt=xe.reduce((We,[,ft])=>We+ft.clicks,0),yt=xe.reduce((We,[,ft])=>We+ft.impressions,0),xr=yt>0?(tt/yt*100).toFixed(1):"0.0",gi=700,Ya=220,sr={top:12,bottom:36,left:48,right:12},Hf=gi-sr.left-sr.right,Dr=Ya-sr.top-sr.bottom,la=Hf/xe.length,vi=Math.max(Math.min(la*.35,24),4),ca=Math.max(vi*.15,1),so=We=>{if(We<=0)return 1;const ft=Math.pow(10,Math.floor(Math.log10(We))),wr=We/ft,bi=wr<=1.5?1.5:wr<=3?3:wr<=5?5:10;return Math.ceil(bi*ft)},yi=4,Ht=Math.ceil(so(ut)/yi)*yi,Gf=Array.from({length:yi+1},(We,ft)=>Ht/yi*ft),Vf=We=>We>=1e3?`${(We/1e3).toFixed(We>=1e4?0:1)}k`:String(We);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:tt.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:yt.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[xr,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${gi} / ${Ya}`},children:u.jsxs("svg",{viewBox:`0 0 ${gi} ${Ya}`,className:"h-full w-full",children:[Gf.map((We,ft)=>{const wr=sr.top+Dr-We/Ht*Dr;return u.jsxs("g",{children:[u.jsx("line",{x1:sr.left,y1:wr,x2:gi-sr.right,y2:wr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:sr.left-6,y:wr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Vf(We)})]},`t-${ft}`)}),xe.map(([We,ft],wr)=>{const bi=sr.left+la*wr+la/2,oo=ft.impressions/Ht*Dr,Zf=ft.clicks/Ht*Dr;return u.jsxs("g",{children:[u.jsx("title",{children:`${We}
270
- Clicks: ${ft.clicks}
271
- Impressions: ${ft.impressions}
272
- CTR: ${ft.impressions>0?(ft.clicks/ft.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:bi-vi-ca/2,y:sr.top+Dr-oo,width:vi,height:Math.max(oo,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:bi+ca/2,y:sr.top+Dr-Zf,width:vi,height:Math.max(Zf,1),rx:2,fill:"#10b981",opacity:.85})]},We)}),(()=>{const We=Math.min(xe.length,7);return Array.from({length:We},(ft,wr)=>{const bi=xe.length===1?0:Math.round(wr/(We-1)*(xe.length-1)),oo=sr.left+la*bi+la/2;return u.jsx("text",{x:oo,y:Ya-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:xe[bi][0].slice(5)},`xl-${bi}`)})})()]})})]})})(),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:R.startDate,onChange:F=>B(xe=>({...xe,startDate:F.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:R.endDate,onChange:F=>B(xe=>({...xe,endDate:F.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:R.query,onChange:F=>B(xe=>({...xe,query:F.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:R.page,onChange:F=>B(xe=>({...xe,page:F.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:R.limit,onChange:F=>B(xe=>({...xe,limit:F.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(Ts).map(F=>u.jsx("th",{className:"text-right","aria-sort":Ee?.key===F?Ee.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:()=>Te(xe=>xe?.key===F?xe.dir==="desc"?{key:F,dir:"asc"}:null:{key:F,dir:"desc"}),children:[WF[F],Ee?.key===F?Ee.dir==="desc"?" ↓":" ↑":""]})},F))]})}),u.jsx("tbody",{children:Ne.map((F,xe)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:F.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:F.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:F.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:F.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(F.ctr)?F.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.position.toFixed(1)})]},`${F.date}:${F.query}:${F.page}:${xe}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),u.jsx("h3",{children:"Inspect a URL"})]})}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:C,onChange:F=>E(F.target.value),onKeyDown:F=>F.key==="Enter"&&void Cl()}),u.jsx(ve,{type:"button",size:"sm",disabled:ie||!ce?.propertyId||!C.trim(),onClick:Cl,children:ie?"Inspecting…":"Inspect URL"})]}),y&&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:y.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:y.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:AA(y.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:Ci(y.crawlTime)})]})]})]}),u.jsxs(He,{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(ve,{type:"button",variant:"outline",size:"sm",disabled:ae,onClick:()=>{Rr()},children:ae?"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:F=>L(F.target.value)}),u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:ae,onClick:()=>{Rr()},children:"Apply filter"})]}),h.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Coverage"}),u.jsx("th",{className:"text-left",children:"Mobile"}),u.jsx("th",{className:"text-left",children:"Inspected"})]})}),u.jsx("tbody",{children:h.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-300",children:F.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:AA(F.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:Ci(F.inspectedAt)})]},F.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),u.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Changed at"})]})}),u.jsx("tbody",{children:g.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:F.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Ci(F.transitionDate)})]},`${F.url}:${F.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ce&&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:()=>pe(F=>!F),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 ${kn?"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"})]})}),kn&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(He,{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:ee||s.length===0,onChange:F=>N(F.target.value),children:s.length===0?u.jsx("option",{value:"",children:ee?"Loading properties…":"No properties available"}):s.map(F=>u.jsxs("option",{value:F.siteUrl,children:[F.siteUrl," · ",F.permissionLevel]},F.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:ee,onClick:()=>{no(ce)},children:ee?"Refreshing…":"Refresh properties"}),u.jsx(ve,{type:"button",size:"sm",disabled:!w||Se,onClick:Kf,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(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),u.jsx("h3",{children:"Import GSC performance data"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),u.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:k,onChange:F=>O(F.target.value)})]}),u.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[u.jsx("input",{type:"checkbox",checked:T,onChange:F=>z(F.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(ve,{type:"button",size:"sm",disabled:vu.isPending||!ce.propertyId,onClick:yu,children:vu.isPending?"Queueing…":"Queue sync"}),!ce.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(He,{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:[ce.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:ce.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:je||!ce.propertyId,onClick:()=>{ao()},children:je?"Loading…":"Browse sitemaps from GSC"}),u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:to.isPending||!ce.propertyId,onClick:Nl,children:to.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."}),Be&&Be.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 (",Be.length,")"]}),Be.map(F=>{const xe=F.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:F.path}),F.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",F.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[xe&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[xe.indexed," / ",xe.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:()=>et(F.path),children:"Use"})]})]},F.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:ce.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Je,onChange:F=>et(F.target.value),onKeyDown:F=>F.key==="Enter"&&Je.trim()&&void io()}),u.jsx(ve,{type:"button",size:"sm",disabled:Ot||!Je.trim(),onClick:io,children:Ot?"Saving…":ce.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(ve,{type:"button",size:"sm",variant:"outline",disabled:Va.isPending||!ce.propertyId,onClick:async()=>{const xe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ce.sitemapUrl||void 0;ot(null),ln(null);try{await Va.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:xe}})}catch{}},children:Va.isPending?"Queueing…":"Inspect sitemap"})]}),!ce.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function tye({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(e.displayName),[g,v]=x.useState(e.canonicalDomain),[y,S]=x.useState(e.country),[w,N]=x.useState(e.language),[C,E]=x.useState(e.ownedDomains??[]),[k,O]=x.useState(""),[T,z]=x.useState(null),[A,P]=x.useState(!1),[R,B]=x.useState(!1),[$,L]=x.useState(""),[re,ge]=x.useState(""),[be,H]=x.useState(""),[ee,ye]=x.useState(""),[Se,q]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),v(e.canonicalDomain),S(e.country),N(e.language),E(e.ownedDomains??[]))},[e,r]);function D(){i(!1),f(null),p(e.displayName),v(e.canonicalDomain),S(e.country),N(e.language),E(e.ownedDomains??[]),O("")}function G(){const V=k.trim();V&&(C.includes(V)||E([...C,V]),O(""))}function ae(V){E(C.filter(Be=>Be!==V))}async function Y(){if(!(!h.trim()||!g.trim()||!y.trim()||!w.trim())){l(!0),f(null);try{await t(e.name,{displayName:h.trim(),canonicalDomain:g.trim(),ownedDomains:C,country:y.trim(),language:w.trim()}),i(!1),it({title:"Project settings saved",detail:`${h.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(V){f(V instanceof Error?V.message:"Failed to save")}finally{l(!1)}}}async function ie(){const V=$.trim(),Be=re.trim(),ze=be.trim(),Je=ee.trim();if(!(!V||!Be||!ze||!Je)){P(!0),z(null);try{const et={label:V,city:Be,region:ze,country:Je};Se.trim()&&(et.timezone=Se.trim()),await g9(e.name,et),n(),L(""),ge(""),H(""),ye(""),q(""),B(!1),it({title:"Location added",detail:`${V} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${V}`,dedupeMode:"drop"})}catch(et){z(et instanceof Error?et.message:"Failed to add location")}finally{P(!1)}}}async function oe(V){P(!0),z(null);try{await v9(e.name,V),n(),it({title:"Location removed",detail:`${V} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${V}`,dedupeMode:"drop"})}catch(Be){z(Be instanceof Error?Be.message:"Failed to remove location")}finally{P(!1)}}async function ue(V){P(!0),z(null);try{await y9(e.name,V),n(),it({title:"Default location updated",detail:`${V} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Be){z(Be instanceof Error?Be.message:"Failed to set default location")}finally{P(!1)}}const we=h!==e.displayName||g!==e.canonicalDomain||y!==e.country||w!==e.language||JSON.stringify(C)!==JSON.stringify(e.ownedDomains??[]),W="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",le="block text-xs font-medium text-zinc-400 mb-1",je=$.trim()&&re.trim()&&be.trim()&&ee.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(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>f(null),children:"×"})]}),r?u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Display name"}),u.jsx("input",{className:W,type:"text",value:h,onChange:V=>p(V.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Canonical domain"}),u.jsx("input",{className:W,type:"text",value:g,onChange:V=>v(V.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Country"}),u.jsx("input",{className:W,type:"text",value:y,onChange:V=>S(V.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Language"}),u.jsx("input",{className:W,type:"text",value:w,onChange:V=>N(V.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(V=>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:[V,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ae(V),"aria-label":`Remove ${V}`,children:"×"})]},V))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${W} flex-1`,type:"text",placeholder:"docs.example.com",value:k,onChange:V=>O(V.target.value),onKeyDown:V=>V.key==="Enter"&&(V.preventDefault(),G())}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:!k.trim(),onClick:G,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(ve,{type:"button",disabled:s||!we||!h.trim()||!g.trim(),onClick:Y,children:s?"Saving...":"Save changes"}),u.jsx(ve,{type:"button",variant:"outline",disabled:s,onClick:D,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(V=>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:V},V))}):u.jsx("span",{className:"text-zinc-500",children:"—"})})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),u.jsxs("tr",{children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),u.jsxs("td",{className:"px-4 py-2.5",children:[T&&u.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[T,u.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>z(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(V=>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 ${V.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:[V.label,V.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:V.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[V.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:A,onClick:()=>ue(V.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${V.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:A,onClick:()=>oe(V.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${V.label}`,children:"Remove"})]})})]},V.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),R?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:W,type:"text",value:$,onChange:V=>L(V.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:W,type:"text",value:re,onChange:V=>ge(V.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:W,type:"text",value:be,onChange:V=>H(V.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:W,type:"text",value:ee,onChange:V=>ye(V.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:W,type:"text",value:Se,onChange:V=>q(V.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(ve,{type:"button",size:"sm",disabled:A||!je,onClick:ie,children:A?"Adding...":"Add location"}),u.jsx(ve,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{B(!1),z(null)},children:"Cancel"})]})]}):u.jsx(ve,{type:"button",size:"sm",variant:"outline",onClick:()=>B(!0),children:"+ Add location"})]})]})]})})})]})}const nye=[{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"}],gM=["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 rye({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState("daily"),[c,f]=x.useState(6),[h,p]=x.useState(""),[g,v]=x.useState("UTC"),[y,S]=x.useState(!1),[w,N]=x.useState(""),[C,E]=x.useState(!1),[k,O]=x.useState(!1),[T,z]=x.useState(null);x.useEffect(()=>{O9(e).then(n).catch(()=>n(null))},[e]);const A=()=>{if(t&&t!=="loading"){const $=JF(t.preset??null,t.cronExpr);l($.freq),f($.hour),p($.customCron);const L=gM.includes(t.timezone);v(L?t.timezone:"Other"),S(!L),N(L?"":t.timezone)}else l("daily"),f(6),p(""),v("UTC"),S(!1),N("");z(null),i(!0)},P=async()=>{E(!0),z(null);try{const L={timezone:y?w.trim()||"UTC":g};s==="custom"?L.cron=h.trim():L.preset=XF(s,c);const re=await mA(e,L);n(re),i(!1),it({title:"Schedule saved",detail:vb(re.preset??null,re.cronExpr,re.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch($){z($ instanceof Error?$.message:"Failed to save schedule")}finally{E(!1)}},R=async()=>{if(!(!t||t==="loading")){E(!0),z(null);try{const $={timezone:t.timezone,enabled:!t.enabled};t.preset?$.preset=t.preset:$.cron=t.cronExpr;const L=await mA(e,$);n(L),it({title:L.enabled?"Schedule resumed":"Schedule paused",detail:vb(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch($){z($ instanceof Error?$.message:"Failed to update schedule")}finally{E(!1)}}},B=async()=>{O(!0),z(null);try{await _9(e),n(null),i(!1),it({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch($){z($ instanceof Error?$.message:"Failed to remove schedule")}finally{O(!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(ve,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(He,{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(He,{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:vb(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(wt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:R,children:t.enabled?"Pause":"Resume"}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:B,children:k?"Removing...":"Remove"})]})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),r&&u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:s,onChange:$=>l($.target.value),children:nye.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:s==="twice-daily"||s==="custom",onChange:$=>f(parseInt($.target.value)),children:Array.from({length:24},($,L)=>u.jsx("option",{value:L,children:_w(L)},L))})]})]}),s==="custom"&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:h,onChange:$=>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:y?"Other":g,onChange:$=>{$.target.value==="Other"?(S(!0),v("Other")):(S(!1),v($.target.value))},children:[gM.map($=>u.jsx("option",{value:$,children:$},$)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),y&&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:$=>N($.target.value)})]}),T&&u.jsx("p",{className:"text-rose-400 text-sm",children:T}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),z(null)},children:"Cancel"}),u.jsx(ve,{type:"button",size:"sm",disabled:C||s==="custom"&&!h.trim(),onClick:P,children:C?"Saving...":"Save schedule"})]})]})]})}const iye=[{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 aye({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState(""),[c,f]=x.useState(["citation.lost","citation.gained"]),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,S]=x.useState({});x.useEffect(()=>{k9(e).then(n).catch(()=>n([]))},[e]);const w=k=>{f(O=>O.includes(k)?O.filter(T=>T!==k):[...O,k])},N=async()=>{if(!(!s.trim()||c.length===0)){p(!0),v(null);try{const k=await A9(e,{channel:"webhook",url:s.trim(),events:c});n(O=>O==="loading"?[k]:[...O,k]),l(""),f(["citation.lost","citation.gained"]),i(!1),it({title:"Webhook added",detail:`Notifications will be sent to ${k.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(k){v(k instanceof Error?k.message:"Failed to add webhook")}finally{p(!1)}}},C=async k=>{try{await E9(e,k),n(O=>O==="loading"?O:O.filter(T=>T.id!==k)),it({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${k}`,dedupeMode:"drop"})}catch(O){v(O instanceof Error?O.message:"Failed to remove webhook")}},E=async k=>{S(O=>({...O,[k]:{state:"testing"}}));try{const O=await T9(e,k);S(T=>({...T,[k]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&it({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${k}`,dedupeMode:"replace"})}catch{S(O=>({...O,[k]:{state:"fail"}}))}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),v(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:s,onChange:k=>l(k.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),u.jsx("div",{className:"flex flex-wrap gap-3",children:iye.map(k=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(k.value),onChange:()=>w(k.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:k.label})]},k.value))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm",children:g}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),v(null)},children:"Cancel"}),u.jsx(ve,{type:"button",size:"sm",disabled:h||!s.trim()||c.length===0,onClick:N,children:h?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(He,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&u.jsxs("div",{className:"evidence-table-wrap",children:[u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Endpoint"}),u.jsx("th",{children:"Events"}),u.jsx("th",{children:"Status"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:t.map(k=>u.jsxs("tr",{children:[u.jsx("td",{className:"evidence-keyword-cell",children:u.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:k.urlHost,children:k.urlDisplay??k.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:k.events.map(O=>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:O.replace("."," ")},O))})}),u.jsx("td",{children:u.jsx(wt,{tone:k.enabled?"positive":"neutral",children:k.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[y[k.id]&&(()=>{const O=y[k.id],T=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return u.jsx(wt,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:T})})(),u.jsx(ve,{variant:"ghost",size:"sm",type:"button",disabled:y[k.id]?.state==="testing",onClick:()=>E(k.id),children:"Test"}),u.jsx(ve,{variant:"ghost",size:"sm",type:"button",onClick:()=>C(k.id),children:"Remove"})]})})]},k.id))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:g})]})]})}function sye({projectName:e,refreshNonce:t}){const[n,r]=x.useState(null),[i,s]=x.useState([]),[l,c]=x.useState(null),[f,h]=x.useState([]),[p,g]=x.useState([]),[v,y]=x.useState(null),[S,w]=x.useState(""),[N,C]=x.useState(""),[E,k]=x.useState(""),[O,T]=x.useState(!0),[z,A]=x.useState(!1),[P,R]=x.useState(null),[B,$]=x.useState("coverage");x.useEffect(()=>{L()},[e,t]);async function L(){T(!0),R(null);try{const q=await cR(e);if(r(q),q.connected){const[D,G,ae,Y]=await Promise.all([b1(e).catch(()=>null),uR(e).catch(()=>[]),J9(e).catch(()=>[]),q.siteUrl?Promise.resolve([]):Q9(e).then(ie=>ie.sites).catch(()=>[])]);c(D),h(G),g(ae),s(Y)}else c(null),h([]),g([]),s([])}catch(q){R(q instanceof Error?q.message:"Failed to load Bing data")}finally{T(!1)}}async function re(){if(N.trim()){R(null);try{const q=await Y9(e,N.trim());C(""),q.availableSites.length>0&&s(q.availableSites),await L()}catch(q){R(q instanceof Error?q.message:"Failed to connect")}}}async function ge(){try{await W9(e),r(null),s([]),c(null),h([]),g([]),y(null),k(""),R(null)}catch(q){R(q instanceof Error?q.message:"Failed to disconnect")}}async function be(){if(E)try{await X9(e,E),await L()}catch(q){R(q instanceof Error?q.message:"Failed to set site")}}async function H(){if(S.trim())try{const q=await dR(e,S.trim());y(q),h(D=>[q,...D])}catch(q){R(q instanceof Error?q.message:"Inspection failed")}}async function ee(q){A(!0),R(null);try{const D=await yA(e,{urls:[q]}),{succeeded:G,failed:ae,total:Y}=D.summary;it({title:"Bing submission requested",detail:ae===0?`${G} URL submitted to Bing.`:`${G}/${Y} submitted successfully, ${ae} failed.`,tone:ae===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${q}`,dedupeMode:"replace"})}catch(D){const G=D instanceof Error?D.message:"Submission failed";R(G),it({title:"Bing submission failed",detail:G,tone:"negative",dedupeKey:`bing:indexing:${e}:${q}`,dedupeMode:"replace"})}finally{A(!1)}}async function ye(){A(!0),R(null),it({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const q=await yA(e,{allUnindexed:!0}),{succeeded:D,failed:G,total:ae}=q.summary;it({title:"Bing submissions requested",detail:G===0?`${D}/${ae} URL${ae!==1?"s":""} submitted to Bing.`:`${D}/${ae} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Batch submission failed";R(D),it({title:"Bing submissions failed",detail:D,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{A(!1)}}if(O)return u.jsx(He,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(He,{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(wt,{tone:"caution",children:"Not connected"})]}),u.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),u.jsxs("div",{className:"mt-3",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:N,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&re()}),u.jsx(ve,{size:"sm",disabled:!N.trim(),onClick:re,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"})]})]}),P&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:P})]});if(!n.siteUrl)return u.jsxs(He,{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(wt,{tone:"positive",children:"Connected"}),u.jsx(ve,{size:"sm",variant:"ghost",onClick:ge,children:"Disconnect"})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?Ci(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:E,onChange:q=>k(q.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(q=>u.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),u.jsx(ve,{size:"sm",disabled:!E,onClick:be,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."})]})]}),P&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:P})]});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(He,{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(wt,{tone:"positive",children:"Connected"}),u.jsx(ve,{size:"sm",variant:"ghost",onClick:ge,children:"Disconnect"})]})]}),P&&u.jsx("p",{className:"mb-3 text-xs text-rose-400",children:P}),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?Ci(n.updatedAt):"—"})]})]})]})]}),u.jsxs(He,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index monitoring"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:l?.lastInspectedAt?`Last inspected ${Ci(l.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:Se.map(q=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${B===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>$(q.key),children:q.label},q.key))}),B==="coverage"&&l&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(kp,{label:"Indexed",value:l.summary.indexed,tone:"positive"}),u.jsx(kp,{label:"Not in index",value:l.summary.notIndexed+(l.summary.unknown??0),tone:"negative"}),u.jsx(kp,{label:"Status unknown",value:l.summary.unknown??0,tone:"neutral"}),u.jsx(kp,{label:"Coverage",value:`${l.summary.percentage}%`,tone:"neutral"})]}),l.notIndexed.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",l.notIndexed.length,")"]}),u.jsx(ve,{size:"sm",variant:"ghost",disabled:z,onClick:ye,children:z?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:l.notIndexed.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.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:z,onClick:()=>ee(q.url),children:"Submit"})})]},q.id))})]})})]}),(l.unknown??[]).length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(l.unknown??[]).length,")"]}),u.jsx(ve,{size:"sm",variant:"ghost",disabled:z,onClick:ye,children:z?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:(l.unknown??[]).map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?Ci(q.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:z,onClick:()=>ee(q.url),children:"Submit"})})]},q.id))})]})})]}),l.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",l.indexed.length,")"]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),u.jsx("tbody",{children:l.indexed.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?Ci(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),B==="coverage"&&!l&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),B==="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:S,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&H()}),u.jsx(ve,{size:"sm",disabled:!S.trim(),onClick:H,children:"Inspect"})]}),v&&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:v.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),u.jsx("tbody",{children:f.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(wt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:Ci(q.inspectedAt)})]},q.id))})]})})]}),B==="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:dp[Ts.Clicks]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:dp[Ts.Impressions]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:dp[Ts.CTR]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:dp[Ts.Position]})]})}),u.jsx("tbody",{children:p.map((q,D)=>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:q.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(q.ctr)?q.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},D))})]})})})]})]})}function oye({projectName:e}){const[t,n]=x.useState("google"),[r,i]=x.useState(!0),[s,l]=x.useState("idle"),[c,f]=x.useState(null),h=x.useRef(null),[p,g]=x.useState(!1),[v,y]=x.useState(null),[S,w]=x.useState(null),[N,C]=x.useState(!1),[E,k]=x.useState(null),[O,T]=x.useState(null),[z,A]=x.useState(0);async function P(D=!1){D||i(!0),f(null);try{const[G,ae,Y]=await Promise.all([v1().catch(()=>null),oR(e).catch(()=>[]),cR(e).catch(()=>null)]),ie=ae.find(we=>we.connectionType==="gsc")??null;g(!!G?.google?.configured),C(!!G?.bing?.configured),y(ie),k(Y);const[oe,ue]=await Promise.all([ie?y1(e).catch(()=>null):Promise.resolve(null),Y?.connected?b1(e).catch(()=>null):Promise.resolve(null)]);w(oe),T(ue)}catch(G){f(G instanceof Error?G.message:"Failed to load search console overview")}finally{i(!1)}}async function R(){if(s!=="idle")return;h.current?.abort();const D=new AbortController;h.current=D;const G=D.signal;l("syncing"),f(null);const ae=[];try{async function Y(){if(!v)return;const we=await lR(e);if(!we?.id)return;const W=2e3,je=Date.now()+12e4;for(;Date.now()<je;){if(G.aborted||(await new Promise(Be=>setTimeout(Be,W)),G.aborted))return;const V=await Lc(we.id).catch(()=>null);if(!V)break;if(["completed","failed","cancelled"].includes(V.status)){V.status!=="completed"&&ae.push(`Google sync ${V.status}`);break}}}const ie=10;async function oe(){if(!E?.connected)return;const we=await uR(e).catch(()=>[]),W=[...new Set(we.map(le=>le.url))];if(W.length!==0)for(let le=0;le<W.length;le+=ie){if(G.aborted)return;const je=W.slice(le,le+ie),Be=(await Promise.allSettled(je.map(ze=>dR(e,ze)))).filter(ze=>ze.status==="rejected").length;Be>0&&ae.push(`${Be} Bing inspection(s) failed`)}}const ue=await Promise.allSettled([Y(),oe()]);for(const we of ue)we.status==="rejected"&&ae.push(we.reason instanceof Error?we.reason.message:"Sync failed");if(G.aborted)return;l("reloading"),await P(!0),A(we=>we+1),ae.length>0&&f(`Partial refresh: ${ae.join("; ")}`)}catch(Y){G.aborted||f(Y instanceof Error?Y.message:"Refresh failed")}finally{G.aborted||l("idle")}}x.useEffect(()=>(P(),()=>{h.current?.abort()}),[e]);const B=v?"positive":p?"caution":"negative",$=v?"Connected":p?"Ready to connect":"Needs setup",L=S?`${S.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",re=S?`${S.summary.notIndexed} not indexed${S.summary.deindexed>0?` · ${S.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ge=S?.lastInspectedAt??v?.updatedAt??null,be=E?.connected?"positive":N?"caution":"negative",H=E?.connected?"Connected":N?"Ready to connect":"Needs setup",ee=O?`${O.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",ye=O?O.summary.notIndexed+(O.summary.unknown??0):0,Se=O?`${ye} not in index`:E?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",q=O?.lastInspectedAt??E?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(He,{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(ve,{type:"button",variant:"outline",size:"sm",disabled:r||s!=="idle",onClick:()=>{R()},children:r?"Loading…":s==="syncing"?"Refreshing Google & Bing…":s==="reloading"?"Reloading workspaces…":"Refresh all"})]}),c&&u.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:c}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsx(qE,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":$,tone:r?"neutral":B,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":re,updatedAt:ge,active:t==="google",onClick:()=>n("google")}),u.jsx(qE,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":H,tone:r?"neutral":be,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:r?"Loading…":ee,note:r?"Loading overview…":Se,updatedAt:q,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(([D,G])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===D,className:`project-subnav-link ${t===D?"project-subnav-link-active":""}`,onClick:()=>n(D),children:G},D))}),t==="google"&&u.jsx(eye,{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(sye,{projectName:e,refreshNonce:z})]})]})}function lye({insights:e}){const{openEvidence:t}=nu(),[n,r]=x.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const s=n===i.id,l=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(s?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&u.jsx(Mg,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${s?"rotate-90":""}`}),u.jsx(wt,{tone:i.tone,children:i.actionLabel}),u.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),u.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),s&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,f)=>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(Zw,{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(Kd,{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:h=>{h.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${f}`))})]},i.id)})})}function Hv({tab:e}){const{projectId:t}=Tg({from:"/projects/$projectId"}),n=Ys(),{dashboard:r,isLoading:i,refetch:s}=bl();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(pe=>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"})]},pe))}),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(pe=>u.jsx("div",{className:"skeleton-text-sm w-full"},pe))})]})]});const l=bQ(r,t),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(!1),[y,S]=x.useState(""),[w,N]=x.useState(!1),[C,E]=x.useState(!1),[k,O]=x.useState(""),[T,z]=x.useState(!1),[A,P]=x.useState(!1),[R,B]=x.useState(""),[$,L]=x.useState(!1),[re,ge]=x.useState(void 0),[be,H]=x.useState(!1),[ee,ye]=x.useState(null),[Se,q]=x.useState(!1),D=l?.visibilityEvidence??[],G=l?.project.name??"",ae=l?.project.displayName||l?.project.name||G,Y=lU(),ie=x.useMemo(()=>new Set(D.map(pe=>pe.location??"")),[D]),oe=ie.has(""),ue=x.useMemo(()=>[...ie].filter(Boolean),[ie]);x.useEffect(()=>{if(re===void 0||re===""||!G){ye(null),q(!1);return}q(!0),aR(G,re).then(pe=>{ye(pe),q(!1)}).catch(()=>{ye(null),q(!1)})},[re,G]);const we=x.useMemo(()=>{if(!ee)return null;const pe=new Map;for(const Fe of ee){for(const[me,Ee]of Object.entries(Fe.providerRuns??{}))pe.set(`${Fe.keyword}::${me}`,Ee.map(Te=>({runId:Te.runId,citationState:Te.citationState,createdAt:Te.createdAt,answerMentioned:Te.answerMentioned,visibilityState:Te.visibilityState,visibilityTransition:Te.visibilityTransition})));(!Fe.providerRuns||Object.keys(Fe.providerRuns).length===0)&&pe.set(`${Fe.keyword}::`,Fe.runs.map(me=>({runId:me.runId,citationState:me.citationState,createdAt:me.createdAt,answerMentioned:me.answerMentioned,visibilityState:me.visibilityState,visibilityTransition:me.visibilityTransition})))}return pe},[ee]),W=x.useMemo(()=>{const pe=re!==void 0?D.filter(Fe=>re===""?!Fe.location:Fe.location===re):D;return we?pe.map(Fe=>{const me=we.get(`${Fe.keyword}::${Fe.provider}`)??we.get(`${Fe.keyword}::`);return me?{...Fe,runHistory:me}:Fe}):pe},[D,re,we]);if(!l)return u.jsx("div",{className:"page-container",children:u.jsxs(He,{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(ve,{asChild:!0,children:u.jsx(Ut,{to:"/",children:"Return to overview"})})]})});async function le(){try{await Y.mutateAsync({projectName:G,projectLabel:ae,sourceAction:"project-run"}),s()}catch{}}async function je(){p(!0);try{await b9(G),it({title:"Project deleted",detail:`${ae} was removed.`,tone:"positive",dedupeKey:`project:delete:${G}`,dedupeMode:"drop"}),n({to:"/"}),s()}catch(pe){console.error("Failed to delete project:",pe)}finally{p(!1)}}async function V(){try{const pe=await x9(G),Fe=typeof pe=="string"?pe:JSON.stringify(pe,null,2),me=new Blob([Fe],{type:"text/yaml"}),Ee=URL.createObjectURL(me),Te=document.createElement("a");Te.href=Ee,Te.download=`${G}.yaml`,Te.click()}catch(pe){it({title:"Export failed",detail:pe instanceof Error?pe.message:"Could not export project YAML.",tone:"negative"})}}async function Be(){const pe=y.split(`
273
- `).map(Fe=>Fe.trim()).filter(Boolean);if(pe.length!==0){N(!0);try{await h9(G,pe),s(),S(""),v(!1)}finally{N(!1)}}}async function ze(){const pe=k.trim();if(pe){z(!0);try{const me=(await iR(G)).map(Te=>Te.domain),Ee=[...new Set([...me,pe])];await sR(G,Ee),s(),O(""),E(!1)}finally{z(!1)}}}async function Je(){const pe=R.trim();if(pe){L(!0);try{const Fe=l?.project.ownedDomains??[];await pA(G,[...Fe,pe]),s(),B(""),P(!1)}finally{L(!1)}}}async function et(pe){L(!0);try{const Fe=l?.project.ownedDomains??[];await pA(G,Fe.filter(me=>me!==pe)),s()}finally{L(!1)}}async function Ot(pe,Fe){await p9(pe,Fe),s()}const It=pe=>!Number.isNaN(Number.parseInt(pe,10)),kn=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${l.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(He,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[u.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),u.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",u.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(ve,{type:"button",variant:"destructive",disabled:h,onClick:je,children:h?"Deleting...":"Yes, delete project"}),u.jsx(ve,{type:"button",variant:"outline",disabled:h,onClick:()=>f(!1),children:"Cancel"})]})]}):null,u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),u.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!A&&u.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>P(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:l.project.country}),u.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(pe=>u.jsx("span",{className:"tag",children:pe},pe))]}),((l.project.ownedDomains??[]).length>0||A)&&u.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(pe=>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:[pe,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:$,onClick:()=>et(pe),"aria-label":`Remove ${pe}`,children:"×"})]},pe)),A?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:R,onChange:pe=>B(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Je(),autoFocus:!0}),u.jsx(ve,{type:"button",size:"sm",disabled:!R.trim()||$,onClick:Je,children:$?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{P(!1),B("")},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:()=>P(!0),children:"+ domain"})]})]}),u.jsxs("div",{className:"page-header-right",children:[u.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:V,"aria-label":"Export project as YAML",children:u.jsx(SF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:u.jsx(qF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(ve,{type:"button",disabled:Y.isPending,onClick:le,children:Y.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:kn.map(pe=>u.jsx(Ut,{to:pe.href,className:`project-subnav-link ${pe.key===e?"project-subnav-link-active":""}`,"aria-current":pe.key===e?"page":void 0,children:pe.label},pe.key))}),e==="overview"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(JI,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:It(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Dn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",l.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapKeyPhrases.tone}`,style:{width:l.gapKeyPhrases.progress!==void 0?`${l.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:l.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:l.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Dn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),u.jsx("span",{className:"text-zinc-600",children:"%"})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Dn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):u.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),u.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),l.providerScores.length>1&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),u.jsxs("h2",{children:["Visibility by model ",u.jsx(Dn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Model"}),u.jsx("th",{children:"Score"}),u.jsx("th",{children:"Cited key phrases"})]})}),u.jsx("tbody",{children:l.providerScores.map(pe=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Kd,{provider:pe.provider}),pe.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:pe.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${pe.score>=70?"text-emerald-400":pe.score>=40?"text-amber-400":"text-rose-400"}`,children:[pe.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[pe.cited," of ",pe.total]})]},`${pe.provider}::${pe.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(lye,{insights:l.insights})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),u.jsx("h2",{children:"Key phrase citation tracking"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(pe=>pe.keyword)).size," key phrases tracked"]}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>v(!g),children:g?"Cancel":"+ Add key phrases"})]})]}),g&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:y,onChange:pe=>S(pe.target.value)}),u.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:[y.split(`
274
- `).filter(pe=>pe.trim()).length," key phrases"]}),u.jsx(ve,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:Be,children:w?"Adding...":"Add key phrases"})]})]}),l.project.locations&&l.project.locations.length>0&&u.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[u.jsx("button",{className:`filter-chip ${re===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":re===void 0,onClick:()=>{ge(void 0)},children:"All locations"}),l.project.locations.map(pe=>ie.has(pe.label)&&u.jsx("button",{className:`filter-chip ${re===pe.label?"filter-chip-active":""}`,type:"button","aria-pressed":re===pe.label,onClick:()=>{ge(pe.label),H(!1)},children:pe.label},pe.label)),oe&&u.jsx("button",{className:`filter-chip ${re===""?"filter-chip-active":""}`,type:"button","aria-pressed":re==="",onClick:()=>{ge(""),H(!1)},children:"No location"}),ue.length>1&&re===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${be?"filter-chip-active":""}`,type:"button","aria-pressed":be,onClick:()=>H(pe=>!pe),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(kJ,{evidence:W})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),u.jsx("h2",{children:"Competitive landscape"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!C),children:C?"Cancel":"+ Add competitor"})]})]}),C&&u.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:k,onChange:pe=>O(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ze()}),u.jsx(ve,{type:"button",size:"sm",disabled:!k.trim()||T,onClick:ze,children:T?"Adding...":"Add"})]}),u.jsx(AJ,{competitors:l.competitors})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),u.jsx("h2",{children:"Recent execution history"})]})}),u.jsx("div",{className:"run-list",children:l.recentRuns.map(pe=>u.jsx(XI,{run:pe},pe.id))})]}),u.jsx(tye,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Ot,onRefresh:()=>{s()}}),u.jsx(rye,{projectName:l.project.name}),u.jsx(aye,{projectName:l.project.name})]}):e==="analytics"?u.jsx(zve,{projectName:l.project.name}):e==="traffic"?u.jsx($ve,{projectName:l.project.name}):u.jsx(oye,{projectName:l.project.name})]})}function cye(){const{dashboard:e,isLoading:t}=bl(),n=Yve();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-20"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"skeleton-text w-40"}),u.jsx("div",{className:"skeleton-text-sm w-56"})]}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const r=e.runs,[i,s]=x.useState("all"),l=i==="all"?r:r.filter(f=>f.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Runs"}),u.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),u.jsx(ve,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),u.jsxs("section",{children:[u.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>u.jsx("button",{className:`filter-chip ${i===f?"filter-chip-active":""}`,type:"button","aria-pressed":i===f,onClick:()=>s(f),children:f==="all"?"All runs":Dg(f)},f))}),u.jsx("div",{className:"run-list",children:l.length>0?l.map(f=>u.jsx(XI,{run:f},f.id)):u.jsxs(He,{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 uye({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[s,l]=x.useState(""),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,S]=x.useState(""),[w,N]=x.useState(""),[C,E]=x.useState(!1),[k,O]=x.useState(null),[T,z]=x.useState(!1),A=i?c.trim().length>0:s.trim().length>0;async function P(){if(A){E(!0),O(null),z(!1);try{const B=be=>{const H=parseInt(be.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},$={},L=B(g);L!==void 0&&($.maxConcurrency=L);const re=B(y);re!==void 0&&($.maxRequestsPerMinute=re);const ge=B(w);ge!==void 0&&($.maxRequestsPerDay=ge),await N9(e.toLowerCase(),{...s.trim()?{apiKey:s.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...h.trim()?{model:h.trim()}:{},...Object.keys($).length>0?{quota:$}:{}}),l(""),f(""),p(""),v(""),S(""),N(""),z(!0),it({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(B){O(B instanceof Error?B.message:"Failed to update provider")}finally{E(!1)}}}const R=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:B=>f(B.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&u.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),u.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:s,onChange:B=>l(B.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:R,value:h,onChange:B=>p(B.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),u.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:g,onChange:B=>v(B.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:y,onChange:B=>S(B.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:B=>N(B.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),k&&u.jsx("p",{className:"text-xs text-rose-400",children:k}),T&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(ve,{type:"button",size:"sm",disabled:!A||C,onClick:P,children:C?"Saving...":"Save"})]})}function dye({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(!1),g=t.trim().length>0&&r.trim().length>0;async function v(){if(g){l(!0),f(null),p(!1);try{await C9({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),it({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(y){f(y instanceof Error?y.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),u.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),u.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:y=>n(y.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:y=>i(y.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&u.jsx("p",{className:"text-xs text-rose-400",children:c}),h&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(ve,{type:"button",size:"sm",disabled:!g||s,onClick:v,children:s?"Saving...":"Save Google OAuth app"})]})}function fye(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,s]=x.useState(!1),[l,c]=x.useState("localhost"),[f,h]=x.useState("9222"),[p,g]=x.useState(!1);return x.useEffect(()=>{gA().then(t).catch(v=>{const y=v instanceof Error?v.message:String(v);y.includes("501")||r(y)})},[]),u.jsxs(He,{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(wt,{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(v=>u.jsxs("span",{className:"mr-2",children:[v.name,": ",v.alive?"● alive":"○ idle"]},v.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(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>s(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&u.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async v=>{v.preventDefault(),g(!0);try{await Z9(l,parseInt(f,10)||9222);const y=await gA().catch(()=>null);y&&t(y),s(!1),it({title:"CDP endpoint saved",detail:`${l}:${parseInt(f,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(y){r(y instanceof Error?y.message:String(y))}finally{g(!1)}},children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:v=>c(v.target.value),"aria-label":"CDP host"}),u.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:f,onChange:v=>h(v.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(ve,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const hye={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function pye(){const e=gf(),{dashboard:t}=bl(),n=t?.settings??e?.dashboard?.settings,s=Vg(!e,e?.health).data??e?.health??hye,[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(!1),[v,y]=x.useState(""),[S,w]=x.useState(!1),[N,C]=x.useState(null),[E,k]=x.useState(!1);return n?u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Settings"}),u.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),u.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(O=>u.jsxs(He,{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:O.displayName??O.name})]}),u.jsx(wt,{tone:O.state==="ready"?"positive":"caution",children:O.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:O.model})]}),O.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:O.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[O.quota.maxRequestsPerMinute,"/min · ",O.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:O.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===O.name?null:O.name),children:l===O.name?"Cancel":O.state==="ready"?O.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===O.name&&u.jsx(uye,{providerName:O.name,keyUrl:O.keyUrl,modelHint:O.modelHint,onSaved:()=>{c(null)}})]},O.name)),u.jsxs(He,{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(wt,{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(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!f),children:f?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),f&&u.jsx(dye,{onSaved:()=>{h(!1)}})]}),u.jsxs(He,{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(wt,{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(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!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:v,onChange:O=>y(O.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),N&&u.jsx("p",{className:"text-xs text-rose-400",children:N}),E&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(ve,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:async()=>{if(v.trim()){w(!0),C(null),k(!1);try{await eF(v.trim()),y(""),k(!0),g(!1),it({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(O){C(O instanceof Error?O.message:"Failed to update Bing API key")}finally{w(!1)}}},children:S?"Saving...":"Save Bing API key"})]})]}),u.jsx(fye,{}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),u.jsx("h2",{children:"API and worker"})]})}),u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"API"}),u.jsx("p",{className:"supporting-copy",children:s.apiStatus.detail})]}),u.jsx(wt,{tone:ym(s.apiStatus),title:qs(s.apiStatus),children:s.apiStatus.state==="ok"?"Healthy":"Attention"})]}),u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"Worker"}),u.jsx("p",{className:"supporting-copy",children:s.workerStatus.detail})]}),u.jsx(wt,{tone:ym(s.workerStatus),title:qs(s.workerStatus),children:s.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(He,{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(O=>u.jsx("li",{children:O},O))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const mye=[{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 gye({current:e,labels:t}){return u.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,s=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${s?"setup-step-active":""}`,role:"listitem","aria-current":s?"step":void 0,children:[u.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),u.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function vye(){const e=gf(),{dashboard:t,isLoading:n,refetch:r}=bl(),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(ce=>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"})]},ce))})]})]});const s=i.settings,f=Vg(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},h=aK(i.setup,f,s),p=Ys(),[g,v]=x.useState(0),[y,S]=x.useState(""),[w,N]=x.useState(""),[C,E]=x.useState(""),[k,O]=x.useState("US"),[T,z]=x.useState("en"),[A,P]=x.useState(null),[R,B]=x.useState(null),[$,L]=x.useState(null),[re,ge]=x.useState(!1),[be,H]=x.useState(""),[ee,ye]=x.useState(!1),[Se,q]=x.useState(null),[D,G]=x.useState(!1),ae=s.providerStatuses.filter(ce=>ce.state==="ready"),[Y,ie]=x.useState(ae[0]?.name??""),[oe,ue]=x.useState(5),[we,W]=x.useState(!1),[le,je]=x.useState(null),[V,Be]=x.useState(""),[ze,Je]=x.useState(!1),[et,Ot]=x.useState(null),[It,kn]=x.useState(!1),[pe,Fe]=x.useState(!1),[me,Ee]=x.useState(!1),Te=lU(),Ne=y.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ke=be.split(`
275
- `).map(ce=>ce.trim()).filter(Boolean),_t=V.split(`
276
- `).map(ce=>ce.trim()).filter(Boolean),dt=h.healthChecks.some(ce=>ce.id==="api"&&ce.state==="ready"),Bn=async()=>{if(!(!Ne||!C)){ge(!0),L(null);try{const ce=await zg(Ne,{displayName:w||y,canonicalDomain:C,country:k,language:T});P(Ne),B(ce.id),it({title:"Project created",detail:`${ce.displayName||ce.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ce.name}`,dedupeMode:"drop"}),r(),v(2)}catch(ce){L(ce instanceof Error?ce.message:"Failed to create project")}finally{ge(!1)}}},Yn=async()=>{if(!A)return;const ce=Ke;if(ce.length!==0){G(!0),q(null);try{await f9(A,ce),ye(!0),r(),v(3)}catch(mi){q(mi instanceof Error?mi.message:"Failed to save key phrases")}finally{G(!1)}}},pi=async()=>{if(!(!A||!Y)){W(!0),je(null);try{const ce=await P9(A,Y,oe);if(ce.keywords.length>0){const mi=be?be.trimEnd()+`
277
- `+ce.keywords.join(`
278
- `):ce.keywords.join(`
279
- `);H(mi)}}catch(ce){je(ce instanceof Error?ce.message:"Failed to generate key phrases")}finally{W(!1)}}},Mr=async()=>{if(!A)return;const ce=_t;if(ce.length!==0){kn(!0),Ot(null);try{await sR(A,ce),Je(!0),r(),v(4)}catch(mi){Ot(mi instanceof Error?mi.message:"Failed to save competitors")}finally{kn(!1)}}},ot=async()=>{if(A){Ee(!0);try{await Te.mutateAsync({projectName:A,projectLabel:w||y||A,sourceAction:"setup-launch"}),Fe(!0),r()}catch{}finally{Ee(!1)}}},Lt=()=>v(ce=>Math.max(0,ce-1)),ln=(()=>{switch(g){case 0:return u.jsxs(He,{className:"surface-card step-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),u.jsx("h2",{children:"System ready"})]})}),u.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),u.jsx("div",{className:"compact-stack",children:h.healthChecks.map(ce=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:ce.label}),u.jsx("p",{className:"supporting-copy",children:ce.detail}),ce.id==="provider"&&ce.state!=="ready"&&u.jsx(Ut,{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(wt,{tone:ce.state==="ready"?"positive":"caution",title:ce.id==="api"?qs(f.apiStatus):ce.id==="worker"?qs(f.workerStatus):ce.detail,children:ce.state==="ready"?"Ready":"Attention"})]},ce.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(ve,{type:"button",disabled:!dt,onClick:()=>v(1),children:"Continue"})]})]});case 1:return u.jsxs(He,{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"})]}),A?u.jsx(wt,{tone:"positive",children:"Created"}):null]}),A?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:A})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",onClick:()=>v(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:y,onChange:ce=>S(ce.target.value)}),Ne&&Ne!==y?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ne]}):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:ce=>N(ce.target.value)})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),u.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:C,onChange:ce=>E(ce.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),u.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:k,onChange:ce=>O(ce.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),u.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:T,onChange:ce=>z(ce.target.value.toLowerCase())})]})]}),$?u.jsx("p",{className:"text-rose-400 text-sm",children:$}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",disabled:!Ne||!C||re,onClick:Bn,children:re?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(He,{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"})]}),ee?u.jsxs(wt,{tone:"positive",children:[Ke.length," saved"]}):u.jsxs(wt,{tone:"neutral",children:[Ke.length," key phrase",Ke.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ee?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:Ke.map(ce=>u.jsx("li",{children:ce},ce))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",onClick:()=>v(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[ae.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:Y,onChange:ce=>ie(ce.target.value),children:ae.map(ce=>u.jsxs("option",{value:ce.name,children:[ce.displayName??ce.name,ce.model?` (${ce.model})`:""]},ce.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:oe,onChange:ce=>ue(Number(ce.target.value)),children:[3,5,10,15,20].map(ce=>u.jsx("option",{value:ce,children:ce},ce))})]}),u.jsx(ve,{type:"button",variant:"outline",disabled:we||!Y,onClick:pi,children:we?"Analyzing site...":"Generate"})]}),le?u.jsx("p",{className:"text-rose-400 text-sm",children:le}):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
280
- best invisalign downtown brooklyn
281
- pediatric dentist brooklyn heights`,value:be,onChange:ce=>H(ce.target.value)})]}),Se?u.jsx("p",{className:"text-rose-400 text-sm",children:Se}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",disabled:Ke.length===0||D,onClick:Yn,children:D?"Saving...":`Save ${Ke.length} key phrase${Ke.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(He,{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"})]}),ze?u.jsx(wt,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),ze?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:_t.map(ce=>u.jsx("li",{children:ce},ce))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",onClick:()=>v(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
282
- competitor2.com`,value:V,onChange:ce=>Be(ce.target.value)})]}),et?u.jsx("p",{className:"text-rose-400 text-sm",children:et}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:()=>v(4),children:"Skip"}),u.jsx(ve,{type:"button",disabled:_t.length===0||It,onClick:Mr,children:It?"Saving...":`Save ${_t.length} competitor${_t.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(He,{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"})]}),pe?u.jsx(wt,{tone:"positive",children:"Queued"}):null]}),pe?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(ve,{type:"button",onClick:()=>p({to:R?`/projects/${R}`:"/"}),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:A}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:Lt,children:"Back"}),u.jsx(ve,{type:"button",disabled:me,onClick:ot,children:me?"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(gye,{current:g,labels:mye}),u.jsx("section",{className:"setup-wizard",children:ln})]})}function yye(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(He,{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(ve,{asChild:!0,children:u.jsx(Ut,{to:"/",children:"Return to overview"})})]})})})}function bye(){return u.jsx(dX,{children:u.jsx(uX,{})})}const Ei=Kq()({component:bye,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),xye=ui({getParentRoute:()=>Ei,path:"/",component:pX,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(ti.projects.all);if(t&&t.length===0)throw o1({to:"/setup"})}}),wye=ui({getParentRoute:()=>Ei,path:"/projects",component:OJ}),Uf=ui({getParentRoute:()=>Ei,path:"/projects/$projectId",component:()=>u.jsx(g1,{})}),Sye=ui({getParentRoute:()=>Uf,path:"/",component:()=>u.jsx(Hv,{tab:"overview"})}),jye=ui({getParentRoute:()=>Uf,path:"/search-console",component:()=>u.jsx(Hv,{tab:"search-console"})}),Nye=ui({getParentRoute:()=>Uf,path:"/analytics",component:()=>u.jsx(Hv,{tab:"analytics"})}),Cye=ui({getParentRoute:()=>Uf,path:"/traffic",component:()=>u.jsx(Hv,{tab:"traffic"})}),Oye=ui({getParentRoute:()=>Ei,path:"/runs",component:cye}),_ye=ui({getParentRoute:()=>Ei,path:"/settings",component:pye,beforeLoad:({context:e})=>{}}),kye=ui({getParentRoute:()=>Ei,path:"/setup",component:vye,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(ti.projects.all);if(t&&t.length>0)throw o1({to:"/"})}}),Aye=ui({getParentRoute:()=>Ei,path:"*",component:yye}),Eye=Ei.addChildren([xye,wye,Uf.addChildren([Sye,jye,Nye,Cye]),Oye,_ye,kye,Aye]);function Tye(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const vM=Tye(),Pye=vM==="/"?"":vM.replace(/\/$/,"");function zye(e,t){return e9({routeTree:Eye,basepath:Pye||"/",context:{queryClient:e},...t?.initialEntries})}const cU=pF(),Mye=zye(cU),uU=document.getElementById("root");if(!uU)throw new Error("Expected #root element for web app bootstrap.");function Rye(){const[e,t]=x.useState(hA()?"ready":"checking"),[n,r]=x.useState(""),[i,s]=x.useState(""),[l,c]=x.useState(null),[f,h]=x.useState(!1);x.useEffect(()=>{if(hA())return;let v=!1;return w9().then(y=>{v||(y.authenticated?t("ready"):t(y.setupRequired?"setup":"login"))}).catch(y=>{v||(c(y instanceof Error?y.message:"Failed to reach the Canonry API"),t("login"))}),()=>{v=!0}},[]);const p=async v=>{if(v.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}h(!0),c(null);try{if(!(await S9(n.trim())).authenticated){c("Setup failed");return}r(""),s(""),t("ready")}catch(y){c(y instanceof Fd||y instanceof Error?y.message:"Setup failed")}finally{h(!1)}},g=async v=>{if(v.preventDefault(),!!n.trim()){h(!0),c(null);try{if(!(await j9(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(y){c(y instanceof Fd||y instanceof Error?y.message:"Authentication failed")}finally{h(!1)}}};return e==="ready"?u.jsx(XB,{client:cU,children:u.jsx(r9,{router:Mye})}):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(He,{className:"surface-card w-full",children:e==="checking"?u.jsx(Xp,{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($w,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(Uw,{children:"Create a dashboard password"}),u.jsx(Bw,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(Xp,{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:v=>r(v.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:v=>s(v.target.value),placeholder:"Re-enter password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(ve,{type:"submit",disabled:f||!n.trim()||!i.trim(),children:f?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs($w,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(Uw,{children:"Sign in to Canonry"}),u.jsx(Bw,{children:"Enter your dashboard password to continue."})]}),u.jsx(Xp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:g,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:v=>r(v.target.value),placeholder:"Dashboard password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(ve,{type:"submit",disabled:f||!n.trim(),children:f?"Signing in…":"Open dashboard"})]})})]})})})})}_B.createRoot(uU).render(u.jsx(x.StrictMode,{children:u.jsx(Rye,{})}));