@ainyc/canonry 2.16.0 → 2.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/index-CwZdqfeb.js +302 -0
- package/assets/assets/{index-DMx3Oy9W.css → index-Ec4au-rY.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-CKABU6PE.js → chunk-75EV36V6.js} +525 -214
- package/dist/{chunk-HNVRN5QL.js → chunk-7DVIJC6L.js} +144 -62
- package/dist/cli.js +90 -2
- package/dist/index.js +2 -2
- package/dist/mcp.js +1 -1
- package/package.json +7 -7
- package/assets/assets/index-B18l8ugs.js +0 -302
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
function t9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ux={exports:{}},Fd={};var pE;function n9(){if(pE)return Fd;pE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Fd.Fragment=t,Fd.jsx=n,Fd.jsxs=n,Fd}var mE;function r9(){return mE||(mE=1,ux.exports=n9()),ux.exports}var c=r9(),dx={exports:{}},We={};var gE;function i9(){if(gE)return We;gE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function N(U,F,D){this.props=U,this.context=F,this.refs=j,this.updater=D||w}N.prototype.isReactComponent={},N.prototype.setState=function(U,F){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,F,"setState")},N.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function O(){}O.prototype=N.prototype;function _(U,F,D){this.props=U,this.context=F,this.refs=j,this.updater=D||w}var C=_.prototype=new O;C.constructor=_,S(C,N.prototype),C.isPureReactComponent=!0;var T=Array.isArray;function E(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function I(U,F,D){var Q=D.ref;return{$$typeof:e,type:U,key:F,ref:Q!==void 0?Q:null,props:D}}function q(U,F){return I(U.type,F,U.props)}function B(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function $(U){var F={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return F[D]})}var V=/\/+/g;function te(U,F){return typeof U=="object"&&U!==null&&U.key!=null?$(""+U.key):F.toString(36)}function Y(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(E,E):(U.status="pending",U.then(function(F){U.status==="pending"&&(U.status="fulfilled",U.value=F)},function(F){U.status==="pending"&&(U.status="rejected",U.reason=F)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,F,D,Q,se){var ae=typeof U;(ae==="undefined"||ae==="boolean")&&(U=null);var he=!1;if(U===null)he=!0;else switch(ae){case"bigint":case"string":case"number":he=!0;break;case"object":switch(U.$$typeof){case e:case t:he=!0;break;case p:return he=U._init,H(he(U._payload),F,D,Q,se)}}if(he)return se=se(U),he=Q===""?"."+te(U,0):Q,T(se)?(D="",he!=null&&(D=he.replace(V,"$&/")+"/"),H(se,F,D,"",function(de){return de})):se!=null&&(B(se)&&(se=q(se,D+(se.key==null||U&&U.key===se.key?"":(""+se.key).replace(V,"$&/")+"/")+he)),F.push(se)),1;he=0;var Ne=Q===""?".":Q+":";if(T(U))for(var ne=0;ne<U.length;ne++)Q=U[ne],ae=Ne+te(Q,ne),he+=H(Q,F,D,ae,se);else if(ne=v(U),typeof ne=="function")for(U=ne.call(U),ne=0;!(Q=U.next()).done;)Q=Q.value,ae=Ne+te(Q,ne++),he+=H(Q,F,D,ae,se);else if(ae==="object"){if(typeof U.then=="function")return H(Y(U),F,D,Q,se);throw F=String(U),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return he}function J(U,F,D){if(U==null)return U;var Q=[],se=0;return H(U,Q,"","",function(ae){return F.call(D,ae,se++)}),Q}function pe(U){if(U._status===-1){var F=U._result;F=F(),F.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=F)}if(U._status===1)return U._result.default;throw U._result}var Se=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},R={map:J,forEach:function(U,F,D){J(U,function(){F.apply(this,arguments)},D)},count:function(U){var F=0;return J(U,function(){F++}),F},toArray:function(U){return J(U,function(F){return F})||[]},only:function(U){if(!B(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return We.Activity=m,We.Children=R,We.Component=N,We.Fragment=n,We.Profiler=i,We.PureComponent=_,We.StrictMode=r,We.Suspense=d,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,We.__COMPILER_RUNTIME={__proto__:null,c:function(U){return A.H.useMemoCache(U)}},We.cache=function(U){return function(){return U.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(U,F,D){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Q=S({},U.props),se=U.key;if(F!=null)for(ae in F.key!==void 0&&(se=""+F.key),F)!P.call(F,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&F.ref===void 0||(Q[ae]=F[ae]);var ae=arguments.length-2;if(ae===1)Q.children=D;else if(1<ae){for(var he=Array(ae),Ne=0;Ne<ae;Ne++)he[Ne]=arguments[Ne+2];Q.children=he}return I(U.type,se,Q)},We.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:a,_context:U},U},We.createElement=function(U,F,D){var Q,se={},ae=null;if(F!=null)for(Q in F.key!==void 0&&(ae=""+F.key),F)P.call(F,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(se[Q]=F[Q]);var he=arguments.length-2;if(he===1)se.children=D;else if(1<he){for(var Ne=Array(he),ne=0;ne<he;ne++)Ne[ne]=arguments[ne+2];se.children=Ne}if(U&&U.defaultProps)for(Q in he=U.defaultProps,he)se[Q]===void 0&&(se[Q]=he[Q]);return I(U,ae,se)},We.createRef=function(){return{current:null}},We.forwardRef=function(U){return{$$typeof:u,render:U}},We.isValidElement=B,We.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:pe}},We.memo=function(U,F){return{$$typeof:f,type:U,compare:F===void 0?null:F}},We.startTransition=function(U){var F=A.T,D={};A.T=D;try{var Q=U(),se=A.S;se!==null&&se(D,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(E,Se)}catch(ae){Se(ae)}finally{F!==null&&D.types!==null&&(F.types=D.types),A.T=F}},We.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},We.use=function(U){return A.H.use(U)},We.useActionState=function(U,F,D){return A.H.useActionState(U,F,D)},We.useCallback=function(U,F){return A.H.useCallback(U,F)},We.useContext=function(U){return A.H.useContext(U)},We.useDebugValue=function(){},We.useDeferredValue=function(U,F){return A.H.useDeferredValue(U,F)},We.useEffect=function(U,F){return A.H.useEffect(U,F)},We.useEffectEvent=function(U){return A.H.useEffectEvent(U)},We.useId=function(){return A.H.useId()},We.useImperativeHandle=function(U,F,D){return A.H.useImperativeHandle(U,F,D)},We.useInsertionEffect=function(U,F){return A.H.useInsertionEffect(U,F)},We.useLayoutEffect=function(U,F){return A.H.useLayoutEffect(U,F)},We.useMemo=function(U,F){return A.H.useMemo(U,F)},We.useOptimistic=function(U,F){return A.H.useOptimistic(U,F)},We.useReducer=function(U,F,D){return A.H.useReducer(U,F,D)},We.useRef=function(U){return A.H.useRef(U)},We.useState=function(U){return A.H.useState(U)},We.useSyncExternalStore=function(U,F,D){return A.H.useSyncExternalStore(U,F,D)},We.useTransition=function(){return A.H.useTransition()},We.version="19.2.4",We}var yE;function Pu(){return yE||(yE=1,dx.exports=i9()),dx.exports}var b=Pu();const qi=ka(b),Ry=t9({__proto__:null,default:qi},[b]);var fx={exports:{}},qd={},hx={exports:{}},px={};var vE;function a9(){return vE||(vE=1,(function(e){function t(H,J){var pe=H.length;H.push(J);e:for(;0<pe;){var Se=pe-1>>>1,R=H[Se];if(0<i(R,J))H[Se]=J,H[pe]=R,pe=Se;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var J=H[0],pe=H.pop();if(pe!==J){H[0]=pe;e:for(var Se=0,R=H.length,U=R>>>1;Se<U;){var F=2*(Se+1)-1,D=H[F],Q=F+1,se=H[Q];if(0>i(D,pe))Q<R&&0>i(se,D)?(H[Se]=se,H[Q]=pe,Se=Q):(H[Se]=D,H[F]=pe,Se=F);else if(Q<R&&0>i(se,pe))H[Se]=se,H[Q]=pe,Se=Q;else break e}}return J}function i(H,J){var pe=H.sortIndex-J.sortIndex;return pe!==0?pe:H.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],f=[],p=1,m=null,y=3,v=!1,w=!1,S=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(H){for(var J=n(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=H)r(f),J.sortIndex=J.expirationTime,t(d,J);else break;J=n(f)}}function T(H){if(S=!1,C(H),!w)if(n(d)!==null)w=!0,E||(E=!0,$());else{var J=n(f);J!==null&&Y(T,J.startTime-H)}}var E=!1,A=-1,P=5,I=-1;function q(){return j?!0:!(e.unstable_now()-I<P)}function B(){if(j=!1,E){var H=e.unstable_now();I=H;var J=!0;try{e:{w=!1,S&&(S=!1,O(A),A=-1),v=!0;var pe=y;try{t:{for(C(H),m=n(d);m!==null&&!(m.expirationTime>H&&q());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,y=m.priorityLevel;var R=Se(m.expirationTime<=H);if(H=e.unstable_now(),typeof R=="function"){m.callback=R,C(H),J=!0;break t}m===n(d)&&r(d),C(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var U=n(f);U!==null&&Y(T,U.startTime-H),J=!1}}break e}finally{m=null,y=pe,v=!1}J=void 0}}finally{J?$():E=!1}}}var $;if(typeof _=="function")$=function(){_(B)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,te=V.port2;V.port1.onmessage=B,$=function(){te.postMessage(null)}}else $=function(){N(B,0)};function Y(H,J){A=N(function(){H(e.unstable_now())},J)}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 y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var pe=y;y=J;try{return H()}finally{y=pe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var pe=y;y=H;try{return J()}finally{y=pe}},e.unstable_scheduleCallback=function(H,J,pe){var Se=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?Se+pe:Se):pe=Se,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=pe+R,H={id:p++,callback:J,priorityLevel:H,startTime:pe,expirationTime:R,sortIndex:-1},pe>Se?(H.sortIndex=pe,t(f,H),n(d)===null&&H===n(f)&&(S?(O(A),A=-1):S=!0,Y(T,pe-Se))):(H.sortIndex=R,t(d,H),w||v||(w=!0,E||(E=!0,$()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var J=y;return function(){var pe=y;y=J;try{return H.apply(this,arguments)}finally{y=pe}}}})(px)),px}var bE;function s9(){return bE||(bE=1,hx.exports=a9()),hx.exports}var mx={exports:{}},er={};var xE;function o9(){if(xE)return er;xE=1;var e=Pu();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,er.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},er.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},er.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},er.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},er.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},er.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},er.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},er.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},er.requestFormReset=function(d){r.d.r(d)},er.unstable_batchedUpdates=function(d,f){return d(f)},er.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},er.useFormStatus=function(){return o.H.useHostTransitionStatus()},er.version="19.2.4",er}var wE;function nI(){if(wE)return mx.exports;wE=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(),mx.exports=o9(),mx.exports}var SE;function l9(){if(SE)return qd;SE=1;var e=s9(),t=Pu(),n=nI();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,h=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(h=l.return),s=l.return;while(s)}return l.tag===3?h:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var h=s,g=l;;){var x=h.return;if(x===null)break;var k=x.alternate;if(k===null){if(g=x.return,g!==null){h=g;continue}break}if(x.child===k.child){for(k=x.child;k;){if(k===h)return d(x),s;if(k===g)return d(x),l;k=k.sibling}throw Error(r(188))}if(h.return!==g.return)h=x,g=k;else{for(var z=!1,L=x.child;L;){if(L===h){z=!0,h=x,g=k;break}if(L===g){z=!0,g=x,h=k;break}L=L.sibling}if(!z){for(L=k.child;L;){if(L===h){z=!0,h=k,g=x;break}if(L===g){z=!0,g=k,h=x;break}L=L.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=B&&s[B]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function te(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case N:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case E:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case _:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case C:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return l=s.displayName||null,l!==null?l:te(s.type)||"Memo";case P:l=s._payload,s=s._init;try{return te(s(l))}catch{}}return null}var Y=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},Se=[],R=-1;function U(s){return{current:s}}function F(s){0>R||(s.current=Se[R],Se[R]=null,R--)}function D(s,l){R++,Se[R]=s.current,s.current=l}var Q=U(null),se=U(null),ae=U(null),he=U(null);function Ne(s,l){switch(D(ae,l),D(se,s),D(Q,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?IO(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=IO(l),s=LO(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(Q),D(Q,s)}function ne(){F(Q),F(se),F(ae)}function de(s){s.memoizedState!==null&&D(he,s);var l=Q.current,h=LO(l,s.type);l!==h&&(D(se,s),D(Q,h))}function Ee(s){se.current===s&&(F(Q),F(se)),he.current===s&&(F(he),Ld._currentValue=pe)}var X,Fe;function De(s){if(X===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);X=l&&l[1]||"",Fe=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+X+s+Fe}var et=!1;function tt(s,l){if(!s||et)return"";et=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ue){var oe=ue}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(ue){oe=ue}s.call(xe.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),z=k[0],L=k[1];if(z&&L){var K=z.split(`
|
|
4
|
-
`),ie=L.split(`
|
|
5
|
-
`);for(x=g=0;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;for(;x<ie.length&&!ie[x].includes("DetermineComponentFrameRoot");)x++;if(g===K.length||x===ie.length)for(g=K.length-1,x=ie.length-1;1<=g&&0<=x&&K[g]!==ie[x];)x--;for(;1<=g&&0<=x;g--,x--)if(K[g]!==ie[x]){if(g!==1||x!==1)do if(g--,x--,0>x||K[g]!==ie[x]){var fe=`
|
|
6
|
-
`+K[g].replace(" at new "," at ");return s.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",s.displayName)),fe}while(1<=g&&0<=x);break}}}finally{et=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?De(h):""}function Ut(s,l){switch(s.tag){case 26:case 27:case 5:return De(s.type);case 16:return De("Lazy");case 13:return s.child!==l&&l!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return tt(s.type,!1);case 11:return tt(s.type.render,!1);case 1:return tt(s.type,!0);case 31:return De("Activity");default:return""}}function Xt(s){try{var l="",h=null;do l+=Ut(s,h),h=s,s=s.return;while(s);return l}catch(g){return`
|
|
7
|
-
Error generating stack: `+g.message+`
|
|
8
|
-
`+g.stack}}var on=Object.prototype.hasOwnProperty,we=e.unstable_scheduleCallback,Ze=e.unstable_cancelCallback,bt=e.unstable_shouldYield,Jt=e.unstable_requestPaint,lt=e.unstable_now,ct=e.unstable_getCurrentPriorityLevel,G=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,je=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,qe=e.unstable_IdlePriority,en=e.log,wt=e.unstable_setDisableYieldValue,Ge=null,zt=null;function Tt(s){if(typeof en=="function"&&wt(s),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(Ge,s)}catch{}}var Te=Math.clz32?Math.clz32:lr,Jr=Math.log,ke=Math.LN2;function lr(s){return s>>>=0,s===0?32:31-(Jr(s)/ke|0)|0}var ys=256,Oo=262144,Oa=4194304;function ei(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Eo(s,l,h){var g=s.pendingLanes;if(g===0)return 0;var x=0,k=s.suspendedLanes,z=s.pingedLanes;s=s.warmLanes;var L=g&134217727;return L!==0?(g=L&~k,g!==0?x=ei(g):(z&=L,z!==0?x=ei(z):h||(h=L&~s,h!==0&&(x=ei(h))))):(L=g&~k,L!==0?x=ei(L):z!==0?x=ei(z):h||(h=g&~s,h!==0&&(x=ei(h)))),x===0?0:l!==0&&l!==x&&(l&k)===0&&(k=x&-x,h=l&-l,k>=h||k===32&&(h&4194048)!==0)?l:x}function vs(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function n0(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zo(){var s=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),s}function ec(s){for(var l=[],h=0;31>h;h++)l.push(s);return l}function To(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Mh(s,l,h,g,x,k){var z=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var L=s.entanglements,K=s.expirationTimes,ie=s.hiddenUpdates;for(h=z&~h;0<h;){var fe=31-Te(h),xe=1<<fe;L[fe]=0,K[fe]=-1;var oe=ie[fe];if(oe!==null)for(ie[fe]=null,fe=0;fe<oe.length;fe++){var ue=oe[fe];ue!==null&&(ue.lane&=-536870913)}h&=~xe}g!==0&&Ih(s,g,0),k!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=k&~(z&~l))}function Ih(s,l,h){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-Te(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function Lh(s,l){var h=s.entangledLanes|=l;for(s=s.entanglements;h;){var g=31-Te(h),x=1<<g;x&l|s[g]&l&&(s[g]|=l),h&=~x}}function $h(s,l){var h=l&-l;return h=(h&42)!==0?1:ed(h),(h&(s.suspendedLanes|l))!==0?0:h}function ed(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function tc(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Z(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:oE(s.type))}function Ce(s,l){var h=J.p;try{return J.p=s,l()}finally{J.p=h}}var xt=Math.random().toString(36).slice(2),ut="__reactFiber$"+xt,Pt="__reactProps$"+xt,Ir="__reactContainer$"+xt,Pi="__reactEvents$"+xt,bs="__reactListeners$"+xt,br="__reactHandles$"+xt,Bh="__reactResources$"+xt,ti="__reactMarker$"+xt;function Ea(s){delete s[ut],delete s[Pt],delete s[Pi],delete s[bs],delete s[br]}function Ri(s){var l=s[ut];if(l)return l;for(var h=s.parentNode;h;){if(l=h[Ir]||h[ut]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(s=KO(s);s!==null;){if(h=s[ut])return h;s=KO(s)}return l}s=h,h=s.parentNode}return null}function za(s){if(s=s[ut]||s[Ir]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Po(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function Di(s){var l=s[Bh];return l||(l=s[Bh]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function ln(s){s[ti]=!0}var Uh=new Set,Fh={};function nt(s,l){St(s,l),St(s+"Capture",l)}function St(s,l){for(Fh[s]=l,s=0;s<l.length;s++)Uh.add(l[s])}var Lr=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]*$"),Mi={},Ro={};function qh(s){return on.call(Ro,s)?!0:on.call(Mi,s)?!1:Lr.test(s)?Ro[s]=!0:(Mi[s]=!0,!1)}function Hh(s,l,h){if(qh(l))if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+h)}}function Kh(s,l,h){if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+h)}}function Ta(s,l,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(l,h,""+g)}}function ni(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function OC(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Z8(s,l,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var x=g.get,k=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return x.call(this)},set:function(z){h=""+z,k.call(this,z)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function r0(s){if(!s._valueTracker){var l=OC(s)?"checked":"value";s._valueTracker=Z8(s,l,""+s[l])}}function EC(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return s&&(g=OC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(l.setValue(s),!0):!1}function Gh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Y8=/[\n"\\]/g;function ri(s){return s.replace(Y8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function i0(s,l,h,g,x,k,z,L){s.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.type=z:s.removeAttribute("type"),l!=null?z==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+ni(l)):s.value!==""+ni(l)&&(s.value=""+ni(l)):z!=="submit"&&z!=="reset"||s.removeAttribute("value"),l!=null?a0(s,z,ni(l)):h!=null?a0(s,z,ni(h)):g!=null&&s.removeAttribute("value"),x==null&&k!=null&&(s.defaultChecked=!!k),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?s.name=""+ni(L):s.removeAttribute("name")}function zC(s,l,h,g,x,k,z,L){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),l!=null||h!=null){if(!(k!=="submit"&&k!=="reset"||l!=null)){r0(s);return}h=h!=null?""+ni(h):"",l=l!=null?""+ni(l):h,L||l===s.value||(s.value=l),s.defaultValue=l}g=g??x,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=L?s.checked:!!g,s.defaultChecked=!!g,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(s.name=z),r0(s)}function a0(s,l,h){l==="number"&&Gh(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function nc(s,l,h,g){if(s=s.options,l){l={};for(var x=0;x<h.length;x++)l["$"+h[x]]=!0;for(h=0;h<s.length;h++)x=l.hasOwnProperty("$"+s[h].value),s[h].selected!==x&&(s[h].selected=x),x&&g&&(s[h].defaultSelected=!0)}else{for(h=""+ni(h),l=null,x=0;x<s.length;x++){if(s[x].value===h){s[x].selected=!0,g&&(s[x].defaultSelected=!0);return}l!==null||s[x].disabled||(l=s[x])}l!==null&&(l.selected=!0)}}function TC(s,l,h){if(l!=null&&(l=""+ni(l),l!==s.value&&(s.value=l),h==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=h!=null?""+ni(h):""}function PC(s,l,h,g){if(l==null){if(g!=null){if(h!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),l=h}h=ni(l),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),r0(s)}function rc(s,l){if(l){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=l;return}}s.textContent=l}var W8=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function RC(s,l,h){var g=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,h):typeof h!="number"||h===0||W8.has(l)?l==="float"?s.cssFloat=h:s[l]=(""+h).trim():s[l]=h+"px"}function DC(s,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var x in l)g=l[x],l.hasOwnProperty(x)&&h[x]!==g&&RC(s,x,g)}else for(var k in l)l.hasOwnProperty(k)&&RC(s,k,l[k])}function s0(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Q8=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"]]),X8=/^[\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 Vh(s){return X8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Pa(){}var o0=null;function l0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var ic=null,ac=null;function MC(s){var l=za(s);if(l&&(s=l.stateNode)){var h=s[Pt]||null;e:switch(s=l.stateNode,l.type){case"input":if(i0(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ri(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==s&&g.form===s.form){var x=g[Pt]||null;if(!x)throw Error(r(90));i0(g,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<h.length;l++)g=h[l],g.form===s.form&&EC(g)}break e;case"textarea":TC(s,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&nc(s,!!h.multiple,l,!1)}}}var c0=!1;function IC(s,l,h){if(c0)return s(l,h);c0=!0;try{var g=s(l);return g}finally{if(c0=!1,(ic!==null||ac!==null)&&(Rp(),ic&&(l=ic,s=ac,ac=ic=null,MC(l),s)))for(l=0;l<s.length;l++)MC(s[l])}}function td(s,l){var h=s.stateNode;if(h===null)return null;var g=h[Pt]||null;if(g===null)return null;h=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u0=!1;if(Ra)try{var nd={};Object.defineProperty(nd,"passive",{get:function(){u0=!0}}),window.addEventListener("test",nd,nd),window.removeEventListener("test",nd,nd)}catch{u0=!1}var xs=null,d0=null,Zh=null;function LC(){if(Zh)return Zh;var s,l=d0,h=l.length,g,x="value"in xs?xs.value:xs.textContent,k=x.length;for(s=0;s<h&&l[s]===x[s];s++);var z=h-s;for(g=1;g<=z&&l[h-g]===x[k-g];g++);return Zh=x.slice(s,1<g?1-g:void 0)}function Yh(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Wh(){return!0}function $C(){return!1}function xr(s){function l(h,g,x,k,z){this._reactName=h,this._targetInst=x,this.type=g,this.nativeEvent=k,this.target=z,this.currentTarget=null;for(var L in s)s.hasOwnProperty(L)&&(h=s[L],this[L]=h?h(k):k[L]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Wh:$C,this.isPropagationStopped=$C,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Wh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Wh)},persist:function(){},isPersistent:Wh}),l}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qh=xr(Do),rd=m({},Do,{view:0,detail:0}),J8=xr(rd),f0,h0,id,Xh=m({},rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:m0,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==id&&(id&&s.type==="mousemove"?(f0=s.screenX-id.screenX,h0=s.screenY-id.screenY):h0=f0=0,id=s),f0)},movementY:function(s){return"movementY"in s?s.movementY:h0}}),BC=xr(Xh),eF=m({},Xh,{dataTransfer:0}),tF=xr(eF),nF=m({},rd,{relatedTarget:0}),p0=xr(nF),rF=m({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),iF=xr(rF),aF=m({},Do,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),sF=xr(aF),oF=m({},Do,{data:0}),UC=xr(oF),lF={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cF={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"},uF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dF(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=uF[s])?!!l[s]:!1}function m0(){return dF}var fF=m({},rd,{key:function(s){if(s.key){var l=lF[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Yh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?cF[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:m0,charCode:function(s){return s.type==="keypress"?Yh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Yh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),hF=xr(fF),pF=m({},Xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),FC=xr(pF),mF=m({},rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:m0}),gF=xr(mF),yF=m({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),vF=xr(yF),bF=m({},Xh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),xF=xr(bF),wF=m({},Do,{newState:0,oldState:0}),SF=xr(wF),jF=[9,13,27,32],g0=Ra&&"CompositionEvent"in window,ad=null;Ra&&"documentMode"in document&&(ad=document.documentMode);var kF=Ra&&"TextEvent"in window&&!ad,qC=Ra&&(!g0||ad&&8<ad&&11>=ad),HC=" ",KC=!1;function GC(s,l){switch(s){case"keyup":return jF.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var sc=!1;function NF(s,l){switch(s){case"compositionend":return VC(l);case"keypress":return l.which!==32?null:(KC=!0,HC);case"textInput":return s=l.data,s===HC&&KC?null:s;default:return null}}function CF(s,l){if(sc)return s==="compositionend"||!g0&&GC(s,l)?(s=LC(),Zh=d0=xs=null,sc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return qC&&l.locale!=="ko"?null:l.data;default:return null}}var _F={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 ZC(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!_F[s.type]:l==="textarea"}function YC(s,l,h,g){ic?ac?ac.push(g):ac=[g]:ic=g,l=Up(l,"onChange"),0<l.length&&(h=new Qh("onChange","change",null,h,g),s.push({event:h,listeners:l}))}var sd=null,od=null;function AF(s){zO(s,0)}function Jh(s){var l=Po(s);if(EC(l))return s}function WC(s,l){if(s==="change")return l}var QC=!1;if(Ra){var y0;if(Ra){var v0="oninput"in document;if(!v0){var XC=document.createElement("div");XC.setAttribute("oninput","return;"),v0=typeof XC.oninput=="function"}y0=v0}else y0=!1;QC=y0&&(!document.documentMode||9<document.documentMode)}function JC(){sd&&(sd.detachEvent("onpropertychange",e_),od=sd=null)}function e_(s){if(s.propertyName==="value"&&Jh(od)){var l=[];YC(l,od,s,l0(s)),IC(AF,l)}}function OF(s,l,h){s==="focusin"?(JC(),sd=l,od=h,sd.attachEvent("onpropertychange",e_)):s==="focusout"&&JC()}function EF(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Jh(od)}function zF(s,l){if(s==="click")return Jh(l)}function TF(s,l){if(s==="input"||s==="change")return Jh(l)}function PF(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var $r=typeof Object.is=="function"?Object.is:PF;function ld(s,l){if($r(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var h=Object.keys(s),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var x=h[g];if(!on.call(l,x)||!$r(s[x],l[x]))return!1}return!0}function t_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function n_(s,l){var h=t_(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=l&&g>=l)return{node:h,offset:l-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=t_(h)}}function r_(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?r_(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function i_(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Gh(s.document);l instanceof s.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)s=l.contentWindow;else break;l=Gh(s.document)}return l}function b0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var RF=Ra&&"documentMode"in document&&11>=document.documentMode,oc=null,x0=null,cd=null,w0=!1;function a_(s,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;w0||oc==null||oc!==Gh(g)||(g=oc,"selectionStart"in g&&b0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),cd&&ld(cd,g)||(cd=g,g=Up(x0,"onSelect"),0<g.length&&(l=new Qh("onSelect","select",null,l,h),s.push({event:l,listeners:g}),l.target=oc)))}function Mo(s,l){var h={};return h[s.toLowerCase()]=l.toLowerCase(),h["Webkit"+s]="webkit"+l,h["Moz"+s]="moz"+l,h}var lc={animationend:Mo("Animation","AnimationEnd"),animationiteration:Mo("Animation","AnimationIteration"),animationstart:Mo("Animation","AnimationStart"),transitionrun:Mo("Transition","TransitionRun"),transitionstart:Mo("Transition","TransitionStart"),transitioncancel:Mo("Transition","TransitionCancel"),transitionend:Mo("Transition","TransitionEnd")},S0={},s_={};Ra&&(s_=document.createElement("div").style,"AnimationEvent"in window||(delete lc.animationend.animation,delete lc.animationiteration.animation,delete lc.animationstart.animation),"TransitionEvent"in window||delete lc.transitionend.transition);function Io(s){if(S0[s])return S0[s];if(!lc[s])return s;var l=lc[s],h;for(h in l)if(l.hasOwnProperty(h)&&h in s_)return S0[s]=l[h];return s}var o_=Io("animationend"),l_=Io("animationiteration"),c_=Io("animationstart"),DF=Io("transitionrun"),MF=Io("transitionstart"),IF=Io("transitioncancel"),u_=Io("transitionend"),d_=new Map,j0="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(" ");j0.push("scrollEnd");function Ii(s,l){d_.set(s,l),nt(l,[s])}var ep=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ii=[],cc=0,k0=0;function tp(){for(var s=cc,l=k0=cc=0;l<s;){var h=ii[l];ii[l++]=null;var g=ii[l];ii[l++]=null;var x=ii[l];ii[l++]=null;var k=ii[l];if(ii[l++]=null,g!==null&&x!==null){var z=g.pending;z===null?x.next=x:(x.next=z.next,z.next=x),g.pending=x}k!==0&&f_(h,x,k)}}function np(s,l,h,g){ii[cc++]=s,ii[cc++]=l,ii[cc++]=h,ii[cc++]=g,k0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function N0(s,l,h,g){return np(s,l,h,g),rp(s)}function Lo(s,l){return np(s,null,null,l),rp(s)}function f_(s,l,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var x=!1,k=s.return;k!==null;)k.childLanes|=h,g=k.alternate,g!==null&&(g.childLanes|=h),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(x=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,x&&l!==null&&(x=31-Te(h),s=k.hiddenUpdates,g=s[x],g===null?s[x]=[l]:g.push(l),l.lane=h|536870912),k):null}function rp(s){if(50<zd)throw zd=0,Rb=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var uc={};function LF(s,l,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(s,l,h,g){return new LF(s,l,h,g)}function C0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Da(s,l){var h=s.alternate;return h===null?(h=Br(s.tag,l,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=l,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,l=s.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function h_(s,l){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,l=h.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function ip(s,l,h,g,x,k){var z=0;if(g=s,typeof s=="function")C0(s)&&(z=1);else if(typeof s=="string")z=qq(s,h,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=Br(31,h,l,x),s.elementType=I,s.lanes=k,s;case S:return $o(h.children,x,k,l);case j:z=8,x|=24;break;case N:return s=Br(12,h,l,x|2),s.elementType=N,s.lanes=k,s;case T:return s=Br(13,h,l,x),s.elementType=T,s.lanes=k,s;case E:return s=Br(19,h,l,x),s.elementType=E,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:z=10;break e;case O:z=9;break e;case C:z=11;break e;case A:z=14;break e;case P:z=16,g=null;break e}z=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=Br(z,h,l,x),l.elementType=s,l.type=g,l.lanes=k,l}function $o(s,l,h,g){return s=Br(7,s,g,l),s.lanes=h,s}function _0(s,l,h){return s=Br(6,s,null,l),s.lanes=h,s}function p_(s){var l=Br(18,null,null,0);return l.stateNode=s,l}function A0(s,l,h){return l=Br(4,s.children!==null?s.children:[],s.key,l),l.lanes=h,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var m_=new WeakMap;function ai(s,l){if(typeof s=="object"&&s!==null){var h=m_.get(s);return h!==void 0?h:(l={value:s,source:l,stack:Xt(l)},m_.set(s,l),l)}return{value:s,source:l,stack:Xt(l)}}var dc=[],fc=0,ap=null,ud=0,si=[],oi=0,ws=null,ea=1,ta="";function Ma(s,l){dc[fc++]=ud,dc[fc++]=ap,ap=s,ud=l}function g_(s,l,h){si[oi++]=ea,si[oi++]=ta,si[oi++]=ws,ws=s;var g=ea;s=ta;var x=32-Te(g)-1;g&=~(1<<x),h+=1;var k=32-Te(l)+x;if(30<k){var z=x-x%5;k=(g&(1<<z)-1).toString(32),g>>=z,x-=z,ea=1<<32-Te(l)+x|h<<x|g,ta=k+s}else ea=1<<k|h<<x|g,ta=s}function O0(s){s.return!==null&&(Ma(s,1),g_(s,1,0))}function E0(s){for(;s===ap;)ap=dc[--fc],dc[fc]=null,ud=dc[--fc],dc[fc]=null;for(;s===ws;)ws=si[--oi],si[oi]=null,ta=si[--oi],si[oi]=null,ea=si[--oi],si[oi]=null}function y_(s,l){si[oi++]=ea,si[oi++]=ta,si[oi++]=ws,ea=l.id,ta=l.overflow,ws=s}var qn=null,Zt=null,gt=!1,Ss=null,li=!1,z0=Error(r(519));function js(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dd(ai(l,s)),z0}function v_(s){var l=s.stateNode,h=s.type,g=s.memoizedProps;switch(l[ut]=s,l[Pt]=g,h){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(h=0;h<Pd.length;h++)ft(Pd[h],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":ft("invalid",l),zC(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ft("invalid",l);break;case"textarea":ft("invalid",l),PC(l,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||g.suppressHydrationWarning===!0||DO(l.textContent,h)?(g.popover!=null&&(ft("beforetoggle",l),ft("toggle",l)),g.onScroll!=null&&ft("scroll",l),g.onScrollEnd!=null&&ft("scrollend",l),g.onClick!=null&&(l.onclick=Pa),l=!0):l=!1,l||js(s,!0)}function b_(s){for(qn=s.return;qn;)switch(qn.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:qn=qn.return}}function hc(s){if(s!==qn)return!1;if(!gt)return b_(s),gt=!0,!1;var l=s.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Yb(s.type,s.memoizedProps)),h=!h),h&&Zt&&js(s),b_(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Zt=HO(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Zt=HO(s)}else l===27?(l=Zt,Is(s.type)?(s=ex,ex=null,Zt=s):Zt=l):Zt=qn?ui(s.stateNode.nextSibling):null;return!0}function Bo(){Zt=qn=null,gt=!1}function T0(){var s=Ss;return s!==null&&(kr===null?kr=s:kr.push.apply(kr,s),Ss=null),s}function dd(s){Ss===null?Ss=[s]:Ss.push(s)}var P0=U(null),Uo=null,Ia=null;function ks(s,l,h){D(P0,l._currentValue),l._currentValue=h}function La(s){s._currentValue=P0.current,F(P0)}function R0(s,l,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===h)break;s=s.return}}function D0(s,l,h,g){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var k=x.dependencies;if(k!==null){var z=x.child;k=k.firstContext;e:for(;k!==null;){var L=k;k=x;for(var K=0;K<l.length;K++)if(L.context===l[K]){k.lanes|=h,L=k.alternate,L!==null&&(L.lanes|=h),R0(k.return,h,s),g||(z=null);break e}k=L.next}}else if(x.tag===18){if(z=x.return,z===null)throw Error(r(341));z.lanes|=h,k=z.alternate,k!==null&&(k.lanes|=h),R0(z,h,s),z=null}else z=x.child;if(z!==null)z.return=x;else for(z=x;z!==null;){if(z===s){z=null;break}if(x=z.sibling,x!==null){x.return=z.return,z=x;break}z=z.return}x=z}}function pc(s,l,h,g){s=null;for(var x=l,k=!1;x!==null;){if(!k){if((x.flags&524288)!==0)k=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var z=x.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var L=x.type;$r(x.pendingProps.value,z.value)||(s!==null?s.push(L):s=[L])}}else if(x===he.current){if(z=x.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Ld):s=[Ld])}x=x.return}s!==null&&D0(l,s,h,g),l.flags|=262144}function sp(s){for(s=s.firstContext;s!==null;){if(!$r(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Fo(s){Uo=s,Ia=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Hn(s){return x_(Uo,s)}function op(s,l){return Uo===null&&Fo(s),x_(s,l)}function x_(s,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Ia===null){if(s===null)throw Error(r(308));Ia=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Ia=Ia.next=l;return h}var $F=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(h){return h()})}},BF=e.unstable_scheduleCallback,UF=e.unstable_NormalPriority,jn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function M0(){return{controller:new $F,data:new Map,refCount:0}}function fd(s){s.refCount--,s.refCount===0&&BF(UF,function(){s.controller.abort()})}var hd=null,I0=0,mc=0,gc=null;function FF(s,l){if(hd===null){var h=hd=[];I0=0,mc=Bb(),gc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return I0++,l.then(w_,w_),l}function w_(){if(--I0===0&&hd!==null){gc!==null&&(gc.status="fulfilled");var s=hd;hd=null,mc=0,gc=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function qF(s,l){var h=[],g={status:"pending",value:null,reason:null,then:function(x){h.push(x)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var x=0;x<h.length;x++)(0,h[x])(l)},function(x){for(g.status="rejected",g.reason=x,x=0;x<h.length;x++)(0,h[x])(void 0)}),g}var S_=H.S;H.S=function(s,l){aO=lt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&FF(s,l),S_!==null&&S_(s,l)};var qo=U(null);function L0(){var s=qo.current;return s!==null?s:$t.pooledCache}function lp(s,l){l===null?D(qo,qo.current):D(qo,l.pool)}function j_(){var s=L0();return s===null?null:{parent:jn._currentValue,pool:s}}var yc=Error(r(460)),$0=Error(r(474)),cp=Error(r(542)),up={then:function(){}};function k_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function N_(s,l,h){switch(h=s[h],h===void 0?s.push(l):h!==l&&(l.then(Pa,Pa),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,__(s),s;default:if(typeof l.status=="string")l.then(Pa,Pa);else{if(s=$t,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=g}},function(g){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,__(s),s}throw Ko=l,yc}}function Ho(s){try{var l=s._init;return l(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ko=h,yc):h}}var Ko=null;function C_(){if(Ko===null)throw Error(r(459));var s=Ko;return Ko=null,s}function __(s){if(s===yc||s===cp)throw Error(r(483))}var vc=null,pd=0;function dp(s){var l=pd;return pd+=1,vc===null&&(vc=[]),N_(vc,s,l)}function md(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function fp(s,l){throw l.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function A_(s){function l(ee,W){if(s){var re=ee.deletions;re===null?(ee.deletions=[W],ee.flags|=16):re.push(W)}}function h(ee,W){if(!s)return null;for(;W!==null;)l(ee,W),W=W.sibling;return null}function g(ee){for(var W=new Map;ee!==null;)ee.key!==null?W.set(ee.key,ee):W.set(ee.index,ee),ee=ee.sibling;return W}function x(ee,W){return ee=Da(ee,W),ee.index=0,ee.sibling=null,ee}function k(ee,W,re){return ee.index=re,s?(re=ee.alternate,re!==null?(re=re.index,re<W?(ee.flags|=67108866,W):re):(ee.flags|=67108866,W)):(ee.flags|=1048576,W)}function z(ee){return s&&ee.alternate===null&&(ee.flags|=67108866),ee}function L(ee,W,re,ge){return W===null||W.tag!==6?(W=_0(re,ee.mode,ge),W.return=ee,W):(W=x(W,re),W.return=ee,W)}function K(ee,W,re,ge){var Ke=re.type;return Ke===S?fe(ee,W,re.props.children,ge,re.key):W!==null&&(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&Ho(Ke)===W.type)?(W=x(W,re.props),md(W,re),W.return=ee,W):(W=ip(re.type,re.key,re.props,null,ee.mode,ge),md(W,re),W.return=ee,W)}function ie(ee,W,re,ge){return W===null||W.tag!==4||W.stateNode.containerInfo!==re.containerInfo||W.stateNode.implementation!==re.implementation?(W=A0(re,ee.mode,ge),W.return=ee,W):(W=x(W,re.children||[]),W.return=ee,W)}function fe(ee,W,re,ge,Ke){return W===null||W.tag!==7?(W=$o(re,ee.mode,ge,Ke),W.return=ee,W):(W=x(W,re),W.return=ee,W)}function xe(ee,W,re){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=_0(""+W,ee.mode,re),W.return=ee,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return re=ip(W.type,W.key,W.props,null,ee.mode,re),md(re,W),re.return=ee,re;case w:return W=A0(W,ee.mode,re),W.return=ee,W;case P:return W=Ho(W),xe(ee,W,re)}if(Y(W)||$(W))return W=$o(W,ee.mode,re,null),W.return=ee,W;if(typeof W.then=="function")return xe(ee,dp(W),re);if(W.$$typeof===_)return xe(ee,op(ee,W),re);fp(ee,W)}return null}function oe(ee,W,re,ge){var Ke=W!==null?W.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ke!==null?null:L(ee,W,""+re,ge);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===Ke?K(ee,W,re,ge):null;case w:return re.key===Ke?ie(ee,W,re,ge):null;case P:return re=Ho(re),oe(ee,W,re,ge)}if(Y(re)||$(re))return Ke!==null?null:fe(ee,W,re,ge,null);if(typeof re.then=="function")return oe(ee,W,dp(re),ge);if(re.$$typeof===_)return oe(ee,W,op(ee,re),ge);fp(ee,re)}return null}function ue(ee,W,re,ge,Ke){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ee=ee.get(re)||null,L(W,ee,""+ge,Ke);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:return ee=ee.get(ge.key===null?re:ge.key)||null,K(W,ee,ge,Ke);case w:return ee=ee.get(ge.key===null?re:ge.key)||null,ie(W,ee,ge,Ke);case P:return ge=Ho(ge),ue(ee,W,re,ge,Ke)}if(Y(ge)||$(ge))return ee=ee.get(re)||null,fe(W,ee,ge,Ke,null);if(typeof ge.then=="function")return ue(ee,W,re,dp(ge),Ke);if(ge.$$typeof===_)return ue(ee,W,re,op(W,ge),Ke);fp(W,ge)}return null}function Re(ee,W,re,ge){for(var Ke=null,jt=null,$e=W,rt=W=0,mt=null;$e!==null&&rt<re.length;rt++){$e.index>rt?(mt=$e,$e=null):mt=$e.sibling;var kt=oe(ee,$e,re[rt],ge);if(kt===null){$e===null&&($e=mt);break}s&&$e&&kt.alternate===null&&l(ee,$e),W=k(kt,W,rt),jt===null?Ke=kt:jt.sibling=kt,jt=kt,$e=mt}if(rt===re.length)return h(ee,$e),gt&&Ma(ee,rt),Ke;if($e===null){for(;rt<re.length;rt++)$e=xe(ee,re[rt],ge),$e!==null&&(W=k($e,W,rt),jt===null?Ke=$e:jt.sibling=$e,jt=$e);return gt&&Ma(ee,rt),Ke}for($e=g($e);rt<re.length;rt++)mt=ue($e,ee,rt,re[rt],ge),mt!==null&&(s&&mt.alternate!==null&&$e.delete(mt.key===null?rt:mt.key),W=k(mt,W,rt),jt===null?Ke=mt:jt.sibling=mt,jt=mt);return s&&$e.forEach(function(Fs){return l(ee,Fs)}),gt&&Ma(ee,rt),Ke}function Ve(ee,W,re,ge){if(re==null)throw Error(r(151));for(var Ke=null,jt=null,$e=W,rt=W=0,mt=null,kt=re.next();$e!==null&&!kt.done;rt++,kt=re.next()){$e.index>rt?(mt=$e,$e=null):mt=$e.sibling;var Fs=oe(ee,$e,kt.value,ge);if(Fs===null){$e===null&&($e=mt);break}s&&$e&&Fs.alternate===null&&l(ee,$e),W=k(Fs,W,rt),jt===null?Ke=Fs:jt.sibling=Fs,jt=Fs,$e=mt}if(kt.done)return h(ee,$e),gt&&Ma(ee,rt),Ke;if($e===null){for(;!kt.done;rt++,kt=re.next())kt=xe(ee,kt.value,ge),kt!==null&&(W=k(kt,W,rt),jt===null?Ke=kt:jt.sibling=kt,jt=kt);return gt&&Ma(ee,rt),Ke}for($e=g($e);!kt.done;rt++,kt=re.next())kt=ue($e,ee,rt,kt.value,ge),kt!==null&&(s&&kt.alternate!==null&&$e.delete(kt.key===null?rt:kt.key),W=k(kt,W,rt),jt===null?Ke=kt:jt.sibling=kt,jt=kt);return s&&$e.forEach(function(e9){return l(ee,e9)}),gt&&Ma(ee,rt),Ke}function Lt(ee,W,re,ge){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var Ke=re.key;W!==null;){if(W.key===Ke){if(Ke=re.type,Ke===S){if(W.tag===7){h(ee,W.sibling),ge=x(W,re.props.children),ge.return=ee,ee=ge;break e}}else if(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&Ho(Ke)===W.type){h(ee,W.sibling),ge=x(W,re.props),md(ge,re),ge.return=ee,ee=ge;break e}h(ee,W);break}else l(ee,W);W=W.sibling}re.type===S?(ge=$o(re.props.children,ee.mode,ge,re.key),ge.return=ee,ee=ge):(ge=ip(re.type,re.key,re.props,null,ee.mode,ge),md(ge,re),ge.return=ee,ee=ge)}return z(ee);case w:e:{for(Ke=re.key;W!==null;){if(W.key===Ke)if(W.tag===4&&W.stateNode.containerInfo===re.containerInfo&&W.stateNode.implementation===re.implementation){h(ee,W.sibling),ge=x(W,re.children||[]),ge.return=ee,ee=ge;break e}else{h(ee,W);break}else l(ee,W);W=W.sibling}ge=A0(re,ee.mode,ge),ge.return=ee,ee=ge}return z(ee);case P:return re=Ho(re),Lt(ee,W,re,ge)}if(Y(re))return Re(ee,W,re,ge);if($(re)){if(Ke=$(re),typeof Ke!="function")throw Error(r(150));return re=Ke.call(re),Ve(ee,W,re,ge)}if(typeof re.then=="function")return Lt(ee,W,dp(re),ge);if(re.$$typeof===_)return Lt(ee,W,op(ee,re),ge);fp(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,W!==null&&W.tag===6?(h(ee,W.sibling),ge=x(W,re),ge.return=ee,ee=ge):(h(ee,W),ge=_0(re,ee.mode,ge),ge.return=ee,ee=ge),z(ee)):h(ee,W)}return function(ee,W,re,ge){try{pd=0;var Ke=Lt(ee,W,re,ge);return vc=null,Ke}catch($e){if($e===yc||$e===cp)throw $e;var jt=Br(29,$e,null,ee.mode);return jt.lanes=ge,jt.return=ee,jt}}}var Go=A_(!0),O_=A_(!1),Ns=!1;function B0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function U0(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Cs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function _s(s,l,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Ct&2)!==0){var x=g.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),g.pending=l,l=rp(s),f_(s,null,h),l}return np(s,g,l,h),rp(s)}function gd(s,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,Lh(s,h)}}function F0(s,l){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var x=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};k===null?x=k=z:k=k.next=z,h=h.next}while(h!==null);k===null?x=k=l:k=k.next=l}else x=k=l;h={baseState:g.baseState,firstBaseUpdate:x,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=l:s.next=l,h.lastBaseUpdate=l}var q0=!1;function yd(){if(q0){var s=gc;if(s!==null)throw s}}function vd(s,l,h,g){q0=!1;var x=s.updateQueue;Ns=!1;var k=x.firstBaseUpdate,z=x.lastBaseUpdate,L=x.shared.pending;if(L!==null){x.shared.pending=null;var K=L,ie=K.next;K.next=null,z===null?k=ie:z.next=ie,z=K;var fe=s.alternate;fe!==null&&(fe=fe.updateQueue,L=fe.lastBaseUpdate,L!==z&&(L===null?fe.firstBaseUpdate=ie:L.next=ie,fe.lastBaseUpdate=K))}if(k!==null){var xe=x.baseState;z=0,fe=ie=K=null,L=k;do{var oe=L.lane&-536870913,ue=oe!==L.lane;if(ue?(pt&oe)===oe:(g&oe)===oe){oe!==0&&oe===mc&&(q0=!0),fe!==null&&(fe=fe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Re=s,Ve=L;oe=l;var Lt=h;switch(Ve.tag){case 1:if(Re=Ve.payload,typeof Re=="function"){xe=Re.call(Lt,xe,oe);break e}xe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ve.payload,oe=typeof Re=="function"?Re.call(Lt,xe,oe):Re,oe==null)break e;xe=m({},xe,oe);break e;case 2:Ns=!0}}oe=L.callback,oe!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=x.callbacks,ue===null?x.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},fe===null?(ie=fe=ue,K=xe):fe=fe.next=ue,z|=oe;if(L=L.next,L===null){if(L=x.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,x.lastBaseUpdate=ue,x.shared.pending=null}}while(!0);fe===null&&(K=xe),x.baseState=K,x.firstBaseUpdate=ie,x.lastBaseUpdate=fe,k===null&&(x.shared.lanes=0),Ts|=z,s.lanes=z,s.memoizedState=xe}}function E_(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function z_(s,l){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)E_(h[s],l)}var bc=U(null),hp=U(0);function T_(s,l){s=Va,D(hp,s),D(bc,l),Va=s|l.baseLanes}function H0(){D(hp,Va),D(bc,bc.current)}function K0(){Va=hp.current,F(bc),F(hp)}var Ur=U(null),ci=null;function As(s){var l=s.alternate;D(vn,vn.current&1),D(Ur,s),ci===null&&(l===null||bc.current!==null||l.memoizedState!==null)&&(ci=s)}function G0(s){D(vn,vn.current),D(Ur,s),ci===null&&(ci=s)}function P_(s){s.tag===22?(D(vn,vn.current),D(Ur,s),ci===null&&(ci=s)):Os()}function Os(){D(vn,vn.current),D(Ur,Ur.current)}function Fr(s){F(Ur),ci===s&&(ci=null),F(vn)}var vn=U(0);function pp(s){for(var l=s;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Xb(h)||Jb(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var $a=0,Xe=null,Mt=null,kn=null,mp=!1,xc=!1,Vo=!1,gp=0,bd=0,wc=null,HF=0;function hn(){throw Error(r(321))}function V0(s,l){if(l===null)return!1;for(var h=0;h<l.length&&h<s.length;h++)if(!$r(s[h],l[h]))return!1;return!0}function Z0(s,l,h,g,x,k){return $a=k,Xe=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,H.H=s===null||s.memoizedState===null?gA:cb,Vo=!1,k=h(g,x),Vo=!1,xc&&(k=D_(l,h,g,x)),R_(s),k}function R_(s){H.H=Sd;var l=Mt!==null&&Mt.next!==null;if($a=0,kn=Mt=Xe=null,mp=!1,bd=0,wc=null,l)throw Error(r(300));s===null||Nn||(s=s.dependencies,s!==null&&sp(s)&&(Nn=!0))}function D_(s,l,h,g){Xe=s;var x=0;do{if(xc&&(wc=null),bd=0,xc=!1,25<=x)throw Error(r(301));if(x+=1,kn=Mt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}H.H=yA,k=l(h,g)}while(xc);return k}function KF(){var s=H.H,l=s.useState()[0];return l=typeof l.then=="function"?xd(l):l,s=s.useState()[0],(Mt!==null?Mt.memoizedState:null)!==s&&(Xe.flags|=1024),l}function Y0(){var s=gp!==0;return gp=0,s}function W0(s,l,h){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~h}function Q0(s){if(mp){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}mp=!1}$a=0,kn=Mt=Xe=null,xc=!1,bd=gp=0,wc=null}function cr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kn===null?Xe.memoizedState=kn=s:kn=kn.next=s,kn}function bn(){if(Mt===null){var s=Xe.alternate;s=s!==null?s.memoizedState:null}else s=Mt.next;var l=kn===null?Xe.memoizedState:kn.next;if(l!==null)kn=l,Mt=s;else{if(s===null)throw Xe.alternate===null?Error(r(467)):Error(r(310));Mt=s,s={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},kn===null?Xe.memoizedState=kn=s:kn=kn.next=s}return kn}function yp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xd(s){var l=bd;return bd+=1,wc===null&&(wc=[]),s=N_(wc,s,l),l=Xe,(kn===null?l.memoizedState:kn.next)===null&&(l=l.alternate,H.H=l===null||l.memoizedState===null?gA:cb),s}function vp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return xd(s);if(s.$$typeof===_)return Hn(s)}throw Error(r(438,String(s)))}function X0(s){var l=null,h=Xe.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var g=Xe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=yp(),Xe.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(s),g=0;g<s;g++)h[g]=q;return l.index++,h}function Ba(s,l){return typeof l=="function"?l(s):l}function bp(s){var l=bn();return J0(l,Mt,s)}function J0(s,l,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var x=s.baseQueue,k=g.pending;if(k!==null){if(x!==null){var z=x.next;x.next=k.next,k.next=z}l.baseQueue=x=k,g.pending=null}if(k=s.baseState,x===null)s.memoizedState=k;else{l=x.next;var L=z=null,K=null,ie=l,fe=!1;do{var xe=ie.lane&-536870913;if(xe!==ie.lane?(pt&xe)===xe:($a&xe)===xe){var oe=ie.revertLane;if(oe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),xe===mc&&(fe=!0);else if(($a&oe)===oe){ie=ie.next,oe===mc&&(fe=!0);continue}else xe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(L=K=xe,z=k):K=K.next=xe,Xe.lanes|=oe,Ts|=oe;xe=ie.action,Vo&&h(k,xe),k=ie.hasEagerState?ie.eagerState:h(k,xe)}else oe={lane:xe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(L=K=oe,z=k):K=K.next=oe,Xe.lanes|=xe,Ts|=xe;ie=ie.next}while(ie!==null&&ie!==l);if(K===null?z=k:K.next=L,!$r(k,s.memoizedState)&&(Nn=!0,fe&&(h=gc,h!==null)))throw h;s.memoizedState=k,s.baseState=z,s.baseQueue=K,g.lastRenderedState=k}return x===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function eb(s){var l=bn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,x=h.pending,k=l.memoizedState;if(x!==null){h.pending=null;var z=x=x.next;do k=s(k,z.action),z=z.next;while(z!==x);$r(k,l.memoizedState)||(Nn=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),h.lastRenderedState=k}return[k,g]}function M_(s,l,h){var g=Xe,x=bn(),k=gt;if(k){if(h===void 0)throw Error(r(407));h=h()}else h=l();var z=!$r((Mt||x).memoizedState,h);if(z&&(x.memoizedState=h,Nn=!0),x=x.queue,rb($_.bind(null,g,x,s),[s]),x.getSnapshot!==l||z||kn!==null&&kn.memoizedState.tag&1){if(g.flags|=2048,Sc(9,{destroy:void 0},L_.bind(null,g,x,h,l),null),$t===null)throw Error(r(349));k||($a&127)!==0||I_(g,l,h)}return h}function I_(s,l,h){s.flags|=16384,s={getSnapshot:l,value:h},l=Xe.updateQueue,l===null?(l=yp(),Xe.updateQueue=l,l.stores=[s]):(h=l.stores,h===null?l.stores=[s]:h.push(s))}function L_(s,l,h,g){l.value=h,l.getSnapshot=g,B_(l)&&U_(s)}function $_(s,l,h){return h(function(){B_(l)&&U_(s)})}function B_(s){var l=s.getSnapshot;s=s.value;try{var h=l();return!$r(s,h)}catch{return!0}}function U_(s){var l=Lo(s,2);l!==null&&Nr(l,s,2)}function tb(s){var l=cr();if(typeof s=="function"){var h=s;if(s=h(),Vo){Tt(!0);try{h()}finally{Tt(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:s},l}function F_(s,l,h,g){return s.baseState=h,J0(s,Mt,typeof g=="function"?g:Ba)}function GF(s,l,h,g,x){if(Sp(s))throw Error(r(485));if(s=l.action,s!==null){var k={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){k.listeners.push(z)}};H.T!==null?h(!0):k.isTransition=!1,g(k),h=l.pending,h===null?(k.next=l.pending=k,q_(l,k)):(k.next=h.next,l.pending=h.next=k)}}function q_(s,l){var h=l.action,g=l.payload,x=s.state;if(l.isTransition){var k=H.T,z={};H.T=z;try{var L=h(x,g),K=H.S;K!==null&&K(z,L),H_(s,l,L)}catch(ie){nb(s,l,ie)}finally{k!==null&&z.types!==null&&(k.types=z.types),H.T=k}}else try{k=h(x,g),H_(s,l,k)}catch(ie){nb(s,l,ie)}}function H_(s,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){K_(s,l,g)},function(g){return nb(s,l,g)}):K_(s,l,h)}function K_(s,l,h){l.status="fulfilled",l.value=h,G_(l),s.state=h,l=s.pending,l!==null&&(h=l.next,h===l?s.pending=null:(h=h.next,l.next=h,q_(s,h)))}function nb(s,l,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=h,G_(l),l=l.next;while(l!==g)}s.action=null}function G_(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function V_(s,l){return l}function Z_(s,l){if(gt){var h=$t.formState;if(h!==null){e:{var g=Xe;if(gt){if(Zt){t:{for(var x=Zt,k=li;x.nodeType!==8;){if(!k){x=null;break t}if(x=ui(x.nextSibling),x===null){x=null;break t}}k=x.data,x=k==="F!"||k==="F"?x:null}if(x){Zt=ui(x.nextSibling),g=x.data==="F!";break e}}js(g)}g=!1}g&&(l=h[0])}}return h=cr(),h.memoizedState=h.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:V_,lastRenderedState:l},h.queue=g,h=hA.bind(null,Xe,g),g.dispatch=h,g=tb(!1),k=lb.bind(null,Xe,!1,g.queue),g=cr(),x={state:l,dispatch:null,action:s,pending:null},g.queue=x,h=GF.bind(null,Xe,x,k,h),x.dispatch=h,g.memoizedState=s,[l,h,!1]}function Y_(s){var l=bn();return W_(l,Mt,s)}function W_(s,l,h){if(l=J0(s,l,V_)[0],s=bp(Ba)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=xd(l)}catch(z){throw z===yc?cp:z}else g=l;l=bn();var x=l.queue,k=x.dispatch;return h!==l.memoizedState&&(Xe.flags|=2048,Sc(9,{destroy:void 0},VF.bind(null,x,h),null)),[g,k,s]}function VF(s,l){s.action=l}function Q_(s){var l=bn(),h=Mt;if(h!==null)return W_(l,h,s);bn(),l=l.memoizedState,h=bn();var g=h.queue.dispatch;return h.memoizedState=s,[l,g,!1]}function Sc(s,l,h,g){return s={tag:s,create:h,deps:g,inst:l,next:null},l=Xe.updateQueue,l===null&&(l=yp(),Xe.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,l.lastEffect=s),s}function X_(){return bn().memoizedState}function xp(s,l,h,g){var x=cr();Xe.flags|=s,x.memoizedState=Sc(1|l,{destroy:void 0},h,g===void 0?null:g)}function wp(s,l,h,g){var x=bn();g=g===void 0?null:g;var k=x.memoizedState.inst;Mt!==null&&g!==null&&V0(g,Mt.memoizedState.deps)?x.memoizedState=Sc(l,k,h,g):(Xe.flags|=s,x.memoizedState=Sc(1|l,k,h,g))}function J_(s,l){xp(8390656,8,s,l)}function rb(s,l){wp(2048,8,s,l)}function ZF(s){Xe.flags|=4;var l=Xe.updateQueue;if(l===null)l=yp(),Xe.updateQueue=l,l.events=[s];else{var h=l.events;h===null?l.events=[s]:h.push(s)}}function eA(s){var l=bn().memoizedState;return ZF({ref:l,nextImpl:s}),function(){if((Ct&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function tA(s,l){return wp(4,2,s,l)}function nA(s,l){return wp(4,4,s,l)}function rA(s,l){if(typeof l=="function"){s=s();var h=l(s);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function iA(s,l,h){h=h!=null?h.concat([s]):null,wp(4,4,rA.bind(null,l,s),h)}function ib(){}function aA(s,l){var h=bn();l=l===void 0?null:l;var g=h.memoizedState;return l!==null&&V0(l,g[1])?g[0]:(h.memoizedState=[s,l],s)}function sA(s,l){var h=bn();l=l===void 0?null:l;var g=h.memoizedState;if(l!==null&&V0(l,g[1]))return g[0];if(g=s(),Vo){Tt(!0);try{s()}finally{Tt(!1)}}return h.memoizedState=[g,l],g}function ab(s,l,h){return h===void 0||($a&1073741824)!==0&&(pt&261930)===0?s.memoizedState=l:(s.memoizedState=h,s=oO(),Xe.lanes|=s,Ts|=s,h)}function oA(s,l,h,g){return $r(h,l)?h:bc.current!==null?(s=ab(s,h,g),$r(s,l)||(Nn=!0),s):($a&42)===0||($a&1073741824)!==0&&(pt&261930)===0?(Nn=!0,s.memoizedState=h):(s=oO(),Xe.lanes|=s,Ts|=s,l)}function lA(s,l,h,g,x){var k=J.p;J.p=k!==0&&8>k?k:8;var z=H.T,L={};H.T=L,lb(s,!1,l,h);try{var K=x(),ie=H.S;if(ie!==null&&ie(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=qF(K,g);wd(s,l,fe,Kr(s))}else wd(s,l,g,Kr(s))}catch(xe){wd(s,l,{then:function(){},status:"rejected",reason:xe},Kr())}finally{J.p=k,z!==null&&L.types!==null&&(z.types=L.types),H.T=z}}function YF(){}function sb(s,l,h,g){if(s.tag!==5)throw Error(r(476));var x=cA(s).queue;lA(s,x,l,pe,h===null?YF:function(){return uA(s),h(g)})}function cA(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:pe},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:h},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function uA(s){var l=cA(s);l.next===null&&(l=s.alternate.memoizedState),wd(s,l.next.queue,{},Kr())}function ob(){return Hn(Ld)}function dA(){return bn().memoizedState}function fA(){return bn().memoizedState}function WF(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var h=Kr();s=Cs(h);var g=_s(l,s,h);g!==null&&(Nr(g,l,h),gd(g,l,h)),l={cache:M0()},s.payload=l;return}l=l.return}}function QF(s,l,h){var g=Kr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Sp(s)?pA(l,h):(h=N0(s,l,h,g),h!==null&&(Nr(h,s,g),mA(h,l,g)))}function hA(s,l,h){var g=Kr();wd(s,l,h,g)}function wd(s,l,h,g){var x={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Sp(s))pA(l,x);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var z=l.lastRenderedState,L=k(z,h);if(x.hasEagerState=!0,x.eagerState=L,$r(L,z))return np(s,l,x,0),$t===null&&tp(),!1}catch{}if(h=N0(s,l,x,g),h!==null)return Nr(h,s,g),mA(h,l,g),!0}return!1}function lb(s,l,h,g){if(g={lane:2,revertLane:Bb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Sp(s)){if(l)throw Error(r(479))}else l=N0(s,h,g,2),l!==null&&Nr(l,s,2)}function Sp(s){var l=s.alternate;return s===Xe||l!==null&&l===Xe}function pA(s,l){xc=mp=!0;var h=s.pending;h===null?l.next=l:(l.next=h.next,h.next=l),s.pending=l}function mA(s,l,h){if((h&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,Lh(s,h)}}var Sd={readContext:Hn,use:vp,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};Sd.useEffectEvent=hn;var gA={readContext:Hn,use:vp,useCallback:function(s,l){return cr().memoizedState=[s,l===void 0?null:l],s},useContext:Hn,useEffect:J_,useImperativeHandle:function(s,l,h){h=h!=null?h.concat([s]):null,xp(4194308,4,rA.bind(null,l,s),h)},useLayoutEffect:function(s,l){return xp(4194308,4,s,l)},useInsertionEffect:function(s,l){xp(4,2,s,l)},useMemo:function(s,l){var h=cr();l=l===void 0?null:l;var g=s();if(Vo){Tt(!0);try{s()}finally{Tt(!1)}}return h.memoizedState=[g,l],g},useReducer:function(s,l,h){var g=cr();if(h!==void 0){var x=h(l);if(Vo){Tt(!0);try{h(l)}finally{Tt(!1)}}}else x=l;return g.memoizedState=g.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},g.queue=s,s=s.dispatch=QF.bind(null,Xe,s),[g.memoizedState,s]},useRef:function(s){var l=cr();return s={current:s},l.memoizedState=s},useState:function(s){s=tb(s);var l=s.queue,h=hA.bind(null,Xe,l);return l.dispatch=h,[s.memoizedState,h]},useDebugValue:ib,useDeferredValue:function(s,l){var h=cr();return ab(h,s,l)},useTransition:function(){var s=tb(!1);return s=lA.bind(null,Xe,s.queue,!0,!1),cr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,h){var g=Xe,x=cr();if(gt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),$t===null)throw Error(r(349));(pt&127)!==0||I_(g,l,h)}x.memoizedState=h;var k={value:h,getSnapshot:l};return x.queue=k,J_($_.bind(null,g,k,s),[s]),g.flags|=2048,Sc(9,{destroy:void 0},L_.bind(null,g,k,h,l),null),h},useId:function(){var s=cr(),l=$t.identifierPrefix;if(gt){var h=ta,g=ea;h=(g&~(1<<32-Te(g)-1)).toString(32)+h,l="_"+l+"R_"+h,h=gp++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=HF++,l="_"+l+"r_"+h.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:ob,useFormState:Z_,useActionState:Z_,useOptimistic:function(s){var l=cr();l.memoizedState=l.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=lb.bind(null,Xe,!0,h),h.dispatch=l,[s,l]},useMemoCache:X0,useCacheRefresh:function(){return cr().memoizedState=WF.bind(null,Xe)},useEffectEvent:function(s){var l=cr(),h={impl:s};return l.memoizedState=h,function(){if((Ct&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},cb={readContext:Hn,use:vp,useCallback:aA,useContext:Hn,useEffect:rb,useImperativeHandle:iA,useInsertionEffect:tA,useLayoutEffect:nA,useMemo:sA,useReducer:bp,useRef:X_,useState:function(){return bp(Ba)},useDebugValue:ib,useDeferredValue:function(s,l){var h=bn();return oA(h,Mt.memoizedState,s,l)},useTransition:function(){var s=bp(Ba)[0],l=bn().memoizedState;return[typeof s=="boolean"?s:xd(s),l]},useSyncExternalStore:M_,useId:dA,useHostTransitionStatus:ob,useFormState:Y_,useActionState:Y_,useOptimistic:function(s,l){var h=bn();return F_(h,Mt,s,l)},useMemoCache:X0,useCacheRefresh:fA};cb.useEffectEvent=eA;var yA={readContext:Hn,use:vp,useCallback:aA,useContext:Hn,useEffect:rb,useImperativeHandle:iA,useInsertionEffect:tA,useLayoutEffect:nA,useMemo:sA,useReducer:eb,useRef:X_,useState:function(){return eb(Ba)},useDebugValue:ib,useDeferredValue:function(s,l){var h=bn();return Mt===null?ab(h,s,l):oA(h,Mt.memoizedState,s,l)},useTransition:function(){var s=eb(Ba)[0],l=bn().memoizedState;return[typeof s=="boolean"?s:xd(s),l]},useSyncExternalStore:M_,useId:dA,useHostTransitionStatus:ob,useFormState:Q_,useActionState:Q_,useOptimistic:function(s,l){var h=bn();return Mt!==null?F_(h,Mt,s,l):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:X0,useCacheRefresh:fA};yA.useEffectEvent=eA;function ub(s,l,h,g){l=s.memoizedState,h=h(g,l),h=h==null?l:m({},l,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var db={enqueueSetState:function(s,l,h){s=s._reactInternals;var g=Kr(),x=Cs(g);x.payload=l,h!=null&&(x.callback=h),l=_s(s,x,g),l!==null&&(Nr(l,s,g),gd(l,s,g))},enqueueReplaceState:function(s,l,h){s=s._reactInternals;var g=Kr(),x=Cs(g);x.tag=1,x.payload=l,h!=null&&(x.callback=h),l=_s(s,x,g),l!==null&&(Nr(l,s,g),gd(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var h=Kr(),g=Cs(h);g.tag=2,l!=null&&(g.callback=l),l=_s(s,g,h),l!==null&&(Nr(l,s,h),gd(l,s,h))}};function vA(s,l,h,g,x,k,z){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,k,z):l.prototype&&l.prototype.isPureReactComponent?!ld(h,g)||!ld(x,k):!0}function bA(s,l,h,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==s&&db.enqueueReplaceState(l,l.state,null)}function Zo(s,l){var h=l;if("ref"in l){h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}if(s=s.defaultProps){h===l&&(h=m({},h));for(var x in s)h[x]===void 0&&(h[x]=s[x])}return h}function xA(s){ep(s)}function wA(s){console.error(s)}function SA(s){ep(s)}function jp(s,l){try{var h=s.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function jA(s,l,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function fb(s,l,h){return h=Cs(h),h.tag=3,h.payload={element:null},h.callback=function(){jp(s,l)},h}function kA(s){return s=Cs(s),s.tag=3,s}function NA(s,l,h,g){var x=h.type.getDerivedStateFromError;if(typeof x=="function"){var k=g.value;s.payload=function(){return x(k)},s.callback=function(){jA(l,h,g)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(s.callback=function(){jA(l,h,g),typeof x!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function XF(s,l,h,g,x){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=h.alternate,l!==null&&pc(l,h,x,!0),h=Ur.current,h!==null){switch(h.tag){case 31:case 13:return ci===null?Dp():h.alternate===null&&pn===0&&(pn=3),h.flags&=-257,h.flags|=65536,h.lanes=x,g===up?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([g]):l.add(g),Ib(s,g,x)),!1;case 22:return h.flags|=65536,g===up?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([g]):h.add(g)),Ib(s,g,x)),!1}throw Error(r(435,h.tag))}return Ib(s,g,x),Dp(),!1}if(gt)return l=Ur.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,g!==z0&&(s=Error(r(422),{cause:g}),dd(ai(s,h)))):(g!==z0&&(l=Error(r(423),{cause:g}),dd(ai(l,h))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,g=ai(g,h),x=fb(s.stateNode,g,x),F0(s,x),pn!==4&&(pn=2)),!1;var k=Error(r(520),{cause:g});if(k=ai(k,h),Ed===null?Ed=[k]:Ed.push(k),pn!==4&&(pn=2),l===null)return!0;g=ai(g,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,s=x&-x,h.lanes|=s,s=fb(h.stateNode,g,s),F0(h,s),!1;case 1:if(l=h.type,k=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Ps===null||!Ps.has(k))))return h.flags|=65536,x&=-x,h.lanes|=x,x=kA(x),NA(x,s,h,g),F0(h,x),!1}h=h.return}while(h!==null);return!1}var hb=Error(r(461)),Nn=!1;function Kn(s,l,h,g){l.child=s===null?O_(l,null,h,g):Go(l,s.child,h,g)}function CA(s,l,h,g,x){h=h.render;var k=l.ref;if("ref"in g){var z={};for(var L in g)L!=="ref"&&(z[L]=g[L])}else z=g;return Fo(l),g=Z0(s,l,h,z,k,x),L=Y0(),s!==null&&!Nn?(W0(s,l,x),Ua(s,l,x)):(gt&&L&&O0(l),l.flags|=1,Kn(s,l,g,x),l.child)}function _A(s,l,h,g,x){if(s===null){var k=h.type;return typeof k=="function"&&!C0(k)&&k.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=k,AA(s,l,k,g,x)):(s=ip(h.type,null,g,l,l.mode,x),s.ref=l.ref,s.return=l,l.child=s)}if(k=s.child,!wb(s,x)){var z=k.memoizedProps;if(h=h.compare,h=h!==null?h:ld,h(z,g)&&s.ref===l.ref)return Ua(s,l,x)}return l.flags|=1,s=Da(k,g),s.ref=l.ref,s.return=l,l.child=s}function AA(s,l,h,g,x){if(s!==null){var k=s.memoizedProps;if(ld(k,g)&&s.ref===l.ref)if(Nn=!1,l.pendingProps=g=k,wb(s,x))(s.flags&131072)!==0&&(Nn=!0);else return l.lanes=s.lanes,Ua(s,l,x)}return pb(s,l,h,g,x)}function OA(s,l,h,g){var x=g.children,k=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(k=k!==null?k.baseLanes|h:h,s!==null){for(g=l.child=s.child,x=0;g!==null;)x=x|g.lanes|g.childLanes,g=g.sibling;g=x&~k}else g=0,l.child=null;return EA(s,l,k,h,g)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&lp(l,k!==null?k.cachePool:null),k!==null?T_(l,k):H0(),P_(l);else return g=l.lanes=536870912,EA(s,l,k!==null?k.baseLanes|h:h,h,g)}else k!==null?(lp(l,k.cachePool),T_(l,k),Os(),l.memoizedState=null):(s!==null&&lp(l,null),H0(),Os());return Kn(s,l,x,h),l.child}function jd(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function EA(s,l,h,g,x){var k=L0();return k=k===null?null:{parent:jn._currentValue,pool:k},l.memoizedState={baseLanes:h,cachePool:k},s!==null&&lp(l,null),H0(),P_(l),s!==null&&pc(s,l,g,!0),l.childLanes=x,null}function kp(s,l){return l=Cp({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function zA(s,l,h){return Go(l,s.child,null,h),s=kp(l,l.pendingProps),s.flags|=2,Fr(l),l.memoizedState=null,s}function JF(s,l,h){var g=l.pendingProps,x=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(gt){if(g.mode==="hidden")return s=kp(l,g),l.lanes=536870912,jd(null,s);if(G0(l),(s=Zt)?(s=qO(s,li),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},h=p_(s),h.return=l,l.child=h,qn=l,Zt=null)):s=null,s===null)throw js(l);return l.lanes=536870912,null}return kp(l,g)}var k=s.memoizedState;if(k!==null){var z=k.dehydrated;if(G0(l),x)if(l.flags&256)l.flags&=-257,l=zA(s,l,h);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(Nn||pc(s,l,h,!1),x=(h&s.childLanes)!==0,Nn||x){if(g=$t,g!==null&&(z=$h(g,h),z!==0&&z!==k.retryLane))throw k.retryLane=z,Lo(s,z),Nr(g,s,z),hb;Dp(),l=zA(s,l,h)}else s=k.treeContext,Zt=ui(z.nextSibling),qn=l,gt=!0,Ss=null,li=!1,s!==null&&y_(l,s),l=kp(l,g),l.flags|=4096;return l}return s=Da(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Np(s,l){var h=l.ref;if(h===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(l.flags|=4194816)}}function pb(s,l,h,g,x){return Fo(l),h=Z0(s,l,h,g,void 0,x),g=Y0(),s!==null&&!Nn?(W0(s,l,x),Ua(s,l,x)):(gt&&g&&O0(l),l.flags|=1,Kn(s,l,h,x),l.child)}function TA(s,l,h,g,x,k){return Fo(l),l.updateQueue=null,h=D_(l,g,h,x),R_(s),g=Y0(),s!==null&&!Nn?(W0(s,l,k),Ua(s,l,k)):(gt&&g&&O0(l),l.flags|=1,Kn(s,l,h,k),l.child)}function PA(s,l,h,g,x){if(Fo(l),l.stateNode===null){var k=uc,z=h.contextType;typeof z=="object"&&z!==null&&(k=Hn(z)),k=new h(g,k),l.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=db,l.stateNode=k,k._reactInternals=l,k=l.stateNode,k.props=g,k.state=l.memoizedState,k.refs={},B0(l),z=h.contextType,k.context=typeof z=="object"&&z!==null?Hn(z):uc,k.state=l.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(ub(l,h,z,g),k.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(z=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),z!==k.state&&db.enqueueReplaceState(k,k.state,null),vd(l,g,k,x),yd(),k.state=l.memoizedState),typeof k.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){k=l.stateNode;var L=l.memoizedProps,K=Zo(h,L);k.props=K;var ie=k.context,fe=h.contextType;z=uc,typeof fe=="object"&&fe!==null&&(z=Hn(fe));var xe=h.getDerivedStateFromProps;fe=typeof xe=="function"||typeof k.getSnapshotBeforeUpdate=="function",L=l.pendingProps!==L,fe||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(L||ie!==z)&&bA(l,k,g,z),Ns=!1;var oe=l.memoizedState;k.state=oe,vd(l,g,k,x),yd(),ie=l.memoizedState,L||oe!==ie||Ns?(typeof xe=="function"&&(ub(l,h,xe,g),ie=l.memoizedState),(K=Ns||vA(l,h,K,g,oe,ie,z))?(fe||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(l.flags|=4194308)):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=ie),k.props=g,k.state=ie,k.context=z,g=K):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{k=l.stateNode,U0(s,l),z=l.memoizedProps,fe=Zo(h,z),k.props=fe,xe=l.pendingProps,oe=k.context,ie=h.contextType,K=uc,typeof ie=="object"&&ie!==null&&(K=Hn(ie)),L=h.getDerivedStateFromProps,(ie=typeof L=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(z!==xe||oe!==K)&&bA(l,k,g,K),Ns=!1,oe=l.memoizedState,k.state=oe,vd(l,g,k,x),yd();var ue=l.memoizedState;z!==xe||oe!==ue||Ns||s!==null&&s.dependencies!==null&&sp(s.dependencies)?(typeof L=="function"&&(ub(l,h,L,g),ue=l.memoizedState),(fe=Ns||vA(l,h,fe,g,oe,ue,K)||s!==null&&s.dependencies!==null&&sp(s.dependencies))?(ie||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ue,K),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ue,K)),typeof k.componentDidUpdate=="function"&&(l.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof k.componentDidUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ue),k.props=g,k.state=ue,k.context=K,g=fe):(typeof k.componentDidUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),g=!1)}return k=g,Np(s,l),g=(l.flags&128)!==0,k||g?(k=l.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:k.render(),l.flags|=1,s!==null&&g?(l.child=Go(l,s.child,null,x),l.child=Go(l,null,h,x)):Kn(s,l,h,x),l.memoizedState=k.state,s=l.child):s=Ua(s,l,x),s}function RA(s,l,h,g){return Bo(),l.flags|=256,Kn(s,l,h,g),l.child}var mb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gb(s){return{baseLanes:s,cachePool:j_()}}function yb(s,l,h){return s=s!==null?s.childLanes&~h:0,l&&(s|=Hr),s}function DA(s,l,h){var g=l.pendingProps,x=!1,k=(l.flags&128)!==0,z;if((z=k)||(z=s!==null&&s.memoizedState===null?!1:(vn.current&2)!==0),z&&(x=!0,l.flags&=-129),z=(l.flags&32)!==0,l.flags&=-33,s===null){if(gt){if(x?As(l):Os(),(s=Zt)?(s=qO(s,li),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},h=p_(s),h.return=l,l.child=h,qn=l,Zt=null)):s=null,s===null)throw js(l);return Jb(s)?l.lanes=32:l.lanes=536870912,null}var L=g.children;return g=g.fallback,x?(Os(),x=l.mode,L=Cp({mode:"hidden",children:L},x),g=$o(g,x,h,null),L.return=l,g.return=l,L.sibling=g,l.child=L,g=l.child,g.memoizedState=gb(h),g.childLanes=yb(s,z,h),l.memoizedState=mb,jd(null,g)):(As(l),vb(l,L))}var K=s.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(k)l.flags&256?(As(l),l.flags&=-257,l=bb(s,l,h)):l.memoizedState!==null?(Os(),l.child=s.child,l.flags|=128,l=null):(Os(),L=g.fallback,x=l.mode,g=Cp({mode:"visible",children:g.children},x),L=$o(L,x,h,null),L.flags|=2,g.return=l,L.return=l,g.sibling=L,l.child=g,Go(l,s.child,null,h),g=l.child,g.memoizedState=gb(h),g.childLanes=yb(s,z,h),l.memoizedState=mb,l=jd(null,g));else if(As(l),Jb(L)){if(z=L.nextSibling&&L.nextSibling.dataset,z)var ie=z.dgst;z=ie,g=Error(r(419)),g.stack="",g.digest=z,dd({value:g,source:null,stack:null}),l=bb(s,l,h)}else if(Nn||pc(s,l,h,!1),z=(h&s.childLanes)!==0,Nn||z){if(z=$t,z!==null&&(g=$h(z,h),g!==0&&g!==K.retryLane))throw K.retryLane=g,Lo(s,g),Nr(z,s,g),hb;Xb(L)||Dp(),l=bb(s,l,h)}else Xb(L)?(l.flags|=192,l.child=s.child,l=null):(s=K.treeContext,Zt=ui(L.nextSibling),qn=l,gt=!0,Ss=null,li=!1,s!==null&&y_(l,s),l=vb(l,g.children),l.flags|=4096);return l}return x?(Os(),L=g.fallback,x=l.mode,K=s.child,ie=K.sibling,g=Da(K,{mode:"hidden",children:g.children}),g.subtreeFlags=K.subtreeFlags&65011712,ie!==null?L=Da(ie,L):(L=$o(L,x,h,null),L.flags|=2),L.return=l,g.return=l,g.sibling=L,l.child=g,jd(null,g),g=l.child,L=s.child.memoizedState,L===null?L=gb(h):(x=L.cachePool,x!==null?(K=jn._currentValue,x=x.parent!==K?{parent:K,pool:K}:x):x=j_(),L={baseLanes:L.baseLanes|h,cachePool:x}),g.memoizedState=L,g.childLanes=yb(s,z,h),l.memoizedState=mb,jd(s.child,g)):(As(l),h=s.child,s=h.sibling,h=Da(h,{mode:"visible",children:g.children}),h.return=l,h.sibling=null,s!==null&&(z=l.deletions,z===null?(l.deletions=[s],l.flags|=16):z.push(s)),l.child=h,l.memoizedState=null,h)}function vb(s,l){return l=Cp({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Cp(s,l){return s=Br(22,s,null,l),s.lanes=0,s}function bb(s,l,h){return Go(l,s.child,null,h),s=vb(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function MA(s,l,h){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),R0(s.return,l,h)}function xb(s,l,h,g,x,k){var z=s.memoizedState;z===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:x,treeForkCount:k}:(z.isBackwards=l,z.rendering=null,z.renderingStartTime=0,z.last=g,z.tail=h,z.tailMode=x,z.treeForkCount=k)}function IA(s,l,h){var g=l.pendingProps,x=g.revealOrder,k=g.tail;g=g.children;var z=vn.current,L=(z&2)!==0;if(L?(z=z&1|2,l.flags|=128):z&=1,D(vn,z),Kn(s,l,g,h),g=gt?ud:0,!L&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&MA(s,h,l);else if(s.tag===19)MA(s,h,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(h=l.child,x=null;h!==null;)s=h.alternate,s!==null&&pp(s)===null&&(x=h),h=h.sibling;h=x,h===null?(x=l.child,l.child=null):(x=h.sibling,h.sibling=null),xb(l,!1,x,h,k,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,x=l.child,l.child=null;x!==null;){if(s=x.alternate,s!==null&&pp(s)===null){l.child=x;break}s=x.sibling,x.sibling=h,h=x,x=s}xb(l,!0,h,null,k,g);break;case"together":xb(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function Ua(s,l,h){if(s!==null&&(l.dependencies=s.dependencies),Ts|=l.lanes,(h&l.childLanes)===0)if(s!==null){if(pc(s,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,h=Da(s,s.pendingProps),l.child=h,h.return=l;s.sibling!==null;)s=s.sibling,h=h.sibling=Da(s,s.pendingProps),h.return=l;h.sibling=null}return l.child}function wb(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&sp(s)))}function eq(s,l,h){switch(l.tag){case 3:Ne(l,l.stateNode.containerInfo),ks(l,jn,s.memoizedState.cache),Bo();break;case 27:case 5:de(l);break;case 4:Ne(l,l.stateNode.containerInfo);break;case 10:ks(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,G0(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(As(l),l.flags|=128,null):(h&l.child.childLanes)!==0?DA(s,l,h):(As(l),s=Ua(s,l,h),s!==null?s.sibling:null);As(l);break;case 19:var x=(s.flags&128)!==0;if(g=(h&l.childLanes)!==0,g||(pc(s,l,h,!1),g=(h&l.childLanes)!==0),x){if(g)return IA(s,l,h);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),D(vn,vn.current),g)break;return null;case 22:return l.lanes=0,OA(s,l,h,l.pendingProps);case 24:ks(l,jn,s.memoizedState.cache)}return Ua(s,l,h)}function LA(s,l,h){if(s!==null)if(s.memoizedProps!==l.pendingProps)Nn=!0;else{if(!wb(s,h)&&(l.flags&128)===0)return Nn=!1,eq(s,l,h);Nn=(s.flags&131072)!==0}else Nn=!1,gt&&(l.flags&1048576)!==0&&g_(l,ud,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Ho(l.elementType),l.type=s,typeof s=="function")C0(s)?(g=Zo(s,g),l.tag=1,l=PA(null,l,s,g,h)):(l.tag=0,l=pb(null,l,s,g,h));else{if(s!=null){var x=s.$$typeof;if(x===C){l.tag=11,l=CA(null,l,s,g,h);break e}else if(x===A){l.tag=14,l=_A(null,l,s,g,h);break e}}throw l=te(s)||s,Error(r(306,l,""))}}return l;case 0:return pb(s,l,l.type,l.pendingProps,h);case 1:return g=l.type,x=Zo(g,l.pendingProps),PA(s,l,g,x,h);case 3:e:{if(Ne(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var k=l.memoizedState;x=k.element,U0(s,l),vd(l,g,null,h);var z=l.memoizedState;if(g=z.cache,ks(l,jn,g),g!==k.cache&&D0(l,[jn],h,!0),yd(),g=z.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:z.cache},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){l=RA(s,l,g,h);break e}else if(g!==x){x=ai(Error(r(424)),l),dd(x),l=RA(s,l,g,h);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Zt=ui(s.firstChild),qn=l,gt=!0,Ss=null,li=!0,h=O_(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Bo(),g===x){l=Ua(s,l,h);break e}Kn(s,l,g,h)}l=l.child}return l;case 26:return Np(s,l),s===null?(h=YO(l.type,null,l.pendingProps,null))?l.memoizedState=h:gt||(h=l.type,s=l.pendingProps,g=Fp(ae.current).createElement(h),g[ut]=l,g[Pt]=s,Gn(g,h,s),ln(g),l.stateNode=g):l.memoizedState=YO(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return de(l),s===null&>&&(g=l.stateNode=GO(l.type,l.pendingProps,ae.current),qn=l,li=!0,x=Zt,Is(l.type)?(ex=x,Zt=ui(g.firstChild)):Zt=x),Kn(s,l,l.pendingProps.children,h),Np(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&>&&((x=g=Zt)&&(g=Eq(g,l.type,l.pendingProps,li),g!==null?(l.stateNode=g,qn=l,Zt=ui(g.firstChild),li=!1,x=!0):x=!1),x||js(l)),de(l),x=l.type,k=l.pendingProps,z=s!==null?s.memoizedProps:null,g=k.children,Yb(x,k)?g=null:z!==null&&Yb(x,z)&&(l.flags|=32),l.memoizedState!==null&&(x=Z0(s,l,KF,null,null,h),Ld._currentValue=x),Np(s,l),Kn(s,l,g,h),l.child;case 6:return s===null&>&&((s=h=Zt)&&(h=zq(h,l.pendingProps,li),h!==null?(l.stateNode=h,qn=l,Zt=null,s=!0):s=!1),s||js(l)),null;case 13:return DA(s,l,h);case 4:return Ne(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=Go(l,null,g,h):Kn(s,l,g,h),l.child;case 11:return CA(s,l,l.type,l.pendingProps,h);case 7:return Kn(s,l,l.pendingProps,h),l.child;case 8:return Kn(s,l,l.pendingProps.children,h),l.child;case 12:return Kn(s,l,l.pendingProps.children,h),l.child;case 10:return g=l.pendingProps,ks(l,l.type,g.value),Kn(s,l,g.children,h),l.child;case 9:return x=l.type._context,g=l.pendingProps.children,Fo(l),x=Hn(x),g=g(x),l.flags|=1,Kn(s,l,g,h),l.child;case 14:return _A(s,l,l.type,l.pendingProps,h);case 15:return AA(s,l,l.type,l.pendingProps,h);case 19:return IA(s,l,h);case 31:return JF(s,l,h);case 22:return OA(s,l,h,l.pendingProps);case 24:return Fo(l),g=Hn(jn),s===null?(x=L0(),x===null&&(x=$t,k=M0(),x.pooledCache=k,k.refCount++,k!==null&&(x.pooledCacheLanes|=h),x=k),l.memoizedState={parent:g,cache:x},B0(l),ks(l,jn,x)):((s.lanes&h)!==0&&(U0(s,l),vd(l,null,null,h),yd()),x=s.memoizedState,k=l.memoizedState,x.parent!==g?(x={parent:g,cache:g},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),ks(l,jn,g)):(g=k.cache,ks(l,jn,g),g!==x.cache&&D0(l,[jn],h,!0))),Kn(s,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Fa(s){s.flags|=4}function Sb(s,l,h,g,x){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(dO())s.flags|=8192;else throw Ko=up,$0}else s.flags&=-16777217}function $A(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!eE(l))if(dO())s.flags|=8192;else throw Ko=up,$0}function _p(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?zo():536870912,s.lanes|=l,Cc|=l)}function kd(s,l){if(!gt)switch(s.tailMode){case"hidden":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Yt(s){var l=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(l)for(var x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags&65011712,g|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags,g|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=g,s.childLanes=h,l}function tq(s,l,h){var g=l.pendingProps;switch(E0(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(l),null;case 1:return Yt(l),null;case 3:return h=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),La(jn),ne(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(hc(l)?Fa(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,T0())),Yt(l),null;case 26:var x=l.type,k=l.memoizedState;return s===null?(Fa(l),k!==null?(Yt(l),$A(l,k)):(Yt(l),Sb(l,x,null,g,h))):k?k!==s.memoizedState?(Fa(l),Yt(l),$A(l,k)):(Yt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&Fa(l),Yt(l),Sb(l,x,s,g,h)),null;case 27:if(Ee(l),h=ae.current,x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&Fa(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Yt(l),null}s=Q.current,hc(l)?v_(l):(s=GO(x,g,h),l.stateNode=s,Fa(l))}return Yt(l),null;case 5:if(Ee(l),x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&Fa(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Yt(l),null}if(k=Q.current,hc(l))v_(l);else{var z=Fp(ae.current);switch(k){case 1:k=z.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:k=z.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":k=z.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":k=z.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":k=z.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?z.createElement("select",{is:g.is}):z.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?z.createElement(x,{is:g.is}):z.createElement(x)}}k[ut]=l,k[Pt]=g;e:for(z=l.child;z!==null;){if(z.tag===5||z.tag===6)k.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===l)break e;for(;z.sibling===null;){if(z.return===null||z.return===l)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}l.stateNode=k;e:switch(Gn(k,x,g),x){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Fa(l)}}return Yt(l),Sb(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,h),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&Fa(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=ae.current,hc(l)){if(s=l.stateNode,h=l.memoizedProps,g=null,x=qn,x!==null)switch(x.tag){case 27:case 5:g=x.memoizedProps}s[ut]=l,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||DO(s.nodeValue,h)),s||js(l,!0)}else s=Fp(s).createTextNode(g),s[ut]=l,l.stateNode=s}return Yt(l),null;case 31:if(h=l.memoizedState,s===null||s.memoizedState!==null){if(g=hc(l),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ut]=l}else Bo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Yt(l),s=!1}else h=T0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return l.flags&256?(Fr(l),l):(Fr(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Yt(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=hc(l),g!==null&&g.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[ut]=l}else Bo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Yt(l),x=!1}else x=T0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Fr(l),l):(Fr(l),null)}return Fr(l),(l.flags&128)!==0?(l.lanes=h,l):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=l.child,x=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(x=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==x&&(g.flags|=2048)),h!==s&&h&&(l.child.flags|=8192),_p(l,l.updateQueue),Yt(l),null);case 4:return ne(),s===null&&Hb(l.stateNode.containerInfo),Yt(l),null;case 10:return La(l.type),Yt(l),null;case 19:if(F(vn),g=l.memoizedState,g===null)return Yt(l),null;if(x=(l.flags&128)!==0,k=g.rendering,k===null)if(x)kd(g,!1);else{if(pn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(k=pp(s),k!==null){for(l.flags|=128,kd(g,!1),s=k.updateQueue,l.updateQueue=s,_p(l,s),l.subtreeFlags=0,s=h,h=l.child;h!==null;)h_(h,s),h=h.sibling;return D(vn,vn.current&1|2),gt&&Ma(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&<()>Tp&&(l.flags|=128,x=!0,kd(g,!1),l.lanes=4194304)}else{if(!x)if(s=pp(k),s!==null){if(l.flags|=128,x=!0,s=s.updateQueue,l.updateQueue=s,_p(l,s),kd(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!gt)return Yt(l),null}else 2*lt()-g.renderingStartTime>Tp&&h!==536870912&&(l.flags|=128,x=!0,kd(g,!1),l.lanes=4194304);g.isBackwards?(k.sibling=l.child,l.child=k):(s=g.last,s!==null?s.sibling=k:l.child=k,g.last=k)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=lt(),s.sibling=null,h=vn.current,D(vn,x?h&1|2:h&1),gt&&Ma(l,g.treeForkCount),s):(Yt(l),null);case 22:case 23:return Fr(l),K0(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(h&536870912)!==0&&(l.flags&128)===0&&(Yt(l),l.subtreeFlags&6&&(l.flags|=8192)):Yt(l),h=l.updateQueue,h!==null&&_p(l,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048),s!==null&&F(qo),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),La(jn),Yt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function nq(s,l){switch(E0(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return La(jn),ne(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Ee(l),null;case 31:if(l.memoizedState!==null){if(Fr(l),l.alternate===null)throw Error(r(340));Bo()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Fr(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Bo()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return F(vn),null;case 4:return ne(),null;case 10:return La(l.type),null;case 22:case 23:return Fr(l),K0(),s!==null&&F(qo),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return La(jn),null;case 25:return null;default:return null}}function BA(s,l){switch(E0(l),l.tag){case 3:La(jn),ne();break;case 26:case 27:case 5:Ee(l);break;case 4:ne();break;case 31:l.memoizedState!==null&&Fr(l);break;case 13:Fr(l);break;case 19:F(vn);break;case 10:La(l.type);break;case 22:case 23:Fr(l),K0(),s!==null&&F(qo);break;case 24:La(jn)}}function Nd(s,l){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var x=g.next;h=x;do{if((h.tag&s)===s){g=void 0;var k=h.create,z=h.inst;g=k(),z.destroy=g}h=h.next}while(h!==x)}}catch(L){Dt(l,l.return,L)}}function Es(s,l,h){try{var g=l.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var k=x.next;g=k;do{if((g.tag&s)===s){var z=g.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,x=l;var K=h,ie=L;try{ie()}catch(fe){Dt(x,K,fe)}}}g=g.next}while(g!==k)}}catch(fe){Dt(l,l.return,fe)}}function UA(s){var l=s.updateQueue;if(l!==null){var h=s.stateNode;try{z_(l,h)}catch(g){Dt(s,s.return,g)}}}function FA(s,l,h){h.props=Zo(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Dt(s,l,g)}}function Cd(s,l){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(x){Dt(s,l,x)}}function na(s,l){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(x){Dt(s,l,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(x){Dt(s,l,x)}else h.current=null}function qA(s){var l=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(x){Dt(s,s.return,x)}}function jb(s,l,h){try{var g=s.stateNode;kq(g,s.type,h,l),g[Pt]=l}catch(x){Dt(s,s.return,x)}}function HA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Is(s.type)||s.tag===4}function kb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||HA(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Is(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Nb(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(s),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Pa));else if(g!==4&&(g===27&&Is(s.type)&&(h=s.stateNode,l=null),s=s.child,s!==null))for(Nb(s,l,h),s=s.sibling;s!==null;)Nb(s,l,h),s=s.sibling}function Ap(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?h.insertBefore(s,l):h.appendChild(s);else if(g!==4&&(g===27&&Is(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Ap(s,l,h),s=s.sibling;s!==null;)Ap(s,l,h),s=s.sibling}function KA(s){var l=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Gn(l,g,h),l[ut]=s,l[Pt]=h}catch(k){Dt(s,s.return,k)}}var qa=!1,Cn=!1,Cb=!1,GA=typeof WeakSet=="function"?WeakSet:Set,In=null;function rq(s,l){if(s=s.containerInfo,Vb=Yp,s=i_(s),b0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var x=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var z=0,L=-1,K=-1,ie=0,fe=0,xe=s,oe=null;t:for(;;){for(var ue;xe!==h||x!==0&&xe.nodeType!==3||(L=z+x),xe!==k||g!==0&&xe.nodeType!==3||(K=z+g),xe.nodeType===3&&(z+=xe.nodeValue.length),(ue=xe.firstChild)!==null;)oe=xe,xe=ue;for(;;){if(xe===s)break t;if(oe===h&&++ie===x&&(L=z),oe===k&&++fe===g&&(K=z),(ue=xe.nextSibling)!==null)break;xe=oe,oe=xe.parentNode}xe=ue}h=L===-1||K===-1?null:{start:L,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zb={focusedElem:s,selectionRange:h},Yp=!1,In=l;In!==null;)if(l=In,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,In=s;else for(;In!==null;){switch(l=In,k=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)x=s[h],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,h=l,x=k.memoizedProps,k=k.memoizedState,g=h.stateNode;try{var Re=Zo(h.type,x);s=g.getSnapshotBeforeUpdate(Re,k),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ve){Dt(h,h.return,Ve)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,h=s.nodeType,h===9)Qb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Qb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,In=s;break}In=l.return}}function VA(s,l,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ka(s,h),g&4&&Nd(5,h);break;case 1:if(Ka(s,h),g&4)if(s=h.stateNode,l===null)try{s.componentDidMount()}catch(z){Dt(h,h.return,z)}else{var x=Zo(h.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(x,l,s.__reactInternalSnapshotBeforeUpdate)}catch(z){Dt(h,h.return,z)}}g&64&&UA(h),g&512&&Cd(h,h.return);break;case 3:if(Ka(s,h),g&64&&(s=h.updateQueue,s!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{z_(s,l)}catch(z){Dt(h,h.return,z)}}break;case 27:l===null&&g&4&&KA(h);case 26:case 5:Ka(s,h),l===null&&g&4&&qA(h),g&512&&Cd(h,h.return);break;case 12:Ka(s,h);break;case 31:Ka(s,h),g&4&&WA(s,h);break;case 13:Ka(s,h),g&4&&QA(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=fq.bind(null,h),Tq(s,h))));break;case 22:if(g=h.memoizedState!==null||qa,!g){l=l!==null&&l.memoizedState!==null||Cn,x=qa;var k=Cn;qa=g,(Cn=l)&&!k?Ga(s,h,(h.subtreeFlags&8772)!==0):Ka(s,h),qa=x,Cn=k}break;case 30:break;default:Ka(s,h)}}function ZA(s){var l=s.alternate;l!==null&&(s.alternate=null,ZA(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Ea(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var tn=null,wr=!1;function Ha(s,l,h){for(h=h.child;h!==null;)YA(s,l,h),h=h.sibling}function YA(s,l,h){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Ge,h)}catch{}switch(h.tag){case 26:Cn||na(h,l),Ha(s,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Cn||na(h,l);var g=tn,x=wr;Is(h.type)&&(tn=h.stateNode,wr=!1),Ha(s,l,h),Dd(h.stateNode),tn=g,wr=x;break;case 5:Cn||na(h,l);case 6:if(g=tn,x=wr,tn=null,Ha(s,l,h),tn=g,wr=x,tn!==null)if(wr)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(h.stateNode)}catch(k){Dt(h,l,k)}else try{tn.removeChild(h.stateNode)}catch(k){Dt(h,l,k)}break;case 18:tn!==null&&(wr?(s=tn,UO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),Rc(s)):UO(tn,h.stateNode));break;case 4:g=tn,x=wr,tn=h.stateNode.containerInfo,wr=!0,Ha(s,l,h),tn=g,wr=x;break;case 0:case 11:case 14:case 15:Es(2,h,l),Cn||Es(4,h,l),Ha(s,l,h);break;case 1:Cn||(na(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"&&FA(h,l,g)),Ha(s,l,h);break;case 21:Ha(s,l,h);break;case 22:Cn=(g=Cn)||h.memoizedState!==null,Ha(s,l,h),Cn=g;break;default:Ha(s,l,h)}}function WA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Rc(s)}catch(h){Dt(l,l.return,h)}}}function QA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Rc(s)}catch(h){Dt(l,l.return,h)}}function iq(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new GA),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new GA),l;default:throw Error(r(435,s.tag))}}function Op(s,l){var h=iq(s);l.forEach(function(g){if(!h.has(g)){h.add(g);var x=hq.bind(null,s,g);g.then(x,x)}})}function Sr(s,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var x=h[g],k=s,z=l,L=z;e:for(;L!==null;){switch(L.tag){case 27:if(Is(L.type)){tn=L.stateNode,wr=!1;break e}break;case 5:tn=L.stateNode,wr=!1;break e;case 3:case 4:tn=L.stateNode.containerInfo,wr=!0;break e}L=L.return}if(tn===null)throw Error(r(160));YA(k,z,x),tn=null,wr=!1,k=x.alternate,k!==null&&(k.return=null),x.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)XA(l,s),l=l.sibling}var Li=null;function XA(s,l){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Sr(l,s),jr(s),g&4&&(Es(3,s,s.return),Nd(3,s),Es(5,s,s.return));break;case 1:Sr(l,s),jr(s),g&512&&(Cn||h===null||na(h,h.return)),g&64&&qa&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var x=Li;if(Sr(l,s),jr(s),g&512&&(Cn||h===null||na(h,h.return)),g&4){var k=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,x=x.ownerDocument||x;t:switch(g){case"title":k=x.getElementsByTagName("title")[0],(!k||k[ti]||k[ut]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=x.createElement(g),x.head.insertBefore(k,x.querySelector("head > title"))),Gn(k,g,h),k[ut]=s,ln(k),g=k;break e;case"link":var z=XO("link","href",x).get(g+(h.href||""));if(z){for(var L=0;L<z.length;L++)if(k=z[L],k.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&k.getAttribute("rel")===(h.rel==null?null:h.rel)&&k.getAttribute("title")===(h.title==null?null:h.title)&&k.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){z.splice(L,1);break t}}k=x.createElement(g),Gn(k,g,h),x.head.appendChild(k);break;case"meta":if(z=XO("meta","content",x).get(g+(h.content||""))){for(L=0;L<z.length;L++)if(k=z[L],k.getAttribute("content")===(h.content==null?null:""+h.content)&&k.getAttribute("name")===(h.name==null?null:h.name)&&k.getAttribute("property")===(h.property==null?null:h.property)&&k.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&k.getAttribute("charset")===(h.charSet==null?null:h.charSet)){z.splice(L,1);break t}}k=x.createElement(g),Gn(k,g,h),x.head.appendChild(k);break;default:throw Error(r(468,g))}k[ut]=s,ln(k),g=k}s.stateNode=g}else JO(x,s.type,s.stateNode);else s.stateNode=QO(x,g,s.memoizedProps);else k!==g?(k===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):k.count--,g===null?JO(x,s.type,s.stateNode):QO(x,g,s.memoizedProps)):g===null&&s.stateNode!==null&&jb(s,s.memoizedProps,h.memoizedProps)}break;case 27:Sr(l,s),jr(s),g&512&&(Cn||h===null||na(h,h.return)),h!==null&&g&4&&jb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Sr(l,s),jr(s),g&512&&(Cn||h===null||na(h,h.return)),s.flags&32){x=s.stateNode;try{rc(x,"")}catch(Re){Dt(s,s.return,Re)}}g&4&&s.stateNode!=null&&(x=s.memoizedProps,jb(s,x,h!==null?h.memoizedProps:x)),g&1024&&(Cb=!0);break;case 6:if(Sr(l,s),jr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Re){Dt(s,s.return,Re)}}break;case 3:if(Kp=null,x=Li,Li=qp(l.containerInfo),Sr(l,s),Li=x,jr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Rc(l.containerInfo)}catch(Re){Dt(s,s.return,Re)}Cb&&(Cb=!1,JA(s));break;case 4:g=Li,Li=qp(s.stateNode.containerInfo),Sr(l,s),jr(s),Li=g;break;case 12:Sr(l,s),jr(s);break;case 31:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Op(s,g)));break;case 13:Sr(l,s),jr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(zp=lt()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Op(s,g)));break;case 22:x=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ie=qa,fe=Cn;if(qa=ie||x,Cn=fe||K,Sr(l,s),Cn=fe,qa=ie,jr(s),g&8192)e:for(l=s.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(h===null||K||qa||Cn||Yo(s)),h=null,l=s;;){if(l.tag===5||l.tag===26){if(h===null){K=h=l;try{if(k=K.stateNode,x)z=k.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{L=K.stateNode;var xe=K.memoizedProps.style,oe=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;L.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Re){Dt(K,K.return,Re)}}}else if(l.tag===6){if(h===null){K=l;try{K.stateNode.nodeValue=x?"":K.memoizedProps}catch(Re){Dt(K,K.return,Re)}}}else if(l.tag===18){if(h===null){K=l;try{var ue=K.stateNode;x?FO(ue,!0):FO(K.stateNode,!1)}catch(Re){Dt(K,K.return,Re)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Op(s,h))));break;case 19:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Op(s,g)));break;case 30:break;case 21:break;default:Sr(l,s),jr(s)}}function jr(s){var l=s.flags;if(l&2){try{for(var h,g=s.return;g!==null;){if(HA(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var x=h.stateNode,k=kb(s);Ap(s,k,x);break;case 5:var z=h.stateNode;h.flags&32&&(rc(z,""),h.flags&=-33);var L=kb(s);Ap(s,L,z);break;case 3:case 4:var K=h.stateNode.containerInfo,ie=kb(s);Nb(s,ie,K);break;default:throw Error(r(161))}}catch(fe){Dt(s,s.return,fe)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function JA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;JA(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Ka(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)VA(s,l.alternate,l),l=l.sibling}function Yo(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Es(4,l,l.return),Yo(l);break;case 1:na(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&FA(l,l.return,h),Yo(l);break;case 27:Dd(l.stateNode);case 26:case 5:na(l,l.return),Yo(l);break;case 22:l.memoizedState===null&&Yo(l);break;case 30:Yo(l);break;default:Yo(l)}s=s.sibling}}function Ga(s,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,x=s,k=l,z=k.flags;switch(k.tag){case 0:case 11:case 15:Ga(x,k,h),Nd(4,k);break;case 1:if(Ga(x,k,h),g=k,x=g.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ie){Dt(g,g.return,ie)}if(g=k,x=g.updateQueue,x!==null){var L=g.stateNode;try{var K=x.shared.hiddenCallbacks;if(K!==null)for(x.shared.hiddenCallbacks=null,x=0;x<K.length;x++)E_(K[x],L)}catch(ie){Dt(g,g.return,ie)}}h&&z&64&&UA(k),Cd(k,k.return);break;case 27:KA(k);case 26:case 5:Ga(x,k,h),h&&g===null&&z&4&&qA(k),Cd(k,k.return);break;case 12:Ga(x,k,h);break;case 31:Ga(x,k,h),h&&z&4&&WA(x,k);break;case 13:Ga(x,k,h),h&&z&4&&QA(x,k);break;case 22:k.memoizedState===null&&Ga(x,k,h),Cd(k,k.return);break;case 30:break;default:Ga(x,k,h)}l=l.sibling}}function _b(s,l){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&fd(h))}function Ab(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&fd(s))}function $i(s,l,h,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)eO(s,l,h,g),l=l.sibling}function eO(s,l,h,g){var x=l.flags;switch(l.tag){case 0:case 11:case 15:$i(s,l,h,g),x&2048&&Nd(9,l);break;case 1:$i(s,l,h,g);break;case 3:$i(s,l,h,g),x&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&fd(s)));break;case 12:if(x&2048){$i(s,l,h,g),s=l.stateNode;try{var k=l.memoizedProps,z=k.id,L=k.onPostCommit;typeof L=="function"&&L(z,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){Dt(l,l.return,K)}}else $i(s,l,h,g);break;case 31:$i(s,l,h,g);break;case 13:$i(s,l,h,g);break;case 23:break;case 22:k=l.stateNode,z=l.alternate,l.memoizedState!==null?k._visibility&2?$i(s,l,h,g):_d(s,l):k._visibility&2?$i(s,l,h,g):(k._visibility|=2,jc(s,l,h,g,(l.subtreeFlags&10256)!==0||!1)),x&2048&&_b(z,l);break;case 24:$i(s,l,h,g),x&2048&&Ab(l.alternate,l);break;default:$i(s,l,h,g)}}function jc(s,l,h,g,x){for(x=x&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var k=s,z=l,L=h,K=g,ie=z.flags;switch(z.tag){case 0:case 11:case 15:jc(k,z,L,K,x),Nd(8,z);break;case 23:break;case 22:var fe=z.stateNode;z.memoizedState!==null?fe._visibility&2?jc(k,z,L,K,x):_d(k,z):(fe._visibility|=2,jc(k,z,L,K,x)),x&&ie&2048&&_b(z.alternate,z);break;case 24:jc(k,z,L,K,x),x&&ie&2048&&Ab(z.alternate,z);break;default:jc(k,z,L,K,x)}l=l.sibling}}function _d(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=s,g=l,x=g.flags;switch(g.tag){case 22:_d(h,g),x&2048&&_b(g.alternate,g);break;case 24:_d(h,g),x&2048&&Ab(g.alternate,g);break;default:_d(h,g)}l=l.sibling}}var Ad=8192;function kc(s,l,h){if(s.subtreeFlags&Ad)for(s=s.child;s!==null;)tO(s,l,h),s=s.sibling}function tO(s,l,h){switch(s.tag){case 26:kc(s,l,h),s.flags&Ad&&s.memoizedState!==null&&Hq(h,Li,s.memoizedState,s.memoizedProps);break;case 5:kc(s,l,h);break;case 3:case 4:var g=Li;Li=qp(s.stateNode.containerInfo),kc(s,l,h),Li=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Ad,Ad=16777216,kc(s,l,h),Ad=g):kc(s,l,h));break;default:kc(s,l,h)}}function nO(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Od(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,iO(g,s)}nO(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)rO(s),s=s.sibling}function rO(s){switch(s.tag){case 0:case 11:case 15:Od(s),s.flags&2048&&Es(9,s,s.return);break;case 3:Od(s);break;case 12:Od(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Ep(s)):Od(s);break;default:Od(s)}}function Ep(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,iO(g,s)}nO(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Es(8,l,l.return),Ep(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,Ep(l));break;default:Ep(l)}s=s.sibling}}function iO(s,l){for(;In!==null;){var h=In;switch(h.tag){case 0:case 11:case 15:Es(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:fd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,In=g;else e:for(h=s;In!==null;){g=In;var x=g.sibling,k=g.return;if(ZA(g),g===h){In=null;break e}if(x!==null){x.return=k,In=x;break e}In=k}}}var aq={getCacheForType:function(s){var l=Hn(jn),h=l.data.get(s);return h===void 0&&(h=s(),l.data.set(s,h)),h},cacheSignal:function(){return Hn(jn).controller.signal}},sq=typeof WeakMap=="function"?WeakMap:Map,Ct=0,$t=null,dt=null,pt=0,Rt=0,qr=null,zs=!1,Nc=!1,Ob=!1,Va=0,pn=0,Ts=0,Wo=0,Eb=0,Hr=0,Cc=0,Ed=null,kr=null,zb=!1,zp=0,aO=0,Tp=1/0,Pp=null,Ps=null,En=0,Rs=null,_c=null,Za=0,Tb=0,Pb=null,sO=null,zd=0,Rb=null;function Kr(){return(Ct&2)!==0&&pt!==0?pt&-pt:H.T!==null?Bb():Z()}function oO(){if(Hr===0)if((pt&536870912)===0||gt){var s=Oo;Oo<<=1,(Oo&3932160)===0&&(Oo=262144),Hr=s}else Hr=536870912;return s=Ur.current,s!==null&&(s.flags|=32),Hr}function Nr(s,l,h){(s===$t&&(Rt===2||Rt===9)||s.cancelPendingCommit!==null)&&(Ac(s,0),Ds(s,pt,Hr,!1)),To(s,h),((Ct&2)===0||s!==$t)&&(s===$t&&((Ct&2)===0&&(Wo|=h),pn===4&&Ds(s,pt,Hr,!1)),ra(s))}function lO(s,l,h){if((Ct&6)!==0)throw Error(r(327));var g=!h&&(l&127)===0&&(l&s.expiredLanes)===0||vs(s,l),x=g?cq(s,l):Mb(s,l,!0),k=g;do{if(x===0){Nc&&!g&&Ds(s,l,0,!1);break}else{if(h=s.current.alternate,k&&!oq(h)){x=Mb(s,l,!1),k=!1;continue}if(x===2){if(k=l,s.errorRecoveryDisabledLanes&k)var z=0;else z=s.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){l=z;e:{var L=s;x=Ed;var K=L.current.memoizedState.isDehydrated;if(K&&(Ac(L,z).flags|=256),z=Mb(L,z,!1),z!==2){if(Ob&&!K){L.errorRecoveryDisabledLanes|=k,Wo|=k,x=4;break e}k=kr,kr=x,k!==null&&(kr===null?kr=k:kr.push.apply(kr,k))}x=z}if(k=!1,x!==2)continue}}if(x===1){Ac(s,0),Ds(s,l,0,!0);break}e:{switch(g=s,k=x,k){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ds(g,l,Hr,!zs);break e;case 2:kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=zp+300-lt(),10<x)){if(Ds(g,l,Hr,!zs),Eo(g,0,!0)!==0)break e;Za=l,g.timeoutHandle=$O(cO.bind(null,g,h,kr,Pp,zb,l,Hr,Wo,Cc,zs,k,"Throttled",-0,0),x);break e}cO(g,h,kr,Pp,zb,l,Hr,Wo,Cc,zs,k,null,-0,0)}}break}while(!0);ra(s)}function cO(s,l,h,g,x,k,z,L,K,ie,fe,xe,oe,ue){if(s.timeoutHandle=-1,xe=l.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pa},tO(l,k,xe);var Re=(k&62914560)===k?zp-lt():(k&4194048)===k?aO-lt():0;if(Re=Kq(xe,Re),Re!==null){Za=k,s.cancelPendingCommit=Re(yO.bind(null,s,l,k,h,g,x,z,L,K,fe,xe,null,oe,ue)),Ds(s,k,z,!ie);return}}yO(s,l,k,h,g,x,z,L,K)}function oq(s){for(var l=s;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var x=h[g],k=x.getSnapshot;x=x.value;try{if(!$r(k(),x))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ds(s,l,h,g){l&=~Eb,l&=~Wo,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var x=l;0<x;){var k=31-Te(x),z=1<<k;g[k]=-1,x&=~z}h!==0&&Ih(s,h,l)}function Rp(){return(Ct&6)===0?(Td(0),!1):!0}function Db(){if(dt!==null){if(Rt===0)var s=dt.return;else s=dt,Ia=Uo=null,Q0(s),vc=null,pd=0,s=dt;for(;s!==null;)BA(s.alternate,s),s=s.return;dt=null}}function Ac(s,l){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,_q(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),Za=0,Db(),$t=s,dt=h=Da(s.current,null),pt=l,Rt=0,qr=null,zs=!1,Nc=vs(s,l),Ob=!1,Cc=Hr=Eb=Wo=Ts=pn=0,kr=Ed=null,zb=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var x=31-Te(g),k=1<<x;l|=s[x],g&=~k}return Va=l,tp(),h}function uO(s,l){Xe=null,H.H=Sd,l===yc||l===cp?(l=C_(),Rt=3):l===$0?(l=C_(),Rt=4):Rt=l===hb?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,qr=l,dt===null&&(pn=1,jp(s,ai(l,s.current)))}function dO(){var s=Ur.current;return s===null?!0:(pt&4194048)===pt?ci===null:(pt&62914560)===pt||(pt&536870912)!==0?s===ci:!1}function fO(){var s=H.H;return H.H=Sd,s===null?Sd:s}function hO(){var s=H.A;return H.A=aq,s}function Dp(){pn=4,zs||(pt&4194048)!==pt&&Ur.current!==null||(Nc=!0),(Ts&134217727)===0&&(Wo&134217727)===0||$t===null||Ds($t,pt,Hr,!1)}function Mb(s,l,h){var g=Ct;Ct|=2;var x=fO(),k=hO();($t!==s||pt!==l)&&(Pp=null,Ac(s,l)),l=!1;var z=pn;e:do try{if(Rt!==0&&dt!==null){var L=dt,K=qr;switch(Rt){case 8:Db(),z=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(l=!0);var ie=Rt;if(Rt=0,qr=null,Oc(s,L,K,ie),h&&Nc){z=0;break e}break;default:ie=Rt,Rt=0,qr=null,Oc(s,L,K,ie)}}lq(),z=pn;break}catch(fe){uO(s,fe)}while(!0);return l&&s.shellSuspendCounter++,Ia=Uo=null,Ct=g,H.H=x,H.A=k,dt===null&&($t=null,pt=0,tp()),z}function lq(){for(;dt!==null;)pO(dt)}function cq(s,l){var h=Ct;Ct|=2;var g=fO(),x=hO();$t!==s||pt!==l?(Pp=null,Tp=lt()+500,Ac(s,l)):Nc=vs(s,l);e:do try{if(Rt!==0&&dt!==null){l=dt;var k=qr;t:switch(Rt){case 1:Rt=0,qr=null,Oc(s,l,k,1);break;case 2:case 9:if(k_(k)){Rt=0,qr=null,mO(l);break}l=function(){Rt!==2&&Rt!==9||$t!==s||(Rt=7),ra(s)},k.then(l,l);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:k_(k)?(Rt=0,qr=null,mO(l)):(Rt=0,qr=null,Oc(s,l,k,7));break;case 5:var z=null;switch(dt.tag){case 26:z=dt.memoizedState;case 5:case 27:var L=dt;if(z?eE(z):L.stateNode.complete){Rt=0,qr=null;var K=L.sibling;if(K!==null)dt=K;else{var ie=L.return;ie!==null?(dt=ie,Mp(ie)):dt=null}break t}}Rt=0,qr=null,Oc(s,l,k,5);break;case 6:Rt=0,qr=null,Oc(s,l,k,6);break;case 8:Db(),pn=6;break e;default:throw Error(r(462))}}uq();break}catch(fe){uO(s,fe)}while(!0);return Ia=Uo=null,H.H=g,H.A=x,Ct=h,dt!==null?0:($t=null,pt=0,tp(),pn)}function uq(){for(;dt!==null&&!bt();)pO(dt)}function pO(s){var l=LA(s.alternate,s,Va);s.memoizedProps=s.pendingProps,l===null?Mp(s):dt=l}function mO(s){var l=s,h=l.alternate;switch(l.tag){case 15:case 0:l=TA(h,l,l.pendingProps,l.type,void 0,pt);break;case 11:l=TA(h,l,l.pendingProps,l.type.render,l.ref,pt);break;case 5:Q0(l);default:BA(h,l),l=dt=h_(l,Va),l=LA(h,l,Va)}s.memoizedProps=s.pendingProps,l===null?Mp(s):dt=l}function Oc(s,l,h,g){Ia=Uo=null,Q0(l),vc=null,pd=0;var x=l.return;try{if(XF(s,x,l,h,pt)){pn=1,jp(s,ai(h,s.current)),dt=null;return}}catch(k){if(x!==null)throw dt=x,k;pn=1,jp(s,ai(h,s.current)),dt=null;return}l.flags&32768?(gt||g===1?s=!0:Nc||(pt&536870912)!==0?s=!1:(zs=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ur.current,g!==null&&g.tag===13&&(g.flags|=16384))),gO(l,s)):Mp(l)}function Mp(s){var l=s;do{if((l.flags&32768)!==0){gO(l,zs);return}s=l.return;var h=tq(l.alternate,l,Va);if(h!==null){dt=h;return}if(l=l.sibling,l!==null){dt=l;return}dt=l=s}while(l!==null);pn===0&&(pn=5)}function gO(s,l){do{var h=nq(s.alternate,s);if(h!==null){h.flags&=32767,dt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(s=s.sibling,s!==null)){dt=s;return}dt=s=h}while(s!==null);pn=6,dt=null}function yO(s,l,h,g,x,k,z,L,K){s.cancelPendingCommit=null;do Ip();while(En!==0);if((Ct&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(k=l.lanes|l.childLanes,k|=k0,Mh(s,h,k,z,L,K),s===$t&&(dt=$t=null,pt=0),_c=l,Rs=s,Za=h,Tb=k,Pb=x,sO=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,pq(je,function(){return SO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,x=J.p,J.p=2,z=Ct,Ct|=4;try{rq(s,l,h)}finally{Ct=z,J.p=x,H.T=g}}En=1,vO(),bO(),xO()}}function vO(){if(En===1){En=0;var s=Rs,l=_c,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var x=Ct;Ct|=4;try{XA(l,s);var k=Zb,z=i_(s.containerInfo),L=k.focusedElem,K=k.selectionRange;if(z!==L&&L&&L.ownerDocument&&r_(L.ownerDocument.documentElement,L)){if(K!==null&&b0(L)){var ie=K.start,fe=K.end;if(fe===void 0&&(fe=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(fe,L.value.length);else{var xe=L.ownerDocument||document,oe=xe&&xe.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Re=L.textContent.length,Ve=Math.min(K.start,Re),Lt=K.end===void 0?Ve:Math.min(K.end,Re);!ue.extend&&Ve>Lt&&(z=Lt,Lt=Ve,Ve=z);var ee=n_(L,Ve),W=n_(L,Lt);if(ee&&W&&(ue.rangeCount!==1||ue.anchorNode!==ee.node||ue.anchorOffset!==ee.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var re=xe.createRange();re.setStart(ee.node,ee.offset),ue.removeAllRanges(),Ve>Lt?(ue.addRange(re),ue.extend(W.node,W.offset)):(re.setEnd(W.node,W.offset),ue.addRange(re))}}}}for(xe=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&xe.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<xe.length;L++){var ge=xe[L];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Yp=!!Vb,Zb=Vb=null}finally{Ct=x,J.p=g,H.T=h}}s.current=l,En=2}}function bO(){if(En===2){En=0;var s=Rs,l=_c,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var x=Ct;Ct|=4;try{VA(s,l.alternate,l)}finally{Ct=x,J.p=g,H.T=h}}En=3}}function xO(){if(En===4||En===3){En=0,Jt();var s=Rs,l=_c,h=Za,g=sO;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?En=5:(En=0,_c=Rs=null,wO(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(Ps=null),tc(h),l=l.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Ge,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=H.T,x=J.p,J.p=2,H.T=null;try{for(var k=s.onRecoverableError,z=0;z<g.length;z++){var L=g[z];k(L.value,{componentStack:L.stack})}}finally{H.T=l,J.p=x}}(Za&3)!==0&&Ip(),ra(s),x=s.pendingLanes,(h&261930)!==0&&(x&42)!==0?s===Rb?zd++:(zd=0,Rb=s):zd=0,Td(0)}}function wO(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,fd(l)))}function Ip(){return vO(),bO(),xO(),SO()}function SO(){if(En!==5)return!1;var s=Rs,l=Tb;Tb=0;var h=tc(Za),g=H.T,x=J.p;try{J.p=32>h?32:h,H.T=null,h=Pb,Pb=null;var k=Rs,z=Za;if(En=0,_c=Rs=null,Za=0,(Ct&6)!==0)throw Error(r(331));var L=Ct;if(Ct|=4,rO(k.current),eO(k,k.current,z,h),Ct=L,Td(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Ge,k)}catch{}return!0}finally{J.p=x,H.T=g,wO(s,l)}}function jO(s,l,h){l=ai(h,l),l=fb(s.stateNode,l,2),s=_s(s,l,2),s!==null&&(To(s,2),ra(s))}function Dt(s,l,h){if(s.tag===3)jO(s,s,h);else for(;l!==null;){if(l.tag===3){jO(l,s,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ps===null||!Ps.has(g))){s=ai(h,s),h=kA(2),g=_s(l,h,2),g!==null&&(NA(h,g,l,s),To(g,2),ra(g));break}}l=l.return}}function Ib(s,l,h){var g=s.pingCache;if(g===null){g=s.pingCache=new sq;var x=new Set;g.set(l,x)}else x=g.get(l),x===void 0&&(x=new Set,g.set(l,x));x.has(h)||(Ob=!0,x.add(h),s=dq.bind(null,s,l,h),l.then(s,s))}function dq(s,l,h){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,$t===s&&(pt&h)===h&&(pn===4||pn===3&&(pt&62914560)===pt&&300>lt()-zp?(Ct&2)===0&&Ac(s,0):Eb|=h,Cc===pt&&(Cc=0)),ra(s)}function kO(s,l){l===0&&(l=zo()),s=Lo(s,l),s!==null&&(To(s,l),ra(s))}function fq(s){var l=s.memoizedState,h=0;l!==null&&(h=l.retryLane),kO(s,h)}function hq(s,l){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,x=s.memoizedState;x!==null&&(h=x.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),kO(s,h)}function pq(s,l){return we(s,l)}var Lp=null,Ec=null,Lb=!1,$p=!1,$b=!1,Ms=0;function ra(s){s!==Ec&&s.next===null&&(Ec===null?Lp=Ec=s:Ec=Ec.next=s),$p=!0,Lb||(Lb=!0,gq())}function Td(s,l){if(!$b&&$p){$b=!0;do for(var h=!1,g=Lp;g!==null;){if(s!==0){var x=g.pendingLanes;if(x===0)var k=0;else{var z=g.suspendedLanes,L=g.pingedLanes;k=(1<<31-Te(42|s)+1)-1,k&=x&~(z&~L),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(h=!0,AO(g,k))}else k=pt,k=Eo(g,g===$t?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||vs(g,k)||(h=!0,AO(g,k));g=g.next}while(h);$b=!1}}function mq(){NO()}function NO(){$p=Lb=!1;var s=0;Ms!==0&&Cq()&&(s=Ms);for(var l=lt(),h=null,g=Lp;g!==null;){var x=g.next,k=CO(g,l);k===0?(g.next=null,h===null?Lp=x:h.next=x,x===null&&(Ec=h)):(h=g,(s!==0||(k&3)!==0)&&($p=!0)),g=x}En!==0&&En!==5||Td(s),Ms!==0&&(Ms=0)}function CO(s,l){for(var h=s.suspendedLanes,g=s.pingedLanes,x=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var z=31-Te(k),L=1<<z,K=x[z];K===-1?((L&h)===0||(L&g)!==0)&&(x[z]=n0(L,l)):K<=l&&(s.expiredLanes|=L),k&=~L}if(l=$t,h=pt,h=Eo(s,s===l?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===l&&(Rt===2||Rt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ze(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||vs(s,h)){if(l=h&-h,l===s.callbackPriority)return l;switch(g!==null&&Ze(g),tc(h)){case 2:case 8:h=le;break;case 32:h=je;break;case 268435456:h=qe;break;default:h=je}return g=_O.bind(null,s),h=we(h,g),s.callbackPriority=l,s.callbackNode=h,l}return g!==null&&g!==null&&Ze(g),s.callbackPriority=2,s.callbackNode=null,2}function _O(s,l){if(En!==0&&En!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Ip()&&s.callbackNode!==h)return null;var g=pt;return g=Eo(s,s===$t?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(lO(s,g,l),CO(s,lt()),s.callbackNode!=null&&s.callbackNode===h?_O.bind(null,s):null)}function AO(s,l){if(Ip())return null;lO(s,l,!0)}function gq(){Aq(function(){(Ct&6)!==0?we(G,mq):NO()})}function Bb(){if(Ms===0){var s=mc;s===0&&(s=ys,ys<<=1,(ys&261888)===0&&(ys=256)),Ms=s}return Ms}function OO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Vh(""+s)}function EO(s,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,s.id&&h.setAttribute("form",s.id),l.parentNode.insertBefore(h,l),s=new FormData(s),h.parentNode.removeChild(h),s}function yq(s,l,h,g,x){if(l==="submit"&&h&&h.stateNode===x){var k=OO((x[Pt]||null).action),z=g.submitter;z&&(l=(l=z[Pt]||null)?OO(l.formAction):z.getAttribute("formAction"),l!==null&&(k=l,z=null));var L=new Qh("action","action",null,g,x);s.push({event:L,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ms!==0){var K=z?EO(x,z):new FormData(x);sb(h,{pending:!0,data:K,method:x.method,action:k},null,K)}}else typeof k=="function"&&(L.preventDefault(),K=z?EO(x,z):new FormData(x),sb(h,{pending:!0,data:K,method:x.method,action:k},k,K))},currentTarget:x}]})}}for(var Ub=0;Ub<j0.length;Ub++){var Fb=j0[Ub],vq=Fb.toLowerCase(),bq=Fb[0].toUpperCase()+Fb.slice(1);Ii(vq,"on"+bq)}Ii(o_,"onAnimationEnd"),Ii(l_,"onAnimationIteration"),Ii(c_,"onAnimationStart"),Ii("dblclick","onDoubleClick"),Ii("focusin","onFocus"),Ii("focusout","onBlur"),Ii(DF,"onTransitionRun"),Ii(MF,"onTransitionStart"),Ii(IF,"onTransitionCancel"),Ii(u_,"onTransitionEnd"),St("onMouseEnter",["mouseout","mouseover"]),St("onMouseLeave",["mouseout","mouseover"]),St("onPointerEnter",["pointerout","pointerover"]),St("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pd="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(" "),xq=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pd));function zO(s,l){l=(l&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],x=g.event;g=g.listeners;e:{var k=void 0;if(l)for(var z=g.length-1;0<=z;z--){var L=g[z],K=L.instance,ie=L.currentTarget;if(L=L.listener,K!==k&&x.isPropagationStopped())break e;k=L,x.currentTarget=ie;try{k(x)}catch(fe){ep(fe)}x.currentTarget=null,k=K}else for(z=0;z<g.length;z++){if(L=g[z],K=L.instance,ie=L.currentTarget,L=L.listener,K!==k&&x.isPropagationStopped())break e;k=L,x.currentTarget=ie;try{k(x)}catch(fe){ep(fe)}x.currentTarget=null,k=K}}}}function ft(s,l){var h=l[Pi];h===void 0&&(h=l[Pi]=new Set);var g=s+"__bubble";h.has(g)||(TO(l,s,2,!1),h.add(g))}function qb(s,l,h){var g=0;l&&(g|=4),TO(h,s,g,l)}var Bp="_reactListening"+Math.random().toString(36).slice(2);function Hb(s){if(!s[Bp]){s[Bp]=!0,Uh.forEach(function(h){h!=="selectionchange"&&(xq.has(h)||qb(h,!1,s),qb(h,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Bp]||(l[Bp]=!0,qb("selectionchange",!1,l))}}function TO(s,l,h,g){switch(oE(l)){case 2:var x=Zq;break;case 8:x=Yq;break;default:x=ax}h=x.bind(null,l,h,s),x=void 0,!u0||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),g?x!==void 0?s.addEventListener(l,h,{capture:!0,passive:x}):s.addEventListener(l,h,!0):x!==void 0?s.addEventListener(l,h,{passive:x}):s.addEventListener(l,h,!1)}function Kb(s,l,h,g,x){var k=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var z=g.tag;if(z===3||z===4){var L=g.stateNode.containerInfo;if(L===x)break;if(z===4)for(z=g.return;z!==null;){var K=z.tag;if((K===3||K===4)&&z.stateNode.containerInfo===x)return;z=z.return}for(;L!==null;){if(z=Ri(L),z===null)return;if(K=z.tag,K===5||K===6||K===26||K===27){g=k=z;continue e}L=L.parentNode}}g=g.return}IC(function(){var ie=k,fe=l0(h),xe=[];e:{var oe=d_.get(s);if(oe!==void 0){var ue=Qh,Re=s;switch(s){case"keypress":if(Yh(h)===0)break e;case"keydown":case"keyup":ue=hF;break;case"focusin":Re="focus",ue=p0;break;case"focusout":Re="blur",ue=p0;break;case"beforeblur":case"afterblur":ue=p0;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=BC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=tF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=gF;break;case o_:case l_:case c_:ue=iF;break;case u_:ue=vF;break;case"scroll":case"scrollend":ue=J8;break;case"wheel":ue=xF;break;case"copy":case"cut":case"paste":ue=sF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=FC;break;case"toggle":case"beforetoggle":ue=SF}var Ve=(l&4)!==0,Lt=!Ve&&(s==="scroll"||s==="scrollend"),ee=Ve?oe!==null?oe+"Capture":null:oe;Ve=[];for(var W=ie,re;W!==null;){var ge=W;if(re=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||re===null||ee===null||(ge=td(W,ee),ge!=null&&Ve.push(Rd(W,ge,re))),Lt)break;W=W.return}0<Ve.length&&(oe=new ue(oe,Re,null,h,fe),xe.push({event:oe,listeners:Ve}))}}if((l&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ue=s==="mouseout"||s==="pointerout",oe&&h!==o0&&(Re=h.relatedTarget||h.fromElement)&&(Ri(Re)||Re[Ir]))break e;if((ue||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Re=h.relatedTarget||h.toElement,ue=ie,Re=Re?Ri(Re):null,Re!==null&&(Lt=a(Re),Ve=Re.tag,Re!==Lt||Ve!==5&&Ve!==27&&Ve!==6)&&(Re=null)):(ue=null,Re=ie),ue!==Re)){if(Ve=BC,ge="onMouseLeave",ee="onMouseEnter",W="mouse",(s==="pointerout"||s==="pointerover")&&(Ve=FC,ge="onPointerLeave",ee="onPointerEnter",W="pointer"),Lt=ue==null?oe:Po(ue),re=Re==null?oe:Po(Re),oe=new Ve(ge,W+"leave",ue,h,fe),oe.target=Lt,oe.relatedTarget=re,ge=null,Ri(fe)===ie&&(Ve=new Ve(ee,W+"enter",Re,h,fe),Ve.target=re,Ve.relatedTarget=Lt,ge=Ve),Lt=ge,ue&&Re)t:{for(Ve=wq,ee=ue,W=Re,re=0,ge=ee;ge;ge=Ve(ge))re++;ge=0;for(var Ke=W;Ke;Ke=Ve(Ke))ge++;for(;0<re-ge;)ee=Ve(ee),re--;for(;0<ge-re;)W=Ve(W),ge--;for(;re--;){if(ee===W||W!==null&&ee===W.alternate){Ve=ee;break t}ee=Ve(ee),W=Ve(W)}Ve=null}else Ve=null;ue!==null&&PO(xe,oe,ue,Ve,!1),Re!==null&&Lt!==null&&PO(xe,Lt,Re,Ve,!0)}}e:{if(oe=ie?Po(ie):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var jt=WC;else if(ZC(oe))if(QC)jt=TF;else{jt=EF;var $e=OF}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ie&&s0(ie.elementType)&&(jt=WC):jt=zF;if(jt&&(jt=jt(s,ie))){YC(xe,jt,h,fe);break e}$e&&$e(s,oe,ie),s==="focusout"&&ie&&oe.type==="number"&&ie.memoizedProps.value!=null&&a0(oe,"number",oe.value)}switch($e=ie?Po(ie):window,s){case"focusin":(ZC($e)||$e.contentEditable==="true")&&(oc=$e,x0=ie,cd=null);break;case"focusout":cd=x0=oc=null;break;case"mousedown":w0=!0;break;case"contextmenu":case"mouseup":case"dragend":w0=!1,a_(xe,h,fe);break;case"selectionchange":if(RF)break;case"keydown":case"keyup":a_(xe,h,fe)}var rt;if(g0)e:{switch(s){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else sc?GC(s,h)&&(mt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(mt="onCompositionStart");mt&&(qC&&h.locale!=="ko"&&(sc||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&sc&&(rt=LC()):(xs=fe,d0="value"in xs?xs.value:xs.textContent,sc=!0)),$e=Up(ie,mt),0<$e.length&&(mt=new UC(mt,s,null,h,fe),xe.push({event:mt,listeners:$e}),rt?mt.data=rt:(rt=VC(h),rt!==null&&(mt.data=rt)))),(rt=kF?NF(s,h):CF(s,h))&&(mt=Up(ie,"onBeforeInput"),0<mt.length&&($e=new UC("onBeforeInput","beforeinput",null,h,fe),xe.push({event:$e,listeners:mt}),$e.data=rt)),yq(xe,s,ie,h,fe)}zO(xe,l)})}function Rd(s,l,h){return{instance:s,listener:l,currentTarget:h}}function Up(s,l){for(var h=l+"Capture",g=[];s!==null;){var x=s,k=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||k===null||(x=td(s,h),x!=null&&g.unshift(Rd(s,x,k)),x=td(s,l),x!=null&&g.push(Rd(s,x,k))),s.tag===3)return g;s=s.return}return[]}function wq(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function PO(s,l,h,g,x){for(var k=l._reactName,z=[];h!==null&&h!==g;){var L=h,K=L.alternate,ie=L.stateNode;if(L=L.tag,K!==null&&K===g)break;L!==5&&L!==26&&L!==27||ie===null||(K=ie,x?(ie=td(h,k),ie!=null&&z.unshift(Rd(h,ie,K))):x||(ie=td(h,k),ie!=null&&z.push(Rd(h,ie,K)))),h=h.return}z.length!==0&&s.push({event:l,listeners:z})}var Sq=/\r\n?/g,jq=/\u0000|\uFFFD/g;function RO(s){return(typeof s=="string"?s:""+s).replace(Sq,`
|
|
9
|
-
`).replace(jq,"")}function DO(s,l){return l=RO(l),RO(s)===l}function It(s,l,h,g,x,k){switch(h){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||rc(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&rc(s,""+g);break;case"className":Kh(s,"class",g);break;case"tabIndex":Kh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Kh(s,h,g);break;case"style":DC(s,g,k);break;case"data":if(l!=="object"){Kh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Vh(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(h==="formAction"?(l!=="input"&&It(s,l,"name",x.name,x,null),It(s,l,"formEncType",x.formEncType,x,null),It(s,l,"formMethod",x.formMethod,x,null),It(s,l,"formTarget",x.formTarget,x,null)):(It(s,l,"encType",x.encType,x,null),It(s,l,"method",x.method,x,null),It(s,l,"target",x.target,x,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Vh(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Pa);break;case"onScroll":g!=null&&ft("scroll",s);break;case"onScrollEnd":g!=null&&ft("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Vh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":ft("beforetoggle",s),ft("toggle",s),Hh(s,"popover",g);break;case"xlinkActuate":Ta(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ta(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ta(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ta(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ta(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ta(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Hh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=Q8.get(h)||h,Hh(s,h,g))}}function Gb(s,l,h,g,x,k){switch(h){case"style":DC(s,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?rc(s,g):(typeof g=="number"||typeof g=="bigint")&&rc(s,""+g);break;case"onScroll":g!=null&&ft("scroll",s);break;case"onScrollEnd":g!=null&&ft("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fh.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(x=h.endsWith("Capture"),l=h.slice(2,x?h.length-7:void 0),k=s[Pt]||null,k=k!=null?k[h]:null,typeof k=="function"&&s.removeEventListener(l,k,x),typeof g=="function")){typeof k!="function"&&k!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(l,g,x);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Hh(s,h,g)}}}function Gn(s,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",s),ft("load",s);var g=!1,x=!1,k;for(k in h)if(h.hasOwnProperty(k)){var z=h[k];if(z!=null)switch(k){case"src":g=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:It(s,l,k,z,h,null)}}x&&It(s,l,"srcSet",h.srcSet,h,null),g&&It(s,l,"src",h.src,h,null);return;case"input":ft("invalid",s);var L=k=z=x=null,K=null,ie=null;for(g in h)if(h.hasOwnProperty(g)){var fe=h[g];if(fe!=null)switch(g){case"name":x=fe;break;case"type":z=fe;break;case"checked":K=fe;break;case"defaultChecked":ie=fe;break;case"value":k=fe;break;case"defaultValue":L=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:It(s,l,g,fe,h,null)}}zC(s,k,L,K,ie,z,x,!1);return;case"select":ft("invalid",s),g=z=k=null;for(x in h)if(h.hasOwnProperty(x)&&(L=h[x],L!=null))switch(x){case"value":k=L;break;case"defaultValue":z=L;break;case"multiple":g=L;default:It(s,l,x,L,h,null)}l=k,h=z,s.multiple=!!g,l!=null?nc(s,!!g,l,!1):h!=null&&nc(s,!!g,h,!0);return;case"textarea":ft("invalid",s),k=x=g=null;for(z in h)if(h.hasOwnProperty(z)&&(L=h[z],L!=null))switch(z){case"value":g=L;break;case"defaultValue":x=L;break;case"children":k=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:It(s,l,z,L,h,null)}PC(s,g,x,k);return;case"option":for(K in h)h.hasOwnProperty(K)&&(g=h[K],g!=null)&&(K==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":It(s,l,K,g,h,null));return;case"dialog":ft("beforetoggle",s),ft("toggle",s),ft("cancel",s),ft("close",s);break;case"iframe":case"object":ft("load",s);break;case"video":case"audio":for(g=0;g<Pd.length;g++)ft(Pd[g],s);break;case"image":ft("error",s),ft("load",s);break;case"details":ft("toggle",s);break;case"embed":case"source":case"link":ft("error",s),ft("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in h)if(h.hasOwnProperty(ie)&&(g=h[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:It(s,l,ie,g,h,null)}return;default:if(s0(l)){for(fe in h)h.hasOwnProperty(fe)&&(g=h[fe],g!==void 0&&Gb(s,l,fe,g,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(g=h[L],g!=null&&It(s,l,L,g,h,null))}function kq(s,l,h,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,k=null,z=null,L=null,K=null,ie=null,fe=null;for(ue in h){var xe=h[ue];if(h.hasOwnProperty(ue)&&xe!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":K=xe;default:g.hasOwnProperty(ue)||It(s,l,ue,null,g,xe)}}for(var oe in g){var ue=g[oe];if(xe=h[oe],g.hasOwnProperty(oe)&&(ue!=null||xe!=null))switch(oe){case"type":k=ue;break;case"name":x=ue;break;case"checked":ie=ue;break;case"defaultChecked":fe=ue;break;case"value":z=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:ue!==xe&&It(s,l,oe,ue,g,xe)}}i0(s,z,L,K,ie,fe,k,x);return;case"select":ue=z=L=oe=null;for(k in h)if(K=h[k],h.hasOwnProperty(k)&&K!=null)switch(k){case"value":break;case"multiple":ue=K;default:g.hasOwnProperty(k)||It(s,l,k,null,g,K)}for(x in g)if(k=g[x],K=h[x],g.hasOwnProperty(x)&&(k!=null||K!=null))switch(x){case"value":oe=k;break;case"defaultValue":L=k;break;case"multiple":z=k;default:k!==K&&It(s,l,x,k,g,K)}l=L,h=z,g=ue,oe!=null?nc(s,!!h,oe,!1):!!g!=!!h&&(l!=null?nc(s,!!h,l,!0):nc(s,!!h,h?[]:"",!1));return;case"textarea":ue=oe=null;for(L in h)if(x=h[L],h.hasOwnProperty(L)&&x!=null&&!g.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:It(s,l,L,null,g,x)}for(z in g)if(x=g[z],k=h[z],g.hasOwnProperty(z)&&(x!=null||k!=null))switch(z){case"value":oe=x;break;case"defaultValue":ue=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==k&&It(s,l,z,x,g,k)}TC(s,oe,ue);return;case"option":for(var Re in h)oe=h[Re],h.hasOwnProperty(Re)&&oe!=null&&!g.hasOwnProperty(Re)&&(Re==="selected"?s.selected=!1:It(s,l,Re,null,g,oe));for(K in g)oe=g[K],ue=h[K],g.hasOwnProperty(K)&&oe!==ue&&(oe!=null||ue!=null)&&(K==="selected"?s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":It(s,l,K,oe,g,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ve in h)oe=h[Ve],h.hasOwnProperty(Ve)&&oe!=null&&!g.hasOwnProperty(Ve)&&It(s,l,Ve,null,g,oe);for(ie in g)if(oe=g[ie],ue=h[ie],g.hasOwnProperty(ie)&&oe!==ue&&(oe!=null||ue!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:It(s,l,ie,oe,g,ue)}return;default:if(s0(l)){for(var Lt in h)oe=h[Lt],h.hasOwnProperty(Lt)&&oe!==void 0&&!g.hasOwnProperty(Lt)&&Gb(s,l,Lt,void 0,g,oe);for(fe in g)oe=g[fe],ue=h[fe],!g.hasOwnProperty(fe)||oe===ue||oe===void 0&&ue===void 0||Gb(s,l,fe,oe,g,ue);return}}for(var ee in h)oe=h[ee],h.hasOwnProperty(ee)&&oe!=null&&!g.hasOwnProperty(ee)&&It(s,l,ee,null,g,oe);for(xe in g)oe=g[xe],ue=h[xe],!g.hasOwnProperty(xe)||oe===ue||oe==null&&ue==null||It(s,l,xe,oe,g,ue)}function MO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Nq(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var x=h[g],k=x.transferSize,z=x.initiatorType,L=x.duration;if(k&&L&&MO(z)){for(z=0,L=x.responseEnd,g+=1;g<h.length;g++){var K=h[g],ie=K.startTime;if(ie>L)break;var fe=K.transferSize,xe=K.initiatorType;fe&&MO(xe)&&(K=K.responseEnd,z+=fe*(K<L?1:(L-ie)/(K-ie)))}if(--g,l+=8*(k+z)/(x.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Vb=null,Zb=null;function Fp(s){return s.nodeType===9?s:s.ownerDocument}function IO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function LO(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Yb(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Wb=null;function Cq(){var s=window.event;return s&&s.type==="popstate"?s===Wb?!1:(Wb=s,!0):(Wb=null,!1)}var $O=typeof setTimeout=="function"?setTimeout:void 0,_q=typeof clearTimeout=="function"?clearTimeout:void 0,BO=typeof Promise=="function"?Promise:void 0,Aq=typeof queueMicrotask=="function"?queueMicrotask:typeof BO<"u"?function(s){return BO.resolve(null).then(s).catch(Oq)}:$O;function Oq(s){setTimeout(function(){throw s})}function Is(s){return s==="head"}function UO(s,l){var h=l,g=0;do{var x=h.nextSibling;if(s.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(x),Rc(l);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Dd(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Dd(h);for(var k=h.firstChild;k;){var z=k.nextSibling,L=k.nodeName;k[ti]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&k.rel.toLowerCase()==="stylesheet"||h.removeChild(k),k=z}}else h==="body"&&Dd(s.ownerDocument.body);h=x}while(h);Rc(l)}function FO(s,l){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Qb(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Qb(h),Ea(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function Eq(s,l,h,g){for(;s.nodeType===1;){var x=h;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[ti])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var k=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=ui(s.nextSibling),s===null)break}return null}function zq(s,l,h){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=ui(s.nextSibling),s===null))return null;return s}function qO(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=ui(s.nextSibling),s===null))return null;return s}function Xb(s){return s.data==="$?"||s.data==="$~"}function Jb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Tq(s,l){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||h.readyState!=="loading")l();else{var g=function(){l(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function ui(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var ex=null;function HO(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(l===0)return ui(s.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}s=s.nextSibling}return null}function KO(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return s;l--}else h!=="/$"&&h!=="/&"||l++}s=s.previousSibling}return null}function GO(s,l,h){switch(l=Fp(h),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Dd(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Ea(s)}var di=new Map,VO=new Set;function qp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ya=J.d;J.d={f:Pq,r:Rq,D:Dq,C:Mq,L:Iq,m:Lq,X:Bq,S:$q,M:Uq};function Pq(){var s=Ya.f(),l=Rp();return s||l}function Rq(s){var l=za(s);l!==null&&l.tag===5&&l.type==="form"?uA(l):Ya.r(s)}var zc=typeof document>"u"?null:document;function ZO(s,l,h){var g=zc;if(g&&typeof l=="string"&&l){var x=ri(l);x='link[rel="'+s+'"][href="'+x+'"]',typeof h=="string"&&(x+='[crossorigin="'+h+'"]'),VO.has(x)||(VO.add(x),s={rel:s,crossOrigin:h,href:l},g.querySelector(x)===null&&(l=g.createElement("link"),Gn(l,"link",s),ln(l),g.head.appendChild(l)))}}function Dq(s){Ya.D(s),ZO("dns-prefetch",s,null)}function Mq(s,l){Ya.C(s,l),ZO("preconnect",s,l)}function Iq(s,l,h){Ya.L(s,l,h);var g=zc;if(g&&s&&l){var x='link[rel="preload"][as="'+ri(l)+'"]';l==="image"&&h&&h.imageSrcSet?(x+='[imagesrcset="'+ri(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(x+='[imagesizes="'+ri(h.imageSizes)+'"]')):x+='[href="'+ri(s)+'"]';var k=x;switch(l){case"style":k=Tc(s);break;case"script":k=Pc(s)}di.has(k)||(s=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:s,as:l},h),di.set(k,s),g.querySelector(x)!==null||l==="style"&&g.querySelector(Md(k))||l==="script"&&g.querySelector(Id(k))||(l=g.createElement("link"),Gn(l,"link",s),ln(l),g.head.appendChild(l)))}}function Lq(s,l){Ya.m(s,l);var h=zc;if(h&&s){var g=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+ri(g)+'"][href="'+ri(s)+'"]',k=x;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Pc(s)}if(!di.has(k)&&(s=m({rel:"modulepreload",href:s},l),di.set(k,s),h.querySelector(x)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Id(k)))return}g=h.createElement("link"),Gn(g,"link",s),ln(g),h.head.appendChild(g)}}}function $q(s,l,h){Ya.S(s,l,h);var g=zc;if(g&&s){var x=Di(g).hoistableStyles,k=Tc(s);l=l||"default";var z=x.get(k);if(!z){var L={loading:0,preload:null};if(z=g.querySelector(Md(k)))L.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},h),(h=di.get(k))&&tx(s,h);var K=z=g.createElement("link");ln(K),Gn(K,"link",s),K._p=new Promise(function(ie,fe){K.onload=ie,K.onerror=fe}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Hp(z,l,g)}z={type:"stylesheet",instance:z,count:1,state:L},x.set(k,z)}}}function Bq(s,l){Ya.X(s,l);var h=zc;if(h&&s){var g=Di(h).hoistableScripts,x=Pc(s),k=g.get(x);k||(k=h.querySelector(Id(x)),k||(s=m({src:s,async:!0},l),(l=di.get(x))&&nx(s,l),k=h.createElement("script"),ln(k),Gn(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(x,k))}}function Uq(s,l){Ya.M(s,l);var h=zc;if(h&&s){var g=Di(h).hoistableScripts,x=Pc(s),k=g.get(x);k||(k=h.querySelector(Id(x)),k||(s=m({src:s,async:!0,type:"module"},l),(l=di.get(x))&&nx(s,l),k=h.createElement("script"),ln(k),Gn(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(x,k))}}function YO(s,l,h,g){var x=(x=ae.current)?qp(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Tc(h.href),h=Di(x).hoistableStyles,g=h.get(l),g||(g={type:"style",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Tc(h.href);var k=Di(x).hoistableStyles,z=k.get(s);if(z||(x=x.ownerDocument||x,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,z),(k=x.querySelector(Md(s)))&&!k._p&&(z.instance=k,z.state.loading=5),di.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},di.set(s,h),k||Fq(x,s,h,z.state))),l&&g===null)throw Error(r(528,""));return z}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Pc(h),h=Di(x).hoistableScripts,g=h.get(l),g||(g={type:"script",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Tc(s){return'href="'+ri(s)+'"'}function Md(s){return'link[rel="stylesheet"]['+s+"]"}function WO(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function Fq(s,l,h,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),Gn(l,"link",h),ln(l),s.head.appendChild(l))}function Pc(s){return'[src="'+ri(s)+'"]'}function Id(s){return"script[async]"+s}function QO(s,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+ri(h.href)+'"]');if(g)return l.instance=g,ln(g),g;var x=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),ln(g),Gn(g,"style",x),Hp(g,h.precedence,s),l.instance=g;case"stylesheet":x=Tc(h.href);var k=s.querySelector(Md(x));if(k)return l.state.loading|=4,l.instance=k,ln(k),k;g=WO(h),(x=di.get(x))&&tx(g,x),k=(s.ownerDocument||s).createElement("link"),ln(k);var z=k;return z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),Gn(k,"link",g),l.state.loading|=4,Hp(k,h.precedence,s),l.instance=k;case"script":return k=Pc(h.src),(x=s.querySelector(Id(k)))?(l.instance=x,ln(x),x):(g=h,(x=di.get(k))&&(g=m({},h),nx(g,x)),s=s.ownerDocument||s,x=s.createElement("script"),ln(x),Gn(x,"link",g),s.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,Hp(g,h.precedence,s));return l.instance}function Hp(s,l,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=g.length?g[g.length-1]:null,k=x,z=0;z<g.length;z++){var L=g[z];if(L.dataset.precedence===l)k=L;else if(k!==x)break}k?k.parentNode.insertBefore(s,k.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(s,l.firstChild))}function tx(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function nx(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Kp=null;function XO(s,l,h){if(Kp===null){var g=new Map,x=Kp=new Map;x.set(h,g)}else x=Kp,g=x.get(h),g||(g=new Map,x.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),x=0;x<h.length;x++){var k=h[x];if(!(k[ti]||k[ut]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var z=k.getAttribute(l)||"";z=s+z;var L=g.get(z);L?L.push(k):g.set(z,[k])}}return g}function JO(s,l,h){s=s.ownerDocument||s,s.head.insertBefore(h,l==="title"?s.querySelector("head > title"):null)}function qq(s,l,h){if(h===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function eE(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function Hq(s,l,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var x=Tc(g.href),k=l.querySelector(Md(x));if(k){l=k._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Gp.bind(s),l.then(s,s)),h.state.loading|=4,h.instance=k,ln(k);return}k=l.ownerDocument||l,g=WO(g),(x=di.get(x))&&tx(g,x),k=k.createElement("link"),ln(k);var z=k;z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),Gn(k,"link",g),h.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Gp.bind(s),l.addEventListener("load",h),l.addEventListener("error",h))}}var rx=0;function Kq(s,l){return s.stylesheets&&s.count===0&&Zp(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Zp(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+l);0<s.imgBytes&&rx===0&&(rx=62500*Nq());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Zp(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>rx?50:800)+l);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(x)}}:null}function Gp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Vp=null;function Zp(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Vp=new Map,l.forEach(Gq,s),Vp=null,Gp.call(s))}function Gq(s,l){if(!(l.state.loading&4)){var h=Vp.get(s);if(h)var g=h.get(null);else{h=new Map,Vp.set(s,h);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<x.length;k++){var z=x[k];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),g=z)}g&&h.set(null,g)}x=l.instance,z=x.getAttribute("data-precedence"),k=h.get(z)||g,k===g&&h.set(null,x),h.set(z,x),this.count++,g=Gp.bind(this),x.addEventListener("load",g),x.addEventListener("error",g),k?k.parentNode.insertBefore(x,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),l.state.loading|=4}}var Ld={$$typeof:_,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function Vq(s,l,h,g,x,k,z,L,K){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ec(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ec(0),this.hiddenUpdates=ec(null),this.identifierPrefix=g,this.onUncaughtError=x,this.onCaughtError=k,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function tE(s,l,h,g,x,k,z,L,K,ie,fe,xe){return s=new Vq(s,l,h,z,K,ie,fe,xe,L),l=1,k===!0&&(l|=24),k=Br(3,null,null,l),s.current=k,k.stateNode=s,l=M0(),l.refCount++,s.pooledCache=l,l.refCount++,k.memoizedState={element:g,isDehydrated:h,cache:l},B0(k),s}function nE(s){return s?(s=uc,s):uc}function rE(s,l,h,g,x,k){x=nE(x),g.context===null?g.context=x:g.pendingContext=x,g=Cs(l),g.payload={element:h},k=k===void 0?null:k,k!==null&&(g.callback=k),h=_s(s,g,l),h!==null&&(Nr(h,s,l),gd(h,s,l))}function iE(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<l?h:l}}function ix(s,l){iE(s,l),(s=s.alternate)&&iE(s,l)}function aE(s){if(s.tag===13||s.tag===31){var l=Lo(s,67108864);l!==null&&Nr(l,s,67108864),ix(s,67108864)}}function sE(s){if(s.tag===13||s.tag===31){var l=Kr();l=ed(l);var h=Lo(s,l);h!==null&&Nr(h,s,l),ix(s,l)}}var Yp=!0;function Zq(s,l,h,g){var x=H.T;H.T=null;var k=J.p;try{J.p=2,ax(s,l,h,g)}finally{J.p=k,H.T=x}}function Yq(s,l,h,g){var x=H.T;H.T=null;var k=J.p;try{J.p=8,ax(s,l,h,g)}finally{J.p=k,H.T=x}}function ax(s,l,h,g){if(Yp){var x=sx(g);if(x===null)Kb(s,l,g,Wp,h),lE(s,g);else if(Qq(x,s,l,h,g))g.stopPropagation();else if(lE(s,g),l&4&&-1<Wq.indexOf(s)){for(;x!==null;){var k=za(x);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var z=ei(k.pendingLanes);if(z!==0){var L=k;for(L.pendingLanes|=2,L.entangledLanes|=2;z;){var K=1<<31-Te(z);L.entanglements[1]|=K,z&=~K}ra(k),(Ct&6)===0&&(Tp=lt()+500,Td(0))}}break;case 31:case 13:L=Lo(k,2),L!==null&&Nr(L,k,2),Rp(),ix(k,2)}if(k=sx(g),k===null&&Kb(s,l,g,Wp,h),k===x)break;x=k}x!==null&&g.stopPropagation()}else Kb(s,l,g,null,h)}}function sx(s){return s=l0(s),ox(s)}var Wp=null;function ox(s){if(Wp=null,s=Ri(s),s!==null){var l=a(s);if(l===null)s=null;else{var h=l.tag;if(h===13){if(s=o(l),s!==null)return s;s=null}else if(h===31){if(s=u(l),s!==null)return s;s=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Wp=s,null}function oE(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ct()){case G:return 2;case le:return 8;case je:case Ae:return 32;case qe:return 268435456;default:return 32}default:return 32}}var lx=!1,Ls=null,$s=null,Bs=null,$d=new Map,Bd=new Map,Us=[],Wq="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 lE(s,l){switch(s){case"focusin":case"focusout":Ls=null;break;case"dragenter":case"dragleave":$s=null;break;case"mouseover":case"mouseout":Bs=null;break;case"pointerover":case"pointerout":$d.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bd.delete(l.pointerId)}}function Ud(s,l,h,g,x,k){return s===null||s.nativeEvent!==k?(s={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:k,targetContainers:[x]},l!==null&&(l=za(l),l!==null&&aE(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),s)}function Qq(s,l,h,g,x){switch(l){case"focusin":return Ls=Ud(Ls,s,l,h,g,x),!0;case"dragenter":return $s=Ud($s,s,l,h,g,x),!0;case"mouseover":return Bs=Ud(Bs,s,l,h,g,x),!0;case"pointerover":var k=x.pointerId;return $d.set(k,Ud($d.get(k)||null,s,l,h,g,x)),!0;case"gotpointercapture":return k=x.pointerId,Bd.set(k,Ud(Bd.get(k)||null,s,l,h,g,x)),!0}return!1}function cE(s){var l=Ri(s.target);if(l!==null){var h=a(l);if(h!==null){if(l=h.tag,l===13){if(l=o(h),l!==null){s.blockedOn=l,Ce(s.priority,function(){sE(h)});return}}else if(l===31){if(l=u(h),l!==null){s.blockedOn=l,Ce(s.priority,function(){sE(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Qp(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var h=sx(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);o0=g,h.target.dispatchEvent(g),o0=null}else return l=za(h),l!==null&&aE(l),s.blockedOn=h,!1;l.shift()}return!0}function uE(s,l,h){Qp(s)&&h.delete(l)}function Xq(){lx=!1,Ls!==null&&Qp(Ls)&&(Ls=null),$s!==null&&Qp($s)&&($s=null),Bs!==null&&Qp(Bs)&&(Bs=null),$d.forEach(uE),Bd.forEach(uE)}function Xp(s,l){s.blockedOn===l&&(s.blockedOn=null,lx||(lx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Xq)))}var Jp=null;function dE(s){Jp!==s&&(Jp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Jp===s&&(Jp=null);for(var l=0;l<s.length;l+=3){var h=s[l],g=s[l+1],x=s[l+2];if(typeof g!="function"){if(ox(g||h)===null)continue;break}var k=za(h);k!==null&&(s.splice(l,3),l-=3,sb(k,{pending:!0,data:x,method:h.method,action:g},g,x))}}))}function Rc(s){function l(K){return Xp(K,s)}Ls!==null&&Xp(Ls,s),$s!==null&&Xp($s,s),Bs!==null&&Xp(Bs,s),$d.forEach(l),Bd.forEach(l);for(var h=0;h<Us.length;h++){var g=Us[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Us.length&&(h=Us[0],h.blockedOn===null);)cE(h),h.blockedOn===null&&Us.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var x=h[g],k=h[g+1],z=x[Pt]||null;if(typeof k=="function")z||dE(h);else if(z){var L=null;if(k&&k.hasAttribute("formAction")){if(x=k,z=k[Pt]||null)L=z.formAction;else if(ox(x)!==null)continue}else L=z.action;typeof L=="function"?h[g+1]=L:(h.splice(g,3),g-=3),dE(h)}}}function fE(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(z){return x=z})},focusReset:"manual",scroll:"manual"})}function l(){x!==null&&(x(),x=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),x!==null&&(x(),x=null)}}}function cx(s){this._internalRoot=s}em.prototype.render=cx.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,g=Kr();rE(h,g,s,l,null,null)},em.prototype.unmount=cx.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;rE(s.current,2,null,s,null,null),Rp(),l[Ir]=null}};function em(s){this._internalRoot=s}em.prototype.unstable_scheduleHydration=function(s){if(s){var l=Z();s={blockedOn:null,target:s,priority:l};for(var h=0;h<Us.length&&l!==0&&l<Us[h].priority;h++);Us.splice(h,0,s),h===0&&cE(s)}};var hE=t.version;if(hE!=="19.2.4")throw Error(r(527,hE,"19.2.4"));J.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var Jq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tm.isDisabled&&tm.supportsFiber)try{Ge=tm.inject(Jq),zt=tm}catch{}}return qd.createRoot=function(s,l){if(!i(s))throw Error(r(299));var h=!1,g="",x=xA,k=wA,z=SA;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(k=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError)),l=tE(s,1,!1,null,null,h,g,null,x,k,z,fE),s[Ir]=l.current,Hb(s),new cx(l)},qd.hydrateRoot=function(s,l,h){if(!i(s))throw Error(r(299));var g=!1,x="",k=xA,z=wA,L=SA,K=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onUncaughtError!==void 0&&(k=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),l=tE(s,1,!0,l,h??null,g,x,K,k,z,L,fE),l.context=nE(null),h=l.current,g=Kr(),g=ed(g),x=Cs(g),x.callback=null,_s(h,x,g),h=g,l.current.lanes=h,To(l,h),ra(l),s[Ir]=l.current,Hb(s),new em(l)},qd.version="19.2.4",qd}var jE;function c9(){if(jE)return fx.exports;jE=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(),fx.exports=l9(),fx.exports}var u9=c9(),Fl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},d9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f9=class{#t=d9;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},cl=new f9;function h9(e){setTimeout(e,0)}var Al=typeof window>"u"||"Deno"in globalThis;function nr(){}function p9(e,t){return typeof e=="function"?e(t):e}function MS(e){return typeof e=="number"&&e>=0&&e!==1/0}function rI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oo(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function kE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==Cj(o,t.options))return!1}else if(!_f(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function NE(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ol(t.options.mutationKey)!==Ol(a))return!1}else if(!_f(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Cj(e,t){return(t?.queryKeyHashFn||Ol)(e)}function Ol(e){return JSON.stringify(e,(t,n)=>IS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _f(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>_f(e[n],t[n])):!1}var m9=Object.prototype.hasOwnProperty;function _j(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=CE(e)&&CE(t);if(!r&&!(IS(e)&&IS(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:m9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const w=_j(y,v,n+1);d[m]=w,w===y&&f++}return a===u&&f===a?e:d}function Af(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 CE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function IS(e){if(!_E(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_E(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _E(e){return Object.prototype.toString.call(e)==="[object Object]"}function g9(e){return new Promise(t=>{cl.setTimeout(t,e)})}function LS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?_j(e,t):t}function y9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function v9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Aj=Symbol();function iI(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Aj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Oj(e,t){return typeof e=="function"?e(...t):!!e}function b9(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 x9=class extends Fl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Al&&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"}},Ej=new x9;function $S(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var w9=h9;function S9(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=w9;const a=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var yn=S9(),j9=class extends Fl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Al&&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}},ug=new j9;function k9(e){return Math.min(1e3*2**e,3e4)}function aI(e){return(e??"online")==="online"?ug.isOnline():!0}var BS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function sI(e){let t=!1,n=0,r;const i=$S(),a=()=>i.status!=="pending",o=S=>{if(!a()){const j=new BS(S);y(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ej.isFocused()&&(e.networkMode==="always"||ug.isOnline())&&e.canRun(),p=()=>aI(e.networkMode)&&e.canRun(),m=S=>{a()||(r?.(),i.resolve(S))},y=S=>{a()||(r?.(),i.reject(S))},v=()=>new Promise(S=>{r=j=>{(a()||f())&&S(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),w=()=>{if(a())return;let S;const j=n===0?e.initialPromise:void 0;try{S=j??e.fn()}catch(N){S=Promise.reject(N)}Promise.resolve(S).then(m).catch(N=>{if(a())return;const O=e.retry??(Al?0:3),_=e.retryDelay??k9,C=typeof _=="function"?_(n,N):_,T=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,N);if(t||!T){y(N);return}n++,e.onFail?.(n,N),g9(C).then(()=>f()?void 0:v()).then(()=>{t?y(N):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var oI=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),MS(this.gcTime)&&(this.#t=cl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Al?1/0:300*1e3))}clearGcTimeout(){this.#t&&(cl.clearTimeout(this.#t),this.#t=void 0)}},N9=class extends oI{#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=OE(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=OE(this.options);t.data!==void 0&&(this.setState(AE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=LS(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(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>yi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Aj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oo(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:!rI(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 u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=iI(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(u,f,this):u(f)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=sI({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof BS&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof BS){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}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,...lI(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...AE(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),yn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function lI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function AE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function OE(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 zj=class extends Fl{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=$S(),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),EE(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return US(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return US(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 yi(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&&!Af(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&zE(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||yi(this.options.enabled,this.#e)!==yi(t.enabled,this.#e)||oo(this.options.staleTime,this.#e)!==oo(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||yi(this.options.enabled,this.#e)!==yi(t.enabled,this.#e)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return _9(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(nr)),t}#g(){this.#x();const e=oo(this.options.staleTime,this.#e);if(Al||this.#i.isStale||!MS(e))return;const n=rI(this.#i.dataUpdatedAt,e)+1;this.#c=cl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Al||yi(this.options.enabled,this.#e)===!1||!MS(this.#l)||this.#l===0)&&(this.#u=cl.setInterval(()=>{(this.options.refetchIntervalInBackground||Ej.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(cl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(cl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const P=this.hasListeners(),I=!P&&EE(e,t),q=P&&zE(e,n,t,r);(I||q)&&(p={...p,...lI(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&S==="pending"){let P;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(P=i.data,j=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,P!==void 0&&(S="success",y=LS(i?.data,P,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=LS(i?.data,y,t),this.#d=y,this.#s=null}catch(P){this.#s=P}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),S="error");const N=p.fetchStatus==="fetching",O=S==="pending",_=S==="error",C=O&&N,T=y!==void 0,A={status:S,fetchStatus:p.fetchStatus,isPending:O,isSuccess:S==="success",isError:_,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:N,isRefetching:N&&!O,isLoadingError:_&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&T,isStale:Tj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:yi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=A.data!==void 0,I=A.status==="error"&&!P,q=V=>{I?V.reject(A.error):P&&V.resolve(A.data)},B=()=>{const V=this.#o=A.promise=$S();q(V)},$=this.#o;switch($.status){case"pending":e.queryHash===n.queryHash&&q($);break;case"fulfilled":(I||A.data!==$.value)&&B();break;case"rejected":(!I||A.error!==$.reason)&&B();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),Af(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&a.has(u)})};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){yn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function C9(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function EE(e,t){return C9(e,t)||e.state.data!==void 0&&US(e,t,t.refetchOnMount)}function US(e,t,n){if(yi(t.enabled,e)!==!1&&oo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Tj(e,t)}return!1}function zE(e,t,n,r){return(e!==t||yi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Tj(e,n)}function Tj(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(oo(t.staleTime,e))}function _9(e,t){return!Af(e.getCurrentResult(),t)}function TE(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{b9(w,()=>t.signal,()=>p=!0)},y=iI(t.options,t.fetchOptions),v=async(w,S,j)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return m(E),E})(),_=await y(O),{maxPages:C}=t.options,T=j?v9:y9;return{pages:T(w.pages,_,C),pageParams:T(w.pageParams,S,C)}};if(i&&a.length){const w=i==="backward",S=w?A9:PE,j={pages:a,pageParams:o},N=S(r,j);u=await v(j,N,w)}else{const w=e??a.length;do{const S=d===0?o[0]??r.initialPageParam:PE(r,u);if(d>0&&S==null)break;u=await v(u,S),d++}while(d<w)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function PE(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 A9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var O9=class extends oI{#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||cI(),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=sI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function cI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uI=class extends Fl{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 O9({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=nm(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=nm(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=nm(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=nm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.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=>NE(t,n))}findAll(e={}){return this.getAll().filter(t=>NE(e,t))}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yn.batch(()=>Promise.all(e.map(t=>t.continue().catch(nr))))}};function nm(e){return e.options.scope?.id}var E9=class extends Fl{#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),Af(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ol(n.mutationKey)!==Ol(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??cI();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){yn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function RE(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function z9(e,t,n){const r=e.slice(0);return r[t]=n,r}var T9=class extends Fl{#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,yn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=o||u,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!Af(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(RE(n,i).forEach(p=>{p.destroy()}),RE(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,o)=>a!==r[o]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=_j(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),o=t.get(i.queryHash)?.shift()??new zj(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=z9(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&&yn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},P9=class extends Fl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??Cj(r,t);let a=this.get(i);return a||(a=new N9({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yn.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=>kE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>kE(e,n)):t}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},R9=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new P9,this.#e=e.mutationCache||new uI,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ej.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=ug.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(oo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,o=p9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return yn.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;yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(nr).catch(nr)}invalidateQueries(e,t={}){return yn.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=yn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(nr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(oo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=TE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=TE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ug.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(Ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{_f(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{_f(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=Cj(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===Aj&&(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()}},dI=b.createContext(void 0),xo=e=>{const t=b.useContext(dI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D9=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(dI.Provider,{value:e,children:t})),fI=b.createContext(!1),hI=()=>b.useContext(fI);fI.Provider;function M9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var I9=b.createContext(M9()),pI=()=>b.useContext(I9),mI=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Oj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},gI=e=>{b.useEffect(()=>{e.clearReset()},[e])},yI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Oj(n,[e.error,r])),vI=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))}},L9=(e,t)=>e.isLoading&&e.isFetching&&!t,FS=(e,t)=>e?.suspense&&t.isPending,qS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $9({queries:e,...t},n){const r=xo(),i=hI(),a=pI(),o=b.useMemo(()=>e.map(S=>{const j=r.defaultQueryOptions(S);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(S=>{vI(S);const j=r.getQueryCache().get(S.queryHash);mI(S,a,j)}),gI(a);const[u]=b.useState(()=>new T9(r,o,t)),[d,f,p]=u.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(S=>m?u.subscribe(yn.batchCalls(S)):nr,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const v=d.some((S,j)=>FS(o[j],S))?d.flatMap((S,j)=>{const N=o[j];if(N&&FS(N,S)){const O=new zj(r,N);return qS(N,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((S,j)=>{const N=o[j];return N&&yI({result:S,errorResetBoundary:a,throwOnError:N.throwOnError,query:r.getQueryCache().get(N.queryHash),suspense:N.suspense})});if(w?.error)throw w.error;return f(p())}function B9(e,t,n){const r=hI(),i=pI(),a=xo(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",vI(o),mI(o,i,u),gI(i);const d=!a.getQueryCache().get(o.queryHash),[f]=b.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(y=>{const v=m?f.subscribe(yn.batchCalls(y)):nr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(o)},[o,f]),FS(o,p))throw qS(o,f,i);if(yI({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Al&&L9(p,r)&&(d?qS(o,f,i):u?.promise)?.catch(nr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function rs(e,t){return B9(e,zj)}function sh(e,t){const n=xo(),[r]=b.useState(()=>new E9(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(yn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((o,u)=>{r.mutate(o,u).catch(nr)},[r]);if(i.error&&Oj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var rm=typeof window<"u"?b.useLayoutEffect:b.useEffect;function gx(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function U9(e,t,n={},r={}){b.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function F9(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}var q9=!1;function Of(e){return e[e.length-1]}function H9(e){return typeof e=="function"}function eo(e,t){return H9(e)?e(t):e}var K9=Object.prototype.hasOwnProperty,DE=Object.prototype.propertyIsEnumerable,G9=()=>Object.create(null),Qo=(e,t)=>ul(e,t,G9);function ul(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=LE(e)&&LE(i);if(!a&&!(dg(e)&&dg(i)))return i;const o=a?e:ME(e);if(!o)return i;const u=a?i:ME(i);if(!u)return i;const d=o.length,f=u.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:u[y],w=e[v],S=i[v];if(w===S){p[v]=w,(a?y<d:K9.call(e,v))&&m++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){p[v]=S;continue}const j=ul(w,S,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function ME(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!DE.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(!DE.call(e,i))return!1;r.push(i)}return r}function dg(e){if(!IE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!IE(n)||!n.hasOwnProperty("isPrototypeOf"))}function IE(e){return Object.prototype.toString.call(e)==="[object Object]"}function LE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xl(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(!xl(e[r],t[r],n))return!1;return!0}if(dg(e)&&dg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!xl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!xl(e[o],t[o],n)))return!1;return i===a}return!1}function vu(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Ef(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function V9(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function $E(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 V9(t)}var Z9=["http:","https:","mailto:","tel:"];function fg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Hd(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+=$E(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+$E(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function Y9(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function hg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=o,i(u);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var W9="Invariant failed";function mo(e,t){if(!e)throw new Error(W9)}var dl=4,bI=5;function Q9(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 Pj(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const o=Q9(a);if(o){const[u,d]=o,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Dy(e,t,n,r,i,a,o){o?.(n);let u=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;u<f;){const v=Pj(d,u,t);let w;const S=u,j=v[5];switch(u=j+1,a++,v[0]){case 0:{const N=d.substring(v[2],v[3]);if(p){const O=i.static?.get(N);if(O)w=O;else{i.static??=new Map;const _=fl(n.fullPath??n.from);_.parent=i,_.depth=a,w=_,i.static.set(N,_)}}else{const O=N.toLowerCase(),_=i.staticInsensitive?.get(O);if(_)w=_;else{i.staticInsensitive??=new Map;const C=fl(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.staticInsensitive.set(O,C)}}break}case 1:{const N=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(N||O),C=N?_?N:N.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=!m&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===T);if(E)w=E;else{const A=vx(1,n.fullPath??n.from,_,C,T);w=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case 3:{const N=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(N||O),C=N?_?N:N.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=!m&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===T);if(E)w=E;else{const A=vx(3,n.fullPath??n.from,_,C,T);w=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case 2:{const N=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(N||O),C=N?_?N:N.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=vx(2,n.fullPath??n.from,_,C,T);w=E,E.parent=i,E.depth=a,i.wildcard??=[],i.wildcard.push(E)}}i=w}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=fl(n.fullPath??n.from);v.kind=bI,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=fl(n.fullPath??n.from);v.kind=dl,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Dy(e,t,d,u,i,a,o)}function yx(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 Ys(e){if(e.pathless)for(const t of e.pathless)Ys(t);if(e.static)for(const t of e.static.values())Ys(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ys(t);if(e.dynamic?.length){e.dynamic.sort(yx);for(const t of e.dynamic)Ys(t)}if(e.optional?.length){e.optional.sort(yx);for(const t of e.optional)Ys(t)}if(e.wildcard?.length){e.wildcard.sort(yx);for(const t of e.wildcard)Ys(t)}}function fl(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 vx(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 X9(e,t){const n=fl("/"),r=new Uint16Array(6);for(const i of e)Dy(!1,r,i,1,n,0);Ys(n),t.masksTree=n,t.flatCache=hg(1e3)}function J9(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Rj(e,t.masksTree);return t.flatCache.set(e,r),r}function eH(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=fl("/"),Dy(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Rj(r,o,n)}function tH(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=Rj(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=iH(a.route)),t.matchCache.set(r,a),a}function nH(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function rH(e,t=!1,n){const r=fl(e.fullPath),i=new Uint16Array(6),a={},o={};let u=0;return Dy(t,i,e,1,r,0,d=>{if(n?.(d,u),mo(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=nH(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}u++}),Ys(r),{processedTree:{segmentTree:r,singleCache:hg(1e3),matchCache:hg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Rj(e,t,n=!1){const r=e.split("/"),i=sH(e,r,t,n);if(!i)return null;const[a]=xI(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function xI(e,t,n){const r=aH(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;o++,u++,d++,f++){const p=r[u];if(p.kind===dl)break;if(p.kind===bI){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const S=p.suffix?.length??0,j=v.substring(w+2,v.length-S-1),N=m.substring(w,m.length-S);a[j]=decodeURIComponent(N)}else{const S=v.substring(1);a[S]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,S=p.suffix?.length??0,j=v.substring(w+3,v.length-S-1),N=p.suffix||p.prefix?m.substring(w,m.length-S):m;N&&(a[j]=decodeURIComponent(N))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);a["*"]=S,a._splat=S;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:u,path:d,segment:f}]}function iH(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function aH(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function sH(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Of(t),a=i&&e!=="/",o=t.length-(i?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;u.length;){const m=u.pop(),{node:y,index:v,skipped:w,depth:S,statics:j,dynamics:N,optionals:O}=m;let{extract:_,rawParams:C,parsedParams:T}=m;if(y.skipOnParamError){if(!bx(e,t,m))continue;C=m.rawParams,_=m.extract,T=m.parsedParams}r&&y.route&&y.kind!==dl&&Kd(f,m)&&(f=m);const E=v===o;if(E&&(y.route&&!a&&Kd(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const A=E?void 0:t[v];let P;if(E&&y.index){const I={node:y.index,index:v,skipped:w,depth:S+1,statics:j,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T};let q=!0;if(y.index.skipOnParamError&&(bx(e,t,I)||(q=!1)),q){if(j===o&&!N&&!O&&!w)return I;Kd(p,I)&&(p=I)}}if(y.wildcard&&Kd(d,m))for(const I of y.wildcard){const{prefix:q,suffix:B}=I;if(q&&(E||!(I.caseSensitive?A:P??=A.toLowerCase()).startsWith(q)))continue;if(B){if(E)continue;const V=t.slice(v).join("/").slice(-B.length);if((I.caseSensitive?V:V.toLowerCase())!==B)continue}const $={node:I,index:o,skipped:w,depth:S,statics:j,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T};if(!(I.skipOnParamError&&!bx(e,t,$))){d=$;break}}if(y.optional){const I=w|1<<S,q=S+1;for(let B=y.optional.length-1;B>=0;B--){const $=y.optional[B];u.push({node:$,index:v,skipped:I,depth:q,statics:j,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E)for(let B=y.optional.length-1;B>=0;B--){const $=y.optional[B],{prefix:V,suffix:te}=$;if(V||te){const Y=$.caseSensitive?A:P??=A.toLowerCase();if(V&&!Y.startsWith(V)||te&&!Y.endsWith(te))continue}u.push({node:$,index:v+1,skipped:w,depth:q,statics:j,dynamics:N,optionals:O+1,extract:_,rawParams:C,parsedParams:T})}}if(!E&&y.dynamic&&A)for(let I=y.dynamic.length-1;I>=0;I--){const q=y.dynamic[I],{prefix:B,suffix:$}=q;if(B||$){const V=q.caseSensitive?A:P??=A.toLowerCase();if(B&&!V.startsWith(B)||$&&!V.endsWith($))continue}u.push({node:q,index:v+1,skipped:w,depth:S+1,statics:j,dynamics:N+1,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E&&y.staticInsensitive){const I=y.staticInsensitive.get(P??=A.toLowerCase());I&&u.push({node:I,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E&&y.static){const I=y.static.get(A);I&&u.push({node:I,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(y.pathless){const I=S+1;for(let q=y.pathless.length-1;q>=0;q--){const B=y.pathless[q];u.push({node:B,index:v,skipped:w,depth:I,statics:j,dynamics:N,optionals:O,extract:_,rawParams:C,parsedParams:T})}}}if(p&&d)return Kd(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function bx(e,t,n){try{const[r,i]=xI(e,t,n);n.rawParams=r,n.extract=i;const a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Kd(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===dl)>(e.node.kind===dl)||t.node.kind===dl==(e.node.kind===dl)&&t.depth>e.depth))):!0}function Vm(e){return Dj(e.filter(t=>t!==void 0).join("/"))}function Dj(e){return e.replace(/\/{2,}/g,"/")}function wI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function lo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function SI(e){return lo(wI(e))}function pg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function oH(e,t,n){return pg(e,n)===pg(t,n)}function lH({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&Of(u)==="";)u.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&u.push(w):u=[w]:w===".."?u.pop():w==="."||u.push(w)}}u.length>1&&(Of(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const y=u[m];if(!y)continue;d=Pj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const w=d[5],S=y.substring(0,d[1]),j=y.substring(d[4],w),N=y.substring(d[2],d[3]);v===1?f+=S||j?`${S}{$${N}}${j}`:`$${N}`:v===2?f+=S||j?`${S}{$}${j}`:"$":f+=`${S}{-$${N}}${j}`}f=Dj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function cH(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,a=>t.get(a)??a)}function xx(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=>UE(i,n)).join("/"):UE(r,n)}function BE({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let u=0,d,f="";for(;u<o;){const p=u;d=Pj(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),S=e.substring(d[4],m);if(!v){i=!0,(w||S)&&(f+="/"+w+S);continue}const j=xx("_splat",t,n);f+="/"+w+j+S;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const w=e.substring(p,d[1]),S=e.substring(d[4],m),j=xx(v,t,n)??"undefined";f+="/"+w+j+S;continue}if(y===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const S=e.substring(p,d[1]),j=e.substring(d[4],m),N=xx(v,t,n)??"";f+="/"+S+N+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function UE(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function hr(e){return!!e?.isNotFound}function uH(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var HS="tsr-scroll-restoration-v1_3",dH=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function fH(){const e=uH();if(!e)return null;const t=e.getItem(HS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=eo(r,n)||n;try{e.setItem(HS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var im=fH(),hH=e=>e.state.__TSR_key||e.href;function pH(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 mg=!1;function mH({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=o[u];mg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}mg=!1}function gH(e,t){if(!im||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!im))return;e.isScrollRestorationSetup=!0,mg=!1;const n=e.options.getScrollRestorationKey||hH;window.history.scrollRestoration="manual";const r=i=>{if(mg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=pH(i.target)}const o=n(e.state.location);im.set(u=>{const d=u[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",dH(r,100),!0),e.subscribe("onRendered",i=>{const a=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(mH({storageKey:HS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&im.set(o=>(o[a]||={},o)))})}function yH(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 vH(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 wx(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function bH(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=wx(i):Array.isArray(a)?a.push(wx(i)):n[r]=[a,wx(i)]}return n}var xH=SH(JSON.parse),wH=jH(JSON.stringify,JSON.parse);function SH(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=bH(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function jH(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=vH(i,r);return a?`?${a}`:""}}var wl="__root__";function Mj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _r(e){return e instanceof Response&&!!e.options}function kH(e){return{input:({url:t})=>{for(const n of e)t=KS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=jI(e[n],t);return t}}}function NH(e){const t=SI(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===i?o.pathname="/":u.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Vm(["/",t,o.pathname]),o)}}function KS(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function jI(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 nn=(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))(nn||{});function kI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:u};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===m&&w.sub===p)return;const S=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:p.deps=S,w!==void 0?w.nextSub=S:f.subs=S}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,w=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=S:m.subsTail=S,S!==void 0?S.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const S=(f=w).nextSub;S!==void 0&&(m={value:p,prev:m},p=S);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const w=f.dep,S=w.flags;if(p.flags&16)v=!0;else if((S&17)===17){if(e(w)){const j=w.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=w.deps,p=w,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,N=j.nextSub!==void 0;if(N?(f=m.value,m=m.prev):f=j,v){if(e(p)){N&&u(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const O=f.nextDep;if(O!==void 0){f=O;continue e}}return v}while(!0)}function u(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let Ij=0,Xo=0,yf=0;const Xa=[],{link:cCe,unlink:NI,propagate:uCe,checkDirty:CH,shallowPropagate:dCe}=kI({update(e){return e.depsTail!==void 0?EH(e):zH(e)},notify(e){let t=yf,n=t;do if(Xa[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(yf=t;n<--t;){const r=Xa[n];Xa[n++]=Xa[t],Xa[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,My(e)):RH.call(e)}});function _H(){return Ij}function AH(){++Ij}function OH(){--Ij||PH()}function EH(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,My(e)}}function zH(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function TH(e){const t=e.flags;if(t&16||t&32&&CH(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,My(e)}}else e.flags=2}function PH(){try{for(;Xo<yf;){const e=Xa[Xo];Xa[Xo++]=void 0,TH(e)}}finally{for(;Xo<yf;){const e=Xa[Xo];Xa[Xo++]=void 0,e.flags|=10}Xo=0,yf=0}}function RH(){this.depsTail=void 0,this.flags=0,My(this);const e=this.subs;e!==void 0&&NI(e)}function My(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=NI(n,e)}function Lj(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 GS=[];let Zm=0;const{link:FE,unlink:DH,propagate:MH,checkDirty:CI,shallowPropagate:qE}=kI({update(e){return e._update()},notify(e){GS[VS++]=e,e.flags&=~nn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=nn.Mutable|nn.Dirty,gg(e))}});let am=0,VS=0,ca;function gg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=DH(n,e)}function _I(){if(!(_H()>0)){for(;am<VS;){const e=GS[am];GS[am++]=void 0,e.notify()}am=0,VS=0}}function AI(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?nn.None:nn.Mutable,get(){return ca!==void 0&&FE(i,ca,Zm),i._snapshot},subscribe(a){const o=Lj(a),u={current:!1},d=IH(()=>{i.get(),u.current?o.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=ca,u=Object.is;if(n)ca=i,++Zm,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=nn.Mutable|nn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,f)?(i._snapshot=f,!0):!1}finally{ca=o,n&&(i.flags&=~nn.RecursedCheck),gg(i)}}};return n?(i.flags=nn.Mutable|nn.Dirty,i.get=function(){const a=i.flags;if(a&nn.Dirty||a&nn.Pending&&CI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&qE(o)}}else a&nn.Pending&&(i.flags=a&~nn.Pending);return ca!==void 0&&FE(i,ca,Zm),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(MH(o),qE(o),_I())}},i}function IH(e){const t=()=>{const r=ca;ca=n,++Zm,n.depsTail=void 0,n.flags=nn.Watching|nn.RecursedCheck;try{return e()}finally{ca=r,n.flags&=~nn.RecursedCheck,gg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:nn.Watching|nn.RecursedCheck,notify(){const r=this.flags;r&nn.Dirty||r&nn.Pending&&CI(this.deps,this)?t():this.flags=nn.Watching},stop(){this.flags=nn.None,this.depsTail=void 0,gg(this)}};return t(),n}class LH{constructor(t){this.atom=AI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Lj(t))}}class $H{constructor(t){this.atom=AI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Lj(t))}}function BH(e){return typeof e=="function"?new $H(e):new LH(e)}function UH(e){try{AH(),e()}finally{OH(),_I()}}function vf(e){let t;return UH(()=>{t=e()}),t}var ZS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Iy=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Sl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const u=e.router.getMatch(o.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},HE=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const u=e.matches[o];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return o}return n?a:i},to=(e,t,n)=>{if(!(!_r(n)&&!hr(n)))throw _r(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:_r(n)?"redirected":r.status==="pending"?"success":r.status,context:Sl(e,t.index),isFetching:!1,error:n})),hr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_r(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},OI=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},KE=(e,t,n)=>{const r=Sl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Gd=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,to(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(u){n=u,to(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!_r(n)&&!hr(n)&&(e.serialError??=n)},EI=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Iy(e,t)&&(n.options.loader||n.options.beforeLoad||TI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{ZS(e)},i);r._nonReactive.pendingTimeout=a}},FH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;EI(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&to(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},qH=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=vu(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:u}=i;o&&Gd(e,n,o,"PARSE_PARAMS"),u&&Gd(e,n,u,"VALIDATE_SEARCH"),EI(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){vf(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=vu();const y={...Sl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:S}=i,j=Iy(e,t),N={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=C=>{if(C===void 0){vf(()=>{p(),m()});return}(_r(C)||hr(C))&&(p(),Gd(e,n,C,"BEFORE_LOAD")),vf(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:C})),m()})};let _;try{if(_=r.options.beforeLoad(N),Ef(_))return p(),_.catch(C=>{Gd(e,n,C,"BEFORE_LOAD")}).then(O)}catch(C){p(),Gd(e,n,C,"BEFORE_LOAD")}O(_)},HH=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),o=()=>qH(e,n,t,i),u=()=>{if(OI(e,n))return;const d=FH(e,n,i);return Ef(d)?d.then(o):o()};return a()},KH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:o,styles:a?.styles}))},zI=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=Sl(e,r),m=Iy(e,n);return{params:o,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},GE=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(q9??e.router.isServer)||a.ssr===!0)&&zf(i);const o=i.options.loader,u=typeof o=="function"?o:o?.handler,d=u?.(zI(e,t,n,r,i)),f=!!u&&Ef(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),u){const m=f?await d:d;to(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Sl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let u=o;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Sl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,hr(o)&&await i.options.notFoundComponent?.preload?.(),to(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){u=f,to(e,e.router.getMatch(n),f)}!_r(u)&&!hr(u)&&await zf(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Sl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),to(e,o,a)}},GH=async(e,t,n)=>{async function r(v,w,S,j,N){const O=Date.now()-w.updatedAt,_=v?N.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:N.options.staleTime??e.router.options.defaultStaleTime??0,C=N.options.shouldReload,T=typeof C=="function"?C(zI(e,t,i,n,N)):C,{status:E,invalid:A}=j,P=O>_&&(!!e.forceStaleReload||j.cause==="enter"||S!==void 0&&S!==j.id);o=E==="success"&&(A||(T??P)),v&&N.options.preload===!1||(o&&!e.sync&&p?(u=!0,(async()=>{try{await GE(e,t,i,n,N);const I=e.router.getMatch(i);I._nonReactive.loaderPromise?.resolve(),I._nonReactive.loadPromise?.resolve(),I._nonReactive.loaderPromise=void 0,I._nonReactive.loadPromise=void 0}catch(I){_r(I)&&await e.router.navigate(I.options)}})()):E!=="success"||o?await GE(e,t,i,n,N):KE(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!1,u=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(OI(e,i)){if(!e.router.getMatch(i))return e.matches[n];KE(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,S=Iy(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),N=j._nonReactive.error||j.error;N&&to(e,j,N),j.status==="pending"&&await r(S,v,w,j,d)}else{const j=S&&!e.router.state.matches.some(O=>O.id===i),N=e.router.getMatch(i);N._nonReactive.loaderPromise=vu(),j!==N.preload&&e.updateMatch(i,O=>({...O,preload:j})),await r(S,v,w,N,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=u?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function VE(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&ZS(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=HH(t,y);Ef(v)&&await v}catch(v){if(_r(v))throw v;if(hr(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?HE(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let y=0;y<o;y++)n.push(GH(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(_r(w))throw w;hr(w)?u??=w:d??=w}if(d!==void 0)throw d}const f=u??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const y=HE(t,f);mo(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,N=>({...N,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await zf(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await zf(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],S=t.router.looseRoutesById[w];try{const j=KH(t,v,S);if(j){const N=await j;t.updateMatch(v,O=>({...O,...N}))}}catch(j){console.error(`Error executing head for route ${w}:`,j)}}const m=ZS(t);if(Ef(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function ZE(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function zf(e,t=Ym){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Ym?(()=>{if(e._componentsPromise===void 0){const r=ZE(e,Ym);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ZE(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function TI(e){for(const t of Ym)if(e.options[t]?.preload)return!0;return!1}var Ym=["component","errorComponent","pendingComponent","notFoundComponent"],co="__TSR_index",YE="popstate",WE="beforeunload";function VH(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=yg(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,u,d)=>{const f=t.state[co];u=QE(f+1,u),a({task:()=>{e.pushState(o,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:u})},replace:(o,u,d)=>{const f=t.state[co];u=QE(f,u),a({task:()=>{e.replaceState(o,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:u})},go:(o,u)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[co]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function QE(e,t){t||(t={});const n=$j();return{...t,key:n,__TSR_key:n,[co]:e}}function ZH(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=P=>i=P,u=(P=>P),d=(()=>yg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=$j();t.history.replaceState({[co]:0,key:P,__TSR_key:P},"")}let f=d(),p,m=!1,y=!1,v=!1,w=!1;const S=()=>f;let j,N;const O=()=>{j&&(A._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),A._ignoreSubscribers=!1,j=void 0,N=void 0,p=void 0)},_=(P,I,q)=>{const B=u(I);N||(p=f),f=yg(I,q),j={href:B,state:q,isPush:j?.isPush||P==="push"},N||(N=Promise.resolve().then(()=>O()))},C=P=>{f=d(),A.notify({type:P})},T=async()=>{if(y){y=!1;return}const P=d(),I=P.state[co]-f.state[co],q=I===1,B=I===-1,$=!q&&!B||m;m=!1;const V=$?"GO":B?"BACK":"FORWARD",te=$?{type:"GO",index:I}:{type:B?"BACK":"FORWARD"};if(v)v=!1;else{const Y=a();if(typeof document<"u"&&Y.length){for(const H of Y)if(await H.blockerFn({currentLocation:f,nextLocation:P,action:V})){y=!0,t.history.go(1),A.notify(te);return}}}f=d(),A.notify(te)},E=P=>{if(w){w=!1;return}let I=!1;const q=a();if(typeof document<"u"&&q.length)for(const B of q){const $=B.enableBeforeUnload??!0;if($===!0){I=!0;break}if(typeof $=="function"&&$()===!0){I=!0;break}}if(I)return P.preventDefault(),P.returnValue=""},A=VH({getLocation:S,getLength:()=>t.history.length,pushState:(P,I)=>_("push",P,I),replaceState:(P,I)=>_("replace",P,I),back:P=>(P&&(v=!0),w=!0,t.history.back()),forward:P=>{P&&(v=!0),w=!0,t.history.forward()},go:P=>{m=!0,t.history.go(P)},createHref:P=>u(P),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(WE,E,{capture:!0}),t.removeEventListener(YE,T)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(WE,E,{capture:!0}),t.addEventListener(YE,T),t.history.pushState=function(...P){const I=n.apply(t.history,P);return A._ignoreSubscribers||C("PUSH"),I},t.history.replaceState=function(...P){const I=r.apply(t.history,P);return A._ignoreSubscribers||C("REPLACE"),I},A}function YH(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function yg(e,t){const n=YH(e),r=n.indexOf("#"),i=n.indexOf("?"),a=$j();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||{[co]:0,key:a,__TSR_key:a}}}function $j(){return(Math.random()+1).toString(36).substring(7)}function jl(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 WH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var QH=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,a=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=cH(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ZH()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=hg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=BH(JH(this.latestLocation)),gH(this));let o=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=SI(u);p&&p!=="/"&&f.push(NH({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:kH(f),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=rH(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&X9(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:u,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const j=this.options.parseSearch(d),N=this.options.stringifySearch(j);return{href:u+N+f,publicHref:p,pathname:Hd(u).path,external:!1,searchStr:N,search:Qo(n?.search,j),hash:Hd(f.slice(1)).path,state:ul(n?.state,m)}}const y=new URL(p,this.origin),v=KS(this.rewrite,y),w=this.options.parseSearch(v.search),S=this.options.stringifySearch(w);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Hd(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:S,search:Qo(n?.search,w),hash:Hd(v.hash.slice(1)).path,state:ul(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const u=r(a);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>lH({base:t,to:Dj(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=>eK({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(u,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,eo(i.params,p)),v=this.getMatchedRoutes(m);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const I of w){const q=I.options.params?.stringify??I.options.stringifyParams;if(q)try{Object.assign(y,q(y))}catch{}}const S=t.leaveParams?m:Hd(BE({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const I={};w.forEach(q=>{if(q.options.validateSearch)try{Object.assign(I,Wm(q.options.validateSearch,{...I,...j}))}catch{}}),j=I}j=tK({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=Qo(f,j);const N=this.options.stringifySearch(j),O=i.hash===!0?a.hash:i.hash?eo(i.hash,a.hash):void 0,_=O?`#${O}`:"";let C=i.state===!0?a.state:i.state?eo(i.state,a.state):{};C=ul(a.state,C);const T=`${S}${N}${_}`;let E,A,P=!1;if(this.rewrite){const I=new URL(T,this.origin),q=jI(this.rewrite,I);E=I.href.replace(I.origin,""),q.origin!==this.origin?(A=q.href,P=!0):A=q.pathname+q.search+q.hash}else E=Y9(T),A=E;return{publicHref:A,href:E,pathname:S,search:j,searchStr:N,state:C,hash:O??"",external:P,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=J9(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,eo(m,d));a={from:t.from,...y,params:v},u=n(a)}}}return u&&(o.maskedLocation=u),o};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=xl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=lo(this.latestLocation.href)===lo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=vu(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=r;u&&(f={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:o,...u}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=yg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);u.to=KS(this.rewrite,y).pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const u=!o&&i?i:r;if(fg(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...jl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...jl({resolvedLocation:f,location:d})}),await VE({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];vf(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return p=S.filter(N=>!j.some(O=>O.id===N.id)),m=S.filter(N=>!j.some(O=>O.routeId===N.routeId)),y=j.filter(N=>!S.some(O=>O.routeId===N.routeId)),v=j.filter(N=>S.some(O=>O.routeId===N.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(N=>N.status!=="error"&&N.status!=="notFound"&&N.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(d){_r(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):hr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(u=>u.status==="error")&&(o=500),o!==void 0&&this.__store.setState(u=>({...u,statusCode:o}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(jl({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:WH(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&fg(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=zf,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);vf(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,o]}))})});try{return r=await VE({router:this,matches:r,location:n,preload:!0,updateMatch:(o,u)=>{i.has(o)?r=r.map(d=>d.id===o?u(d):d):this.updateMatch(o,u)}}),r}catch(o){if(_r(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});hr(o)||console.error(o);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=eH(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!xl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?xl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??wH,parseSearch:e.parseSearch??xH,protocolAllowlist:e.protocolAllowlist??Z9}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,u=!1;(r?r.path!=="/"&&i["**"]:lo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:u=!0);const d=u?rK(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let w,S,j;{const V=v?.search??e.search,te=v?._strictSearch??void 0;try{const Y=Wm(y.options.validateSearch,{...V})??void 0;w={...V,...Y},S={...te,...Y},j=void 0}catch(Y){let H=Y;if(Y instanceof vg||(H=new vg(Y.message,{cause:Y})),t?.throwOnError)throw H;w=V,S={},j=H}}const N=y.options.loaderDeps?.({search:w})??"",O=N?JSON.stringify(N):"",{interpolatedPath:_,usedParams:C}=BE({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=y.id+_+O,E=this.getMatch(T),A=p.get(y.id),P=E?._strictParams??C;let I;if(!E)try{XE(y,C,a,P)}catch(V){if(hr(V)||_r(V)?I=V:I=new XH(V.message,{cause:V}),t?.throwOnError)throw I}Object.assign(i,P);const q=A?"stay":"enter";let B;if(E)B={...E,cause:q,params:A?.params??i,_strictParams:P,search:Qo(A?A.search:E.search,w),_strictSearch:S};else{const V=y.options.loader||y.options.beforeLoad||y.lazyFn||TI(y)?"pending":"success";B={id:T,ssr:y.options.ssr,index:m,routeId:y.id,params:A?.params??i,_strictParams:P,pathname:_,updatedAt:Date.now(),search:A?Qo(A.search,w):w,_strictSearch:S,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:vu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:A?ul(A.loaderDeps,N):N,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(B.globalNotFound=d===y.id),B.searchError=j;const $=this.getParentContext(v);B.context={...$,...B.__routeContext,...B.__beforeLoadContext},f[m]=B}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),S=p.get(y.routeId);if(y.params=S?Qo(S.params,i):i,!w){const j=f[m-1],N=this.getParentContext(j);if(v.options.context){const O={deps:y.loaderDeps,params:y.params,context:N??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(O)??void 0}y.context={...N,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Of(t),a={...e.search};for(const f of t)try{Object.assign(a,Wm(f.options.validateSearch,a))}catch{}const o=Of(this.state.matches),u=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{XE(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},vg=class extends Error{},XH=class extends Error{};function JH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Wm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new vg("Async validation not supported");if(n.issues)throw new vg(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 eK({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=lo(e);let a,o;const u=tH(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),o=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function tK({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return nK(n)(e,t,r??!1)}function nK(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:u})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));const f=u(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:o,next:u})=>{const d=u(o);if(!t._includeValidateSearch)return d;try{return{...d,...Wm(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:eo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const u=o[i];return u({search:a,next:f=>r(i+1,f,o)})};return function(a,o,u){return t.dest=o,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function rK(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 wl}function XE(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var iK="Error preloading route! ☝️",PI=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=wl:this.parentRoute||mo(!1);let i=r?wl:n?.path;i&&i!=="/"&&(i=wI(i));const a=n?.id||i;let o=r?wl:Vm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=Vm(["/",o]));const u=o==="__root__"?"/":Vm([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=u,this._to=lo(u)},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=>Mj({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.")}},aK=class extends PI{constructor(e){super(e)}};function Bj(e){const t=e.errorComponent??Uj;return c.jsx(sK,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var sK=class extends b.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 Uj({error:e}){const[t,n]=b.useState(!1);return c.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[c.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),c.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"})]}),c.jsx("div",{style:{height:".25rem"}}),t?c.jsx("div",{children:c.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?c.jsx("code",{children:e.message}):null})}):null]})}function oK({children:e,fallback:t=null}){return RI()?c.jsx(qi.Fragment,{children:e}):c.jsx(qi.Fragment,{children:t})}function RI(){return qi.useSyncExternalStore(lK,()=>!0,()=>!1)}function lK(){return()=>{}}var DI=b.createContext(null);function Oi(e){const t=b.useContext(DI);return e?.warn,t}var Sx={exports:{}},jx={},kx={exports:{}},Nx={};var JE;function cK(){if(JE)return Nx;JE=1;var e=Pu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(m,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),S=w[0].inst,j=w[1];return a(function(){S.value=v,S.getSnapshot=y,d(S)&&j({inst:S})},[m,v,y]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Nx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Nx}var e2;function uK(){return e2||(e2=1,kx.exports=cK()),kx.exports}var t2;function dK(){if(t2)return jx;t2=1;var e=Pu(),t=uK();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return jx.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var w=a(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function N(E){if(!O){if(O=!0,_=E,E=y(E),v!==void 0&&S.hasValue){var A=S.value;if(v(A,E))return C=A}return C=E}if(A=C,r(_,E))return A;var P=y(E);return v!==void 0&&v(A,P)?(_=E,A):(_=E,C=P)}var O=!1,_,C,T=m===void 0?null:m;return[function(){return N(p())},T===null?void 0:function(){return N(T())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return o(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},jx}var n2;function fK(){return n2||(n2=1,Sx.exports=dK()),Sx.exports}var MI=fK();function hK(e,t){return e===t}function pK(e,t,n=hK){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(o);return u},[e]),i=b.useCallback(()=>e?.get(),[e]);return MI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function zr(e){const t=Oi({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return pK(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ul(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Ly=b.createContext(void 0),mK=b.createContext(void 0);function wo(e){const t=b.useContext(e.from?mK:Ly);return zr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(mo(!((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 Fj(e){return wo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function qj(e){const{select:t,...n}=e;return wo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function $y(e){return wo({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 By(e){return wo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function So(e){const t=Oi();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Hj(e){return wo({...e,select:t=>e.select?e.select(t.context):t.context})}var ql=nI();const gK=ka(ql);function yK(e,t){const n=Oi(),r=F9(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:S,target:j,disabled:N,style:O,className:_,onClick:C,onBlur:T,onFocus:E,onMouseEnter:A,onMouseLeave:P,onTouchStart:I,ignoreBlocker:q,params:B,search:$,hash:V,state:te,mask:Y,reloadDocument:H,unsafeRelative:J,from:pe,_fromLocation:Se,...R}=e,U=RI(),F=zr({select:ct=>{const G=ct.matches[ct.matches.length-1];return{search:G?.search,hash:ct.location.hash,path:G?.pathname}},structuralSharing:!0}),D=e.from,Q=b.useMemo(()=>({...e,from:D}),[n,F,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=b.useMemo(()=>n.buildLocation({...Q}),[n,Q]),ae=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,he=se.maskedLocation?se.maskedLocation.external:se.external,Ne=b.useMemo(()=>jK(ae,he,n.history,N),[N,he,ae,n.history]),ne=b.useMemo(()=>{if(Ne?.external)return fg(Ne.href,n.protocolAllowlist)?void 0:Ne.href;if(!kK(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),fg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Ne,n.protocolAllowlist]),de=zr({select:ct=>{if(ne)return!1;if(o?.exact){if(!oH(ct.location.pathname,se.pathname,n.basepath))return!1}else{const G=pg(ct.location.pathname,n.basepath),le=pg(se.pathname,n.basepath);if(!(G.startsWith(le)&&(G.length===le.length||G[le.length]==="/")))return!1}return(o?.includeSearch??!0)&&!xl(ct.location.search,se.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&ct.location.hash===se.hash:!0}}),Ee=de?eo(i,{})??vK:Cx,X=de?Cx:eo(a,{})??Cx,Fe=[_,Ee.className,X.className].filter(Boolean).join(" "),De=(O||Ee.style||X.style)&&{...O,...Ee.style,...X.style},[et,tt]=b.useState(!1),Ut=b.useRef(!1),Xt=e.reloadDocument||ne?!1:d??n.options.defaultPreload,on=f??n.options.defaultPreloadDelay??0,we=b.useCallback(()=>{n.preloadRoute({...Q,_builtLocation:se}).catch(ct=>{console.warn(ct),console.warn(iK)})},[n,Q,se]);U9(r,b.useCallback(ct=>{ct?.isIntersecting&&we()},[we]),SK,{disabled:!!N||Xt!=="viewport"}),b.useEffect(()=>{Ut.current||!N&&Xt==="render"&&(we(),Ut.current=!0)},[N,we,Xt]);const Ze=ct=>{const G=ct.currentTarget.getAttribute("target"),le=j!==void 0?j:G;if(!N&&!NK(ct)&&!ct.defaultPrevented&&(!le||le==="_self")&&ct.button===0){ct.preventDefault(),ql.flushSync(()=>{tt(!0)});const je=n.subscribe("onResolved",()=>{je(),tt(!1)});n.navigate({...Q,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:q})}};if(ne)return{...R,ref:r,href:ne,...S&&{children:S},...j&&{target:j},...N&&{disabled:N},...O&&{style:O},..._&&{className:_},...C&&{onClick:C},...T&&{onBlur:T},...E&&{onFocus:E},...A&&{onMouseEnter:A},...P&&{onMouseLeave:P},...I&&{onTouchStart:I}};const bt=ct=>{if(N||Xt!=="intent")return;if(!on){we();return}const G=ct.currentTarget;if(Vd.has(G))return;const le=setTimeout(()=>{Vd.delete(G),we()},on);Vd.set(G,le)},Jt=ct=>{N||Xt!=="intent"||we()},lt=ct=>{if(N||!Xt||!on)return;const G=ct.currentTarget,le=Vd.get(G);le&&(clearTimeout(le),Vd.delete(G))};return{...R,...Ee,...X,href:Ne?.href,ref:r,onClick:Dc([C,Ze]),onBlur:Dc([T,lt]),onFocus:Dc([E,bt]),onMouseEnter:Dc([A,bt]),onMouseLeave:Dc([P,lt]),onTouchStart:Dc([I,Jt]),disabled:!!N,target:j,...De&&{style:De},...Fe&&{className:Fe},...N&&bK,...de&&xK,...U&&et&&wK}}var Cx={},vK={className:"active"},bK={role:"link","aria-disabled":!0},xK={"data-status":"active","aria-current":"page"},wK={"data-transitioning":"transitioning"},Vd=new WeakMap,SK={rootMargin:"100px"},Dc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function jK(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function kK(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var qt=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=yK(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return b.createElement("a",d,o)}return b.createElement(n,a,o)});function NK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var CK=class extends PI{constructor(e){super(e),this.useMatch=t=>wo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Hj({...t,from:this.id}),this.useSearch=t=>By({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>qj({...t,from:this.id}),this.useLoaderData=t=>Fj({...t,from:this.id}),this.useNavigate=()=>So({from:this.fullPath}),this.Link=qi.forwardRef((t,n)=>c.jsx(qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Rr(e){return new CK(e)}function _K(){return e=>OK(e)}var AK=class extends aK{constructor(e){super(e),this.useMatch=t=>wo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Hj({...t,from:this.id}),this.useSearch=t=>By({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>qj({...t,from:this.id}),this.useLoaderData=t=>Fj({...t,from:this.id}),this.useNavigate=()=>So({from:this.fullPath}),this.Link=qi.forwardRef((t,n)=>c.jsx(qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function OK(e){return new AK(e)}function r2(e){return typeof e=="object"?new i2(e,{silent:!0}).createRoute(e):new i2(e,{silent:!0}).createRoute}var i2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=Rr(n);return r.isRoot=!1,r},this.silent=t?.silent}},a2=class{constructor(e){this.useMatch=t=>wo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Hj({...t,from:this.options.id}),this.useSearch=t=>By({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>qj({...t,from:this.options.id}),this.useLoaderData=t=>Fj({...t,from:this.options.id}),this.useNavigate=()=>So({from:Oi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function s2(e){return typeof e=="object"?new a2(e):t=>new a2({id:e,...t})}function EK(e){const t=zr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return c.jsx(Bj,{getResetKey:()=>t,onCatch:(n,r)=>{if(hr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(hr(n))return e.fallback?.(n);throw n},children:e.children})}function zK(){return c.jsx("p",{children:"Not Found"})}function Xc(e){return c.jsx(c.Fragment,{children:e.children})}function II(e,t,n){return t.options.notFoundComponent?c.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?c.jsx(e.options.defaultNotFoundComponent,{...n}):c.jsx(zK,{})}function TK(){return Oi().isScrollRestoring,null}var LI=b.memo(function({matchId:t}){const n=Oi(),r=zr({select:w=>{const S=w.matches.findIndex(N=>N.id===t),j=w.matches[S];return mo(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?c.jsx(a,{}):null,u=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?b.Suspense:Xc,y=u?Bj:Xc,v=f?EK:Xc;return c.jsxs(i.isRoot?i.options.shellComponent??Xc:Xc,{children:[c.jsx(Ly.Provider,{value:t,children:c.jsx(m,{fallback:o,children:c.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||Uj,onCatch:(w,S)=>{if(hr(w))throw w;d?.(w,S)},children:c.jsx(v,{fallback:w=>{if(!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return b.createElement(f,w)},children:p||r._displayPending?c.jsx(oK,{fallback:o,children:c.jsx(o2,{matchId:t})}):c.jsx(o2,{matchId:t})})})})}),r.parentRouteId===wl&&n.options.scrollRestoration?c.jsxs(c.Fragment,{children:[c.jsx(PK,{}),c.jsx(TK,{})]}):null]})});function PK(){const e=Oi(),t=b.useRef(void 0);return c.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...jl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var o2=b.memo(function({matchId:t}){const n=Oi(),{match:r,key:i,routeId:a}=zr({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],u=b.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?c.jsx(d,{},i):c.jsx(Kj,{})},[i,o.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=vu();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return mo(hr(r.error)),II(n,o,r.error);if(r.status==="redirected")throw mo(_r(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),Kj=b.memo(function(){const t=Oi(),n=b.useContext(Ly),r=zr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=zr({select:f=>{const p=f.matches.find(m=>m.id===n);return mo(p),p.globalNotFound}}),o=zr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?c.jsx(t.options.defaultPendingComponent,{}):null;if(a)return II(t,i,void 0);if(!o)return null;const d=c.jsx(LI,{matchId:o});return r===wl?c.jsx(b.Suspense,{fallback:u,children:d}):d});function RK(){const e=Oi(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:a}=zr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=gx(a),u=a||n||i,d=gx(u),f=a||i,p=gx(f);return e.startTransition=m=>{r(!0),b.startTransition(()=>{m(),r(!1)})},b.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return lo(e.latestLocation.publicHref)!==lo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),rm(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),rm(()=>{o&&!a&&e.emit({type:"onLoad",...jl(e.state)})},[o,e,a]),rm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...jl(e.state)})},[f,p,e]),rm(()=>{if(d&&!u){const m=jl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&yH(e)}},[u,d,e]),null}function DK(){const e=Oi(),t=e.routesById[wl].options.pendingComponent??e.options.defaultPendingComponent,n=t?c.jsx(t,{}):null,r=c.jsxs(typeof document<"u"&&e.ssr?Xc:b.Suspense,{fallback:n,children:[c.jsx(RK,{}),c.jsx(MK,{})]});return e.options.InnerWrap?c.jsx(e.options.InnerWrap,{children:r}):r}function MK(){const e=Oi(),t=zr({select:i=>i.matches[0]?.id}),n=zr({select:i=>i.loadedAt}),r=t?c.jsx(LI,{matchId:t}):null;return c.jsx(Ly.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:c.jsx(Bj,{getResetKey:()=>n,errorComponent:Uj,onCatch:void 0,children:r})})}var IK=e=>new LK(e),LK=class extends QH{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=r2,globalThis.createLazyFileRoute=s2):typeof window<"u"&&(window.createFileRoute=r2,window.createLazyFileRoute=s2);function $K({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=c.jsx(DI.Provider,{value:e,children:t});return e.options.Wrap?c.jsx(e.options.Wrap,{children:r}):r}function BK({router:e,...t}){return c.jsx($K,{router:e,...t,children:c.jsx(DK,{})})}function $I(e){return zr({select:t=>t.location})}class Ni extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function UK(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const FK=UK();function qK(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function HK(e){return`${qK()}${e}`}function KK(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 GK(){return""}function l2(){return!!GK()}async function Oe(e,t){const n=t?.body!=null,r=await fetch(`${FK}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{...n?{"Content-Type":"application/json"}:{},...t?.headers}});if(!r.ok){const i=await r.text();let a=`API ${r.status}: ${r.statusText}`,o;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,o=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new Ni(a,r.status,o)}if(r.status!==204)return r.json()}function Gj(){return Oe("/projects")}function BI(e){return Oe(`/projects/${encodeURIComponent(e)}`)}function UI(){return Oe("/runs")}function VK(e){return Oe(`/projects/${encodeURIComponent(e)}/runs`)}function El(e){return Oe(`/runs/${encodeURIComponent(e)}`)}function ZK(e){return Oe(`/projects/${encodeURIComponent(e)}/keywords`)}function FI(e){return Oe(`/projects/${encodeURIComponent(e)}/competitors`)}function qI(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 Uy(e,t){return Oe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function YK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function WK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function HI(e,t){return Oe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function c2(e,t){const n=await BI(e);return Uy(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 QK(e,t){const n=await BI(e);return Uy(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 XK(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 JK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function e7(e,t){await Oe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function t7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function n7(e){await Oe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function r7(e){return Oe(`/projects/${encodeURIComponent(e)}/export`)}function Vj(){return Oe("/settings")}function i7(){return Oe("/session")}function a7(e){return Oe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function s7(e){return Oe("/session",{method:"POST",body:JSON.stringify({password:e})})}function o7(e,t){return Oe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function l7(e){return Oe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function c7(e){try{return await Oe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Ni&&t.statusCode===404)return null;throw t}}function u2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function u7(e){await Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function d7(e){return Oe(`/projects/${encodeURIComponent(e)}/notifications`)}function f7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function h7(e,t){await Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function p7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function m7(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function g7(e){return Oe("/apply",{method:"POST",body:JSON.stringify(e)})}function y7(e){return Oe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function KI(e){return Oe(`/projects/${encodeURIComponent(e)}/google/connections`)}function v7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function b7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function x7(e){return Oe(`/projects/${encodeURIComponent(e)}/google/properties`)}function w7(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function S7(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function GI(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function j7(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 k7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function N7(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 C7(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Zj(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function _7(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function A7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function O7(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function E7(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function d2(){return Oe("/cdp/status")}function z7(e,t){return Oe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function f2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function VI(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/status`)}function T7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function P7(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function R7(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function D7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Yj(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function ZI(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function YI(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function h2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function M7(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function I7(e){return Oe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function L7(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function $7(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function B7(e,t){const n=t?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function p2(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/status`)}function m2(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 WI(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function U7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function g2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function y2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function v2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function F7(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function q7(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Oe(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function H7(e,t){const n=HK(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:KK(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,lastHeartbeatAt:u}}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}}}function K7(){return Oe("/backlinks/status")}function G7(){return Oe("/backlinks/install",{method:"POST"})}function QI(){return Oe("/backlinks/syncs/latest")}function V7(){return Oe("/backlinks/syncs")}function Z7(e){return Oe("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function Y7(){return Oe("/backlinks/releases")}function W7(){return Oe("/backlinks/latest-release")}function Q7(e){return Oe(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function X7(e,t){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/summary`)}function J7(e,t={}){const n=new URLSearchParams;t.limit!==void 0&&n.set("limit",String(t.limit)),t.offset!==void 0&&n.set("offset",String(t.offset)),t.release&&n.set("release",t.release);const r=n.toString();return Oe(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function eG(e){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function tG(e,t){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const nG=6e3,rG=5,iG=180;let rr=[],aG=0;const YS=new Set,WS=new Map,QS=new Map;function bg(){const e=[...rr];for(const t of YS)t(e)}function Wj(e){const t=WS.get(e);t&&(clearTimeout(t),WS.delete(e));const n=QS.get(e);n&&(clearTimeout(n),QS.delete(e))}function XI(e){Wj(e);const t=rr.length;rr=rr.filter(n=>n.id!==e),rr.length!==t&&bg()}function b2(e){Wj(e.id),WS.set(e.id,setTimeout(()=>{XS(e.id)},e.durationMs))}function sG(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function ht(e,t="negative",n=nG){const r=sG(e,t,n),i={id:String(++aG),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const a=rr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return rr=rr.map(u=>u.id===a.id?o:u),bg(),b2(o),a.id}}return rr.length>=rG&&XI(rr[0].id),rr=[...rr,i],bg(),b2(i),i.id}function XS(e){const t=rr.find(n=>n.id===e);!t||t.state==="closing"||(Wj(e),rr=rr.map(n=>n.id===e?{...n,state:"closing"}:n),bg(),QS.set(e,setTimeout(()=>{XI(e)},iG)))}function oG(e){return YS.add(e),()=>{YS.delete(e)}}function x2(){return rr}function lG(){return new R9({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new uI({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||ht({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const cG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uG=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),w2=e=>{const t=uG(e);return t.charAt(0).toUpperCase()+t.slice(1)},JI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),dG=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var fG={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 hG=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...u},d)=>b.createElement("svg",{ref:d,...fG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:JI("lucide",i),...!a&&!dG(u)&&{"aria-hidden":"true"},...u},[...o.map(([f,p])=>b.createElement(f,p)),...Array.isArray(a)?a:[a]]));const At=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(hG,{ref:a,iconNode:t,className:JI(`lucide-${cG(w2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=w2(e),n};const pG=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],mG=At("arrow-up",pG);const gG=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eL=At("check",gG);const yG=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vG=At("chevron-down",yG);const bG=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oh=At("chevron-right",bG);const xG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],wG=At("circle-alert",xG);const SG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tL=At("circle-check",SG);const jG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nL=At("circle-question-mark",jG);const kG=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],NG=At("copy",kG);const CG=[["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"}]],Qj=At("download",CG);const _G=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],AG=At("external-link",_G);const OG=[["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"}]],EG=At("github",OG);const zG=[["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"}]],TG=At("globe",zG);const PG=[["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"}]],RG=At("layout-dashboard",PG);const DG=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],rL=At("link-2",DG);const MG=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],iL=At("loader-circle",MG);const IG=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],LG=At("maximize-2",IG);const $G=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],BG=At("menu",$G);const UG=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],FG=At("minimize-2",UG);const qG=[["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"}]],xg=At("play",qG);const HG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],S2=At("plus",HG);const KG=[["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"}]],j2=At("refresh-cw",KG);const GG=[["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"}]],VG=At("rocket",GG);const ZG=[["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"}]],aL=At("rotate-ccw",ZG);const YG=[["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"}]],WG=At("settings",YG);const QG=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],k2=At("sparkles",QG);const XG=[["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"}]],sL=At("trash-2",XG);const JG=[["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"}]],wg=At("triangle-alert",JG);const eV=[["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"}]],tV=At("unplug",eV);const nV=[["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"}]],rV=At("upload",nV);const iV=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],aV=At("wrench",iV);const sV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lh=At("x",sV);function me(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in u||(u[y]=f[y].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(u){var d;const f=n?.Parent?new a:this;r(f,u),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class lu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class oL extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const lL={};function go(e){return lL}function cL(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 JS(e,t){return typeof t=="bigint"?t.toString():t}function Fy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Xj(e){return e==null}function Jj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function oV(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return o%u/10**a}const N2=Symbol("evaluating");function Ot(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==N2)return r===void 0&&(r=N2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Hl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function jo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function C2(e){return JSON.stringify(e)}function lV(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const uL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const cV=Fy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function bu(e){if(Tf(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Tf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function dL(e){return bu(e)?{...e}:Array.isArray(e)?[...e]:e}const uV=new Set(["string","number","symbol"]);function xu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ko(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function He(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 dV(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const fV={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 hV(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=jo(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=n.shape[u])}return Hl(this,"shape",o),o},checks:[]});return ko(e,a)}function pV(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=jo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return Hl(this,"shape",o),o},checks:[]});return ko(e,a)}function mV(e,t){if(!bu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=jo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Hl(this,"shape",a),a}});return ko(e,i)}function gV(e,t){if(!bu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=jo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Hl(this,"shape",r),r}});return ko(e,n)}function yV(e,t){const n=jo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Hl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ko(e,n)}function vV(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=jo(t._zod.def,{get shape(){const u=t._zod.def.shape,d={...u};if(n)for(const f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(const f in u)d[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return Hl(this,"shape",d),d},checks:[]});return ko(t,o)}function bV(e,t,n){const r=jo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return Hl(this,"shape",a),a}});return ko(t,r)}function eu(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 tu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function sm(e){return typeof e=="string"?e:e?.message}function yo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=sm(e.inst?._zod.def?.error?.(e))??sm(t?.error?.(e))??sm(n.customError?.(e))??sm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ek(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const fL=(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,JS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hL=me("$ZodError",fL),pL=me("$ZodError",fL,{Parent:Error});function xV(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 wV(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return r(e),n}const tk=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new lu;if(o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>yo(d,a,go())));throw uL(u,i?.callee),u}return o.value},nk=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>yo(d,a,go())));throw uL(u,i?.callee),u}return o.value},qy=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new lu;return a.issues.length?{success:!1,error:new(e??hL)(a.issues.map(o=>yo(o,i,go())))}:{success:!0,data:a.value}},SV=qy(pL),Hy=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>yo(o,i,go())))}:{success:!0,data:a.value}},jV=Hy(pL),kV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tk(e)(t,n,i)},NV=e=>(t,n,r)=>tk(e)(t,n,r),CV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return nk(e)(t,n,i)},_V=e=>async(t,n,r)=>nk(e)(t,n,r),AV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qy(e)(t,n,i)},OV=e=>(t,n,r)=>qy(e)(t,n,r),EV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hy(e)(t,n,i)},zV=e=>async(t,n,r)=>Hy(e)(t,n,r),TV=/^[cC][^\s-]{8,}$/,PV=/^[0-9a-z]+$/,RV=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,DV=/^[0-9a-vA-V]{20}$/,MV=/^[A-Za-z0-9]{27}$/,IV=/^[a-zA-Z0-9_-]{21}$/,LV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$V=/^([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})$/,_2=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)$/,BV=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,UV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function FV(){return new RegExp(UV,"u")}const qV=/^(?:(?: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])$/,HV=/^(([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}|:))$/,KV=/^((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])$/,GV=/^(([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])$/,VV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mL=/^[A-Za-z0-9_-]*$/,ZV=/^\+[1-9]\d{6,14}$/,gL="(?:(?:\\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])))",YV=new RegExp(`^${gL}$`);function yL(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 WV(e){return new RegExp(`^${yL(e)}$`)}function QV(e){const t=yL({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(`^${gL}T(?:${r})$`)}const XV=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},JV=/^-?\d+$/,vL=/^-?\d+(?:\.\d+)?$/,eZ=/^(?:true|false)$/i,tZ=/^[^A-Z]*$/,nZ=/^[^a-z]*$/,Dr=me("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bL={number:"number",bigint:"bigint",object:"date"},xL=me("$ZodCheckLessThan",(e,t)=>{Dr.init(e,t);const n=bL[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wL=me("$ZodCheckGreaterThan",(e,t)=>{Dr.init(e,t);const n=bL[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rZ=me("$ZodCheckMultipleOf",(e,t)=>{Dr.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):oV(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})}}),iZ=me("$ZodCheckNumberFormat",(e,t)=>{Dr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=fV[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=JV)}),e._zod.check=o=>{const u=o.value;if(n){if(!Number.isInteger(u)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:u,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}}u<i&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),aZ=me("$ZodCheckMaxLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Xj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=ek(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),sZ=me("$ZodCheckMinLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Xj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=ek(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),oZ=me("$ZodCheckLengthEquals",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Xj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=ek(i),u=a>t.length;r.issues.push({origin:o,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ky=me("$ZodCheckStringFormat",(e,t)=>{var n,r;Dr.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lZ=me("$ZodCheckRegex",(e,t)=>{Ky.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})}}),cZ=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tZ),Ky.init(e,t)}),uZ=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nZ),Ky.init(e,t)}),dZ=me("$ZodCheckIncludes",(e,t)=>{Dr.init(e,t);const n=xu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),fZ=me("$ZodCheckStartsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`^${xu(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})}}),hZ=me("$ZodCheckEndsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`.*${xu(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})}}),pZ=me("$ZodCheckOverwrite",(e,t)=>{Dr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class mZ{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(`
|
|
10
|
-
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
-
`))}}const gZ={major:4,minor:3,patch:6},cn=me("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gZ;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,u,d)=>{let f=eu(o),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new lu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=eu(o,y)))});else{if(o.issues.length===y)continue;f||(f=eu(o,y))}}return p?p.then(()=>o):o},a=(o,u,d)=>{if(eu(o))return o.aborted=!0,o;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new lu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,u)=>{if(u.skipChecks)return e._zod.parse(o,u);if(u.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,u)):a(f,o,u)}const d=e._zod.parse(o,u);if(d instanceof Promise){if(u.async===!1)throw new lu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Ot(e,"~standard",()=>({validate:i=>{try{const a=SV(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return jV(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),rk=me("$ZodString",(e,t)=>{cn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??XV(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}}),an=me("$ZodStringFormat",(e,t)=>{Ky.init(e,t),rk.init(e,t)}),yZ=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$V),an.init(e,t)}),vZ=me("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=_2(r))}else t.pattern??(t.pattern=_2());an.init(e,t)}),bZ=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=BV),an.init(e,t)}),xZ=me("$ZodURL",(e,t)=>{an.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})}}}),wZ=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=FV()),an.init(e,t)}),SZ=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=IV),an.init(e,t)}),jZ=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=TV),an.init(e,t)}),kZ=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=PV),an.init(e,t)}),NZ=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=RV),an.init(e,t)}),CZ=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=DV),an.init(e,t)}),_Z=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=MV),an.init(e,t)}),AZ=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=QV(t)),an.init(e,t)}),OZ=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YV),an.init(e,t)}),EZ=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=WV(t)),an.init(e,t)}),zZ=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=LV),an.init(e,t)}),TZ=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qV),an.init(e,t),e._zod.bag.format="ipv4"}),PZ=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=HV),an.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})}}}),RZ=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=KV),an.init(e,t)}),DZ=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=GV),an.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function SL(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const MZ=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=VV),an.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{SL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function IZ(e){if(!mL.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return SL(n)}const LZ=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mL),an.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{IZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$Z=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ZV),an.init(e,t)});function BZ(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 UZ=me("$ZodJWT",(e,t)=>{an.init(e,t),e._zod.check=n=>{BZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jL=me("$ZodNumber",(e,t)=>{cn.init(e,t),e._zod.pattern=e._zod.bag.pattern??vL,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),FZ=me("$ZodNumberFormat",(e,t)=>{iZ.init(e,t),jL.init(e,t)}),qZ=me("$ZodBoolean",(e,t)=>{cn.init(e,t),e._zod.pattern=eZ,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}}),HZ=me("$ZodUnknown",(e,t)=>{cn.init(e,t),e._zod.parse=n=>n}),KZ=me("$ZodNever",(e,t)=>{cn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function A2(e,t,n){e.issues.length&&t.issues.push(...tu(n,e.issues)),t.value[n]=e.value}const GZ=me("$ZodArray",(e,t)=>{cn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const u=i[o],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>A2(f,n,o))):A2(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function Sg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...tu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function kL(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=dV(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function NL(e,t,n,r,i,a){const o=[],u=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(u.has(m))continue;if(f==="never"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>Sg(v,n,m,t,p))):Sg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const VZ=me("$ZodObject",(e,t)=>{if(cn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...u};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Fy(()=>kL(t));Ot(e._zod,"propValues",()=>{const u=t.shape,d={};for(const f in u){const p=u[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=Tf,a=t.catchall;let o;e._zod.parse=(u,d)=>{o??(o=r.value);const f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value={};const p=[],m=o.shape;for(const y of o.keys){const v=m[y],w=v._zod.optout==="optional",S=v._zod.run({value:f[y],issues:[]},d);S instanceof Promise?p.push(S.then(j=>Sg(j,u,y,f,w))):Sg(S,u,y,f,w)}return a?NL(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),ZZ=me("$ZodObjectJIT",(e,t)=>{VZ.init(e,t);const n=e._zod.parse,r=Fy(()=>kL(t)),i=y=>{const v=new mZ(["shape","payload","ctx"]),w=r.value,S=_=>{const C=C2(_);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let N=0;for(const _ of w.keys)j[_]=`key_${N++}`;v.write("const newResult = {};");for(const _ of w.keys){const C=j[_],T=C2(_),A=y[_]?._zod?.optout==="optional";v.write(`const ${C} = ${S(_)};`),A?v.write(`
|
|
12
|
-
if (${C}.issues.length) {
|
|
13
|
-
if (${T} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${T}, ...iss.path] : [${T}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${C}.value === undefined) {
|
|
22
|
-
if (${T} in input) {
|
|
23
|
-
newResult[${T}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${T}] = ${C}.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`):v.write(`
|
|
30
|
-
if (${C}.issues.length) {
|
|
31
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
32
|
-
...iss,
|
|
33
|
-
path: iss.path ? [${T}, ...iss.path] : [${T}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${C}.value === undefined) {
|
|
38
|
-
if (${T} in input) {
|
|
39
|
-
newResult[${T}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${T}] = ${C}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(_,C)=>O(y,_,C)};let a;const o=Tf,u=!lL.jitless,f=u&&cV.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return o(w)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?NL([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function O2(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!eu(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(o=>yo(o,r,go())))}),t)}const CL=me("$ZodUnion",(e,t)=>{cn.init(e,t),Ot(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ot(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ot(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ot(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Jj(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),o=!0;else{if(f.issues.length===0)return f;u.push(f)}}return o?Promise.all(u).then(d=>O2(d,i,e,a)):O2(u,i,e,a)}}),YZ=me("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,CL.init(e,t);const n=e._zod.parse;Ot(e._zod,"propValues",()=>{const i={};for(const a of t.options){const o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(o)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=Fy(()=>{const i=t.options,a=new Map;for(const o of i){const u=o._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,o)}}return a});e._zod.parse=(i,a)=>{const o=i.value;if(!Tf(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const u=r.value.get(o?.[t.discriminator]);return u?u._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),WZ=me("$ZodIntersection",(e,t)=>{cn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>E2(n,d,f)):E2(n,a,o)}});function e1(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(bu(e)&&bu(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=e1(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],o=e1(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function E2(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),eu(e))return e;const o=e1(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const QZ=me("$ZodRecord",(e,t)=>{cn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!bu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...tu(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...tu(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&vL.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[u]=i[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>yo(m,r,go())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...tu(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...tu(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),XZ=me("$ZodEnum",(e,t)=>{cn.init(e,t);const n=cL(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>uV.has(typeof i)).map(i=>typeof i=="string"?xu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),JZ=me("$ZodLiteral",(e,t)=>{if(cn.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"?xu(r):r?xu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),eY=me("$ZodTransform",(e,t)=>{cn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new oL(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new lu;return n.value=i,n}});function z2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const _L=me("$ZodOptional",(e,t)=>{cn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jj(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>z2(a,n.value)):z2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),tY=me("$ZodExactOptional",(e,t)=>{_L.init(e,t),Ot(e._zod,"values",()=>t.innerType._zod.values),Ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),nY=me("$ZodNullable",(e,t)=>{cn.init(e,t),Ot(e._zod,"optin",()=>t.innerType._zod.optin),Ot(e._zod,"optout",()=>t.innerType._zod.optout),Ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jj(n.source)}|null)$`):void 0}),Ot(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)}),rY=me("$ZodDefault",(e,t)=>{cn.init(e,t),e._zod.optin="optional",Ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>T2(a,t)):T2(i,t)}});function T2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const iY=me("$ZodPrefault",(e,t)=>{cn.init(e,t),e._zod.optin="optional",Ot(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))}),aY=me("$ZodNonOptional",(e,t)=>{cn.init(e,t),Ot(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>P2(a,e)):P2(i,e)}});function P2(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 sY=me("$ZodCatch",(e,t)=>{cn.init(e,t),Ot(e._zod,"optin",()=>t.innerType._zod.optin),Ot(e._zod,"optout",()=>t.innerType._zod.optout),Ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>yo(o,r,go()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>yo(a,r,go()))},input:n.value}),n.issues=[]),n)}}),oY=me("$ZodPipe",(e,t)=>{cn.init(e,t),Ot(e._zod,"values",()=>t.in._zod.values),Ot(e._zod,"optin",()=>t.in._zod.optin),Ot(e._zod,"optout",()=>t.out._zod.optout),Ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(o=>om(o,t.in,r)):om(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>om(a,t.out,r)):om(i,t.out,r)}});function om(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const lY=me("$ZodReadonly",(e,t)=>{cn.init(e,t),Ot(e._zod,"propValues",()=>t.innerType._zod.propValues),Ot(e._zod,"values",()=>t.innerType._zod.values),Ot(e._zod,"optin",()=>t.innerType?._zod?.optin),Ot(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(R2):R2(i)}});function R2(e){return e.value=Object.freeze(e.value),e}const cY=me("$ZodCustom",(e,t)=>{Dr.init(e,t),cn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>D2(a,n,r,e));D2(i,n,r,e)}});function D2(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(Pf(i))}}var M2;class uY{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 dY(){return new uY}(M2=globalThis).__zod_globalRegistry??(M2.__zod_globalRegistry=dY());const ff=globalThis.__zod_globalRegistry;function fY(e,t){return new e({type:"string",...He(t)})}function hY(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...He(t)})}function I2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...He(t)})}function pY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...He(t)})}function mY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...He(t)})}function gY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...He(t)})}function yY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...He(t)})}function vY(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...He(t)})}function bY(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...He(t)})}function xY(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...He(t)})}function wY(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...He(t)})}function SY(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...He(t)})}function jY(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...He(t)})}function kY(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...He(t)})}function NY(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...He(t)})}function CY(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...He(t)})}function _Y(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...He(t)})}function AY(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...He(t)})}function OY(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...He(t)})}function EY(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...He(t)})}function zY(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...He(t)})}function TY(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...He(t)})}function PY(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...He(t)})}function RY(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...He(t)})}function DY(e,t){return new e({type:"string",format:"date",check:"string_format",...He(t)})}function MY(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...He(t)})}function IY(e,t){return new e({type:"string",format:"duration",check:"string_format",...He(t)})}function LY(e,t){return new e({type:"number",checks:[],...He(t)})}function $Y(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...He(t)})}function BY(e,t){return new e({type:"boolean",...He(t)})}function UY(e){return new e({type:"unknown"})}function FY(e,t){return new e({type:"never",...He(t)})}function L2(e,t){return new xL({check:"less_than",...He(t),value:e,inclusive:!1})}function _x(e,t){return new xL({check:"less_than",...He(t),value:e,inclusive:!0})}function $2(e,t){return new wL({check:"greater_than",...He(t),value:e,inclusive:!1})}function Ax(e,t){return new wL({check:"greater_than",...He(t),value:e,inclusive:!0})}function B2(e,t){return new rZ({check:"multiple_of",...He(t),value:e})}function AL(e,t){return new aZ({check:"max_length",...He(t),maximum:e})}function jg(e,t){return new sZ({check:"min_length",...He(t),minimum:e})}function OL(e,t){return new oZ({check:"length_equals",...He(t),length:e})}function qY(e,t){return new lZ({check:"string_format",format:"regex",...He(t),pattern:e})}function HY(e){return new cZ({check:"string_format",format:"lowercase",...He(e)})}function KY(e){return new uZ({check:"string_format",format:"uppercase",...He(e)})}function GY(e,t){return new dZ({check:"string_format",format:"includes",...He(t),includes:e})}function VY(e,t){return new fZ({check:"string_format",format:"starts_with",...He(t),prefix:e})}function ZY(e,t){return new hZ({check:"string_format",format:"ends_with",...He(t),suffix:e})}function Ru(e){return new pZ({check:"overwrite",tx:e})}function YY(e){return Ru(t=>t.normalize(e))}function WY(){return Ru(e=>e.trim())}function QY(){return Ru(e=>e.toLowerCase())}function XY(){return Ru(e=>e.toUpperCase())}function JY(){return Ru(e=>lV(e))}function eW(e,t,n){return new e({type:"array",element:t,...He(n)})}function tW(e,t,n){return new e({type:"custom",check:"custom",fn:t,...He(n)})}function nW(e){const t=rW(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Pf(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(Pf(i))}},e(n.value,n)));return t}function rW(e,t){const n=new Dr({check:"custom",...He(t)});return n._zod.check=e,n}function EL(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??ff,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 An(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),An(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&ur(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function zL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const u=e.metadataRegistry.get(o[0])?.id;if(u){const d=r.get(u);if(d&&d!==o[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,o[0])}}const i=o=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${u}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${u}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const u=o[1],{ref:d,defId:f}=i(o);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const o of e.seen.entries()){const u=o[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
46
|
-
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const u=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(u.cycle){a(o);continue}if(u.count>1&&e.reused==="ref"){a(o);continue}}}function TL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),o._zod.parent===p)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(v.$ref&&y.def)for(const S in d)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(d[S])===JSON.stringify(y.def[S])&&delete d[S]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:kg(t,"input",e.processors),output:kg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function ur(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 ur(r.element,n);if(r.type==="set")return ur(r.valueType,n);if(r.type==="lazy")return ur(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 ur(r.innerType,n);if(r.type==="intersection")return ur(r.left,n)||ur(r.right,n);if(r.type==="record"||r.type==="map")return ur(r.keyType,n)||ur(r.valueType,n);if(r.type==="pipe")return ur(r.in,n)||ur(r.out,n);if(r.type==="object"){for(const i in r.shape)if(ur(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(ur(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(ur(i,n))return!0;return!!(r.rest&&ur(r.rest,n))}return!1}const iW=(e,t={})=>n=>{const r=EL({...n,processors:t});return An(e,r),zL(r,e),TL(r,e)},kg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=EL({...i??{},target:a,io:t,processors:n});return An(e,o),zL(o,e),TL(o,e)},aW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sW=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),u&&(i.format=aW[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},oW=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},lW=(e,t,n,r)=>{n.type="boolean"},cW=(e,t,n,r)=>{n.not={}},uW=(e,t,n,r)=>{},dW=(e,t,n,r)=>{const i=e._zod.def,a=cL(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},fW=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},hW=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},pW=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},mW=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=An(a.element,t,{...r,path:[...r.path,"items"]})},gW=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=An(o[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(o)),d=new Set([...u].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=An(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},yW=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((u,d)=>An(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},vW=(e,t,n,r)=>{const i=e._zod.def,a=An(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=An(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(a)?a.allOf:[a],...u(o)?o.allOf:[o]];n.allOf=d},bW=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=An(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of d)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=An(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=An(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},xW=(e,t,n,r)=>{const i=e._zod.def,a=An(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},wW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},SW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},jW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},NW=(e,t,n,r)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;An(a,t,r);const o=t.seen.get(e);o.ref=a},CW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},PL=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},_W=me("ZodISODateTime",(e,t)=>{AZ.init(e,t),dn.init(e,t)});function AW(e){return RY(_W,e)}const OW=me("ZodISODate",(e,t)=>{OZ.init(e,t),dn.init(e,t)});function EW(e){return DY(OW,e)}const zW=me("ZodISOTime",(e,t)=>{EZ.init(e,t),dn.init(e,t)});function TW(e){return MY(zW,e)}const PW=me("ZodISODuration",(e,t)=>{zZ.init(e,t),dn.init(e,t)});function RW(e){return IY(PW,e)}const DW=(e,t)=>{hL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>wV(e,n)},flatten:{value:n=>xV(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,JS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,JS,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ei=me("ZodError",DW,{Parent:Error}),MW=tk(Ei),IW=nk(Ei),LW=qy(Ei),$W=Hy(Ei),BW=kV(Ei),UW=NV(Ei),FW=CV(Ei),qW=_V(Ei),HW=AV(Ei),KW=OV(Ei),GW=EV(Ei),VW=zV(Ei),un=me("ZodType",(e,t)=>(cn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kg(e,"input"),output:kg(e,"output")}}),e.toJSONSchema=iW(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(jo(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)=>ko(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>MW(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>LW(e,n,r),e.parseAsync=async(n,r)=>IW(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>$W(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>BW(e,n,r),e.decode=(n,r)=>UW(e,n,r),e.encodeAsync=async(n,r)=>FW(e,n,r),e.decodeAsync=async(n,r)=>qW(e,n,r),e.safeEncode=(n,r)=>HW(e,n,r),e.safeDecode=(n,r)=>KW(e,n,r),e.safeEncodeAsync=async(n,r)=>GW(e,n,r),e.safeDecodeAsync=async(n,r)=>VW(e,n,r),e.refine=(n,r)=>e.check(FQ(n,r)),e.superRefine=n=>e.check(qQ(n)),e.overwrite=n=>e.check(Ru(n)),e.optional=()=>q2(e),e.exactOptional=()=>OQ(e),e.nullable=()=>H2(e),e.nullish=()=>q2(H2(e)),e.nonoptional=n=>DQ(e,n),e.array=()=>ze(e),e.or=n=>bQ([e,n]),e.and=n=>jQ(e,n),e.transform=n=>K2(e,_Q(n)),e.default=n=>TQ(e,n),e.prefault=n=>RQ(e,n),e.catch=n=>IQ(e,n),e.pipe=n=>K2(e,n),e.readonly=()=>BQ(e),e.describe=n=>{const r=e.clone();return ff.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ff.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ff.get(e);const r=e.clone();return ff.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),RL=me("_ZodString",(e,t)=>{rk.init(e,t),un.init(e,t),e._zod.processJSONSchema=(r,i,a)=>sW(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(qY(...r)),e.includes=(...r)=>e.check(GY(...r)),e.startsWith=(...r)=>e.check(VY(...r)),e.endsWith=(...r)=>e.check(ZY(...r)),e.min=(...r)=>e.check(jg(...r)),e.max=(...r)=>e.check(AL(...r)),e.length=(...r)=>e.check(OL(...r)),e.nonempty=(...r)=>e.check(jg(1,...r)),e.lowercase=r=>e.check(HY(r)),e.uppercase=r=>e.check(KY(r)),e.trim=()=>e.check(WY()),e.normalize=(...r)=>e.check(YY(...r)),e.toLowerCase=()=>e.check(QY()),e.toUpperCase=()=>e.check(XY()),e.slugify=()=>e.check(JY())}),ZW=me("ZodString",(e,t)=>{rk.init(e,t),RL.init(e,t),e.email=n=>e.check(hY(YW,n)),e.url=n=>e.check(vY(WW,n)),e.jwt=n=>e.check(PY(dQ,n)),e.emoji=n=>e.check(bY(QW,n)),e.guid=n=>e.check(I2(U2,n)),e.uuid=n=>e.check(pY(lm,n)),e.uuidv4=n=>e.check(mY(lm,n)),e.uuidv6=n=>e.check(gY(lm,n)),e.uuidv7=n=>e.check(yY(lm,n)),e.nanoid=n=>e.check(xY(XW,n)),e.guid=n=>e.check(I2(U2,n)),e.cuid=n=>e.check(wY(JW,n)),e.cuid2=n=>e.check(SY(eQ,n)),e.ulid=n=>e.check(jY(tQ,n)),e.base64=n=>e.check(EY(lQ,n)),e.base64url=n=>e.check(zY(cQ,n)),e.xid=n=>e.check(kY(nQ,n)),e.ksuid=n=>e.check(NY(rQ,n)),e.ipv4=n=>e.check(CY(iQ,n)),e.ipv6=n=>e.check(_Y(aQ,n)),e.cidrv4=n=>e.check(AY(sQ,n)),e.cidrv6=n=>e.check(OY(oQ,n)),e.e164=n=>e.check(TY(uQ,n)),e.datetime=n=>e.check(AW(n)),e.date=n=>e.check(EW(n)),e.time=n=>e.check(TW(n)),e.duration=n=>e.check(RW(n))});function M(e){return fY(ZW,e)}const dn=me("ZodStringFormat",(e,t)=>{an.init(e,t),RL.init(e,t)}),YW=me("ZodEmail",(e,t)=>{bZ.init(e,t),dn.init(e,t)}),U2=me("ZodGUID",(e,t)=>{yZ.init(e,t),dn.init(e,t)}),lm=me("ZodUUID",(e,t)=>{vZ.init(e,t),dn.init(e,t)}),WW=me("ZodURL",(e,t)=>{xZ.init(e,t),dn.init(e,t)}),QW=me("ZodEmoji",(e,t)=>{wZ.init(e,t),dn.init(e,t)}),XW=me("ZodNanoID",(e,t)=>{SZ.init(e,t),dn.init(e,t)}),JW=me("ZodCUID",(e,t)=>{jZ.init(e,t),dn.init(e,t)}),eQ=me("ZodCUID2",(e,t)=>{kZ.init(e,t),dn.init(e,t)}),tQ=me("ZodULID",(e,t)=>{NZ.init(e,t),dn.init(e,t)}),nQ=me("ZodXID",(e,t)=>{CZ.init(e,t),dn.init(e,t)}),rQ=me("ZodKSUID",(e,t)=>{_Z.init(e,t),dn.init(e,t)}),iQ=me("ZodIPv4",(e,t)=>{TZ.init(e,t),dn.init(e,t)}),aQ=me("ZodIPv6",(e,t)=>{PZ.init(e,t),dn.init(e,t)}),sQ=me("ZodCIDRv4",(e,t)=>{RZ.init(e,t),dn.init(e,t)}),oQ=me("ZodCIDRv6",(e,t)=>{DZ.init(e,t),dn.init(e,t)}),lQ=me("ZodBase64",(e,t)=>{MZ.init(e,t),dn.init(e,t)}),cQ=me("ZodBase64URL",(e,t)=>{LZ.init(e,t),dn.init(e,t)}),uQ=me("ZodE164",(e,t)=>{$Z.init(e,t),dn.init(e,t)}),dQ=me("ZodJWT",(e,t)=>{UZ.init(e,t),dn.init(e,t)}),DL=me("ZodNumber",(e,t)=>{jL.init(e,t),un.init(e,t),e._zod.processJSONSchema=(r,i,a)=>oW(e,r,i),e.gt=(r,i)=>e.check($2(r,i)),e.gte=(r,i)=>e.check(Ax(r,i)),e.min=(r,i)=>e.check(Ax(r,i)),e.lt=(r,i)=>e.check(L2(r,i)),e.lte=(r,i)=>e.check(_x(r,i)),e.max=(r,i)=>e.check(_x(r,i)),e.int=r=>e.check(F2(r)),e.safe=r=>e.check(F2(r)),e.positive=r=>e.check($2(0,r)),e.nonnegative=r=>e.check(Ax(0,r)),e.negative=r=>e.check(L2(0,r)),e.nonpositive=r=>e.check(_x(0,r)),e.multipleOf=(r,i)=>e.check(B2(r,i)),e.step=(r,i)=>e.check(B2(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 ve(e){return LY(DL,e)}const fQ=me("ZodNumberFormat",(e,t)=>{FZ.init(e,t),DL.init(e,t)});function F2(e){return $Y(fQ,e)}const hQ=me("ZodBoolean",(e,t)=>{qZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lW(e,n,r)});function ot(e){return BY(hQ,e)}const pQ=me("ZodUnknown",(e,t)=>{HZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uW()});function wu(){return UY(pQ)}const mQ=me("ZodNever",(e,t)=>{KZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cW(e,n,r)});function gQ(e){return FY(mQ,e)}const yQ=me("ZodArray",(e,t)=>{GZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mW(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(jg(n,r)),e.nonempty=n=>e.check(jg(1,n)),e.max=(n,r)=>e.check(AL(n,r)),e.length=(n,r)=>e.check(OL(n,r)),e.unwrap=()=>e.element});function ze(e,t){return eW(yQ,e,t)}const vQ=me("ZodObject",(e,t)=>{ZZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gW(e,n,r,i),Ot(e,"shape",()=>t.shape),e.keyof=()=>at(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:wu()}),e.loose=()=>e.clone({...e._zod.def,catchall:wu()}),e.strict=()=>e.clone({...e._zod.def,catchall:gQ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>mV(e,n),e.safeExtend=n=>gV(e,n),e.merge=n=>yV(e,n),e.pick=n=>hV(e,n),e.omit=n=>pV(e,n),e.partial=(...n)=>vV(IL,e,n[0]),e.required=(...n)=>bV(LL,e,n[0])});function ye(e,t){const n={type:"object",shape:e??{},...He(t)};return new vQ(n)}const ML=me("ZodUnion",(e,t)=>{CL.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yW(e,n,r,i),e.options=t.options});function bQ(e,t){return new ML({type:"union",options:e,...He(t)})}const xQ=me("ZodDiscriminatedUnion",(e,t)=>{ML.init(e,t),YZ.init(e,t)});function wQ(e,t,n){return new xQ({type:"union",options:t,discriminator:e,...He(n)})}const SQ=me("ZodIntersection",(e,t)=>{WZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vW(e,n,r,i)});function jQ(e,t){return new SQ({type:"intersection",left:e,right:t})}const kQ=me("ZodRecord",(e,t)=>{QZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bW(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Kl(e,t,n){return new kQ({type:"record",keyType:e,valueType:t,...He(n)})}const t1=me("ZodEnum",(e,t)=>{XZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(r,i,a)=>dW(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new t1({...t,checks:[],...He(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new t1({...t,checks:[],...He(i),entries:a})}});function at(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t1({type:"enum",entries:n,...He(t)})}const NQ=me("ZodLiteral",(e,t)=>{JZ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fW(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 ya(e,t){return new NQ({type:"literal",values:Array.isArray(e)?e:[e],...He(t)})}const CQ=me("ZodTransform",(e,t)=>{eY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pW(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new oL(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Pf(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Pf(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function _Q(e){return new CQ({type:"transform",transform:e})}const IL=me("ZodOptional",(e,t)=>{_L.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function q2(e){return new IL({type:"optional",innerType:e})}const AQ=me("ZodExactOptional",(e,t)=>{tY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function OQ(e){return new AQ({type:"optional",innerType:e})}const EQ=me("ZodNullable",(e,t)=>{nY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function H2(e){return new EQ({type:"nullable",innerType:e})}const zQ=me("ZodDefault",(e,t)=>{rY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function TQ(e,t){return new zQ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():dL(t)}})}const PQ=me("ZodPrefault",(e,t)=>{iY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function RQ(e,t){return new PQ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():dL(t)}})}const LL=me("ZodNonOptional",(e,t)=>{aY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function DQ(e,t){return new LL({type:"nonoptional",innerType:e,...He(t)})}const MQ=me("ZodCatch",(e,t)=>{sY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function IQ(e,t){return new MQ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const LQ=me("ZodPipe",(e,t)=>{oY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NW(e,n,r,i),e.in=t.in,e.out=t.out});function K2(e,t){return new LQ({type:"pipe",in:e,out:t})}const $Q=me("ZodReadonly",(e,t)=>{lY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function BQ(e){return new $Q({type:"readonly",innerType:e})}const UQ=me("ZodCustom",(e,t)=>{cY.init(e,t),un.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hW(e,n)});function FQ(e,t={}){return tW(UQ,e,t)}function qQ(e){return nW(e)}ye({maxConcurrency:ve().int().positive(),maxRequestsPerMinute:ve().int().positive(),maxRequestsPerDay:ve().int().positive()});const ds=M().min(1);M().min(1);const ik=ye({label:M().min(1),city:M().min(1),region:M().min(1),country:M().length(2),timezone:M().optional()}),ak=at(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ye({id:M(),projectId:M(),channel:ya("webhook"),url:M().url(),urlDisplay:M(),urlHost:M(),events:ze(ak),enabled:ot().default(!0),source:M().optional(),webhookSecret:M().optional(),createdAt:M(),updatedAt:M()});ye({channel:ya("webhook"),url:M().url(),events:ze(ak).min(1),source:M().optional()});const $L=at(["cli","api","config-file"]);function HQ(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 KQ(e,t){return t?e.some(n=>n.label===t):!0}ye({displayName:M().min(1),canonicalDomain:M().min(1),ownedDomains:ze(M().min(1)).optional(),country:M().length(2),language:M().min(2),tags:ze(M()).optional(),labels:Kl(M(),M()).optional(),providers:ze(ds).optional(),locations:ze(ik).optional(),defaultLocation:M().nullable().optional(),autoExtractBacklinks:ot().optional(),configSource:$L.optional()});ye({id:M(),name:M(),displayName:M().optional(),canonicalDomain:M(),ownedDomains:ze(M()).default([]),country:M().length(2),language:M().min(2),tags:ze(M()).default([]),labels:Kl(M(),M()).default({}),locations:ze(ik).default([]),defaultLocation:M().nullable().optional(),autoExtractBacklinks:ot().default(!1),configSource:$L.default("cli"),configRevision:ve().int().positive().default(1),createdAt:M().optional(),updatedAt:M().optional()});ye({id:M(),keyword:M(),createdAt:M()});ye({keywords:ze(M().trim().min(1)).min(1)});ye({provider:ds,count:ve().int().min(1).max(20).optional()});ye({id:M(),domain:M(),createdAt:M()});ye({competitors:ze(M().trim().min(1)).min(1)});function n1(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function GQ(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=n1(a);n.has(o)||(n.add(o),r.push(a))}return r}const VQ=ye({name:M().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:Kl(M(),M()).optional().default({})}),ZQ=ye({preset:M().optional(),cron:M().optional(),timezone:M().optional().default("UTC"),providers:ze(ds).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),YQ=ye({channel:ya("webhook"),url:M().url(),events:ze(ak).min(1)}),WQ=ye({gsc:ye({propertyUrl:M()}).optional(),syncSchedule:ye({preset:M().optional(),cron:M().optional()}).optional()}).optional(),QQ=ye({displayName:M().min(1),canonicalDomain:M().min(1),ownedDomains:ze(M().min(1)).optional().default([]),country:M().length(2),language:M().min(2),keywords:ze(M().min(1)).optional().default([]),competitors:ze(M().min(1)).optional().default([]),providers:ze(ds).optional().default([]),locations:ze(ik).optional().default([]),defaultLocation:M().optional(),schedule:ZQ,notifications:ze(YQ).optional().default([]),google:WQ,autoExtractBacklinks:ot().optional().default(!1)}).superRefine((e,t)=>{const n=HQ(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),KQ(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ye({apiVersion:ya("canonry/v1"),kind:ya("Project"),metadata:VQ,spec:QQ});const XQ=at(["gsc","ga4"]);ye({id:M(),domain:M(),connectionType:XQ,propertyId:M().nullable().optional(),sitemapUrl:M().nullable().optional(),scopes:ze(M()).default([]),createdAt:M(),updatedAt:M()});ye({date:M(),query:M(),page:M(),country:M().nullable().optional(),device:M().nullable().optional(),clicks:ve(),impressions:ve(),ctr:ve(),position:ve()});const r1=ye({id:M(),url:M(),indexingState:M().nullable().optional(),verdict:M().nullable().optional(),coverageState:M().nullable().optional(),pageFetchState:M().nullable().optional(),robotsTxtState:M().nullable().optional(),crawlTime:M().nullable().optional(),lastCrawlResult:M().nullable().optional(),isMobileFriendly:ot().nullable().optional(),richResults:ze(M()).default([]),inspectedAt:M()});at(["stable","reindexed","deindexed","still-missing","new"]);const JQ=ye({url:M(),previousState:M().nullable(),currentState:M().nullable(),transitionDate:M()}),eX=ye({reason:M(),count:ve(),urls:ze(r1).default([])});ye({summary:ye({total:ve(),indexed:ve(),notIndexed:ve(),deindexed:ve(),percentage:ve()}),lastInspectedAt:M().nullable(),indexed:ze(r1).default([]),notIndexed:ze(r1).default([]),deindexed:ze(JQ).default([]),reasonGroups:ze(eX).default([])});ye({url:M(),type:at(["URL_UPDATED","URL_DELETED"]),notifiedAt:M()});ye({url:M(),type:at(["URL_UPDATED","URL_DELETED"]),notifiedAt:M(),status:at(["success","error"]),error:M().optional()});ye({date:M(),indexed:ve(),notIndexed:ve(),reasonBreakdown:Kl(M(),ve()).default({})});ye({id:M(),domain:M(),siteUrl:M().nullable().optional(),createdAt:M(),updatedAt:M()});const Ox=ye({id:M(),url:M(),httpCode:ve().nullable().optional(),inIndex:ot().nullable().optional(),lastCrawledDate:M().nullable().optional(),inIndexDate:M().nullable().optional(),inspectedAt:M(),documentSize:ve().nullable().optional(),anchorCount:ve().nullable().optional(),discoveryDate:M().nullable().optional()});ye({summary:ye({total:ve(),indexed:ve(),notIndexed:ve(),unknown:ve().optional(),percentage:ve()}),lastInspectedAt:M().nullable(),indexed:ze(Ox).default([]),notIndexed:ze(Ox).default([]),unknown:ze(Ox).default([]).optional()});ye({query:M(),impressions:ve(),clicks:ve(),ctr:ve(),averagePosition:ve()});ye({date:M(),indexed:ve(),notIndexed:ve(),unknown:ve()});ye({url:M(),status:at(["success","error"]),submittedAt:M(),error:M().optional()});const Du=at(["live","staging"]);ye({projectName:M(),url:M(),stagingUrl:M().optional(),username:M(),defaultEnv:Du,createdAt:M(),updatedAt:M()});const G2=ye({url:M(),reachable:ot(),pageCount:ve().nullable().optional(),version:M().nullable().optional(),error:M().nullable().optional(),plugins:ze(M()).optional(),authenticatedUser:ye({id:ve(),slug:M()}).nullable().optional()});ye({connected:ot(),projectName:M(),defaultEnv:Du,live:G2.nullable(),staging:G2.nullable(),adminUrl:M().nullable().optional()});const tX=ye({id:ve(),slug:M(),title:M(),status:M(),modifiedAt:M().nullable().optional(),link:M().nullable().optional()}),BL=ye({title:M().nullable(),description:M().nullable(),noindex:ot().nullable(),writable:ot().default(!1),writeTargets:ze(M()).default([])}),nX=ye({type:M(),json:Kl(M(),wu())}),rX=tX.extend({env:Du,content:M(),seo:BL,schemaBlocks:ze(nX).default([])}),V2=rX.extend({contentHash:M(),contentSnippet:M()}),UL=ye({manualRequired:ya(!0),targetUrl:M(),adminUrl:M().nullable().optional(),content:M(),nextSteps:ze(M()).default([])}),iX=ye({slug:M(),severity:at(["high","medium","low"]),code:at(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:M()});ye({slug:M(),title:M(),status:M(),wordCount:ve(),seo:BL,schemaPresent:ot(),issues:ze(iX).default([])});const aX=ye({slug:M(),status:at(["applied","skipped","manual"]),error:M().optional(),manualAssist:UL.optional()});ye({env:Du,strategy:at(["plugin","manual"]),results:ze(aX)});const sX=ye({slug:M(),status:at(["deployed","stripped","skipped","failed"]),schemasInjected:ze(M()).optional(),manualAssist:UL.optional(),error:M().optional()});ye({env:Du,results:ze(sX)});const oX=ye({slug:M(),title:M(),canonrySchemas:ze(M()),thirdPartySchemas:ze(M()),hasCanonrySchema:ot()});ye({env:Du,pages:ze(oX)});const lX=ye({name:M(),status:at(["completed","skipped","failed"]),summary:M().optional(),error:M().optional()});ye({projectName:M(),steps:ze(lX)});ye({slug:M(),live:V2,staging:V2,hasDifferences:ot(),differences:ye({title:ot(),slug:ot(),content:ot(),seoTitle:ot(),seoDescription:ot(),noindex:ot(),schema:ot()})});const FL=at(["queued","running","completed","partial","failed","cancelled"]),gn=FL.enum,qL=at(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),Kt=qL.enum,HL=at(["manual","scheduled","config-apply"]),bf=HL.enum,Rf=at(["cited","not-cited"]);Rf.enum;const Ng=at(["visible","not-visible"]);Ng.enum;const KL=at(["new","cited","lost","emerging","not-cited"]);KL.enum;ye({kind:ya(Kt["answer-visibility"]).optional(),trigger:ya(bf.manual).optional(),providers:ze(ds).optional(),location:M().min(1).optional(),allLocations:ot().optional(),noLocation:ot().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const cX=ye({message:M(),raw:wu().optional()}),uX=ye({message:M().optional(),providers:Kl(M(),cX).optional()}),dX=ye({id:M(),projectId:M(),kind:qL,status:FL,trigger:HL.default("manual"),location:M().nullable().optional(),startedAt:M().nullable().optional(),finishedAt:M().nullable().optional(),error:uX.nullable().optional(),createdAt:M()});function sk(e){if(e.providers){const t=Object.entries(e.providers);if(t.length===1){const[n,r]=t[0];return`${n}: ${r.message}`}if(t.length>1)return t.map(([n,r])=>`${n}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const GL=ye({uri:M(),title:M()}),VL=ye({id:M(),runId:M(),keywordId:M(),keyword:M().optional(),provider:ds,citationState:Rf,answerMentioned:ot().optional(),visibilityState:Ng.optional(),transition:KL.optional(),answerText:M().nullable().optional(),citedDomains:ze(M()).default([]),competitorOverlap:ze(M()).default([]),recommendedCompetitors:ze(M()).default([]),matchedTerms:ze(M()).default([]),groundingSources:ze(GL).default([]),searchQueries:ze(M()).default([]),model:M().nullable().optional(),location:M().nullable().optional(),createdAt:M()});ye({snapshots:ze(VL),total:ve().int().nonnegative()});const fX=ye({keywordId:M().nullable(),keyword:M().nullable(),run1State:Rf.nullable(),run2State:Rf.nullable(),run1AnswerMentioned:ot().nullable(),run2AnswerMentioned:ot().nullable(),run1VisibilityState:Ng.nullable(),run2VisibilityState:Ng.nullable(),changed:ot(),visibilityChanged:ot()});ye({run1:M(),run2:M(),diff:ze(fX)});const hX=dX.extend({snapshots:ze(VL).optional()});ye({totalRuns:ve().int().nonnegative(),run:hX.nullable()});ye({id:M(),projectId:M().nullable().optional(),actor:M(),action:M(),entityType:M(),entityId:M().nullable().optional(),diff:wu().optional(),createdAt:M()});const pX=at(["yes","no","unknown","not-mentioned"]);ye({companyName:M().min(1),domain:M().min(1),phrases:ze(M().min(1)).optional().default([]),competitors:ze(M().min(1)).optional().default([])});const mX=ye({name:M(),count:ve().int().nonnegative()}),gX=ye({id:M(),name:M(),weight:ve(),score:ve(),grade:M(),status:at(["pass","partial","fail"]),findings:ze(ye({type:M(),message:M()})).default([]),recommendations:ze(M()).default([])}),yX=ye({url:M(),finalUrl:M(),auditedAt:M(),overallScore:ve(),overallGrade:M(),summary:M(),factors:ze(gX).default([])}),vX=ye({industry:M(),summary:M(),services:ze(M()).default([]),categoryTerms:ze(M()).default([])}),bX=ye({provider:M(),displayName:M(),model:M().nullable().optional(),mentioned:ot(),cited:ot(),describedAccurately:pX,accuracyNotes:M().nullable().optional(),incorrectClaims:ze(M()).default([]),recommendedCompetitors:ze(M()).default([]),citedDomains:ze(M()).default([]),groundingSources:ze(GL).default([]),searchQueries:ze(M()).default([]),answerText:M(),error:M().nullable().optional()}),xX=ye({phrase:M(),providerResults:ze(bX).default([])}),wX=ye({totalQueries:ve().int().nonnegative(),totalProviders:ve().int().nonnegative(),totalComparisons:ve().int().nonnegative(),mentionCount:ve().int().nonnegative(),citationCount:ve().int().nonnegative(),topCompetitors:ze(mX).default([]),visibilityGap:M(),whatThisMeans:ze(M()).default([]),recommendedActions:ze(M()).default([])});ye({companyName:M(),domain:M(),homepageUrl:M(),generatedAt:M(),phrases:ze(M()).default([]),competitors:ze(M()).default([]),profile:vX,audit:yX,queryResults:ze(xX).default([]),summary:wX});ye({id:M(),projectId:M(),cronExpr:M(),preset:M().nullable().optional(),timezone:M().default("UTC"),enabled:ot().default(!0),providers:ze(ds).default([]),lastRunAt:M().nullable().optional(),nextRunAt:M().nullable().optional(),createdAt:M(),updatedAt:M()});ye({preset:M().optional(),cron:M().optional(),timezone:M().optional().default("UTC"),enabled:ot().optional().default(!0),providers:ze(ds).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const SX=at(["answer","citation"]),no=SX.enum;ye({id:M(),projectId:M(),propertyId:M(),clientEmail:M(),connected:ot(),createdAt:M(),updatedAt:M()});ye({date:M(),landingPage:M(),sessions:ve(),organicSessions:ve(),users:ve()});const ZL=at(["session","first_user","manual_utm"]),jX=ye({source:M(),medium:M(),sessions:ve(),users:ve(),sourceDimension:ZL}),kX=ye({source:M(),medium:M(),sessions:ve(),users:ve(),channelGroup:M()});ye({totalSessions:ve(),totalOrganicSessions:ve(),totalDirectSessions:ve(),totalUsers:ve(),topPages:ze(ye({landingPage:M(),sessions:ve(),organicSessions:ve(),directSessions:ve(),users:ve()})),aiReferrals:ze(jX),aiSessionsDeduped:ve(),aiUsersDeduped:ve(),aiSessionsBySession:ve(),aiUsersBySession:ve(),socialReferrals:ze(kX),socialSessions:ve(),socialUsers:ve(),organicSharePct:ve(),aiSharePct:ve(),aiSharePctBySession:ve(),directSharePct:ve(),socialSharePct:ve(),lastSyncedAt:M().nullable()});ye({date:M(),source:M(),medium:M(),sessions:ve(),users:ve(),sourceDimension:ZL});ye({date:M(),source:M(),medium:M(),sessions:ve(),users:ve(),channelGroup:M()});ye({date:M(),sessions:ve(),organicSessions:ve(),users:ve()});function Z2(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const NX=at(["aero","user","compaction"]);NX.enum;const YL=128;ye({key:M().min(1).max(YL),value:M().min(1)});ye({key:M().min(1).max(YL)});const ok=at(["queued","downloading","querying","ready","failed"]);ok.enum;ye({id:M(),release:M(),status:ok,phaseDetail:M().nullable().optional(),vertexPath:M().nullable().optional(),edgesPath:M().nullable().optional(),vertexSha256:M().nullable().optional(),edgesSha256:M().nullable().optional(),vertexBytes:ve().int().nullable().optional(),edgesBytes:ve().int().nullable().optional(),projectsProcessed:ve().int().nullable().optional(),domainsDiscovered:ve().int().nullable().optional(),downloadStartedAt:M().nullable().optional(),downloadFinishedAt:M().nullable().optional(),queryStartedAt:M().nullable().optional(),queryFinishedAt:M().nullable().optional(),error:M().nullable().optional(),createdAt:M(),updatedAt:M()});const CX=ye({linkingDomain:M(),numHosts:ve().int()}),_X=ye({projectId:M(),release:M(),targetDomain:M(),totalLinkingDomains:ve().int(),totalHosts:ve().int(),top10HostsShare:M(),queriedAt:M()});ye({summary:_X.nullable(),total:ve().int(),rows:ze(CX)});ye({release:M(),totalLinkingDomains:ve().int(),totalHosts:ve().int(),top10HostsShare:M(),queriedAt:M()});ye({duckdbInstalled:ot(),duckdbVersion:M().nullable().optional(),duckdbSpec:M(),pluginDir:M()});ye({installed:ot(),version:M(),path:M(),alreadyPresent:ot()});ye({release:M(),vertexUrl:M(),edgesUrl:M(),vertexBytes:ve().int().nullable(),edgesBytes:ve().int().nullable(),lastModified:M().nullable()});ye({release:M(),syncStatus:ok.nullable(),bytes:ve().int(),lastUsedAt:M().nullable()});at(["snapshot","insight"]);const AX=ye({kind:ya("snapshot"),id:M(),runId:M(),keyword:M(),provider:M(),model:M().nullable(),citationState:Rf,matchedField:at(["answerText","citedDomains","searchQueries","keyword"]),snippet:M(),createdAt:M()}),OX=ye({kind:ya("insight"),id:M(),runId:M().nullable(),type:at(["regression","gain","opportunity"]),severity:at(["critical","high","medium","low"]),title:M(),keyword:M(),provider:M(),matchedField:at(["title","keyword","recommendation","cause"]),snippet:M(),dismissed:ot(),createdAt:M()}),EX=wQ("kind",[AX,OX]);ye({query:M(),totalHits:ve().int().nonnegative(),truncated:ot(),hits:ze(EX)});const WL=at(["create","expand","refresh","add-schema"]);WL.enum;const QL=at(["gsc","competitor-evidence","both"]);QL.enum;const XL=at(["high","medium","low"]);XL.enum;const zX=at(["blog-post","comparison","listicle","how-to","guide","glossary"]);zX.enum;const JL=at(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);JL.enum;const TX=ye({url:M(),gscImpressions:ve().nonnegative(),gscClicks:ve().nonnegative(),gscAvgPosition:ve().nonnegative().nullable(),organicSessions:ve().nonnegative()}),PX=ye({domain:M(),url:M(),title:M(),citationCount:ve().int().nonnegative()}),RX=ye({demand:ve(),competitor:ve(),absence:ve(),gapSeverity:ve()}),DX=ye({actionId:M(),state:JL,lastUpdated:M()}),MX=ye({targetRef:M(),query:M(),action:WL,ourBestPage:TX.nullable(),winningCompetitor:PX.nullable(),score:ve(),scoreBreakdown:RX,drivers:ze(M()),demandSource:QL,actionConfidence:XL,existingAction:DX.nullable()});ye({targets:ze(MX),contextMetrics:ye({totalAiReferralSessions:ve().int().nonnegative(),latestRunId:M(),runTimestamp:M()})});const IX=ye({uri:M(),title:M(),domain:M(),isOurDomain:ot(),isCompetitor:ot(),citationCount:ve().int().nonnegative(),providers:ze(ds)}),LX=ye({query:M(),groundingSources:ze(IX)});ye({sources:ze(LX),latestRunId:M()});const $X=ye({query:M(),competitorDomains:ze(M()),competitorCount:ve().int().nonnegative(),missRate:ve().min(0).max(1),lastSeenInRunId:M()});ye({gaps:ze($X),latestRunId:M()});const e5=at(["ok","warn","fail","skipped"]);e5.enum;const lk=at(["global","project"]);lk.enum;const t5=at(["auth","config","providers","integrations","database","schedules"]);t5.enum;const BX=ye({id:M(),category:t5,scope:lk,title:M(),status:e5,code:M().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:M(),remediation:M().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Kl(M(),wu()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:ve().int().nonnegative().describe("How long the check took to execute.")});ye({scope:lk,project:M().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:M().describe("ISO-8601 timestamp when this doctor run started."),durationMs:ve().int().nonnegative(),summary:ye({total:ve().int().nonnegative(),ok:ve().int().nonnegative(),warn:ve().int().nonnegative(),fail:ve().int().nonnegative(),skipped:ve().int().nonnegative()}),checks:ze(BX)});var ro=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(ro||{});const UX={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},cm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},FX=sk;function qX(e){const t=[];if(e.message&&t.push(e.message),e.providers)for(const[n,r]of Object.entries(e.providers)){const i=`[${n}] ${r.message}`;r.raw!==void 0?t.push(`${i}
|
|
48
|
-
|
|
49
|
-
${JSON.stringify(r.raw,null,2)}`):t.push(i)}return t.length>0?t.join(`
|
|
50
|
-
|
|
51
|
-
`):"Run failed."}function Gy(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Fi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Y2(e){return e===null?"Unknown":e?"Pass":"Fail"}function i1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function HX(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function KX(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 Ex(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const o=i[1]?parseInt(i[1]):6;return`Every day at ${i1(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${i1(u)} · ${r}`}return`${e} · ${r}`}function Cg(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function n5(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 GX(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 VX(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function ZX(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function vo(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
-
`):void 0}function YX(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:Cg(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:Cg(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>ZX(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function WX(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 QX(e,t,n){const r=WX(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const r5="canonry.run-tracker",a1=new Set;let W2=!1,XX=0,Vy={runs:{},batches:{}};function JX(){const e=zl();for(const t of a1)t(e)}function eJ(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function tJ(){typeof window>"u"||window.sessionStorage.setItem(r5,JSON.stringify(Vy))}function i5(){W2||(W2=!0,!(typeof window>"u")&&(Vy=eJ(window.sessionStorage.getItem(r5))))}function Zy(e){Vy=e,tJ(),JX()}function zl(){return i5(),Vy}function nJ(e){return i5(),a1.add(e),()=>{a1.delete(e)}}function a5(e){const t=zl();Zy({...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 Q2(e){const t=zl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Zy({...t,runs:r})}function rJ(e){const t=zl(),n=`batch_${Date.now()}_${++XX}`;return Zy({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function iJ(e){const t=zl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Zy({...t,batches:r})}function ck(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function aJ(e,t){let n=0,r=0,i=0,a=0,o=0;for(const u of e){const d=t[u]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function X2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=X2(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():X2(e[i],null)}}}}function Gl(...e){return b.useCallback(uk(...e),e)}var sJ=Symbol.for("react.lazy"),_g=Ry[" use ".trim().toString()];function oJ(e){return typeof e=="object"&&e!==null&&"then"in e}function s5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===sJ&&"_payload"in e&&oJ(e._payload)}function lJ(e){const t=uJ(e),n=b.forwardRef((r,i)=>{let{children:a,...o}=r;s5(a)&&typeof _g=="function"&&(a=_g(a._payload));const u=b.Children.toArray(a),d=u.find(fJ);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return c.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return c.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var cJ=lJ("Slot");function uJ(e){const t=b.forwardRef((n,r)=>{let{children:i,...a}=n;if(s5(i)&&typeof _g=="function"&&(i=_g(i._payload)),b.isValidElement(i)){const o=pJ(i),u=hJ(a,i.props);return i.type!==b.Fragment&&(u.ref=r?uk(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dJ=Symbol("radix.slottable");function fJ(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dJ}function hJ(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function pJ(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 o5(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=o5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Et(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=o5(e))&&(r&&(r+=" "),r+=t);return r}const J2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ez=Et,l5=(e,t)=>n=>{var r;if(t?.variants==null)return ez(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=J2(p)||J2(m);return i[f][y]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(w=>{let[S,j]=w;return Array.isArray(j)?j.includes({...a,...u}[S]):{...a,...u}[S]===j})?[...f,m,y]:f},[]);return ez(e,o,d,n?.class,n?.className)},mJ=(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},gJ=(e,t)=>({classGroupId:e,validator:t}),c5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ag="-",tz=[],yJ="arbitrary..",vJ=e=>{const t=xJ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return bJ(o);const u=o.split(Ag),d=u[0]===""&&u.length>1?1:0;return u5(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=r[o],f=n[o];return d?f?mJ(f,d):d:f||tz}return n[o]||tz}}},u5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=u5(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const u=t===0?e.join(Ag):e.slice(t).join(Ag),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},bJ=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?yJ+r:void 0})(),xJ=e=>{const{theme:t,classGroups:n}=e;return wJ(n,t)},wJ=(e,t)=>{const n=c5();for(const r in e){const i=e[r];dk(i,n,r,t)}return n},dk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];SJ(o,t,n,r)}},SJ=(e,t,n,r)=>{if(typeof e=="string"){jJ(e,t,n);return}if(typeof e=="function"){kJ(e,t,n,r);return}NJ(e,t,n,r)},jJ=(e,t,n)=>{const r=e===""?t:d5(t,e);r.classGroupId=n},kJ=(e,t,n,r)=>{if(CJ(e)){dk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(gJ(n,e))},NJ=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[u,d]=i[o];dk(d,d5(t,u),n,r)}},d5=(e,t)=>{let n=e;const r=t.split(Ag),i=r.length;for(let a=0;a<i;a++){const o=r[a];let u=n.nextPart.get(o);u||(u=c5(),n.nextPart.set(o,u)),n=u}return n},CJ=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_J=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},s1="!",nz=":",AJ=[],rz=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),OJ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,u=0,d=0,f;const p=i.length;for(let S=0;S<p;S++){const j=i[S];if(o===0&&u===0){if(j===nz){a.push(i.slice(d,S)),d=S+1;continue}if(j==="/"){f=S;continue}}j==="["?o++:j==="]"?o--:j==="("?u++:j===")"&&u--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(s1)?(y=m.slice(0,-1),v=!0):m.startsWith(s1)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return rz(a,v,y,w)};if(t){const i=t+nz,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):rz(AJ,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},EJ=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],u=o[0]==="[",d=t.has(o);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},zJ=e=>({cache:_J(e.cacheSize),parseClassName:OJ(e),sortModifiers:EJ(e),...vJ(e)}),TJ=/\s+/,PJ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],u=e.trim().split(TJ);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!S,N=r(j?w.substring(0,S):w);if(!N){if(!j){d=p+(d.length>0?" "+d:d);continue}if(N=r(w),!N){d=p+(d.length>0?" "+d:d);continue}j=!1}const O=y.length===0?"":y.length===1?y[0]:a(y).join(":"),_=v?O+s1:O,C=_+N;if(o.indexOf(C)>-1)continue;o.push(C);const T=i(N,j);for(let E=0;E<T.length;++E){const A=T[E];o.push(_+A)}d=p+(d.length>0?" "+d:d)}return d},RJ=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=f5(n))&&(i&&(i+=" "),i+=r);return i},f5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=f5(e[r]))&&(n&&(n+=" "),n+=t);return n},DJ=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=zJ(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=PJ(d,n);return i(d,p),p};return a=o,(...d)=>a(RJ(...d))},MJ=[],zn=e=>{const t=n=>n[e]||MJ;return t.isThemeGetter=!0,t},h5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IJ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LJ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$J=/\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$/,BJ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UJ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FJ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>IJ.test(e),st=e=>!!e&&!Number.isNaN(Number(e)),Hs=e=>!!e&&Number.isInteger(Number(e)),zx=e=>e.endsWith("%")&&st(e.slice(0,-1)),Wa=e=>LJ.test(e),m5=()=>!0,qJ=e=>$J.test(e)&&!BJ.test(e),fk=()=>!1,HJ=e=>UJ.test(e),KJ=e=>FJ.test(e),GJ=e=>!Me(e)&&!Ie(e),VJ=e=>No(e,v5,fk),Me=e=>h5.test(e),Jo=e=>No(e,b5,qJ),iz=e=>No(e,tee,st),ZJ=e=>No(e,w5,m5),YJ=e=>No(e,x5,fk),az=e=>No(e,g5,fk),WJ=e=>No(e,y5,KJ),um=e=>No(e,S5,HJ),Ie=e=>p5.test(e),Zd=e=>Vl(e,b5),QJ=e=>Vl(e,x5),sz=e=>Vl(e,g5),XJ=e=>Vl(e,v5),JJ=e=>Vl(e,y5),dm=e=>Vl(e,S5,!0),eee=e=>Vl(e,w5,!0),No=(e,t,n)=>{const r=h5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Vl=(e,t,n=!1)=>{const r=p5.exec(e);return r?r[1]?t(r[1]):n:!1},g5=e=>e==="position"||e==="percentage",y5=e=>e==="image"||e==="url",v5=e=>e==="length"||e==="size"||e==="bg-size",b5=e=>e==="length",tee=e=>e==="number",x5=e=>e==="family-name",w5=e=>e==="number"||e==="weight",S5=e=>e==="shadow",nee=()=>{const e=zn("color"),t=zn("font"),n=zn("text"),r=zn("font-weight"),i=zn("tracking"),a=zn("leading"),o=zn("breakpoint"),u=zn("container"),d=zn("spacing"),f=zn("radius"),p=zn("shadow"),m=zn("inset-shadow"),y=zn("text-shadow"),v=zn("drop-shadow"),w=zn("blur"),S=zn("perspective"),j=zn("aspect"),N=zn("ease"),O=zn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...C(),Ie,Me],E=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],P=()=>[Ie,Me,d],I=()=>[qs,"full","auto",...P()],q=()=>[Hs,"none","subgrid",Ie,Me],B=()=>["auto",{span:["full",Hs,Ie,Me]},Hs,Ie,Me],$=()=>[Hs,"auto",Ie,Me],V=()=>["auto","min","max","fr",Ie,Me],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...P()],J=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],pe=()=>[qs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Se=()=>[qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],R=()=>[e,Ie,Me],U=()=>[...C(),sz,az,{position:[Ie,Me]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",XJ,VJ,{size:[Ie,Me]}],Q=()=>[zx,Zd,Jo],se=()=>["","none","full",f,Ie,Me],ae=()=>["",st,Zd,Jo],he=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[st,zx,sz,az],de=()=>["","none",w,Ie,Me],Ee=()=>["none",st,Ie,Me],X=()=>["none",st,Ie,Me],Fe=()=>[st,Ie,Me],De=()=>[qs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wa],breakpoint:[Wa],color:[m5],container:[Wa],"drop-shadow":[Wa],ease:["in","out","in-out"],font:[GJ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wa],shadow:[Wa],spacing:["px",st],text:[Wa],"text-shadow":[Wa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Me,Ie,j]}],container:["container"],columns:[{columns:[st,Me,Ie,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Hs,"auto",Ie,Me]}],basis:[{basis:[qs,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,qs,"auto","initial","none",Me]}],grow:[{grow:["",st,Ie,Me]}],shrink:[{shrink:["",st,Ie,Me]}],order:[{order:[Hs,"first","last","none",Ie,Me]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],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:J()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,Zd,Jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,eee,ZJ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zx,Me]}],"font-family":[{font:[QJ,YJ,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,Ie,Me]}],"line-clamp":[{"line-clamp":[st,"none",Ie,iz]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ie,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Ie,Jo]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[st,"auto",Ie,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",Ie,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",Ie,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:U()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hs,Ie,Me],radial:["",Ie,Me],conic:[Hs,Ie,Me]},JJ,WJ]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Ie,Me]}],"outline-w":[{outline:["",st,Zd,Jo]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,dm,um]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",m,dm,um]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[st,Jo]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,dm,um]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[st,Ie,Me]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"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":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Ie,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Me]}],filter:[{filter:["","none",Ie,Me]}],blur:[{blur:de()}],brightness:[{brightness:[st,Ie,Me]}],contrast:[{contrast:[st,Ie,Me]}],"drop-shadow":[{"drop-shadow":["","none",v,dm,um]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",st,Ie,Me]}],"hue-rotate":[{"hue-rotate":[st,Ie,Me]}],invert:[{invert:["",st,Ie,Me]}],saturate:[{saturate:[st,Ie,Me]}],sepia:[{sepia:["",st,Ie,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Me]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[st,Ie,Me]}],"backdrop-contrast":[{"backdrop-contrast":[st,Ie,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Ie,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Ie,Me]}],"backdrop-invert":[{"backdrop-invert":["",st,Ie,Me]}],"backdrop-opacity":[{"backdrop-opacity":[st,Ie,Me]}],"backdrop-saturate":[{"backdrop-saturate":[st,Ie,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Ie,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",Ie,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Ie,Me]}],ease:[{ease:["linear","initial",N,Ie,Me]}],delay:[{delay:[st,Ie,Me]}],animate:[{animate:["none",O,Ie,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ie,Me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[Ie,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,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",Ie,Me]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[st,Zd,Jo,iz]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ree=DJ(nee);function zi(...e){return ree(Et(e))}const iee=l5("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"}}),be=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?cJ:"button";return c.jsx(o,{ref:a,className:zi(iee({variant:t,size:n,className:e})),...i})});be.displayName="Button";const aee=l5("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 j5({className:e,variant:t,...n}){return c.jsx("div",{className:zi(aee({variant:t}),e),...n})}function oz({compact:e=!1}){return c.jsxs(qt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[c.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),c.jsxs("span",{className:"brand-copy",children:[c.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:c.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Df({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 c.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 vt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return c.jsx(j5,{variant:r,...n,children:t})}function Yy({status:e}){return c.jsx(vt,{tone:n5(e),children:Gy(e)})}function uo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function see(e,t){const n=b.createContext(t),r=a=>{const{children:o,...u}=a,d=b.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=b.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function oee(e,t=[]){let n=[];function r(a,o){const u=b.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...w}=m,S=y?.[e]?.[d]||u,j=b.useMemo(()=>w,Object.values(w));return c.jsx(S.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||u,w=b.useContext(v);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>b.createContext(o));return function(u){const d=u?.[e]||a;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,lee(i,...t)]}function lee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Mf=globalThis?.document?b.useLayoutEffect:()=>{},cee=Ry[" useId ".trim().toString()]||(()=>{}),uee=0;function Tx(e){const[t,n]=b.useState(cee());return Mf(()=>{n(r=>r??String(uee++))},[e]),e||(t?`radix-${t}`:"")}var dee=Ry[" useInsertionEffect ".trim().toString()]||Mf;function fee({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=hee({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const f=b.useCallback(p=>{if(u){const m=pee(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[u,e,a,o]);return[d,f]}function hee({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return dee(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function pee(e){return typeof e=="function"}function k5(e){const t=mee(e),n=b.forwardRef((r,i)=>{const{children:a,...o}=r,u=b.Children.toArray(a),d=u.find(yee);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return c.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return c.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function mee(e){const t=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const o=bee(i),u=vee(a,i.props);return i.type!==b.Fragment&&(u.ref=r?uk(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gee=Symbol("radix.slottable");function yee(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gee}function vee(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function bee(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 xee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fs=xee.reduce((e,t)=>{const n=k5(`Primitive.${t}`),r=b.forwardRef((i,a)=>{const{asChild:o,...u}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wee(e,t){e&&ql.flushSync(()=>e.dispatchEvent(t))}function If(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function See(e,t=globalThis?.document){const n=If(e);b.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 jee="DismissableLayer",o1="dismissableLayer.update",kee="dismissableLayer.pointerDownOutside",Nee="dismissableLayer.focusOutside",lz,N5=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),C5=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:u,...d}=e,f=b.useContext(N5),[p,m]=b.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=b.useState({}),w=Gl(t,A=>m(A)),S=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(j),O=p?S.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=O>=N,T=Aee(A=>{const P=A.target,I=[...f.branches].some(q=>q.contains(P));!C||I||(i?.(A),o?.(A),A.defaultPrevented||u?.())},y),E=Oee(A=>{const P=A.target;[...f.branches].some(q=>q.contains(P))||(a?.(A),o?.(A),A.defaultPrevented||u?.())},y);return See(A=>{O===f.layers.size-1&&(r?.(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))},y),b.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(lz=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),cz(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=lz)}},[p,y,n,f]),b.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),cz())},[p,f]),b.useEffect(()=>{const A=()=>v({});return document.addEventListener(o1,A),()=>document.removeEventListener(o1,A)},[]),c.jsx(fs.div,{...d,ref:w,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:uo(e.onFocusCapture,E.onFocusCapture),onBlurCapture:uo(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:uo(e.onPointerDownCapture,T.onPointerDownCapture)})});C5.displayName=jee;var Cee="DismissableLayerBranch",_ee=b.forwardRef((e,t)=>{const n=b.useContext(N5),r=b.useRef(null),i=Gl(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),c.jsx(fs.div,{...e,ref:i})});_ee.displayName=Cee;function Aee(e,t=globalThis?.document){const n=If(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){_5(kee,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Oee(e,t=globalThis?.document){const n=If(e),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&_5(Nee,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function cz(){const e=new CustomEvent(o1);document.dispatchEvent(e)}function _5(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wee(i,a):i.dispatchEvent(a)}var Px="focusScope.autoFocusOnMount",Rx="focusScope.autoFocusOnUnmount",uz={bubbles:!1,cancelable:!0},Eee="FocusScope",A5=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[u,d]=b.useState(null),f=If(i),p=If(a),m=b.useRef(null),y=Gl(t,S=>d(S)),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const C=_.target;u.contains(C)?m.current=C:Zs(m.current,{select:!0})},j=function(_){if(v.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||Zs(m.current,{select:!0}))},N=function(_){if(document.activeElement===document.body)for(const T of _)T.removedNodes.length>0&&Zs(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",j);const O=new MutationObserver(N);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",j),O.disconnect()}}},[r,u,v.paused]),b.useEffect(()=>{if(u){fz.add(v);const S=document.activeElement;if(!u.contains(S)){const N=new CustomEvent(Px,uz);u.addEventListener(Px,f),u.dispatchEvent(N),N.defaultPrevented||(zee(Mee(O5(u)),{select:!0}),document.activeElement===S&&Zs(u))}return()=>{u.removeEventListener(Px,f),setTimeout(()=>{const N=new CustomEvent(Rx,uz);u.addEventListener(Rx,p),u.dispatchEvent(N),N.defaultPrevented||Zs(S??document.body,{select:!0}),u.removeEventListener(Rx,p),fz.remove(v)},0)}}},[u,f,p,v]);const w=b.useCallback(S=>{if(!n&&!r||v.paused)return;const j=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(j&&N){const O=S.currentTarget,[_,C]=Tee(O);_&&C?!S.shiftKey&&N===C?(S.preventDefault(),n&&Zs(_,{select:!0})):S.shiftKey&&N===_&&(S.preventDefault(),n&&Zs(C,{select:!0})):N===O&&S.preventDefault()}},[n,r,v.paused]);return c.jsx(fs.div,{tabIndex:-1,...o,ref:y,onKeyDown:w})});A5.displayName=Eee;function zee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function Tee(e){const t=O5(e),n=dz(t,e),r=dz(t.reverse(),e);return[n,r]}function O5(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 dz(e,t){for(const n of e)if(!Pee(n,{upTo:t}))return n}function Pee(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 Ree(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ree(e)&&t&&e.select()}}var fz=Dee();function Dee(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=hz(e,t),e.unshift(t)},remove(t){e=hz(e,t),e[0]?.resume()}}}function hz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mee(e){return e.filter(t=>t.tagName!=="A")}var Iee="Portal",E5=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=b.useState(!1);Mf(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?gK.createPortal(c.jsx(fs.div,{...r,ref:t}),o):null});E5.displayName=Iee;function Lee(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Wy=e=>{const{present:t,children:n}=e,r=$ee(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=Gl(r.ref,Bee(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};Wy.displayName="Presence";function $ee(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef("none"),o=e?"mounted":"unmounted",[u,d]=Lee(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=fm(r.current);a.current=u==="mounted"?f:"none"},[u]),Mf(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=fm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Mf(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const S=fm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=fm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function fm(e){return e?.animationName||"none"}function Bee(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 Dx=0;function Uee(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pz()),document.body.insertAdjacentElement("beforeend",e[1]??pz()),Dx++,()=>{Dx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dx--}},[])}function pz(){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 da=function(){return da=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},da.apply(this,arguments)};function z5(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 Fee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Qm="right-scroll-bar-position",Xm="width-before-scroll-bar",qee="with-scroll-bars-hidden",Hee="--removed-body-scroll-bar-size";function Mx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Kee(e,t){var n=b.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 Gee=typeof window<"u"?b.useLayoutEffect:b.useEffect,mz=new WeakMap;function Vee(e,t){var n=Kee(null,function(r){return e.forEach(function(i){return Mx(i,r)})});return Gee(function(){var r=mz.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(u){a.has(u)||Mx(u,null)}),a.forEach(function(u){i.has(u)||Mx(u,o)})}mz.set(n,e)},[e]),n}function Zee(e){return e}function Yee(e,t){t===void 0&&(t=Zee);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function Wee(e){e===void 0&&(e={});var t=Yee(null);return t.options=da({async:!0,ssr:!1},e),t}var T5=function(e){var t=e.sideCar,n=z5(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 b.createElement(r,da({},n))};T5.isSideCarExport=!0;function Qee(e,t){return e.useMedium(t),T5}var P5=Wee(),Ix=function(){},Qy=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Ix,onWheelCapture:Ix,onTouchMoveCapture:Ix}),i=r[0],a=r[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,S=e.inert,j=e.allowPinchZoom,N=e.as,O=N===void 0?"div":N,_=e.gapMode,C=z5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=y,E=Vee([n,t]),A=da(da({},C),i);return b.createElement(b.Fragment,null,p&&b.createElement(T,{sideCar:P5,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:S,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?b.cloneElement(b.Children.only(u),da(da({},A),{ref:E})):b.createElement(O,da({},A,{className:d,ref:E}),u))});Qy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qy.classNames={fullWidth:Xm,zeroRight:Qm};var Xee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xee();return t&&e.setAttribute("nonce",t),e}function ete(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jee())&&(ete(t,n),tte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rte=function(){var e=nte();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R5=function(){var e=rte(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ite={left:0,top:0,right:0,gap:0},Lx=function(e){return parseInt(e||"",10)||0},ate=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[Lx(n),Lx(r),Lx(i)]},ste=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ite;var t=ate(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])}},ote=R5(),cu="data-scroll-locked",lte=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
-
.`.concat(qee,` {
|
|
54
|
-
overflow: hidden `).concat(r,`;
|
|
55
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
-
}
|
|
57
|
-
body[`).concat(cu,`] {
|
|
58
|
-
overflow: hidden `).concat(r,`;
|
|
59
|
-
overscroll-behavior: contain;
|
|
60
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
-
padding-left: `.concat(i,`px;
|
|
62
|
-
padding-top: `).concat(a,`px;
|
|
63
|
-
padding-right: `).concat(o,`px;
|
|
64
|
-
margin-left:0;
|
|
65
|
-
margin-top:0;
|
|
66
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
67
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat(Qm,` {
|
|
71
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(Xm,` {
|
|
75
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(Qm," .").concat(Qm,` {
|
|
79
|
-
right: 0 `).concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Xm," .").concat(Xm,` {
|
|
83
|
-
margin-right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
body[`).concat(cu,`] {
|
|
87
|
-
`).concat(Hee,": ").concat(u,`px;
|
|
88
|
-
}
|
|
89
|
-
`)},gz=function(){var e=parseInt(document.body.getAttribute(cu)||"0",10);return isFinite(e)?e:0},cte=function(){b.useEffect(function(){return document.body.setAttribute(cu,(gz()+1).toString()),function(){var e=gz()-1;e<=0?document.body.removeAttribute(cu):document.body.setAttribute(cu,e.toString())}},[])},ute=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;cte();var a=b.useMemo(function(){return ste(i)},[i]);return b.createElement(ote,{styles:lte(a,!t,i,n?"":"!important")})},l1=!1;if(typeof window<"u")try{var hm=Object.defineProperty({},"passive",{get:function(){return l1=!0,!0}});window.addEventListener("test",hm,hm),window.removeEventListener("test",hm,hm)}catch{l1=!1}var Mc=l1?{passive:!1}:!1,dte=function(e){return e.tagName==="TEXTAREA"},D5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dte(e)&&n[t]==="visible")},fte=function(e){return D5(e,"overflowY")},hte=function(e){return D5(e,"overflowX")},yz=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=M5(e,r);if(i){var a=I5(e,r),o=a[1],u=a[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},M5=function(e,t){return e==="v"?fte(t):hte(t)},I5=function(e,t){return e==="v"?pte(t):mte(t)},gte=function(e,t){return e==="h"&&t==="rtl"?-1:1},yte=function(e,t,n,r,i){var a=gte(e,window.getComputedStyle(t).direction),o=a*r,u=n.target,d=t.contains(u),f=!1,p=o>0,m=0,y=0;do{if(!u)break;var v=I5(e,u),w=v[0],S=v[1],j=v[2],N=S-j-a*w;(w||N)&&M5(e,u)&&(m+=N,y+=w);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},pm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vz=function(e){return[e.deltaX,e.deltaY]},bz=function(e){return e&&"current"in e?e.current:e},vte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bte=function(e){return`
|
|
90
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
-
`)},xte=0,Ic=[];function wte(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(xte++)[0],a=b.useState(R5)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=Fee([e.lockRef.current],(e.shards||[]).map(bz),!0).filter(Boolean);return S.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(S,j){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!o.current.allowPinchZoom;var N=pm(S),O=n.current,_="deltaX"in S?S.deltaX:O[0]-N[0],C="deltaY"in S?S.deltaY:O[1]-N[1],T,E=S.target,A=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in S&&A==="h"&&E.type==="range")return!1;var P=window.getSelection(),I=P&&P.anchorNode,q=I?I===E||I.contains(E):!1;if(q)return!1;var B=yz(A,E);if(!B)return!0;if(B?T=A:(T=A==="v"?"h":"v",B=yz(A,E)),!B)return!1;if(!r.current&&"changedTouches"in S&&(_||C)&&(r.current=T),!T)return!0;var $=r.current||T;return yte($,j,S,$==="h"?_:C)},[]),d=b.useCallback(function(S){var j=S;if(!(!Ic.length||Ic[Ic.length-1]!==a)){var N="deltaY"in j?vz(j):pm(j),O=t.current.filter(function(T){return T.name===j.type&&(T.target===j.target||j.target===T.shadowParent)&&vte(T.delta,N)})[0];if(O&&O.should){j.cancelable&&j.preventDefault();return}if(!O){var _=(o.current.shards||[]).map(bz).filter(Boolean).filter(function(T){return T.contains(j.target)}),C=_.length>0?u(j,_[0]):!o.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=b.useCallback(function(S,j,N,O){var _={name:S,delta:j,target:N,should:O,shadowParent:Ste(N)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=b.useCallback(function(S){n.current=pm(S),r.current=void 0},[]),m=b.useCallback(function(S){f(S.type,vz(S),S.target,u(S,e.lockRef.current))},[]),y=b.useCallback(function(S){f(S.type,pm(S),S.target,u(S,e.lockRef.current))},[]);b.useEffect(function(){return Ic.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Mc),document.addEventListener("touchmove",d,Mc),document.addEventListener("touchstart",p,Mc),function(){Ic=Ic.filter(function(S){return S!==a}),document.removeEventListener("wheel",d,Mc),document.removeEventListener("touchmove",d,Mc),document.removeEventListener("touchstart",p,Mc)}},[]);var v=e.removeScrollBar,w=e.inert;return b.createElement(b.Fragment,null,w?b.createElement(a,{styles:bte(i)}):null,v?b.createElement(ute,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ste(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jte=Qee(P5,wte);var L5=b.forwardRef(function(e,t){return b.createElement(Qy,da({},e,{ref:t,sideCar:jte}))});L5.classNames=Qy.classNames;var kte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lc=new WeakMap,mm=new WeakMap,gm={},$x=0,$5=function(e){return e&&(e.host||$5(e.parentNode))},Nte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$5(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})},Cte=function(e,t,n,r){var i=Nte(t,Array.isArray(e)?e:[e]);gm[n]||(gm[n]=new WeakMap);var a=gm[n],o=[],u=new Set,d=new Set(i),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(u.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",S=(Lc.get(y)||0)+1,j=(a.get(y)||0)+1;Lc.set(y,S),a.set(y,j),o.push(y),S===1&&w&&mm.set(y,!0),j===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return p(t),u.clear(),$x++,function(){o.forEach(function(m){var y=Lc.get(m)-1,v=a.get(m)-1;Lc.set(m,y),a.set(m,v),y||(mm.has(m)||m.removeAttribute(r),mm.delete(m)),v||m.removeAttribute(n)}),$x--,$x||(Lc=new WeakMap,Lc=new WeakMap,mm=new WeakMap,gm={})}},_te=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=kte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Cte(r,i,n,"aria-hidden")):function(){return null}},Xy="Dialog",[B5]=oee(Xy),[Ate,Wi]=B5(Xy),U5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,u=b.useRef(null),d=b.useRef(null),[f,p]=fee({prop:r,defaultProp:i??!1,onChange:a,caller:Xy});return c.jsx(Ate,{scope:t,triggerRef:u,contentRef:d,contentId:Tx(),titleId:Tx(),descriptionId:Tx(),open:f,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};U5.displayName=Xy;var F5="DialogTrigger",Ote=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(F5,n),a=Gl(t,i.triggerRef);return c.jsx(fs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mk(i.open),...r,ref:a,onClick:uo(e.onClick,i.onOpenToggle)})});Ote.displayName=F5;var hk="DialogPortal",[Ete,q5]=B5(hk,{forceMount:void 0}),H5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wi(hk,t);return c.jsx(Ete,{scope:t,forceMount:n,children:b.Children.map(r,o=>c.jsx(Wy,{present:n||a.open,children:c.jsx(E5,{asChild:!0,container:i,children:o})}))})};H5.displayName=hk;var Og="DialogOverlay",K5=b.forwardRef((e,t)=>{const n=q5(Og,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wi(Og,e.__scopeDialog);return a.modal?c.jsx(Wy,{present:r||a.open,children:c.jsx(Tte,{...i,ref:t})}):null});K5.displayName=Og;var zte=k5("DialogOverlay.RemoveScroll"),Tte=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(Og,n);return c.jsx(L5,{as:zte,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(fs.div,{"data-state":mk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Tl="DialogContent",G5=b.forwardRef((e,t)=>{const n=q5(Tl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wi(Tl,e.__scopeDialog);return c.jsx(Wy,{present:r||a.open,children:a.modal?c.jsx(Pte,{...i,ref:t}):c.jsx(Rte,{...i,ref:t})})});G5.displayName=Tl;var Pte=b.forwardRef((e,t)=>{const n=Wi(Tl,e.__scopeDialog),r=b.useRef(null),i=Gl(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return _te(a)},[]),c.jsx(V5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:uo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:uo(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&a.preventDefault()}),onFocusOutside:uo(e.onFocusOutside,a=>a.preventDefault())})}),Rte=b.forwardRef((e,t)=>{const n=Wi(Tl,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return c.jsx(V5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),V5=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,u=Wi(Tl,n),d=b.useRef(null),f=Gl(t,d);return Uee(),c.jsxs(c.Fragment,{children:[c.jsx(A5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:c.jsx(C5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":mk(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Dte,{titleId:u.titleId}),c.jsx(Ite,{contentRef:d,descriptionId:u.descriptionId})]})]})}),pk="DialogTitle",Z5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(pk,n);return c.jsx(fs.h2,{id:i.titleId,...r,ref:t})});Z5.displayName=pk;var Y5="DialogDescription",W5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(Y5,n);return c.jsx(fs.p,{id:i.descriptionId,...r,ref:t})});W5.displayName=Y5;var Q5="DialogClose",X5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wi(Q5,n);return c.jsx(fs.button,{type:"button",...r,ref:t,onClick:uo(e.onClick,()=>i.onOpenChange(!1))})});X5.displayName=Q5;function mk(e){return e?"open":"closed"}var J5="DialogTitleWarning",[fCe,e4]=see(J5,{contentName:Tl,titleName:pk,docsSlug:"dialog"}),Dte=({titleId:e})=>{const t=e4(J5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
93
|
-
|
|
94
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
95
|
-
|
|
96
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Mte="DialogDescriptionWarning",Ite=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${e4(Mte).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},t4=U5,n4=H5,gk=K5,yk=G5,vk=Z5,r4=W5,i4=X5;const Lte=t4,$te=n4,a4=b.forwardRef(({className:e,...t},n)=>c.jsx(gk,{ref:n,className:zi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));a4.displayName=gk.displayName;const Bte=400,Ute=1200,Fte=720,s4=b.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=b.useState(Fte),o=b.useRef(!1),u=b.useRef(0),d=b.useRef(0),f=b.useCallback(y=>{o.current=!0,u.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=b.useCallback(y=>{if(!o.current)return;const v=u.current-y.clientX,w=Math.min(Ute,Math.max(Bte,d.current+v));a(w)},[]),m=b.useCallback(()=>{o.current=!1},[]);return c.jsxs($te,{children:[c.jsx(a4,{}),c.jsxs(yk,{ref:r,className:zi("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:[c.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:f,onPointerMove:p,onPointerUp:m}),t,c.jsxs(i4,{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:[c.jsx(lh,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});s4.displayName=yk.displayName;const qte=({className:e,...t})=>c.jsx("div",{className:zi("flex flex-col gap-1.5 pr-10",e),...t}),o4=b.forwardRef(({className:e,...t},n)=>c.jsx(vk,{ref:n,className:zi("text-lg font-medium text-zinc-50",e),...t}));o4.displayName=vk.displayName;const l4=b.forwardRef(({className:e,...t},n)=>c.jsx(r4,{ref:n,className:zi("text-sm text-zinc-500",e),...t}));l4.displayName=r4.displayName;function Hte({title:e,subtitle:t,children:n,open:r,onClose:i}){return c.jsx(Lte,{open:r,onOpenChange:a=>a?void 0:i(),children:c.jsxs(s4,{children:[c.jsxs(qte,{className:"drawer-head",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),c.jsx(o4,{id:"drawer-title",children:e}),c.jsx(l4,{className:"sr-only",children:t})]}),c.jsx("div",{className:"drawer-body",children:n})]})})}function Wn({text:e}){const[t,n]=b.useState(null),r=b.useRef(null),i=b.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=b.useCallback(()=>n(null),[]);return c.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[c.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&ql.createPortal(c.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 xz(e,t){const n=Kte(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(f=>f.startsWith("**")&&f.endsWith("**")?{type:"bold",value:f.slice(2,-2)}:{type:"text",value:f}),i=n.flatMap(f=>f.terms).filter(f=>f.trim().length>1);if(i.length===0)return r.map((f,p)=>f.type==="bold"?qi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=p.toLowerCase();d.has(m)||d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((y,v)=>{if(!y)return null;if(v%2===1){const S=d.get(y.toLowerCase())??"answer-highlight";return f.type==="bold"?qi.createElement("mark",{key:`hl-${p}-${v}`,className:S},qi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):qi.createElement("mark",{key:`hl-${p}-${v}`,className:S},y)}return f.type==="bold"?qi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Kte(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Bx(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 Gte({evidence:e,project:t,onClose:n}){const[r,i]=b.useState(!1),[a,o]=b.useState("mentions"),[u,d]=b.useState(-1),[f,p]=b.useState(null),[m,y]=b.useState(!1),[v,w]=b.useState({}),S=GQ(t.project),j=new Set(S.map(n1)),N=e.runHistory,O=N.length>1,[_,C]=b.useState(null),T=b.useRef(!1);b.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Q=N.at(-1);Q&&(T.current=!0,El(Q.runId).then(se=>{const ae=se.snapshots.find(he=>he.keyword===e.keyword&&he.provider===e.provider);ae&&C({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:Q.visibilityTransition,provider:ae.provider,model:ae.model??e.model,answerSnippet:ae.answerText??e.answerSnippet,citedDomains:ae.citedDomains??e.citedDomains,competitorDomains:ae.competitorOverlap??e.competitorDomains,recommendedCompetitors:ae.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ae.matchedTerms??e.matchedTerms??[],groundingSources:ae.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,N]);const E=u>=0&&f!==null,A=E?f:_||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:N.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",I=P?!1:A.visibilityState!=null?A.visibilityState==="visible":A.answerMentioned!=null?A.answerMentioned:A.citationState==="cited"||A.citationState==="emerging",q=A.answerMentioned!=null||A.visibilityState!=null||A.recommendedCompetitors.length>0,B=A.citedDomains.length>0||A.groundingSources.length>0||A.evidenceUrls.length>0,$=t.project.displayName||t.project.name,V=[...S.map(n1),$,$.split(" ").slice(0,2).join(" "),...A.matchedTerms].filter(Q=>Q.trim().length>2),te=[...A.competitorDomains.flatMap(Q=>{const se=Q.split(".")[0];return se&&se.length>=4?[se]:[]}),...A.recommendedCompetitors].filter(Q=>Q.trim().length>2),Y=[{terms:V,className:"answer-highlight-brand"},...te.length>0?[{terms:te,className:"answer-highlight-competitor"}]:[]],H=P?"pending":A.visibilityTransition==="lost"?"lost":I?"cited":"not-cited",J=b.useRef(0),pe=b.useCallback(async Q=>{const se=++J.current;if(Q===-1||Q===N.length-1){d(-1),p(null),i(!1);return}d(Q),i(!1);const ae=N[Q],he=`${ae.runId}::${e.keyword}::${e.provider}`;if(v[he]){p(v[he]);return}y(!0);try{const Ne=await El(ae.runId);if(se!==J.current)return;const ne=Ne.snapshots.find(Ee=>Ee.keyword===e.keyword&&Ee.provider===e.provider)??Ne.snapshots.find(Ee=>Ee.keyword===e.keyword),de=ne?{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ae.visibilityTransition,provider:ne.provider,model:ne.model??null,answerSnippet:ne.answerText??"",citedDomains:ne.citedDomains,competitorDomains:ne.competitorOverlap,recommendedCompetitors:ne.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??[],groundingSources:ne.groundingSources,evidenceUrls:[],changeLabel:Bx(ae.visibilityTransition,ae.visibilityState),summary:""}:{citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Bx(ae.visibilityTransition,ae.visibilityState),summary:"Snapshot data not available for this run."};w(Ee=>({...Ee,[he]:de})),p(de)}catch{if(se!==J.current)return;p({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Bx(ae.visibilityTransition,ae.visibilityState),summary:"Failed to load historical run data."})}finally{se===J.current&&y(!1)}},[N,e.keyword,e.provider,v]),R=(E||e.historyScope!=="provider")&&A.model?`${A.provider} (${A.model}) · ${A.changeLabel.toLowerCase()}`:`${A.provider} · ${A.changeLabel.toLowerCase()}`,U=!E&&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(" · "):"",F=I?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:R}:A.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:R}: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:R},D=()=>{if(!A.answerSnippet)return null;const Q=A.answerSnippet.split(`
|
|
97
|
-
`),se=[];let ae=[],he=0;const Ne=()=>{if(ae.length===0)return;const ne=ae.join(" ").trim();ne&&se.push(c.jsx("p",{className:se.length>0?"mt-2.5":"",children:xz(ne,Y)},he++)),ae=[]};for(const ne of Q){const de=ne.trim();if(/^[-\u2013\u2014]{3,}$/.test(de)){Ne(),se.push(c.jsx("hr",{className:"border-zinc-800/60 my-3"},he++));continue}const Ee=de.match(/^(#{1,3})\s+(.+)$/);if(Ee){Ne();const X=Ee[1].length,Fe=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],De=X===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":X===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(c.jsx("p",{className:De,children:xz(Fe,Y)},he++));continue}if(de===""){Ne();continue}ae.push(de)}return Ne(),se};return c.jsx(t4,{open:!0,onOpenChange:Q=>{Q||n()},children:c.jsxs(n4,{children:[c.jsx(gk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),c.jsxs(yk,{className:"evidence-modal","aria-describedby":void 0,children:[c.jsxs("div",{className:"evidence-modal-header",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",A.provider||"All providers"]}),c.jsx(vk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),c.jsxs(i4,{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:[c.jsx(lh,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]}),O&&c.jsxs("div",{className:"evidence-modal-timeline",children:[c.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),c.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:N.map((Q,se)=>{const ae=u===-1&&se===N.length-1||u===se,he=Q.visibilityState??(Q.answerMentioned?"visible":"not-visible"),Ne=Q.visibilityTransition??he,ne=he==="visible"?"bg-emerald-400":Ne==="emerging"?"bg-amber-400":Ne==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(Q.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),X=!!(Q.model&&se>0&&N[se-1]?.model&&N[se-1].model!==Q.model);return c.jsxs("button",{type:"button",className:`evidence-run-dot ${ae?"evidence-run-dot--selected":""}`,onClick:()=>pe(se===N.length-1?-1:se),"aria-label":[`Run ${Ee}: ${he}`,Q.model?`model ${Q.model}`:null,X?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ae,children:[c.jsx("span",{className:`size-2 rounded-full ${ne} ${X?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),c.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},se)})}),u>=0&&u<N.length&&c.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(N[u].createdAt).toLocaleString()," ","—"," ",c.jsx("span",{className:"capitalize",children:N[u].visibilityState??(N[u].answerMentioned?"visible":"not-visible")}),c.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>pe(-1),children:["←"," Back to latest"]})]}),!E&&(e.modelTransitions?.length??0)>0&&c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Q=>c.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${Q.fromModel??"unknown"} -> ${Q.toModel??"unknown"} on ${new Date(Q.createdAt).toLocaleDateString()}`},`${Q.runId}:${Q.toModel??"unknown"}`))})]}),c.jsxs("div",{className:"evidence-modal-body",children:[m&&c.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!m&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"evidence-modal-main",children:[c.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[c.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:F.label}),c.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:F.title}),c.jsx("p",{className:"evidence-position-meta",children:F.meta}),U&&c.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:U})]}),A.answerSnippet&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),c.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),A.answerSnippet.length>280&&c.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&&!m&&c.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"}),!E&&e.relatedTechnicalSignals.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:I?"Why you're visible":"What to fix"}),c.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Q,se)=>c.jsxs("div",{className:"action-item",children:[c.jsx("svg",{className:`action-item-icon ${I?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:I?c.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),c.jsx("span",{className:"action-item-text",children:Q})]},se))})]}),A.summary&&c.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:A.summary})]}),c.jsxs("div",{className:"evidence-modal-sidebar",children:[(q||B)&&c.jsxs("div",{className:"sidebar-tabs",children:[c.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),c.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Answer visibility"}),c.jsx(Wn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),c.jsxs("div",{className:`mention-status mention-status--${I?"visible":"not-visible"}`,children:[c.jsx("span",{className:"mention-status-icon",children:P?"…":I?"✓":"—"}),c.jsx("span",{className:"mention-status-label",children:P?"Pending":I?"Visible":"Not visible"})]}),A.matchedTerms.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:A.matchedTerms.map(Q=>c.jsx("span",{className:"mention-chip mention-chip--brand",children:Q},Q))})]}),!P&&!I&&A.matchedTerms.length===0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(Q=>c.jsx("span",{className:"mention-chip mention-chip--muted",children:Q},Q))}),c.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)&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Competitors in answer"}),c.jsx(Wn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const Q=A.competitorDomains.map(he=>he.replace(/^www\./,"")),se=new Set(Q.map(he=>Z2(he.replace(/\.[^.]+$/,""))));return[...A.recommendedCompetitors.filter(he=>!se.has(Z2(he))),...Q].map(he=>c.jsx("span",{className:"mention-chip mention-chip--competitor",children:he},he))})()})]})]}),a==="sources"&&c.jsxs(c.Fragment,{children:[A.citedDomains.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Domains from source links"}),c.jsx(Wn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),c.jsx("div",{className:"citation-leaderboard",children:A.citedDomains.map((Q,se)=>{const ae=Q.toLowerCase().replace(/^www\./,""),he=j.has(ae),Ne=!he&&A.competitorDomains.some(de=>de.toLowerCase().replace(/^www\./,"")===ae),ne=he?"you":Ne?"competitor":"other";return c.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ne}`,children:[c.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),c.jsx("span",{className:"citation-leaderboard-domain",children:Q}),he&&c.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Ne&&c.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Q)})})]}),A.groundingSources.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsxs("span",{children:["Grounding source links (",A.groundingSources.length,")"]}),c.jsx(Wn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),c.jsx("ul",{className:"grid gap-0.5",children:A.groundingSources.map((Q,se)=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:Q.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q.title||Q.uri})},se))})]}),A.evidenceUrls.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),c.jsx("ul",{className:"grid gap-1",children:A.evidenceUrls.map(Q=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:Q,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q})},Q))})]}),A.citedDomains.length===0&&A.groundingSources.length===0&&A.evidenceUrls.length===0&&c.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",E?"for this run":"yet"]})]}),!q&&!B&&c.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",E?"for this run":"yet"]})]})]})]})]})]})})}function Ui(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 Ux=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Jy(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 Vte=Jy({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"}),Zte=Jy({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"}),Yte=Jy({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"}),Wte=Jy({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"}),Qte=[{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:Ui(["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:Ui(["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:Ui(["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:Ui(["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:Ui(["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:Ui(["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:Ui(["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:Ui(["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:Ui(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Ux[0],Ux[1],Ui(["cited","cited","cited","cited","cited"]),Ux[2],2/7,Ui(["not-cited","not-cited","not-cited","cited"]);function Xte(e,t){return e.projects.find(n=>n.project.id===t)}function Jte(e,t){return e.runs.find(n=>n.id===t)}function ene(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 tne={regression:"negative",gain:"positive",opportunity:"caution"},nne={regression:"lost",gain:"emerging",opportunity:"not-cited"},rne={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function ine(e){return{id:e.id,tone:tne[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??rne[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:nne[e.type]}]}}function ane(e){return e.filter(t=>!t.dismissed).map(ine)}function c4(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,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function c1(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function sne(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return`${i}m ${a}s`}function bk(e){switch(e){case Kt["answer-visibility"]:return"Answer visibility sweep";case Kt["gsc-sync"]:return"GSC sync";case Kt["inspect-sitemap"]:return"Sitemap inspection";case Kt["ga-sync"]:return"GA sync";case Kt["bing-inspect"]:return"Bing URL inspection";case Kt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Kt["site-audit"]:return"Site audit";case Kt["backlink-extract"]:return"Backlink extract"}}function one(e){return e===bf.manual?"Manual":e===bf.scheduled?"Scheduled":e===bf["config-apply"]?"Config apply":e}function xk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:bk(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?c1(e.startedAt):c1(e.createdAt),duration:sne(e.startedAt,e.finishedAt),statusDetail:e.error?u4(e.error):lne(e),summary:cne(e),triggerLabel:one(e.trigger)}}function u4(e){const t=sk(e);return t.length>200?t.slice(0,200)+"…":t}function lne(e){switch(e.status){case gn.queued:return"Waiting for execution slot.";case gn.running:return"Provider queries in progress.";case gn.completed:return"All key phrases checked.";case gn.partial:return"Run completed with some key phrases skipped.";case gn.failed:return e.error?u4(e.error):"Run failed.";case gn.cancelled:return"Run was cancelled.";default:return""}}function cne(e){const t=bk(e.kind);switch(e.status){case gn.queued:return`${t} queued`;case gn.running:return`${t} in progress`;case gn.completed:return`${t} completed`;case gn.partial:return`${t} partially completed`;case gn.failed:return`${t} failed`;case gn.cancelled:return`${t} cancelled`;default:return e.status}}function d4(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.keyword??a.id;t.has(o)||t.set(o,!1),a.citationState==="cited"&&t.set(o,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function f4(e){return e>=70?"positive":e>=40?"caution":"negative"}function une(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function dne(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function fne(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const a of e){const o=a.keywordId,u=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState==="cited"&&(u.cited=!0);for(const d of a.competitorOverlap)u.competitorOverlap.add(d);t.set(o,u)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:dne(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 hne(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 pne(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function mne(e,t){const n=hne(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:pne(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 h4(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const a of e)a.competitorOverlap.some(o=>n.has(o))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function gne(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const u=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;u.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.keyword);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const S of m){const j=u.get(`${y.keyword}::${S}`),N=(y.providerRuns?.[S]?.length??0)>0;if(!j&&!N)continue;const O=j?.model??null,_=O?`${S}:${O}`:null,C=_?y.modelRuns?.[_]:void 0,T=y.providerRuns?.[S],E=(T?.length?T:null)??(C?.length?C:null),A=T?.length?"provider":C?.length?"model":"keyword",P=E?E.at(-1).transition:w,I=E?E.at(-1).visibilityTransition??(E.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),q=E?.at(-1)?.citationState,B=E?.at(-1)?.visibilityState,$=j?P==="lost"?"lost":P==="emerging"?"emerging":j.citationState==="cited"?"cited":"not-cited":q==="cited"?"cited":"not-cited",V=j?.visibilityState??(B==="visible"?"visible":B==="pending"?"pending":"not-visible"),te=u1(E||y.runs),Y=wz(E||y.runs),H=yne(y,S),J=(E??y.runs).map(U=>({runId:U.runId,citationState:U.citationState,createdAt:U.createdAt,model:H.get(U.runId)??null,answerMentioned:U.answerMentioned,visibilityState:U.visibilityState,visibilityTransition:U.visibilityTransition})),pe=vne(J),Se=A==="provider"&&pe.length<=1?"model":A,R=bne(J);i.push({id:`evidence_${e}_${a++}`,keyword:y.keyword,provider:j?.provider??S,model:j?.model??null,location:j?.location??null,citationState:$,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:Sz(I,Y,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Sz(P,te),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:xne(V,I,y.keyword),runHistory:J,historyScope:Se,modelsSeen:pe,modelTransitions:R})}}}for(const u of r)o.has(u.keyword)||i.push({id:`evidence_${e}_${a++}`,keyword:u.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:`"${u.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function yne(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),u=o==="unknown"?null:o;for(const d of a)n.set(d.runId,u)}return n}function vne(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function bne(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 u1(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 wz(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 Sz(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?`${Yd(r.positive)} in latest run`:`${Yd(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Yd(r.first);case"not-cited":case"not-visible":return t<=1?`${Yd(r.negative)} in latest run`:`${Yd(r.negative)} across ${t} runs`;default:return e}}function Yd(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xne(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 jz(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.keyword),r.set(a,o)}return r}const Fx=3;function wne(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],u=[],d=new Set;for(const N of t)N.citationState==="lost"&&(d.has(N.keyword)||(d.add(N.keyword),u.push({keyword:N.keyword,evidenceId:N.id,provider:N.provider,citationState:"lost"})));u.length>0&&o.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${u.length} key phrase${u.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:u});const f=jz(r,a),p=jz(i,a);for(const N of a){const O=f.get(N)??new Set,_=p.get(N)??new Set,C=[...O].filter(T=>!_.has(T));C.length>0&&o.push({id:`insight_comp_gained_${N}`,tone:"negative",title:`${N} appeared on ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:C.map(T=>{const E=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:E?.id??"",citationState:"cited"}})})}const m=new Map;for(const N of n){const O=N.runs.at(-1);O&&m.set(N.keyword,{transition:O.transition,citationState:O.citationState})}const y=[],v=[],w=new Set;for(const[N,{transition:O,citationState:_}]of m){if(!(O==="emerging"||O==="new"&&_==="cited"))continue;w.add(N);const T=t.find(E=>E.keyword===N&&(E.citationState==="emerging"||E.citationState==="cited"));y.push({keyword:N,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const N of t)N.citationState==="emerging"&&(w.has(N.keyword)||v.push({keyword:N.keyword,evidenceId:N.id,provider:N.provider,citationState:"emerging"}));if(v.length>0){const N=new Set(v.map(O=>O.keyword)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${N} key phrase${N>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const S=new Set(t.map(N=>N.keyword)),j=[];for(const N of n){if(!S.has(N.keyword)||N.runs.length<Fx||N.runs.at(-1)?.citationState!=="not-cited")continue;if(u1(N.runs)>=Fx){const C=t.find(T=>T.keyword===N.keyword);j.push({keyword:N.keyword,evidenceId:C?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} key phrase${j.length>1?"s":""} uncited for ${Fx}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:j});for(const N of a){const O=f.get(N)??new Set,C=[...p.get(N)??new Set].filter(T=>!O.has(T));C.length>0&&o.push({id:`insight_comp_lost_${N}`,tone:"neutral",title:`${N} dropped from ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:C.map(T=>{const E=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:E?.id??"",citationState:"not-cited"}})})}return o.length===0&&o.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),o}function Sne(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 jne(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState==="cited").map(f=>f.keyword)).size;return{gained:d,lost:0,tone:d>0?"positive":"neutral",hasPreviousRun:!1}}const n=d=>{const f=new Set;for(const p of d)p.citationState==="cited"&&p.keyword&&f.add(p.keyword);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const u=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:u,hasPreviousRun:!0}}function kne(e){if(e.length===0)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const n=e.find(d=>d.kind===Kt["answer-visibility"])??e[0],r=n.status===gn.completed?"Healthy":n.status===gn.running?"Running":n.status===gn.queued?"Queued":n.status===gn.partial?"Partial":"Failed",i=n.status===gn.completed?"positive":n.status===gn.failed?"negative":n.status===gn.partial?"caution":"neutral",a=e.filter(d=>d.kind===Kt["answer-visibility"]).length,o=e.length-a,u=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:u,tone:i,description:`Latest: ${bk(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 Nne(e){const t=c4(e.project),n=gne(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(A=>A.kind===Kt["answer-visibility"]).sort((A,P)=>P.createdAt.localeCompare(A.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=d4(i),o=fne(i),u=mne(e.gscCoverage,e.bingCoverage),d=h4(i,e.competitors.map(A=>A.domain)),f=wne({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(A=>A.domain)}),p=e.dbInsights!=null?ane(e.dbInsights):null,m=p!=null?Sne(f,p):f,y=[...e.runs].sort((A,P)=>P.createdAt.localeCompare(A.createdAt)),v=y.find(A=>A.kind===Kt["answer-visibility"]),w=y.find(A=>A.kind!==Kt["answer-visibility"]);if(v&&w){const A=new Date(w.createdAt).getTime()-new Date(v.createdAt).getTime(),P=1440*60*1e3;A>P&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${c1(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const S=y.map(A=>xk(A,e.project.displayName||e.project.name)),j=new Map;for(const A of i){const P=A.provider||"gemini",I=A.model??null,q=`${P}::${I??"unknown"}`,B=j.get(q)??{provider:P,model:I,cited:0,total:0};B.total++,A.citationState==="cited"&&B.cited++,j.set(q,B)}const N=[...j.values()].sort((A,P)=>A.provider.localeCompare(P.provider)||(A.model??"").localeCompare(P.model??"")).map(({provider:A,model:P,cited:I,total:q})=>({provider:A,model:P,score:q>0?Math.round(I/q*100):0,cited:I,total:q})),O=e.project.providers.filter(A=>!A.startsWith("cdp:")),_=new Set(i.map(A=>A.provider)),C=O.filter(A=>_.has(A)).length,T=i.length>0&&O.length>1&&C<O.length,E=T?`${C} of ${O.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${a.score}`:"No data",delta:i.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?T?"caution":f4(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:E},keywordCounts:{cited:a.citedCount,total:a.totalCount},gapKeyPhrases:o,indexCoverage:u,providerScores:N,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:une(d.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:kne(y),movementSummary:jne(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((A,P)=>{const I=new Set;for(const te of i)(te.competitorOverlap.includes(A.domain)||te.citedDomains.includes(A.domain))&&te.keyword&&I.add(te.keyword);const q=[...I],B=new Set(i.map(te=>te.keyword).filter(Boolean)),$=B.size>0?q.length/B.size:0,V=$>=.5?"High":$>=.2?"Moderate":q.length>0?"Low":"None";return{id:A.id||`comp_${P}`,domain:A.domain,citationCount:q.length,totalKeywords:B.size,pressureLabel:V,citedKeywords:q,movement:"",notes:""}}),recentRuns:S.slice(0,5)}}function Cne(e){const t=c4(e.project),n=e.runs.filter(w=>w.kind===Kt["answer-visibility"]).sort((w,S)=>S.createdAt.localeCompare(w.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=d4(r),a=h4(r,e.competitors.map(w=>w.domain)),o=[...e.runs].sort((w,S)=>S.createdAt.localeCompare(w.createdAt)),u=o.find(w=>w.kind===Kt["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=u?xk(u,d):{id:"none",projectId:e.project.id,projectName:d,kind:Kt["answer-visibility"],kindLabel:"No runs yet",status:gn.queued,trigger:bf.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(w=>!w.startsWith("cdp:")),m=new Set(r.map(w=>w.provider)),y=p.filter(w=>m.has(w)).length,v=r.length>0&&p.length>1&&y<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?v?"caution":f4(i.score):"neutral",providerCoverage:v?`${y} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(w=>w.provider)).size} provider${new Set(r.map(w=>w.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:a.label}}function _ne(e,t){const n=[],r=[],i=[];for(const o of e){r.push(Nne(o)),i.push(Cne(o));const u=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(xk(d,o.project.displayName||o.project.name))}n.sort((o,u)=>u.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Ane(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function Ane(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===gn.running||a.status===gn.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 Ar={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],agent:{providers:e=>["agent",e,"providers"]}},p4=b.createContext(null);p4.Provider;function ch(){return b.useContext(p4)}function Zl(e){const n=ch()?.dashboard??null,r=rs({queryKey:Ar.projects.all,queryFn:Gj,enabled:!n}),i=rs({queryKey:Ar.runs.all,queryFn:UI,enabled:!n,refetchInterval:w=>w.state.data?.some(N=>N.status==="running"||N.status==="queued")?3e3:!1}),a=rs({queryKey:Ar.settings,queryFn:()=>Vj().catch(()=>null),enabled:!n}),o=r.data??[],u=i.data??[],d=$9({queries:o.map(w=>{const S=u.filter(N=>N.projectId===w.id),j=S.filter(N=>(N.status==="completed"||N.status==="partial")&&N.kind==="answer-visibility").sort((N,O)=>O.createdAt.localeCompare(N.createdAt));return{queryKey:Ar.projects.detail(w.id,j[0]?.id),queryFn:async()=>{const N=j[0]?.id,[O,_,C,T,E,A,P,I]=await Promise.all([ZK(w.name).catch(()=>[]),FI(w.name).catch(()=>[]),qI(w.name).catch(()=>[]),N?El(N).catch(()=>null):Promise.resolve(null),j[1]?El(j[1].id).catch(()=>null):Promise.resolve(null),Zj(w.name).catch(()=>null),Yj(w.name).catch(()=>null),N?q7(w.name,N).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:O,competitors:_,timeline:C,latestRunDetail:T,previousRunDetail:E,gscCoverage:A,bingCoverage:P,dbInsights:I}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),f=d.every(w=>w.isSuccess),p=b.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const w=d.map(S=>S.data).filter(S=>S!=null);return _ne(w,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=b.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function One(){const e=await H7("/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 ev(e,t){return rs({queryKey:Ar.health,queryFn:One,enabled:e,refetchInterval:15e3,initialData:t})}function Ene(e){return rs({queryKey:Ar.runs.detail(e??""),queryFn:()=>El(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Mu(){const e=So(),t=By({strict:!1}),n=zr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:ki.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:ki.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:ki.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const zne={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Tne(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Pne(){const e=b.useSyncExternalStore(oG,x2,x2),t=So(),{openRun:n}=Mu(),r=b.useCallback(a=>{XS(a)},[]),i=b.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),XS(a.id))},[t,n]);return e.length===0?null:c.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>c.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${zne[a.tone]}`,children:[c.jsxs("div",{className:"toast-copy",children:[c.jsx("p",{className:"toast-title",children:a.title}),a.detail?c.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?c.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Tne(a),children:a.cta.label}):null]}),c.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:c.jsx(lh,{className:"size-3.5"})})]},a.id))})}function Rne(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Dne=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mne=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ine={};function kz(e,t){return(Ine.jsx?Mne:Dne).test(e)}const Lne=/[ \t\n\f\r]/g;function $ne(e){return typeof e=="object"?e.type==="text"?Nz(e.value):!1:Nz(e)}function Nz(e){return e.replace(Lne,"")===""}let uh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};uh.prototype.normal={};uh.prototype.property={};uh.prototype.space=void 0;function m4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new uh(n,r,t)}function d1(e){return e.toLowerCase()}class Mr{constructor(t,n){this.attribute=n,this.property=t}}Mr.prototype.attribute="";Mr.prototype.booleanish=!1;Mr.prototype.boolean=!1;Mr.prototype.commaOrSpaceSeparated=!1;Mr.prototype.commaSeparated=!1;Mr.prototype.defined=!1;Mr.prototype.mustUseProperty=!1;Mr.prototype.number=!1;Mr.prototype.overloadedBoolean=!1;Mr.prototype.property="";Mr.prototype.spaceSeparated=!1;Mr.prototype.space=void 0;let Bne=0;const it=Yl(),_n=Yl(),f1=Yl(),_e=Yl(),Ft=Yl(),uu=Yl(),Gr=Yl();function Yl(){return 2**++Bne}const h1=Object.freeze(Object.defineProperty({__proto__:null,boolean:it,booleanish:_n,commaOrSpaceSeparated:Gr,commaSeparated:uu,number:_e,overloadedBoolean:f1,spaceSeparated:Ft},Symbol.toStringTag,{value:"Module"})),qx=Object.keys(h1);class wk extends Mr{constructor(t,n,r,i){let a=-1;if(super(t,n),Cz(this,"space",i),typeof r=="number")for(;++a<qx.length;){const o=qx[a];Cz(this,qx[a],(r&h1[o])===h1[o])}}}wk.prototype.defined=!0;function Cz(e,t,n){n&&(e[t]=n)}function Iu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new wk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[d1(r)]=r,n[d1(a.attribute)]=r}return new uh(t,n,e.space)}const g4=Iu({properties:{ariaActiveDescendant:null,ariaAtomic:_n,ariaAutoComplete:null,ariaBusy:_n,ariaChecked:_n,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Ft,ariaCurrent:null,ariaDescribedBy:Ft,ariaDetails:null,ariaDisabled:_n,ariaDropEffect:Ft,ariaErrorMessage:null,ariaExpanded:_n,ariaFlowTo:Ft,ariaGrabbed:_n,ariaHasPopup:null,ariaHidden:_n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ft,ariaLevel:_e,ariaLive:null,ariaModal:_n,ariaMultiLine:_n,ariaMultiSelectable:_n,ariaOrientation:null,ariaOwns:Ft,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:_n,ariaReadOnly:_n,ariaRelevant:null,ariaRequired:_n,ariaRoleDescription:Ft,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:_n,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function y4(e,t){return t in e?e[t]:t}function v4(e,t){return y4(e,t.toLowerCase())}const Une=Iu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uu,acceptCharset:Ft,accessKey:Ft,action:null,allow:null,allowFullScreen:it,allowPaymentRequest:it,allowUserMedia:it,alt:null,as:null,async:it,autoCapitalize:null,autoComplete:Ft,autoFocus:it,autoPlay:it,blocking:Ft,capture:null,charSet:null,checked:it,cite:null,className:Ft,cols:_e,colSpan:null,content:null,contentEditable:_n,controls:it,controlsList:Ft,coords:_e|uu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:it,defer:it,dir:null,dirName:null,disabled:it,download:f1,draggable:_n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:it,formTarget:null,headers:Ft,height:_e,hidden:f1,high:_e,href:null,hrefLang:null,htmlFor:Ft,httpEquiv:Ft,id:null,imageSizes:null,imageSrcSet:null,inert:it,inputMode:null,integrity:null,is:null,isMap:it,itemId:null,itemProp:Ft,itemRef:Ft,itemScope:it,itemType:Ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:it,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:it,muted:it,name:null,nonce:null,noModule:it,noValidate:it,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:it,optimum:_e,pattern:null,ping:Ft,placeholder:null,playsInline:it,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:it,referrerPolicy:null,rel:Ft,required:it,reversed:it,rows:_e,rowSpan:_e,sandbox:Ft,scope:null,scoped:it,seamless:it,selected:it,shadowRootClonable:it,shadowRootDelegatesFocus:it,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:_n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:it,useMap:null,value:_n,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ft,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:it,declare:it,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:it,noHref:it,noShade:it,noWrap:it,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:_n,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:it,disableRemotePlayback:it,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:v4}),Fne=Iu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gr,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Ft,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:it,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uu,g2:uu,glyphName:uu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gr,rev:Gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gr,requiredFeatures:Gr,requiredFonts:Gr,requiredFormats:Gr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gr,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:y4}),b4=Iu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),x4=Iu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:v4}),w4=Iu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qne={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hne=/[A-Z]/g,_z=/-[a-z]/g,Kne=/^data[-\w.:]+$/i;function Gne(e,t){const n=d1(t);let r=t,i=Mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Kne.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(_z,Zne);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!_z.test(a)){let o=a.replace(Hne,Vne);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=wk}return new i(r,t)}function Vne(e){return"-"+e.toLowerCase()}function Zne(e){return e.charAt(1).toUpperCase()}const Yne=m4([g4,Une,b4,x4,w4],"html"),Sk=m4([g4,Fne,b4,x4,w4],"svg");function Wne(e){return e.join(" ").trim()}var $c={},Hx,Az;function Qne(){if(Az)return Hx;Az=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
98
|
-
`,f="/",p="*",m="",y="comment",v="declaration";function w(j,N){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];N=N||{};var O=1,_=1;function C(te){var Y=te.match(t);Y&&(O+=Y.length);var H=te.lastIndexOf(d);_=~H?te.length-H:_+te.length}function T(){var te={line:O,column:_};return function(Y){return Y.position=new E(te),I(),Y}}function E(te){this.start=te,this.end={line:O,column:_},this.source=N.source}E.prototype.content=j;function A(te){var Y=new Error(N.source+":"+O+":"+_+": "+te);if(Y.reason=te,Y.filename=N.source,Y.line=O,Y.column=_,Y.source=j,!N.silent)throw Y}function P(te){var Y=te.exec(j);if(Y){var H=Y[0];return C(H),j=j.slice(H.length),Y}}function I(){P(n)}function q(te){var Y;for(te=te||[];Y=B();)Y!==!1&&te.push(Y);return te}function B(){var te=T();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Y=2;m!=j.charAt(Y)&&(p!=j.charAt(Y)||f!=j.charAt(Y+1));)++Y;if(Y+=2,m===j.charAt(Y-1))return A("End of comment missing");var H=j.slice(2,Y-2);return _+=2,C(H),j=j.slice(Y),_+=2,te({type:y,comment:H})}}function $(){var te=T(),Y=P(r);if(Y){if(B(),!P(i))return A("property missing ':'");var H=P(a),J=te({type:v,property:S(Y[0].replace(e,m)),value:H?S(H[0].replace(e,m)):m});return P(o),J}}function V(){var te=[];q(te);for(var Y;Y=$();)Y!==!1&&(te.push(Y),q(te));return te}return I(),V()}function S(j){return j?j.replace(u,m):m}return Hx=w,Hx}var Oz;function Xne(){if(Oz)return $c;Oz=1;var e=$c&&$c.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($c,"__esModule",{value:!0}),$c.default=n;const t=e(Qne());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),u=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return $c}var Wd={},Ez;function Jne(){if(Ez)return Wd;Ez=1,Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},u=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,u):f=f.replace(r,u),f.replace(t,o))};return Wd.camelCase=d,Wd}var Qd,zz;function ere(){if(zz)return Qd;zz=1;var e=Qd&&Qd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Xne()),n=Jne();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(o[(0,n.camelCase)(u,a)]=d)}),o}return r.default=r,Qd=r,Qd}var tre=ere();const nre=ka(tre),S4=j4("end"),jk=j4("start");function j4(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function rre(e){const t=jk(e),n=S4(e);if(t&&n)return{start:t,end:n}}function xf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Tz(e.position):"start"in e||"end"in e?Tz(e):"line"in e||"column"in e?p1(e):""}function p1(e){return Pz(e&&e.line)+":"+Pz(e&&e.column)}function Tz(e){return p1(e&&e.start)+"-"+p1(e&&e.end)}function Pz(e){return e&&typeof e=="number"?e:1}class sr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=xf(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sr.prototype.file="";sr.prototype.name="";sr.prototype.reason="";sr.prototype.message="";sr.prototype.stack="";sr.prototype.column=void 0;sr.prototype.line=void 0;sr.prototype.ancestors=void 0;sr.prototype.cause=void 0;sr.prototype.fatal=void 0;sr.prototype.place=void 0;sr.prototype.ruleId=void 0;sr.prototype.source=void 0;const kk={}.hasOwnProperty,ire=new Map,are=/[A-Z]/g,sre=new Set(["table","tbody","thead","tfoot","tr"]),ore=new Set(["td","th"]),k4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lre(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gre(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mre(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Sk:Yne,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=N4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function N4(e,t,n){if(t.type==="element")return cre(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ure(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fre(e,t,n);if(t.type==="mdxjsEsm")return dre(e,t);if(t.type==="root")return hre(e,t,n);if(t.type==="text")return pre(e,t)}function cre(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Sk,e.schema=i),e.ancestors.push(t);const a=_4(e,t.tagName,!1),o=yre(e,t);let u=Ck(e,t);return sre.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!$ne(d):!0})),C4(e,o,a,t),Nk(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ure(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Lf(e,t.position)}function dre(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lf(e,t.position)}function fre(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Sk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:_4(e,t.name,!0),o=vre(e,t),u=Ck(e,t);return C4(e,o,a,t),Nk(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hre(e,t,n){const r={};return Nk(r,Ck(e,t)),e.create(t,e.Fragment,r,n)}function pre(e,t){return t.value}function C4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Nk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mre(e,t,n){return r;function r(i,a,o,u){const f=Array.isArray(o.children)?n:t;return u?f(a,o,u):f(a,o)}}function gre(e,t){return n;function n(r,i,a,o){const u=Array.isArray(a.children),d=jk(r);return t(i,a,o,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function yre(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&kk.call(t.properties,i)){const a=bre(e,i,t.properties[i]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&ore.has(t.tagName)?r=u:n[o]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vre(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const u=o.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Lf(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Lf(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Ck(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ire;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const u=N4(e,a,o);u!==void 0&&n.push(u)}return n}function bre(e,t,n){const r=Gne(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Rne(n):Wne(n)),r.property==="style"){let i=typeof n=="object"?n:xre(e,String(n));return e.stylePropertyNameCase==="css"&&(i=wre(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?qne[r.property]||r.property:r.attribute,n]}}function xre(e,t){try{return nre(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new sr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=k4+"#cannot-parse-style-attribute",i}}function _4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const u=kz(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=o}else r=kz(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return kk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Lf(e)}function Lf(e,t){const n=new sr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=k4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wre(e){const t={};let n;for(n in e)kk.call(e,n)&&(t[Sre(n)]=e[n]);return t}function Sre(e){let t=e.replace(are,jre);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jre(e){return"-"+e.toLowerCase()}const Kx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kre={};function Nre(e,t){const n=kre,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return A4(e,r,i)}function A4(e,t,n){if(Cre(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Rz(e.children,t,n)}return Array.isArray(e)?Rz(e,t,n):""}function Rz(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=A4(e[i],t,n);return r.join("")}function Cre(e){return!!(e&&typeof e=="object")}const Dz=document.createElement("i");function _k(e){const t="&"+e+";";Dz.innerHTML=t;const n=Dz.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function va(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function vi(e,t){return e.length>0?(va(e,e.length,0,t),e):t}const Mz={}.hasOwnProperty;function _re(e){const t={};let n=-1;for(;++n<e.length;)Are(t,e[n]);return t}function Are(e,t){let n;for(n in t){const i=(Mz.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){Mz.call(i,o)||(i[o]=[]);const u=a[o];Ore(i[o],Array.isArray(u)?u:u?[u]:[])}}}function Ore(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);va(e,0,0,r)}function O4(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fa=Co(/[A-Za-z]/),Zr=Co(/[\dA-Za-z]/),Ere=Co(/[#-'*+\--9=?A-Z^-~]/);function m1(e){return e!==null&&(e<32||e===127)}const g1=Co(/\d/),zre=Co(/[\dA-Fa-f]/),Tre=Co(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function Tr(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const Pre=Co(new RegExp("\\p{P}|\\p{S}","u")),Rre=Co(/\s/);function Co(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Lu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Zr(e.charCodeAt(n+1))&&Zr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(o=String.fromCharCode(a,u),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Gt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return _t(d)?(e.enter(n),u(d)):t(d)}function u(d){return _t(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const Dre={tokenize:Mre};function Mre(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Gt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ye(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),o)}}const Ire={tokenize:Lre},Iz={tokenize:$re};function Lre(e){const t=this,n=[];let r=0,i,a,o;return u;function u(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const C=t.events.length;let T=C,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){E=t.events[T][1].end;break}N(r);let A=C;for(;A<t.events.length;)t.events[A][1].end={...E},A++;return va(t.events,T+1,0,t.events.slice(C)),t.events.length=A,f(_)}return u(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return w(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Iz,p,m)(_)}function p(_){return i&&O(),N(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(_)}function y(_){return t.containerState={},e.attempt(Iz,v,w)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function w(_){if(_===null){i&&O(),N(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),S(_)}function S(_){if(_===null){j(e.exit("chunkFlow"),!0),N(0),e.consume(_);return}return Ye(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(_),S)}function j(_,C){const T=t.sliceStream(_);if(C&&T.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(T),t.parser.lazy[_.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<o&&(!i.events[E][1].end||i.events[E][1].end.offset>o))return;const A=t.events.length;let P=A,I,q;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(I){q=t.events[P][1].end;break}I=!0}for(N(r),E=A;E<t.events.length;)t.events[E][1].end={...q},E++;va(t.events,P+1,0,t.events.slice(A)),t.events.length=E}}function N(_){let C=n.length;for(;C-- >_;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=_}function O(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $re(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lz(e){if(e===null||Tr(e)||Rre(e))return 1;if(Pre(e))return 2}function Ak(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const y1={name:"attention",resolveAll:Bre,tokenize:Ure};function Bre(e,t){let n=-1,r,i,a,o,u,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};$z(m,-d),$z(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...u.end}},e[r][1].end={...o.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=vi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=vi(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=vi(f,Ak(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=vi(f,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=vi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,va(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ure(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Lz(r);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const f=e.exit("attentionSequence"),p=Lz(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function $z(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Fre={name:"autolink",tokenize:qre};function qre(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return fa(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Zr(v)?(r=1,u(v)):f(v)}function u(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||Zr(v))&&r++<32?(e.consume(v),u):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||m1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Ere(v)?(e.consume(v),f):n(v)}function p(v){return Zr(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Zr(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const tv={partial:!0,tokenize:Hre};function Hre(e,t,n){return r;function r(a){return _t(a)?Gt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ye(a)?t(a):n(a)}}const E4={continuation:{tokenize:Gre},exit:Vre,name:"blockQuote",tokenize:Kre};function Kre(e,t,n){const r=this;return i;function i(o){if(o===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return _t(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Gre(e,t,n){const r=this;return i;function i(o){return _t(o)?Gt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(E4,t,n)(o)}}function Vre(e){e.exit("blockQuote")}const z4={name:"characterEscape",tokenize:Zre};function Zre(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Tre(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const T4={name:"characterReference",tokenize:Yre};function Yre(e,t,n){const r=this;let i=0,a,o;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Zr,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=zre,p):(e.enter("characterReferenceValue"),a=7,o=g1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Zr&&!_k(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const Bz={partial:!0,tokenize:Qre},Uz={concrete:!0,name:"codeFenced",tokenize:Wre};function Wre(e,t,n){const r=this,i={partial:!0,tokenize:T};let a=0,o=0,u;return d;function d(E){return f(E)}function f(E){const A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===u?(o++,e.consume(E),p):o<3?n(E):(e.exit("codeFencedFenceSequence"),_t(E)?Gt(e,m,"whitespace")(E):m(E))}function m(E){return E===null||Ye(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Bz,S,C)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===null||Ye(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):_t(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Gt(e,v,"whitespace")(E)):E===96&&E===u?n(E):(e.consume(E),y)}function v(E){return E===null||Ye(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===null||Ye(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===u?n(E):(e.consume(E),w)}function S(E){return e.attempt(i,C,j)(E)}function j(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),N}function N(E){return a>0&&_t(E)?Gt(e,O,"linePrefix",a+1)(E):O(E)}function O(E){return E===null||Ye(E)?e.check(Bz,S,C)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||Ye(E)?(e.exit("codeFlowValue"),O(E)):(e.consume(E),_)}function C(E){return e.exit("codeFenced"),t(E)}function T(E,A,P){let I=0;return q;function q(Y){return E.enter("lineEnding"),E.consume(Y),E.exit("lineEnding"),B}function B(Y){return E.enter("codeFencedFence"),_t(Y)?Gt(E,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===u?(E.enter("codeFencedFenceSequence"),V(Y)):P(Y)}function V(Y){return Y===u?(I++,E.consume(Y),V):I>=o?(E.exit("codeFencedFenceSequence"),_t(Y)?Gt(E,te,"whitespace")(Y):te(Y)):P(Y)}function te(Y){return Y===null||Ye(Y)?(E.exit("codeFencedFence"),A(Y)):P(Y)}}}function Qre(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Gx={name:"codeIndented",tokenize:Jre},Xre={partial:!0,tokenize:eie};function Jre(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Gt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):Ye(f)?e.attempt(Xre,o,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function eie(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,a,"linePrefix",5)(o)}function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):Ye(o)?i(o):n(o)}}const tie={name:"codeText",previous:rie,resolve:nie,tokenize:iie};function nie(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function rie(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iie(e,t,n){let r=0,i,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):Ye(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ye(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class aie{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Xd(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Xd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Xd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xd(this.left,n.reverse())}}}function Xd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function P4(e){const t={};let n=-1,r,i,a,o,u,d,f;const p=new aie(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,sie(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return va(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function sie(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,d=[],f={};let p,m,y=-1,v=n,w=0,S=0;const j=[S];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(S=y+1,j.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const N=u.slice(j[y],j[y+1]),O=a.pop();d.push([O,O+N.length-1]),e.splice(O,2,N)}for(d.reverse(),y=-1;++y<d.length;)f[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return f}const oie={resolve:cie,tokenize:uie},lie={partial:!0,tokenize:die};function cie(e){return P4(e),e}function uie(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):Ye(u)?e.check(lie,o,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function die(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Gt(e,a,"linePrefix")}function a(o){if(o===null||Ye(o))return n(o);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function R4(e,t,n,r,i,a,o,u,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(N){return N===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(N),e.exit(a),y):N===null||N===32||N===41||m1(N)?n(N):(e.enter(r),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(N))}function y(N){return N===62?(e.enter(a),e.consume(N),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(u),y(N)):N===null||N===60||Ye(N)?n(N):(e.consume(N),N===92?w:v)}function w(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function S(N){return!p&&(N===null||N===41||Tr(N))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),t(N)):p<f&&N===40?(e.consume(N),p++,S):N===41?(e.consume(N),p--,S):N===null||N===32||N===40||m1(N)?n(N):(e.consume(N),N===92?j:S)}function j(N){return N===40||N===41||N===92?(e.consume(N),S):S(N)}}function D4(e,t,n,r,i,a){const o=this;let u=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return u>999||v===null||v===91||v===93&&!d||v===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ye(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ye(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!_t(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function M4(e,t,n,r,i,a){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Gt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Ye(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function wf(e,t){let n;return r;function r(i){return Ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_t(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const fie={name:"definition",tokenize:pie},hie={partial:!0,tokenize:mie};function pie(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return D4.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=du(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Tr(v)?wf(e,f)(v):f(v)}function f(v){return R4(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(hie,m,m)(v)}function m(v){return _t(v)?Gt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ye(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function mie(e,t,n){return r;function r(u){return Tr(u)?wf(e,i)(u):n(u)}function i(u){return M4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return _t(u)?Gt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||Ye(u)?t(u):n(u)}}const gie={name:"hardBreakEscape",tokenize:yie};function yie(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ye(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const vie={name:"headingAtx",resolve:bie,tokenize:xie};function bie(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},va(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function xie(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||Tr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):_t(p)?Gt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Tr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const wie=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Fz=["pre","script","style","textarea"],Sie={concrete:!0,name:"htmlFlow",resolveTo:Nie,tokenize:Cie},jie={partial:!0,tokenize:Aie},kie={partial:!0,tokenize:_ie};function Nie(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Cie(e,t,n){const r=this;let i,a,o,u,d;return f;function f(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),y):D===47?(e.consume(D),a=!0,S):D===63?(e.consume(D),i=3,r.interrupt?t:R):fa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function y(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,w):fa(D)?(e.consume(D),i=4,r.interrupt?t:R):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:R):n(D)}function w(D){const Q="CDATA[";return D===Q.charCodeAt(u++)?(e.consume(D),u===Q.length?r.interrupt?t:$:w):n(D)}function S(D){return fa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||Tr(D)){const Q=D===47,se=o.toLowerCase();return!Q&&!a&&Fz.includes(se)?(i=1,r.interrupt?t(D):$(D)):wie.includes(o.toLowerCase())?(i=6,Q?(e.consume(D),N):r.interrupt?t(D):$(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?O(D):_(D))}return D===45||Zr(D)?(e.consume(D),o+=String.fromCharCode(D),j):n(D)}function N(D){return D===62?(e.consume(D),r.interrupt?t:$):n(D)}function O(D){return _t(D)?(e.consume(D),O):q(D)}function _(D){return D===47?(e.consume(D),q):D===58||D===95||fa(D)?(e.consume(D),C):_t(D)?(e.consume(D),_):q(D)}function C(D){return D===45||D===46||D===58||D===95||Zr(D)?(e.consume(D),C):T(D)}function T(D){return D===61?(e.consume(D),E):_t(D)?(e.consume(D),T):_(D)}function E(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,A):_t(D)?(e.consume(D),E):P(D)}function A(D){return D===d?(e.consume(D),d=null,I):D===null||Ye(D)?n(D):(e.consume(D),A)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Tr(D)?T(D):(e.consume(D),P)}function I(D){return D===47||D===62||_t(D)?_(D):n(D)}function q(D){return D===62?(e.consume(D),B):n(D)}function B(D){return D===null||Ye(D)?$(D):_t(D)?(e.consume(D),B):n(D)}function $(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),J):D===62&&i===4?(e.consume(D),U):D===63&&i===3?(e.consume(D),R):D===93&&i===5?(e.consume(D),Se):Ye(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(jie,F,V)(D)):D===null||Ye(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),$)}function V(D){return e.check(kie,te,F)(D)}function te(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Y}function Y(D){return D===null||Ye(D)?V(D):(e.enter("htmlFlowData"),$(D))}function H(D){return D===45?(e.consume(D),R):$(D)}function J(D){return D===47?(e.consume(D),o="",pe):$(D)}function pe(D){if(D===62){const Q=o.toLowerCase();return Fz.includes(Q)?(e.consume(D),U):$(D)}return fa(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),pe):$(D)}function Se(D){return D===93?(e.consume(D),R):$(D)}function R(D){return D===62?(e.consume(D),U):D===45&&i===2?(e.consume(D),R):$(D)}function U(D){return D===null||Ye(D)?(e.exit("htmlFlowData"),F(D)):(e.consume(D),U)}function F(D){return e.exit("htmlFlow"),t(D)}}function _ie(e,t,n){const r=this;return i;function i(o){return Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Aie(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(tv,t,n)}}const Oie={name:"htmlText",tokenize:Eie};function Eie(e,t,n){const r=this;let i,a,o;return u;function u(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),T):R===63?(e.consume(R),_):fa(R)?(e.consume(R),P):n(R)}function f(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),a=0,w):fa(R)?(e.consume(R),O):n(R)}function p(R){return R===45?(e.consume(R),v):n(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),y):Ye(R)?(o=m,J(R)):(e.consume(R),m)}function y(R){return R===45?(e.consume(R),v):m(R)}function v(R){return R===62?H(R):R===45?y(R):m(R)}function w(R){const U="CDATA[";return R===U.charCodeAt(a++)?(e.consume(R),a===U.length?S:w):n(R)}function S(R){return R===null?n(R):R===93?(e.consume(R),j):Ye(R)?(o=S,J(R)):(e.consume(R),S)}function j(R){return R===93?(e.consume(R),N):S(R)}function N(R){return R===62?H(R):R===93?(e.consume(R),N):S(R)}function O(R){return R===null||R===62?H(R):Ye(R)?(o=O,J(R)):(e.consume(R),O)}function _(R){return R===null?n(R):R===63?(e.consume(R),C):Ye(R)?(o=_,J(R)):(e.consume(R),_)}function C(R){return R===62?H(R):_(R)}function T(R){return fa(R)?(e.consume(R),E):n(R)}function E(R){return R===45||Zr(R)?(e.consume(R),E):A(R)}function A(R){return Ye(R)?(o=A,J(R)):_t(R)?(e.consume(R),A):H(R)}function P(R){return R===45||Zr(R)?(e.consume(R),P):R===47||R===62||Tr(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),H):R===58||R===95||fa(R)?(e.consume(R),q):Ye(R)?(o=I,J(R)):_t(R)?(e.consume(R),I):H(R)}function q(R){return R===45||R===46||R===58||R===95||Zr(R)?(e.consume(R),q):B(R)}function B(R){return R===61?(e.consume(R),$):Ye(R)?(o=B,J(R)):_t(R)?(e.consume(R),B):I(R)}function $(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,V):Ye(R)?(o=$,J(R)):_t(R)?(e.consume(R),$):(e.consume(R),te)}function V(R){return R===i?(e.consume(R),i=void 0,Y):R===null?n(R):Ye(R)?(o=V,J(R)):(e.consume(R),V)}function te(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Tr(R)?I(R):(e.consume(R),te)}function Y(R){return R===47||R===62||Tr(R)?I(R):n(R)}function H(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function J(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),pe}function pe(R){return _t(R)?Gt(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Se(R)}function Se(R){return e.enter("htmlTextData"),o(R)}}const Ok={name:"labelEnd",resolveAll:Rie,resolveTo:Die,tokenize:Mie},zie={tokenize:Iie},Tie={tokenize:Lie},Pie={tokenize:$ie};function Rie(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&va(e,0,e.length,n),e}function Die(e,t){let n=e.length,r=0,i,a,o,u;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=vi(u,e.slice(a+1,a+r+3)),u=vi(u,[["enter",p,t]]),u=vi(u,Ak(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),u=vi(u,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),u=vi(u,e.slice(o+1)),u=vi(u,[["exit",d,t]]),va(e,a,e.length,u),e}function Mie(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(du(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(zie,p,o?p:m)(y):y===91?e.attempt(Tie,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(Pie,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Iie(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Tr(m)?wf(e,a)(m):a(m)}function a(m){return m===41?p(m):R4(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Tr(m)?wf(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?M4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Tr(m)?wf(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function Lie(e,t,n){const r=this;return i;function i(u){return D4.call(r,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(du(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function $ie(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Bie={name:"labelStartImage",resolveAll:Ok.resolveAll,tokenize:Uie};function Uie(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Fie={name:"labelStartLink",resolveAll:Ok.resolveAll,tokenize:qie};function qie(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Vx={name:"lineEnding",tokenize:Hie};function Hie(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Gt(e,t,"linePrefix")}}const Jm={name:"thematicBreak",tokenize:Kie};function Kie(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),_t(f)?Gt(e,u,"whitespace")(f):u(f))}}const Cr={continuation:{tokenize:Yie},exit:Qie,name:"list",tokenize:Zie},Gie={partial:!0,tokenize:Xie},Vie={partial:!0,tokenize:Wie};function Zie(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return u;function u(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:g1(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Jm,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return g1(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(tv,r.interrupt?n:p,e.attempt(Gie,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return _t(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Yie(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(tv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!_t(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Vie,t,o)(u))}function o(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(Cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Wie(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Qie(e){e.exit(this.containerState.type)}function Xie(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!_t(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const qz={name:"setextUnderline",resolveTo:Jie,tokenize:eae};function Jie(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function eae(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),_t(f)?Gt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const tae={tokenize:nae};function nae(e){const t=this,n=e.attempt(tv,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(oie,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rae={resolveAll:L4()},iae=I4("string"),aae=I4("text");function I4(e){return{resolveAll:L4(e==="text"?sae:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,u);return o;function o(p){return f(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function L4(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function sae(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(f===-2)d=!0,u++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const oae={42:Cr,43:Cr,45:Cr,48:Cr,49:Cr,50:Cr,51:Cr,52:Cr,53:Cr,54:Cr,55:Cr,56:Cr,57:Cr,62:E4},lae={91:fie},cae={[-2]:Gx,[-1]:Gx,32:Gx},uae={35:vie,42:Jm,45:[qz,Jm],60:Sie,61:qz,95:Jm,96:Uz,126:Uz},dae={38:T4,92:z4},fae={[-5]:Vx,[-4]:Vx,[-3]:Vx,33:Bie,38:T4,42:y1,60:[Fre,Oie],91:Fie,92:[gie,z4],93:Ok,95:y1,96:tie},hae={null:[y1,rae]},pae={null:[42,95]},mae={null:[]},gae=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pae,contentInitial:lae,disable:mae,document:oae,flow:uae,flowInitial:cae,insideSpan:hae,string:dae,text:fae},Symbol.toStringTag,{value:"Module"}));function yae(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],u=[];const d={attempt:A(T),check:A(E),consume:O,enter:_,exit:C,interrupt:A(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(B){return o=vi(o,B),j(),o[o.length-1]!==null?[]:(P(t,0),f.events=Ak(a,f.events,f),f.events)}function y(B,$){return bae(v(B),$)}function v(B){return vae(o,B)}function w(){const{_bufferIndex:B,_index:$,line:V,column:te,offset:Y}=r;return{_bufferIndex:B,_index:$,line:V,column:te,offset:Y}}function S(B){i[B.line]=B.column,q()}function j(){let B;for(;r._index<o.length;){const $=o[r._index];if(typeof $=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<$.length;)N($.charCodeAt(r._bufferIndex));else N($)}}function N(B){p=p(B)}function O(B){Ye(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,q()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=B}function _(B,$){const V=$||{};return V.type=B,V.start=w(),f.events.push(["enter",V,f]),u.push(V),V}function C(B){const $=u.pop();return $.end=w(),f.events.push(["exit",$,f]),$}function T(B,$){P(B,$.from)}function E(B,$){$.restore()}function A(B,$){return V;function V(te,Y,H){let J,pe,Se,R;return Array.isArray(te)?F(te):"tokenize"in te?F([te]):U(te);function U(ae){return he;function he(Ne){const ne=Ne!==null&&ae[Ne],de=Ne!==null&&ae.null,Ee=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(de)?de:de?[de]:[]];return F(Ee)(Ne)}}function F(ae){return J=ae,pe=0,ae.length===0?H:D(ae[pe])}function D(ae){return he;function he(Ne){return R=I(),Se=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?se():ae.tokenize.call($?Object.assign(Object.create(f),$):f,d,Q,se)(Ne)}}function Q(ae){return B(Se,R),Y}function se(ae){return R.restore(),++pe<J.length?D(J[pe]):H}}}function P(B,$){B.resolveAll&&!a.includes(B)&&a.push(B),B.resolve&&va(f.events,$,f.events.length-$,B.resolve(f.events.slice($),f)),B.resolveTo&&(f.events=B.resolveTo(f.events,f))}function I(){const B=w(),$=f.previous,V=f.currentConstruct,te=f.events.length,Y=Array.from(u);return{from:te,restore:H};function H(){r=B,f.previous=$,f.currentConstruct=V,f.events.length=te,u=Y,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function vae(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function bae(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
99
|
-
`;break}case-3:{o=`\r
|
|
100
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function xae(e){const r={constructs:_re([gae,...(e||{}).extensions||[]]),content:i(Dre),defined:[],document:i(Ire),flow:i(tae),lazy:{},string:i(iae),text:i(aae)};return r;function i(a){return o;function o(u){return yae(r,a,u)}}}function wae(e){for(;!P4(e););return e}const Hz=/[\0\t\n\r]/g;function Sae(){let e=1,t="",n=!0,r;return i;function i(a,o,u){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Hz.lastIndex=m,f=Hz.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const jae=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kae(e){return e.replace(jae,Nae)}function Nae(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return O4(n.slice(a?2:1),a?16:10)}return _k(n)||e}const $4={}.hasOwnProperty;function Cae(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_ae(n)(wae(xae(n).document().write(Sae()(e,t,!0))))}function _ae(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(on),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(et),blockQuote:a(de),characterEscape:I,characterReference:I,codeFenced:a(Ee),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Ee,o),codeText:a(X,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(De),hardBreakEscape:a(tt),hardBreakTrailing:a(tt),htmlFlow:a(Ut,o),htmlFlowData:I,htmlText:a(Ut,o),htmlTextData:I,image:a(Xt),label:o,link:a(on),listItem:a(Ze),listItemValue:y,listOrdered:a(we,m),listUnordered:a(we),paragraph:a(bt),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(et),strong:a(Jt),thematicBreak:a(ct)},exit:{atxHeading:d(),atxHeadingSequence:T,autolink:d(),autolinkEmail:ne,autolinkProtocol:Ne,blockQuote:d(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ae,characterReference:he,codeFenced:d(j),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:d(N),codeText:d(Y),codeTextData:q,data:q,definition:d(),definitionDestinationString:C,definitionLabelString:O,definitionTitleString:_,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(V),htmlFlowData:q,htmlText:d(te),htmlTextData:q,image:d(J),label:Se,labelText:pe,lineEnding:B,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Q,resourceDestinationString:R,resourceTitleString:U,resource:F,setextHeading:d(P),setextHeadingLineSequence:A,setextHeadingText:E,strong:d(),thematicBreak:d()}};B4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let le={type:"root",children:[]};const je={stack:[le],tokenStack:[],config:t,enter:u,exit:f,buffer:o,resume:p,data:n},Ae=[];let qe=-1;for(;++qe<G.length;)if(G[qe][1].type==="listOrdered"||G[qe][1].type==="listUnordered")if(G[qe][0]==="enter")Ae.push(qe);else{const en=Ae.pop();qe=i(G,en,qe)}for(qe=-1;++qe<G.length;){const en=t[G[qe][0]];$4.call(en,G[qe][1].type)&&en[G[qe][1].type].call(Object.assign({sliceSerialize:G[qe][2].sliceSerialize},je),G[qe][1])}if(je.tokenStack.length>0){const en=je.tokenStack[je.tokenStack.length-1];(en[1]||Kz).call(je,void 0,en[0])}for(le.position={start:Ks(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Ks(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)le=t.transforms[qe](le)||le;return le}function i(G,le,je){let Ae=le-1,qe=-1,en=!1,wt,Ge,zt,Tt;for(;++Ae<=je;){const Te=G[Ae];switch(Te[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Te[0]==="enter"?qe++:qe--,Tt=void 0;break}case"lineEndingBlank":{Te[0]==="enter"&&(wt&&!Tt&&!qe&&!zt&&(zt=Ae),Tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Tt=void 0}if(!qe&&Te[0]==="enter"&&Te[1].type==="listItemPrefix"||qe===-1&&Te[0]==="exit"&&(Te[1].type==="listUnordered"||Te[1].type==="listOrdered")){if(wt){let Jr=Ae;for(Ge=void 0;Jr--;){const ke=G[Jr];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;Ge&&(G[Ge][1].type="lineEndingBlank",en=!0),ke[1].type="lineEnding",Ge=Jr}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}zt&&(!Ge||zt<Ge)&&(wt._spread=!0),wt.end=Object.assign({},Ge?G[Ge][1].start:Te[1].end),G.splice(Ge||Ae,0,["exit",wt,Te[2]]),Ae++,je++}if(Te[1].type==="listItemPrefix"){const Jr={type:"listItem",_spread:!1,start:Object.assign({},Te[1].start),end:void 0};wt=Jr,G.splice(Ae,0,["enter",Jr,Te[2]]),Ae++,je++,zt=void 0,Tt=!0}}}return G[le][1]._spread=en,je}function a(G,le){return je;function je(Ae){u.call(this,G(Ae),Ae),le&&le.call(this,Ae)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(G,le,je){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([le,je||void 0]),G.position={start:Ks(le.start),end:void 0}}function d(G){return le;function le(je){G&&G.call(this,je),f.call(this,je)}}function f(G,le){const je=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==G.type&&(le?le.call(this,G,Ae[0]):(Ae[1]||Kz).call(this,G,Ae[0]));else throw new Error("Cannot close `"+G.type+"` ("+xf({start:G.start,end:G.end})+"): it’s not open");je.position.end=Ks(G.end)}function p(){return Nre(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(G){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function v(){const G=this.resume(),le=this.stack[this.stack.length-1];le.lang=G}function w(){const G=this.resume(),le=this.stack[this.stack.length-1];le.meta=G}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const G=this.resume(),le=this.stack[this.stack.length-1];le.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const G=this.resume(),le=this.stack[this.stack.length-1];le.value=G.replace(/(\r?\n|\r)$/g,"")}function O(G){const le=this.resume(),je=this.stack[this.stack.length-1];je.label=le,je.identifier=du(this.sliceSerialize(G)).toLowerCase()}function _(){const G=this.resume(),le=this.stack[this.stack.length-1];le.title=G}function C(){const G=this.resume(),le=this.stack[this.stack.length-1];le.url=G}function T(G){const le=this.stack[this.stack.length-1];if(!le.depth){const je=this.sliceSerialize(G).length;le.depth=je}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(G){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function I(G){const je=this.stack[this.stack.length-1].children;let Ae=je[je.length-1];(!Ae||Ae.type!=="text")&&(Ae=lt(),Ae.position={start:Ks(G.start),end:void 0},je.push(Ae)),this.stack.push(Ae)}function q(G){const le=this.stack.pop();le.value+=this.sliceSerialize(G),le.position.end=Ks(G.end)}function B(G){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=le.children[le.children.length-1];je.position.end=Ks(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(I.call(this,G),q.call(this,G))}function $(){this.data.atHardBreak=!0}function V(){const G=this.resume(),le=this.stack[this.stack.length-1];le.value=G}function te(){const G=this.resume(),le=this.stack[this.stack.length-1];le.value=G}function Y(){const G=this.resume(),le=this.stack[this.stack.length-1];le.value=G}function H(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=le,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function J(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=le,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function pe(G){const le=this.sliceSerialize(G),je=this.stack[this.stack.length-2];je.label=kae(le),je.identifier=du(le).toLowerCase()}function Se(){const G=this.stack[this.stack.length-1],le=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const Ae=G.children;je.children=Ae}else je.alt=le}function R(){const G=this.resume(),le=this.stack[this.stack.length-1];le.url=G}function U(){const G=this.resume(),le=this.stack[this.stack.length-1];le.title=G}function F(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Q(G){const le=this.resume(),je=this.stack[this.stack.length-1];je.label=le,je.identifier=du(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function se(G){this.data.characterReferenceType=G.type}function ae(G){const le=this.sliceSerialize(G),je=this.data.characterReferenceType;let Ae;je?(Ae=O4(le,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=_k(le);const qe=this.stack[this.stack.length-1];qe.value+=Ae}function he(G){const le=this.stack.pop();le.position.end=Ks(G.end)}function Ne(G){q.call(this,G);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(G)}function ne(G){q.call(this,G);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(G)}function de(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function et(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function Ut(){return{type:"html",value:""}}function Xt(){return{type:"image",title:null,url:"",alt:null}}function on(){return{type:"link",title:null,url:"",children:[]}}function we(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function Ze(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function bt(){return{type:"paragraph",children:[]}}function Jt(){return{type:"strong",children:[]}}function lt(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function Ks(e){return{line:e.line,column:e.column,offset:e.offset}}function B4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?B4(e,r):Aae(e,r)}}function Aae(e,t){let n;for(n in t)if($4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kz(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xf({start:t.start,end:t.end})+") is still open")}function Oae(e){const t=this;t.parser=n;function n(r){return Cae(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Eae(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zae(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
-
`}]}function Tae(e,t){const n=t.value?t.value+`
|
|
102
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Pae(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rae(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Dae(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Lu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Mae(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Iae(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function U4(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Lae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U4(e,t);const i={src:Lu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $ae(e,t){const n={src:Lu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Bae(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Uae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return U4(e,t);const i={href:Lu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Fae(e,t){const n={href:Lu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qae(e,t,n){const r=e.all(t),i=n?Hae(n):F4(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
103
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
104
|
-
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function Hae(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=F4(n[r])}return t}function F4(e){const t=e.spread;return t??e.children.length>1}function Kae(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Gae(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vae(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zae(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yae(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=jk(t.children[1]),d=S4(t.children[t.children.length-1]);u&&d&&(o.position={start:u,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Wae(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,u=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Qae(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Gz=9,Vz=32;function Xae(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Zz(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Zz(t.slice(i),i>0,!1)),a.join("")}function Zz(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Gz||a===Vz;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Gz||a===Vz;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Jae(e,t){const n={type:"text",value:Xae(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ese(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tse={blockquote:Eae,break:zae,code:Tae,delete:Pae,emphasis:Rae,footnoteReference:Dae,heading:Mae,html:Iae,imageReference:Lae,image:$ae,inlineCode:Bae,linkReference:Uae,link:Fae,listItem:qae,list:Kae,paragraph:Gae,root:Vae,strong:Zae,table:Yae,tableCell:Qae,tableRow:Wae,text:Jae,thematicBreak:ese,toml:ym,yaml:ym,definition:ym,footnoteDefinition:ym};function ym(){}const q4=-1,nv=0,Sf=1,Eg=2,Ek=3,zk=4,Tk=5,Pk=6,H4=7,K4=8,Yz=typeof self=="object"?self:globalThis,nse=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case nv:case q4:return n(o,i);case Sf:{const u=n([],i);for(const d of o)u.push(r(d));return u}case Eg:{const u=n({},i);for(const[d,f]of o)u[r(d)]=r(f);return u}case Ek:return n(new Date(o),i);case zk:{const{source:u,flags:d}=o;return n(new RegExp(u,d),i)}case Tk:{const u=n(new Map,i);for(const[d,f]of o)u.set(r(d),r(f));return u}case Pk:{const u=n(new Set,i);for(const d of o)u.add(r(d));return u}case H4:{const{name:u,message:d}=o;return n(new Yz[u](d),i)}case K4:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new Yz[a](o),i)};return r},Wz=e=>nse(new Map,e)(0),Bc="",{toString:rse}={},{keys:ise}=Object,Jd=e=>{const t=typeof e;if(t!=="object"||!e)return[nv,t];const n=rse.call(e).slice(8,-1);switch(n){case"Array":return[Sf,Bc];case"Object":return[Eg,Bc];case"Date":return[Ek,Bc];case"RegExp":return[zk,Bc];case"Map":return[Tk,Bc];case"Set":return[Pk,Bc];case"DataView":return[Sf,n]}return n.includes("Array")?[Sf,n]:n.includes("Error")?[H4,n]:[Eg,n]},vm=([e,t])=>e===nv&&(t==="function"||t==="symbol"),ase=(e,t,n,r)=>{const i=(o,u)=>{const d=r.push(o)-1;return n.set(u,d),d},a=o=>{if(n.has(o))return n.get(o);let[u,d]=Jd(o);switch(u){case nv:{let p=o;switch(d){case"bigint":u=K4,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([q4],o)}return i([u,p],o)}case Sf:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([u,p],o);for(const y of o)p.push(a(y));return m}case Eg:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([u,p],o);for(const y of ise(o))(e||!vm(Jd(o[y])))&&p.push([a(y),a(o[y])]);return m}case Ek:return i([u,o.toISOString()],o);case zk:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case Tk:{const p=[],m=i([u,p],o);for(const[y,v]of o)(e||!(vm(Jd(y))||vm(Jd(v))))&&p.push([a(y),a(v)]);return m}case Pk:{const p=[],m=i([u,p],o);for(const y of o)(e||!vm(Jd(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([u,{name:d,message:f}],o)};return a},Qz=(e,{json:t,lossy:n}={})=>{const r=[];return ase(!(t||n),!!t,new Map,r)(e),r},zg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Wz(Qz(e,t)):structuredClone(e):(e,t)=>Wz(Qz(e,t));function sse(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ose(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lse(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sse,r=e.options.footnoteBackLabel||ose,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),y=Lu(m.toLowerCase());let v=0;const w=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++v<=S;){w.length>0&&w.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,v);typeof O=="string"&&(O={type:"text",value:O}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const O=j.children[j.children.length-1];O&&O.type==="text"?O.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else p.push(...w);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,N),u.push(N)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...zg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
106
|
-
`}]}}const G4=(function(e){if(e==null)return fse;if(typeof e=="function")return rv(e);if(typeof e=="object")return Array.isArray(e)?cse(e):use(e);if(typeof e=="string")return dse(e);throw new Error("Expected function, string, or object as test")});function cse(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=G4(e[n]);return rv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function use(e){const t=e;return rv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function dse(e){return rv(t);function t(n){return n&&n.type===e}}function rv(e){return t;function t(n,r,i){return!!(hse(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fse(){return!0}function hse(e){return e!==null&&typeof e=="object"&&"type"in e}const V4=[],pse=!0,Xz=!1,mse="skip";function gse(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=G4(i),o=r?-1:1;u(e,void 0,[])();function u(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=V4,w,S,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=yse(n(d,p)),v[0]===Xz))return v;if("children"in d&&d.children){const N=d;if(N.children&&v[0]!==mse)for(S=(r?N.children.length:-1)+o,j=p.concat(N);S>-1&&S<N.children.length;){const O=N.children[S];if(w=u(O,S,j)(),w[0]===Xz)return w;S=typeof w[1]=="number"?w[1]:S+o}}return v}}}function yse(e){return Array.isArray(e)?e:typeof e=="number"?[pse,e]:e==null?V4:[e]}function Z4(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),gse(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const v1={}.hasOwnProperty,vse={};function bse(e,t){const n=t||vse,r=new Map,i=new Map,a=new Map,o={...tse,...n.handlers},u={all:f,applyData:wse,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:xse,wrap:jse};return Z4(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),u;function d(p,m){const y=p.type,v=u.handlers[y];if(v1.call(u.handlers,y)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in p){const{children:S,...j}=p,N=zg(j);return N.children=u.all(p),N}return zg(p)}return(u.options.unknownHandler||Sse)(u,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=u.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Jz(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=Jz(S.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function xse(e,t){e.position&&(t.position=rre(e))}function wse(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,zg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Sse(e,t){const n=t.data||{},r="value"in t&&!(v1.call(n,"hProperties")||v1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jse(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
107
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
108
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
109
|
-
`}),n}function Jz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eT(e,t){const n=bse(e,t),r=n.one(e,void 0),i=lse(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
110
|
-
`},i),a}function kse(e,t){return e&&"run"in e?async function(n,r){const i=eT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return eT(n,{file:r,...e||t})}}function tT(e){if(e)throw e}var Zx,nT;function Nse(){if(nT)return Zx;nT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Zx=function d(){var f,p,m,y,v,w,S=arguments[0],j=1,N=arguments.length,O=!1;for(typeof S=="boolean"&&(O=S,S=arguments[1]||{},j=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});j<N;++j)if(f=arguments[j],f!=null)for(p in f)m=u(S,p),y=u(f,p),S!==y&&(O&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},o(S,{name:p,newValue:d(O,w,y)})):typeof y<"u"&&o(S,{name:p,newValue:y}));return S},Zx}var Cse=Nse();const Yx=ka(Cse);function b1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _se(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?Ase(p,u)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Ase(e,t){let n;return r;function r(...o){const u=e.length>o.length;let d;u&&o.push(i);try{d=e.apply(this,o)}catch(f){const p=f;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(o,...u){n||(n=!0,t(o,...u))}function a(o){i(null,o)}}const la={basename:Ose,dirname:Ese,extname:zse,join:Tse,sep:"/"};function Ose(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ese(e){if(dh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function zse(e){dh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),u===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Tse(...e){let t=-1,n;for(;++t<e.length;)dh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Pse(n)}function Pse(e){dh(e);const t=e.codePointAt(0)===47;let n=Rse(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Rse(e,t){let n="",r=0,i=-1,a=0,o=-1,u,d;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else u===46&&a>-1?a++:a=-1}return n}function dh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Dse={cwd:Mse};function Mse(){return"/"}function x1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ise(e){if(typeof e=="string")e=new URL(e);else if(!x1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Lse(e)}function Lse(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Wx=["history","path","basename","stem","extname","dirname"];class Y4{constructor(t){let n;t?x1(t)?n={path:t}:typeof t=="string"||$se(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Dse.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Wx.length;){const a=Wx[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Wx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){Xx(t,"basename"),Qx(t,"basename"),this.path=la.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?la.dirname(this.path):void 0}set dirname(t){rT(this.basename,"dirname"),this.path=la.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?la.extname(this.path):void 0}set extname(t){if(Qx(t,"extname"),rT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=la.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){x1(t)&&(t=Ise(t)),Xx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?la.basename(this.path,this.extname):void 0}set stem(t){Xx(t,"stem"),Qx(t,"stem"),this.path=la.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new sr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Qx(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function Xx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $se(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bse=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Use={}.hasOwnProperty;class Rk extends Bse{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_se()}copy(){const t=new Rk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(tw("data",this.frozen),this.namespace[t]=n,this):Use.call(this.namespace,t)&&this.namespace[t]||void 0:t?(tw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bm(t),r=this.parser||this.Parser;return Jx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jx("process",this.parser||this.Parser),ew("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const u=bm(t),d=r.parse(u);r.run(d,u,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);Hse(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Jx("processSync",this.parser||this.Parser),ew("processSync",this.compiler||this.Compiler),this.process(t,i),aT("processSync","process",n),r;function i(a,o){n=!0,tT(a),r=o}}run(t,n,r){iT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,u){const d=bm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?u(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),aT("runSync","run",r),i;function a(o,u){tT(o),i=u,r=!0}}stringify(t,n){this.freeze();const r=bm(n),i=this.compiler||this.Compiler;return ew("stringify",i),iT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(tw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=Yx(!0,i.settings,f.settings))}function u(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const S=r[y][1];b1(S)&&b1(v)&&(v=Yx(!0,S,v)),r[y]=[f,v,...w]}}}}const Fse=new Rk().freeze();function Jx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ew(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function tw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iT(e){if(!b1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bm(e){return qse(e)?e:new Y4(e)}function qse(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Hse(e){return typeof e=="string"||Kse(e)}function Kse(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Gse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sT=[],oT={allowDangerousHtml:!0},Vse=/^(https?|ircs?|mailto|xmpp)$/i,Zse=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Yse(e){const t=Wse(e),n=Qse(e);return Xse(t.runSync(t.parse(n),n),e)}function Wse(e){const t=e.rehypePlugins||sT,n=e.remarkPlugins||sT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...oT}:oT;return Fse().use(Oae).use(n).use(kse,r).use(t)}function Qse(e){const t=e.children||"",n=new Y4;return typeof t=="string"&&(n.value=t),n}function Xse(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Jse;for(const p of Zse)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Gse+p.id,void 0);return Z4(e,f),lre(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Kx)if(Object.hasOwn(Kx,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],S=Kx[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return u&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Jse(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Vse.test(e.slice(0,t))?e:""}function eoe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const iv=eoe();async function lT(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ni(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function toe(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ni(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function noe(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ni(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function roe({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new Ni(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)break;m+=p.decode(v,{stream:!0});let S=m.indexOf(`
|
|
111
|
-
|
|
112
|
-
`);for(;S!==-1;){const j=m.slice(0,S);m=m.slice(S+2);for(const N of j.split(`
|
|
113
|
-
`)){if(!N.startsWith("data:"))continue;const O=N.slice(5).trim();if(O)try{o(JSON.parse(O))}catch{}}S=m.indexOf(`
|
|
114
|
-
|
|
115
|
-
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function W4(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const ioe=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],aoe=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/keywords",label:"Keywords",hint:"List tracked keywords",prompt:"List the tracked keywords for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],xm=e=>`canonry:aero:provider:${e}`,cT=e=>`canonry:aero:scope:${e}`;function soe({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState(""),[f,p]=b.useState(!1),[m,y]=b.useState([]),[v,w]=b.useState(""),[S,j]=b.useState(null),[N,O]=b.useState(()=>typeof window>"u"?null:window.localStorage.getItem(xm(e))??null),[_,C]=b.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(cT(e))==="all"?"all":"read-only"),T=b.useRef(null),E=b.useRef(null),A=b.useRef(null),[P,I]=b.useState(0),q=b.useMemo(()=>{const F=u.trimStart();if(!F.startsWith("/"))return[];if(/\s/.test(F))return[];const D=F.toLowerCase();return aoe.filter(Q=>Q.command.startsWith(D)||Q.label.toLowerCase().includes(D.slice(1)))},[u]);b.useEffect(()=>{I(F=>q.length===0?0:Math.min(F,q.length-1))},[q.length]);const B=rs({queryKey:Ar.agent.providers(e),queryFn:()=>toe(e),enabled:t,staleTime:6e4}),$=b.useMemo(()=>{const F=B.data?.providers??[];if(N){const Q=F.find(se=>se.id===N&&se.configured);if(Q)return Q}const D=B.data?.defaultProvider;return D?F.find(Q=>Q.id===D)??null:null},[N,B.data]);b.useEffect(()=>{if(!B.data||!N)return;B.data.providers.find(D=>D.id===N&&D.configured)||(O(null),window.localStorage.removeItem(xm(e)))},[B.data,N,e]);const V=b.useCallback(F=>{O(F),!(typeof window>"u")&&(F?window.localStorage.setItem(xm(e),F):window.localStorage.removeItem(xm(e)))},[e]),te=b.useCallback(()=>{C(F=>{const D=F==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(cT(e),D),D})},[e]);b.useEffect(()=>{if(!t)return;const F=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[t,r]),b.useEffect(()=>{if(!t)return;let F=!1;j(null);const D=()=>{F||f||lT(e).then(ae=>{F||o(ae.messages)}).catch(ae=>{F||j(ae instanceof Error?ae.message:"Failed to load transcript")})};D();const se=window.setInterval(D,15e3);return()=>{F=!0,window.clearInterval(se)}},[t,e,f]),b.useEffect(()=>()=>{T.current?.abort()},[e]),b.useEffect(()=>{const F=E.current;F&&(F.scrollTop=F.scrollHeight)},[a,v,m]);async function Y(F){const D=F.trim();if(!D||f)return;j(null),d(""),p(!0),w(""),y([]);const Q={role:"user",content:D,timestamp:Date.now()};o(ae=>[...ae,Q]);const se=new AbortController;T.current=se;try{await roe({project:e,prompt:D,provider:N??void 0,scope:_,signal:se.signal,onEvent:H});const ae=await lT(e);o(ae.messages)}catch(ae){ae.name!=="AbortError"&&j(ae instanceof Error?ae.message:"Prompt failed")}finally{p(!1),w(""),T.current=null}}function H(F){switch(F.type){case"message_update":w(W4(F.message));break;case"message_end":F.message.role==="assistant"&&w("");break;case"tool_execution_start":y(D=>[...D,{id:F.toolCallId,name:F.toolName,args:F.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(D=>D.map(Q=>Q.id===F.toolCallId?{...Q,endedAt:Date.now(),isError:F.isError,result:F.result}:Q));break;case"error":j(F.message);break}}async function J(){T.current?.abort();try{await noe(e),o([]),j(null)}catch(F){j(F instanceof Error?F.message:"Reset failed")}}const pe=a.length===0,Se=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",R=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",U=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return c.jsx("div",{className:Se,onClick:F=>{r&&F.target===F.currentTarget&&i(!1)},children:c.jsx("div",{className:R,children:t?c.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(k2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),c.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),c.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(ooe,{providers:B.data?.providers??[],active:$,override:N,onPick:V,disabled:f}),c.jsx("button",{type:"button",onClick:J,className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:c.jsx(aL,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),c.jsx("button",{type:"button",onClick:()=>i(F=>!F),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?c.jsx(FG,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(LG,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),c.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:c.jsx(lh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),c.jsxs("div",{ref:E,className:U,children:[S&&c.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:S}),pe&&!f&&c.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",c.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:ioe.map(F=>c.jsx("button",{type:"button",onClick:()=>Y(F.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:F.label},F.label))})]}),foe(a,e,N,_),m.length>0&&c.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(F=>c.jsx(Q4,{trail:F},F.id))}),f&&v&&c.jsxs("div",{className:"mt-3",children:[c.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsx(X4,{content:v})]}),f&&!v&&m.every(F=>F.endedAt!==void 0)&&c.jsx(goe,{})]}),c.jsx(loe,{projectName:e,activeProvider:$,scope:_,onToggleScope:te,disabled:f}),c.jsxs("div",{className:"relative",children:[q.length>0&&c.jsx(coe,{matches:q,selectedIndex:P,onHover:I,onPick:F=>{d(""),A.current?.focus(),F.action==="clear"?J():Y(F.prompt)}}),c.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:F=>{if(F.preventDefault(),q.length>0){const D=q[P];d(""),D.action==="clear"?J():Y(D.prompt);return}Y(u)},children:[c.jsx("textarea",{ref:A,value:u,onChange:F=>d(F.target.value),onKeyDown:F=>{if(q.length>0){if(F.key==="ArrowDown"){F.preventDefault(),I(D=>(D+1)%q.length);return}if(F.key==="ArrowUp"){F.preventDefault(),I(D=>(D-1+q.length)%q.length);return}if(F.key==="Tab"){F.preventDefault();const D=q[P];d(`${D.command} `);return}if(F.key==="Escape"){F.preventDefault(),d("");return}}if(F.key==="Enter"&&!F.shiftKey)if(F.preventDefault(),q.length>0){const D=q[P];d(""),D.action==="clear"?J():Y(D.prompt)}else Y(u)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),c.jsx("button",{type:"submit",disabled:f||!u.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:c.jsx(mG,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):c.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(k2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),c.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function ooe({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=b.useState(!1),u=b.useRef(null);if(b.useEffect(()=>{if(!a)return;const p=y=>{u.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return c.jsxs("div",{ref:u,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[c.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&c.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),c.jsx(vG,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&c.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[c.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),c.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,y=n===p.id;return c.jsx("li",{children:c.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?c.jsx(eL,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),c.jsxs("span",{className:"flex-1",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&c.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!p.configured&&c.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),c.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&c.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&c.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",c.jsx("code",{className:"font-mono text-zinc-400",children:uoe(p.id)})]})]})]})},p.id)})}),n&&c.jsx("button",{type:"button",onClick:()=>{r(null),o(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function loe({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[c.jsx("span",{className:"text-zinc-600",children:"project"}),c.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[c.jsx("span",{className:"text-zinc-600",children:"model"}),c.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),c.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${o?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:o?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[c.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),c.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function coe({matches:e,selectedIndex:t,onHover:n,onPick:r}){return c.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[c.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),c.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return c.jsx("li",{children:c.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[c.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),c.jsx("span",{className:"font-medium",children:i.label}),c.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),c.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[c.jsx("span",{className:"mr-3",children:"↑↓ to select"}),c.jsx("span",{className:"mr-3",children:"Enter to run"}),c.jsx("span",{children:"Tab to autocomplete"})]})]})}function uoe(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function doe(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function foe(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],u=doe(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(c.jsx(hoe,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=moe(o,d,o.timestamp??0),m=W4(o);i.push(c.jsxs(b.Fragment,{children:[p.length>0&&c.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>c.jsx(Q4,{trail:y},y.id))}),m.trim()&&c.jsxs("div",{className:"mt-3",children:[c.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsx(X4,{content:m})]})]},u)),a=f-1;continue}}return i}function hoe({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=b.useState(!1),o=b.useMemo(()=>poe(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return c.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),c.jsx("button",{type:"button",onClick:u,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:o,children:i?c.jsxs(c.Fragment,{children:[c.jsx(eL,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):c.jsxs(c.Fragment,{children:[c.jsx(NG,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),c.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function poe(e,t,n,r){const i=["canonry","agent","ask",uT(e),uT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function uT(e){return`'${e.replace(/'/g,"'\\''")}'`}function moe(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function Q4({trail:e}){const[t,n]=b.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,u=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return c.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[c.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":t,children:[c.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?c.jsx(iL,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?c.jsx(wg,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):c.jsx(aV,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),c.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),c.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?c.jsx("span",{className:"text-emerald-400",children:"running…"}):c.jsxs(c.Fragment,{children:[c.jsx("span",{children:i?"failed":"ok"}),o&&c.jsx("span",{children:o})]}),c.jsx(oh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&c.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[c.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),c.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:dT(e.args)}),!r&&e.result!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),c.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:dT(e.result)})]})]})]})}function dT(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
|
|
116
|
-
… (${t.length-2e3} more chars)`:t}catch{return String(e)}}function X4({content:e}){return c.jsx("div",{className:"aero-markdown text-zinc-100",children:c.jsx(Yse,{components:{h1:t=>c.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>c.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>c.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>c.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>c.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>c.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>c.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>c.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>c.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>c.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>c.jsx("code",{...n,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:t}),pre:t=>c.jsx("pre",{...t,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:t=>c.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>c.jsx("div",{className:"mb-2 overflow-x-auto",children:c.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>c.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>c.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>c.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>c.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>c.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>c.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function goe(){return c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[c.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),c.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),c.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function yoe(){const e=$I(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=rs({queryKey:Ar.projects.all,queryFn:Gj,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?c.jsx(soe,{projectName:a.name},a.name):null}const fT=[{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"}],hT=e=>({label:e,state:"checking",detail:"Checking service health"}),voe={apiStatus:hT("API"),workerStatus:hT("Worker")};function boe(e){switch(e){case Kt["answer-visibility"]:return"Visibility sweep";case Kt["gsc-sync"]:return"GSC sync";case Kt["inspect-sitemap"]:return"Sitemap inspection";case Kt["ga-sync"]:return"GA sync";case Kt["bing-inspect"]:return"Bing URL inspection";case Kt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Kt["site-audit"]:return"Site audit";case Kt["backlink-extract"]:return"Backlink extract"}}function xoe(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function woe(e){const t=boe(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Soe(e,t){return e.error?`${t}: ${sk(e.error)}`:e.location?`${t} · ${e.location}`:t}function joe(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function koe(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 Noe(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function Coe(){const e=b.useSyncExternalStore(nJ,zl,zl),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=rs({queryKey:Ar.runs.all,queryFn:UI,enabled:t}),r=rs({queryKey:Ar.projects.all,queryFn:Gj,enabled:t}),i=b.useRef({}),a=b.useCallback(()=>{n.refetch()},[n.refetch]);return b.useEffect(()=>{t&&a()},[t,a]),b.useEffect(()=>{if(!t||typeof window>"u")return;const o=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",o)}},[t,a]),b.useEffect(()=>{const o=n.data??[],u=r.data??[],d=Object.fromEntries(o.map(p=>[p.id,p])),f=Object.fromEntries(o.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const m=d[p.runId];if(!m||!ck(m.status)||(i.current[m.id]??p.lastAnnouncedStatus)===m.status)continue;if(p.sourceAction==="run-all"){Q2(m.id);continue}const v=joe(m.projectId,p.projectLabel,u);ht({title:woe(m),detail:Soe(m,v),tone:xoe(m.status),dedupeKey:`run:${m.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:m.id}}),Q2(m.id)}for(const p of Object.values(e.batches)){const m=aJ(p.runIds,d);m.finished&&(ht({title:"Run-all batch finished",detail:koe(m,p.skippedCount),tone:Noe(m),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),iJ(p.batchId))}i.current=f},[r.data,n.data,e]),null}function _oe(){const e=ch(),{dashboard:t,isLoading:n,refetch:r}=Zl(),o=ev(!e,e?.health).data??e?.health??voe,u=$I(),{runId:d,evidenceId:f,closeDrawer:p}=Mu(),[m,y]=b.useState(!1),v=Ene(d),w=v.data??null,S=v.isLoading;b.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),b.useEffect(()=>{y(!1)},[u.pathname]),b.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,N=d&&j?Jte(j,d):void 0,O=f&&j?ene(j,f):void 0,_=(()=>{const C=u.pathname;if(C==="/")return"Portfolio";if(C==="/projects")return"Projects";if(C==="/runs")return"Runs";if(C==="/settings")return"Settings";if(C==="/setup")return"Setup";if(C==="/backlinks")return"Backlinks";if(C.startsWith("/projects/")){const E=C.split("/").filter(Boolean)[1];if(E&&j){const A=j.projects.find(P=>P.project.id===E);if(A)return A.project.name}return"Project"}return"Not found"})();return c.jsxs("div",{className:"app-shell",children:[c.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),c.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[c.jsx("div",{className:"sidebar-brand",children:c.jsx(oz,{})}),c.jsxs("nav",{className:"sidebar-nav",children:[c.jsxs(qt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(RG,{className:"sidebar-icon"}),c.jsx("span",{children:"Overview"})]}),c.jsxs(qt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[c.jsx(TG,{className:"sidebar-icon"}),c.jsx("span",{children:"Projects"})]}),c.jsxs(qt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(xg,{className:"sidebar-icon"}),c.jsx("span",{children:"Runs"})]}),c.jsxs(qt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(rL,{className:"sidebar-icon"}),c.jsx("span",{children:"Backlinks"})]}),c.jsxs(qt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(WG,{className:"sidebar-icon"}),c.jsx("span",{children:"Settings"})]}),n?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(C=>c.jsxs("div",{className:"sidebar-skeleton-item",children:[c.jsx("span",{className:"skeleton-circle size-2"}),c.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+C*15}%`}})]},C))]}):j&&j.projects.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const T=C.visibilitySummary.tone;return c.jsxs(qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[c.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),c.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Resources"}),c.jsxs(qt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(VG,{className:"sidebar-icon"}),c.jsx("span",{children:"Setup"})]})]})]}),c.jsx("div",{className:"sidebar-footer",children:fT.map(C=>c.jsx("a",{className:"sidebar-footer-link",href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]}),c.jsxs("div",{className:"main-area",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"topbar-left",children:[c.jsx("div",{className:"topbar-brand-mobile",children:c.jsx(oz,{compact:!0})}),c.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[c.jsx(qt,{to:"/",children:"Home"}),c.jsx(oh,{className:"breadcrumb-sep size-3"}),c.jsx("span",{className:"breadcrumb-current",children:_})]})]}),c.jsxs("div",{className:"topbar-actions",children:[c.jsxs("div",{className:"health-pill-row",children:[c.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:vo(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),c.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:vo(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),c.jsxs(be,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[c.jsx(BG,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),c.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[c.jsxs(be,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[c.jsx(lh,{className:"size-5"}),c.jsx("span",{className:"sr-only",children:"Close navigation"})]}),c.jsx(qt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),c.jsx(qt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),c.jsx(qt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),c.jsx(qt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),j&&j.projects.length>0?c.jsxs("div",{className:"mobile-nav-section",children:[c.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(C=>c.jsx(qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.project.id))]}):null]}),c.jsx("main",{id:"content",className:"page-shell",children:n&&!e?c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-40"}),c.jsx("div",{className:"skeleton-text-sm w-72"})]}),c.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(C=>c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton-text w-full"}),c.jsx("div",{className:"skeleton-text-sm w-3/4"})]},C))}),c.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-20"}),c.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>c.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},C))})]}):c.jsx(Kj,{})}),c.jsxs("footer",{className:"footer",children:[c.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noopener noreferrer",className:"footer-brand",children:[c.jsx(EG,{className:"size-3.5"}),c.jsx("span",{children:"Canonry"})]}),c.jsx("div",{className:"footer-links",children:fT.map(C=>c.jsx("a",{href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]})]}),N?c.jsxs(Hte,{open:N!==void 0,title:N.summary,subtitle:`${N.projectName} · ${N.kindLabel}`,onClose:p,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[c.jsx(Yy,{status:N.status}),c.jsx("span",{className:"text-zinc-400",children:N.startedAt}),c.jsx("span",{className:"text-zinc-500",children:N.duration}),c.jsx("span",{className:"text-zinc-600",children:N.triggerLabel})]}),N.status==="failed"&&N.statusDetail&&c.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:N.statusDetail}),c.jsxs("div",{className:"mt-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?c.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(C=>c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:C.keyword??"Unknown key phrase"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(Df,{provider:C.provider}),c.jsx(j5,{variant:C.citationState==="cited"?"success":"neutral",children:C.citationState})]})]}),C.model&&c.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[c.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&c.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.groundingSources.length>0&&c.jsxs("details",{className:"mt-2",children:[c.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((T,E)=>c.jsx("li",{className:"text-xs text-zinc-500 truncate",children:c.jsx("a",{href:T.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},E))})]}),C.answerText&&c.jsxs("details",{className:"mt-1",children:[c.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),c.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:C.answerText})]})]},C.id)),w.status==="running"&&c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?c.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[c.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),c.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:qX(w.error)})]}):c.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?c.jsx(Gte,{evidence:O.evidence,project:O.project,onClose:p}):null,c.jsx(Coe,{}),c.jsx(Pne,{}),c.jsx(yoe,{})]})}class Aoe extends b.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?c.jsx("div",{className:"page-container",children:c.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[c.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:c.jsx(wg,{className:"size-6 text-rose-400"})}),c.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),c.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),c.jsxs("div",{className:"flex gap-3 mt-2",children:[c.jsxs(be,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[c.jsx(aL,{className:"size-3.5 mr-1.5"}),"Try again"]}),c.jsx(be,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const Be=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:zi("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}));Be.displayName="Card";const w1=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:zi("flex flex-col gap-1.5 p-5",e),...t}));w1.displayName="CardHeader";const S1=b.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:zi("font-medium tracking-tight text-zinc-50",e),...t}));S1.displayName="CardTitle";const j1=b.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:zi("text-sm text-zinc-500",e),...t}));j1.displayName="CardDescription";const eg=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:zi("p-5 pt-0",e),...t}));eg.displayName="CardContent";function Ooe({points:e,tone:t}){const n=b.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,S=a+(1-(y-o)/d)*p;return`${w},${S}`}).join(" ");return c.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[c.jsx("defs",{children:c.jsx("clipPath",{id:n,children:c.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),c.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),c.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function Eoe({project:e}){return c.jsxs(qt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[c.jsxs("div",{className:"project-row-primary",children:[c.jsxs("div",{children:[c.jsx("p",{className:"project-name",children:e.project.name}),c.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),c.jsx("p",{className:"project-insight",children:e.insight})]}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),c.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),c.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&c.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),c.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),c.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Gy(e.lastRun.status)]})]})}),c.jsx("div",{className:"project-row-chart",children:c.jsx(Ooe,{points:e.trend,tone:n5(e.lastRun.status)})}),c.jsx("span",{className:"project-row-link",children:c.jsx(oh,{className:"h-4 w-4 text-zinc-500"})})]})}function zoe(){const e=ch(),{dashboard:t,isLoading:n}=Zl(),r=t??e?.dashboard;if(!r||n)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-32"}),c.jsx("div",{className:"skeleton-text-sm w-64"})]}),c.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 space-y-2",children:[c.jsx("div",{className:"skeleton-text w-36"}),c.jsx("div",{className:"skeleton-text-sm w-48"})]}),c.jsx("div",{className:"skeleton-text w-16"}),c.jsx("div",{className:"skeleton-text w-16"}),c.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=ev(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=YX(i.systemHealth,u,r.settings),{openRun:f}=Mu();return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Portfolio"}),c.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),c.jsx("div",{className:"page-header-right",children:c.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?c.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>c.jsx(Eoe,{project:p},p.project.id))}):c.jsxs(Be,{className:"surface-card empty-card",children:[c.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),c.jsx(be,{size:"sm",asChild:!0,children:c.jsx(qt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),c.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),c.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),c.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>c.jsxs(qt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[c.jsxs("div",{children:[c.jsx("p",{className:"attention-title",children:p.title}),c.jsx("p",{className:"attention-detail",children:p.detail})]}),c.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),c.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),c.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>c.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[c.jsxs("div",{children:[c.jsx("p",{className:"compact-run-title",children:p.projectName}),c.jsx("p",{className:"compact-run-detail",children:p.summary})]}),c.jsx(Yy,{status:p.status})]},p.id)):c.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),c.jsxs("section",{className:"page-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),c.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),c.jsx("div",{className:"health-grid",children:d.map(p=>c.jsxs(Be,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),c.jsx("h3",{children:p.detail})]}),c.jsx(vt,{tone:p.tone,title:p.id==="api"?vo(u.apiStatus):p.id==="worker"?vo(u.workerStatus):void 0,children:p.label})]}),c.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Dk=Symbol.for("yaml.alias"),k1=Symbol.for("yaml.document"),fo=Symbol.for("yaml.map"),J4=Symbol.for("yaml.pair"),ba=Symbol.for("yaml.scalar"),$u=Symbol.for("yaml.seq"),Ci=Symbol.for("yaml.node.type"),Wl=e=>!!e&&typeof e=="object"&&e[Ci]===Dk,av=e=>!!e&&typeof e=="object"&&e[Ci]===k1,fh=e=>!!e&&typeof e=="object"&&e[Ci]===fo,Sn=e=>!!e&&typeof e=="object"&&e[Ci]===J4,Vt=e=>!!e&&typeof e=="object"&&e[Ci]===ba,hh=e=>!!e&&typeof e=="object"&&e[Ci]===$u;function xn(e){if(e&&typeof e=="object")switch(e[Ci]){case fo:case $u:return!0}return!1}function wn(e){if(e&&typeof e=="object")switch(e[Ci]){case Dk:case fo:case ba:case $u:return!0}return!1}const e$=e=>(Vt(e)||xn(e))&&!!e.anchor,al=Symbol("break visit"),Toe=Symbol("skip children"),jf=Symbol("remove node");function Bu(e,t){const n=Poe(t);av(e)?nu(null,e.contents,n,Object.freeze([e]))===jf&&(e.contents=null):nu(null,e,n,Object.freeze([]))}Bu.BREAK=al;Bu.SKIP=Toe;Bu.REMOVE=jf;function nu(e,t,n,r){const i=Roe(e,t,n,r);if(wn(i)||Sn(i))return Doe(e,r,i),nu(e,i,n,r);if(typeof i!="symbol"){if(xn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=nu(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===al)return al;o===jf&&(t.items.splice(a,1),a-=1)}}}else if(Sn(t)){r=Object.freeze(r.concat(t));const a=nu("key",t.key,n,r);if(a===al)return al;a===jf&&(t.key=null);const o=nu("value",t.value,n,r);if(o===al)return al;o===jf&&(t.value=null)}}return i}function Poe(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 Roe(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(fh(t))return n.Map?.(e,t,r);if(hh(t))return n.Seq?.(e,t,r);if(Sn(t))return n.Pair?.(e,t,r);if(Vt(t))return n.Scalar?.(e,t,r);if(Wl(t))return n.Alias?.(e,t,r)}function Doe(e,t,n){const r=t[t.length-1];if(xn(r))r.items[e]=n;else if(Sn(r))e==="key"?r.key=n:r.value=n;else if(av(r))r.contents=n;else{const i=Wl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Moe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ioe=e=>e.replace(/[!,[\]{}]/g,t=>Moe[t]);class dr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dr.defaultYaml,t),this.tags=Object.assign({},dr.defaultTags,n)}clone(){const t=new dr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:dr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Ioe(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&&wn(t.contents)){const a={};Bu(t.contents,(o,u)=>{wn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
117
|
-
`)}}dr.defaultYaml={explicit:!1,version:"1.2"};dr.defaultTags={"!!":"tag:yaml.org,2002:"};function t$(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 n$(e){const t=new Set;return Bu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function r$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Loe(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=n$(e));const o=r$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Vt(o.node)||xn(o.node)))o.node.anchor=o.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function ru(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],u=ru(e,r,String(i),o);u===void 0?delete r[i]:u!==o&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=ru(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=ru(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=ru(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function ji(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ji(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!e$(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Mk{constructor(t){Object.defineProperty(this,Ci,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){if(!av(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=ji(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?ru(a,{"":u},"",u):u}}class Ik extends Mk{constructor(t){super(Dk),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=[],Bu(t,{Node:(a,o)=>{(Wl(o)||e$(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(o);if(u||(ji(o,null,n),u=r.get(o)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=tg(i,o,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(t$(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function tg(e,t,n){if(Wl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(xn(t)){let r=0;for(const i of t.items){const a=tg(e,i,n);a>r&&(r=a)}return r}else if(Sn(t)){const r=tg(e,t.key,n),i=tg(e,t.value,n);return Math.max(r,i)}return 1}const i$=e=>!e||typeof e!="function"&&typeof e!="object";class Qe extends Mk{constructor(t){super(ba),this.value=t}toJSON(t,n){return n?.keep?this.value:ji(this.value,t,n)}toString(){return String(this.value)}}Qe.BLOCK_FOLDED="BLOCK_FOLDED";Qe.BLOCK_LITERAL="BLOCK_LITERAL";Qe.PLAIN="PLAIN";Qe.QUOTE_DOUBLE="QUOTE_DOUBLE";Qe.QUOTE_SINGLE="QUOTE_SINGLE";const $oe="tag:yaml.org,2002:";function Boe(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function $f(e,t,n){if(av(e)&&(e=e.contents),wn(e))return e;if(Sn(e)){const m=n.schema[fo].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new Ik(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=$oe+t.slice(2));let f=Boe(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Qe(e);return d&&(d.node=m),m}f=e instanceof Map?o[fo]:Symbol.iterator in Object(e)?o[$u]:o[fo]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new Qe(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Tg(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return $f(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 hf=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class a$ extends Mk{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=>wn(r)||Sn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(hf(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(xn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,Tg(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(xn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&Vt(a)?a.value:a:xn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Sn(n))return!1;const r=n.value;return r==null||t&&Vt(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 xn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(xn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,Tg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Uoe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function es(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const hl=(e,t,n)=>e.endsWith(`
|
|
118
|
-
`)?es(n,t):n.includes(`
|
|
119
|
-
`)?`
|
|
120
|
-
`+es(n,t):(e.endsWith(" ")?"":" ")+n,s$="flow",N1="block",ng="quoted";function sv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:u}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let y,v,w=!1,S=-1,j=-1,N=-1;n===N1&&(S=pT(e,S,t.length),S!==-1&&(m=S+d));for(let _;_=e[S+=1];){if(n===ng&&_==="\\"){switch(j=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}N=S}if(_===`
|
|
121
|
-
`)n===N1&&(S=pT(e,S,t.length)),m=S+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
|
|
122
|
-
`&&v!==" "){const C=e[S+1];C&&C!==" "&&C!==`
|
|
123
|
-
`&&C!==" "&&(y=S)}if(S>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===ng){for(;v===" "||v===" ";)v=_,_=e[S+=1],w=!0;const C=S>N+1?S-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else w=!0}v=_}if(w&&u&&u(),f.length===0)return e;o&&o();let O=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const C=f[_],T=f[_+1]||e.length;C===0?O=`
|
|
124
|
-
${t}${e.slice(0,T)}`:(n===ng&&p[C]&&(O+=`${e[C]}\\`),O+=`
|
|
125
|
-
${t}${e.slice(C+1,T)}`)}return O}function pT(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
126
|
-
`);r=t,i=t+1,a=e[i]}return r}const ov=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),lv=e=>/^(%|---|\.\.\.)/m.test(e);function Foe(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;a<i;++a)if(e[a]===`
|
|
127
|
-
`){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function kf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(lv(e)?" ":"");let o="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(u,d)+`
|
|
128
|
-
|
|
129
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
130
|
-
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,u=d+1}break;default:d+=1}return o=u?o+n.slice(u):n,r?o:sv(o,a,ng,ov(t,!1))}function C1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return kf(e,t);const n=t.indent||(lv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
-
${n}`)+"'";return t.implicitKey?r:sv(r,n,s$,ov(t,!1))}function iu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=kf;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=C1:a&&!i?r=kf:r=n?C1:kf}return r(e,t)}let _1;try{_1=new RegExp(`(^|(?<!
|
|
133
|
-
))
|
|
134
|
-
+(?!
|
|
135
|
-
|$)`,"g")}catch{_1=/\n+(?!\n|$)/g}function rg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:u,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return iu(n,r);const f=r.indent||(r.forceBlockIndent||lv(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===Qe.BLOCK_FOLDED?!1:t===Qe.BLOCK_LITERAL?!0:!Foe(n,d,f.length);if(!n)return p?`|
|
|
136
|
-
`:`>
|
|
137
|
-
`;let m,y;for(y=n.length;y>0;--y){const T=n[y-1];if(T!==`
|
|
138
|
-
`&&T!==" "&&T!==" ")break}let v=n.substring(y);const w=v.indexOf(`
|
|
139
|
-
`);w===-1?m="-":n===v||w!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
140
|
-
`&&(v=v.slice(0,-1)),v=v.replace(_1,`$&${f}`));let S=!1,j,N=-1;for(j=0;j<n.length;++j){const T=n[j];if(T===" ")S=!0;else if(T===`
|
|
141
|
-
`)N=j;else break}let O=n.substring(0,N<j?N+1:j);O&&(n=n.substring(O.length),O=O.replace(/\n+/g,`$&${f}`));let C=(S?f?"2":"1":"")+m;if(e&&(C+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=n.replace(/\n+/g,`
|
|
142
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let E=!1;const A=ov(r,!0);o!=="folded"&&t!==Qe.BLOCK_FOLDED&&(A.onOverflow=()=>{E=!0});const P=sv(`${O}${T}${v}`,f,N1,A);if(!E)return`>${C}
|
|
143
|
-
${f}${P}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
|
|
144
|
-
${f}${O}${n}${v}`}function qoe(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
|
|
145
|
-
`)||p&&/[[\]{},]/.test(a))return iu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
|
|
146
|
-
`)?iu(a,t):rg(e,t,n,r);if(!u&&!p&&i!==Qe.PLAIN&&a.includes(`
|
|
147
|
-
`))return rg(e,t,n,r);if(lv(a)){if(d==="")return t.forceBlockIndent=!0,rg(e,t,n,r);if(u&&d===f)return iu(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
-
${d}`);if(o){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return iu(a,t)}return u?m:sv(m,d,s$,ov(t,!1))}function Lk(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==Qe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(u=Qe.QUOTE_DOUBLE);const d=p=>{switch(p){case Qe.BLOCK_FOLDED:case Qe.BLOCK_LITERAL:return i||a?iu(o.value,t):rg(o,t,n,r);case Qe.QUOTE_DOUBLE:return kf(o.value,t);case Qe.QUOTE_SINGLE:return C1(o.value,t);case Qe.PLAIN:return qoe(o,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function o$(e,t){const n=Object.assign({blockQuote:!0,commentString:Uoe,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 Hoe(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Vt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Koe(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Vt(e)||xn(e))&&e.anchor;a&&t$(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Su(e,t,n,r){if(Sn(e))return e.toString(t,n,r);if(Wl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const a=wn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Hoe(t.doc.schema.tags,a));const o=Koe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Vt(a)?Lk(a,t,n,r):a.toString(t,n,r);return o?Vt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
|
|
149
|
-
${t.indent}${u}`:u}function Goe({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=wn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(xn(e)||!wn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||xn(e)||(Vt(e)?e.type===Qe.BLOCK_FOLDED||e.type===Qe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let w=!1,S=!1,j=Su(e,n,()=>w=!0,()=>S=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return w&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!w?j+=hl(j,n.indent,f(y)):S&&i&&i(),j;w&&(y=null),v?(y&&(j+=hl(j,n.indent,f(y))),j=`? ${j}
|
|
150
|
-
${u}:`):(j=`${j}:`,y&&(j+=hl(j,n.indent,f(y))));let N,O,_;wn(t)?(N=!!t.spaceBefore,O=t.commentBefore,_=t.comment):(N=!1,O=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Vt(t)&&(n.indentAtStart=j.length+1),S=!1,!p&&d.length>=2&&!n.inFlow&&!v&&hh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const T=Su(t,n,()=>C=!0,()=>S=!0);let E=" ";if(y||N||O){if(E=N?`
|
|
151
|
-
`:"",O){const A=f(O);E+=`
|
|
152
|
-
${es(A,n.indent)}`}T===""&&!n.inFlow?E===`
|
|
153
|
-
`&&_&&(E=`
|
|
154
|
-
|
|
155
|
-
`):E+=`
|
|
156
|
-
${n.indent}`}else if(!v&&xn(t)){const A=T[0],P=T.indexOf(`
|
|
157
|
-
`),I=P!==-1,q=n.inFlow??t.flow??t.items.length===0;if(I||!q){let B=!1;if(I&&(A==="&"||A==="!")){let $=T.indexOf(" ");A==="&"&&$!==-1&&$<P&&T[$+1]==="!"&&($=T.indexOf(" ",$+1)),($===-1||P<$)&&(B=!0)}B||(E=`
|
|
158
|
-
${n.indent}`)}}else(T===""||T[0]===`
|
|
159
|
-
`)&&(E="");return j+=E+T,n.inFlow?C&&r&&r():_&&!C?j+=hl(j,n.indent,f(_)):S&&i&&i(),j}function Voe(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const wm="<<",is={identify:e=>e===wm||typeof e=="symbol"&&e.description===wm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Qe(Symbol(wm)),{addToJSMap:l$}),stringify:()=>wm},Zoe=(e,t)=>(is.identify(t)||Vt(t)&&(!t.type||t.type===Qe.PLAIN)&&is.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===is.tag&&n.default);function l$(e,t,n){if(n=e&&Wl(n)?n.resolve(e.doc):n,hh(n))for(const r of n.items)nw(e,t,r);else if(Array.isArray(n))for(const r of n)nw(e,t,r);else nw(e,t,n)}function nw(e,t,n){const r=e&&Wl(n)?n.resolve(e.doc):n;if(!fh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function c$(e,t,{key:n,value:r}){if(wn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Zoe(e,n))l$(e,t,r);else{const i=ji(n,"",e);if(t instanceof Map)t.set(i,ji(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Yoe(n,i,e),o=ji(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Yoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(wn(e)&&n?.doc){const r=o$(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),Voe(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function $k(e,t,n){const r=$f(e,void 0,n),i=$f(t,void 0,n);return new pr(r,i)}class pr{constructor(t,n=null){Object.defineProperty(this,Ci,{value:J4}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return wn(n)&&(n=n.clone(t)),wn(r)&&(r=r.clone(t)),new pr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return c$(n,r,this)}toString(t,n,r){return t?.doc?Goe(this,t,n,r):JSON.stringify(this)}}function u$(e,t,n){return(t.inFlow??e.flow?Qoe:Woe)(e,t,n)}function Woe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let w=0;w<t.length;++w){const S=t[w];let j=null;if(wn(S))!m&&S.spaceBefore&&y.push(""),Pg(n,y,S.commentBefore,m),S.comment&&(j=S.comment);else if(Sn(S)){const O=wn(S.key)?S.key:null;O&&(!m&&O.spaceBefore&&y.push(""),Pg(n,y,O.commentBefore,m))}m=!1;let N=Su(S,p,()=>j=null,()=>m=!0);j&&(N+=hl(N,a,f(j))),m&&j&&(m=!1),y.push(r+N)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const S=y[w];v+=S?`
|
|
160
|
-
${d}${S}`:`
|
|
161
|
-
`}}return e?(v+=`
|
|
162
|
-
`+es(f(e),d),u&&u()):m&&o&&o(),v}function Qoe({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:u}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let w=0;w<e.length;++w){const S=e[w];let j=null;if(wn(S))S.spaceBefore&&m.push(""),Pg(t,m,S.commentBefore,!1),S.comment&&(j=S.comment);else if(Sn(S)){const O=wn(S.key)?S.key:null;O&&(O.spaceBefore&&m.push(""),Pg(t,m,O.commentBefore,!1),O.comment&&(f=!0));const _=wn(S.value)?S.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):S.value==null&&O?.comment&&(j=O.comment)}j&&(f=!0);let N=Su(S,d,()=>j=null);w<e.length-1&&(N+=","),j&&(N+=hl(N,r,u(j))),!f&&(m.length>p||N.includes(`
|
|
163
|
-
`))&&(f=!0),m.push(N),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const w=m.reduce((S,j)=>S+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=y;for(const S of m)w+=S?`
|
|
164
|
-
${a}${i}${S}`:`
|
|
165
|
-
`;return`${w}
|
|
166
|
-
${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function Pg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=es(t(r),e);n.push(a.trimStart())}}function pl(e,t){const n=Vt(t)?t.value:t;for(const r of e)if(Sn(r)&&(r.key===t||r.key===n||Vt(r.key)&&r.key.value===n))return r}class bi extends a${static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(fo,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),u=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&o.items.push($k(d,f,r))};if(n instanceof Map)for(const[d,f]of n)u(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;Sn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new pr(t,t?.value):r=new pr(t.key,t.value);const i=pl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Vt(i.value)&&i$(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(u=>a(r,u)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=pl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=pl(this.items,t)?.value;return(!n&&Vt(i)?i.value:i)??void 0}has(t){return!!pl(this.items,t)}set(t,n){this.add(new pr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)c$(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Sn(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})),u$(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Uu={collection:"map",default:!0,nodeClass:bi,tag:"tag:yaml.org,2002:map",resolve(e,t){return fh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>bi.from(e,t,n)};class Pl extends a${static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super($u,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Sm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Sm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Vt(i)?i.value:i}has(t){const n=Sm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Sm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Vt(i)&&i$(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push(ji(a,String(i++),n));return r}toString(t,n,r){return t?u$(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(o++);u=i.call(n,d,u)}a.items.push($f(u,void 0,r))}}return a}}function Sm(e){let t=Vt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Fu={collection:"seq",default:!0,nodeClass:Pl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return hh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Pl.from(e,t,n)},cv={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),Lk(e,t,n,r)}},uv={identify:e=>e==null,createNode:()=>new Qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qe(null),stringify:({source:e},t)=>typeof e=="string"&&uv.test.test(e)?e:t.options.nullStr},Bk={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Qe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Bk.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 Qi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let u=t-(a.length-o-1);for(;u-- >0;)a+="0"}return a}const d$={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qi},f$={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():Qi(e)}},h$={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 Qe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Qi},dv=e=>typeof e=="bigint"||Number.isInteger(e),Uk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function p$(e,t,n){const{value:r}=e;return dv(r)&&r>=0?n+r.toString(t):Qi(e)}const m$={identify:e=>dv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Uk(e,2,8,n),stringify:e=>p$(e,8,"0o")},g$={identify:dv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Uk(e,0,10,n),stringify:Qi},y$={identify:e=>dv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Uk(e,2,16,n),stringify:e=>p$(e,16,"0x")},Xoe=[Uu,Fu,cv,uv,Bk,m$,g$,y$,d$,f$,h$];function mT(e){return typeof e=="bigint"||Number.isInteger(e)}const jm=({value:e})=>JSON.stringify(e),Joe=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:jm},{identify:e=>e==null,createNode:()=>new Qe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:jm},{identify:mT,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})=>mT(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:jm}],ele={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tle=[Uu,Fu].concat(Joe,ele),Fk={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const o=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[f]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Qe.BLOCK_LITERAL),t!==Qe.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(u.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=u.substr(y,d);u=p.join(t===Qe.BLOCK_LITERAL?`
|
|
167
|
-
`:" ")}return Lk({comment:e,type:t,value:u},r,i,a)}};function v$(e,t){if(hh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Sn(r)){if(fh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new pr(new Qe(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
168
|
-
${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
|
|
169
|
-
${a.comment}`:r.comment}r=i}e.items[n]=Sn(r)?r:new pr(r)}}else t("Expected a sequence for this tag");return e}function b$(e,t,n){const{replacer:r}=n,i=new Pl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let u,d;if(Array.isArray(o))if(o.length===2)u=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)u=f[0],d=o[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=o;i.items.push($k(u,d,n))}return i}const qk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:v$,createNode:b$};class fu extends Pl{constructor(){super(),this.add=bi.prototype.add.bind(this),this.delete=bi.prototype.delete.bind(this),this.get=bi.prototype.get.bind(this),this.has=bi.prototype.has.bind(this),this.set=bi.prototype.set.bind(this),this.tag=fu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(Sn(i)?(a=ji(i.key,"",n),o=ji(i.value,a,n)):a=ji(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=b$(t,n,r),a=new this;return a.items=i.items,a}}fu.tag="tag:yaml.org,2002:omap";const Hk={collection:"seq",identify:e=>e instanceof Map,nodeClass:fu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=v$(e,t),r=[];for(const{key:i}of n.items)Vt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new fu,n)},createNode:(e,t,n)=>fu.from(e,t,n)};function x$({value:e,source:t},n){return t&&(e?w$:S$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const w$={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 Qe(!0),stringify:x$},S$={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 Qe(!1),stringify:x$},nle={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:Qi},rle={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():Qi(e)}},ile={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 Qe(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:Qi},ph=e=>typeof e=="bigint"||Number.isInteger(e);function fv(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function Kk(e,t,n){const{value:r}=e;if(ph(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Qi(e)}const ale={identify:ph,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>fv(e,2,2,n),stringify:e=>Kk(e,2,"0b")},sle={identify:ph,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>fv(e,1,8,n),stringify:e=>Kk(e,8,"0")},ole={identify:ph,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>fv(e,0,10,n),stringify:Qi},lle={identify:ph,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>fv(e,2,16,n),stringify:e=>Kk(e,16,"0x")};class hu extends bi{constructor(t){super(t),this.tag=hu.tag}add(t){let n;Sn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new pr(t.key,null):n=new pr(t,null),pl(this.items,n.key)||this.items.push(n)}get(t,n){const r=pl(this.items,t);return!n&&Sn(r)?Vt(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=pl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new pr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push($k(o,null,r));return a}}hu.tag="tag:yaml.org,2002:set";const Gk={collection:"map",identify:e=>e instanceof Set,nodeClass:hu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>hu.from(e,t,n),resolve(e,t){if(fh(e)){if(e.hasAllNullValues(!0))return Object.assign(new hu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Vk(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,u)=>o*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function j$(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Qi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const k$={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})=>Vk(e,n),stringify:j$},N$={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=>Vk(e,!1),stringify:j$},hv={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(hv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,o||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=Vk(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},gT=[Uu,Fu,cv,uv,w$,S$,ale,sle,ole,lle,nle,rle,ile,Fk,is,Hk,qk,Gk,k$,N$,hv],yT=new Map([["core",Xoe],["failsafe",[Uu,Fu,cv]],["json",tle],["yaml11",gT],["yaml-1.1",gT]]),vT={binary:Fk,bool:Bk,float:h$,floatExp:f$,floatNaN:d$,floatTime:N$,int:g$,intHex:y$,intOct:m$,intTime:k$,map:Uu,merge:is,null:uv,omap:Hk,pairs:qk,seq:Fu,set:Gk,timestamp:hv},cle={"tag:yaml.org,2002:binary":Fk,"tag:yaml.org,2002:merge":is,"tag:yaml.org,2002:omap":Hk,"tag:yaml.org,2002:pairs":qk,"tag:yaml.org,2002:set":Gk,"tag:yaml.org,2002:timestamp":hv};function rw(e,t,n){const r=yT.get(t);if(r&&!e)return n&&!r.includes(is)?r.concat(is):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(yT.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(is)),i.reduce((a,o)=>{const u=typeof o=="string"?vT[o]:o;if(!u){const d=JSON.stringify(o),f=Object.keys(vT).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(u)||a.push(u),a},[])}const ule=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Zk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?rw(t,"compat"):t?rw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?cle:{},this.tags=rw(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,fo,{value:Uu}),Object.defineProperty(this,ba,{value:cv}),Object.defineProperty(this,$u,{value:Fu}),this.sortMapEntries=typeof o=="function"?o:o===!0?ule:null}clone(){const t=Object.create(Zk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function dle(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=o$(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(es(d,""))}let o=!1,u=null;if(e.contents){if(wn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(es(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>o=!0;let f=Su(e.contents,i,()=>u=null,d);u&&(f+=hl(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Su(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
-
`)?(n.push("..."),n.push(es(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||u)&&n[n.length-1]!==""&&n.push(""),n.push(es(a(d),"")))}return n.join(`
|
|
171
|
-
`)+`
|
|
172
|
-
`}class pv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ci,{value:k1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new dr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(pv.prototype,{[Ci]:{value:k1}});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=wn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Uc(this.contents)&&this.contents.add(t)}addIn(t,n){Uc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=n$(this);t.anchor=!n||r.has(n)?r$(n||"a",r):n}return new Ik(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const j=O=>typeof O=="number"||O instanceof String||O instanceof Number,N=n.filter(j).map(String);N.length>0&&(n=n.concat(N)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=Loe(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},S=$f(t,p,w);return u&&xn(S)&&(S.flow=!0),y(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new pr(i,a)}delete(t){return Uc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return hf(t)?this.contents==null?!1:(this.contents=null,!0):Uc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return xn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return hf(t)?!n&&Vt(this.contents)?this.contents.value:this.contents:xn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return xn(this.contents)?this.contents.has(t):!1}hasIn(t){return hf(t)?this.contents!==void 0:xn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Tg(this.schema,[t],n):Uc(this.contents)&&this.contents.set(t,n)}setIn(t,n){hf(t)?this.contents=n:this.contents==null?this.contents=Tg(this.schema,Array.from(t),n):Uc(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 dr({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 dr({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 Zk(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=ji(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof o=="function"?ru(o,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return dle(this,t)}}function Uc(e){if(xn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class C$ extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class km extends C${constructor(t,n,r){super("YAMLParseError",t,n,r)}}class fle extends C${constructor(t,n,r){super("YAMLWarning",t,n,r)}}const bT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const u=Math.min(a-39,o.length-79);o="…"+o.substring(u),a-=u-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
173
|
-
`),o=u+o}if(/[^ ]/.test(o)){let u=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(u=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(u);n.message+=`:
|
|
174
|
-
|
|
175
|
-
${o}
|
|
176
|
-
${f}
|
|
177
|
-
`}};function ju(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:u}){let d=!1,f=u,p=u,m="",y="",v=!1,w=!1,S=null,j=null,N=null,O=null,_=null,C=null,T=null;for(const P of e)switch(w&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&a(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(f&&P.type!=="comment"&&P.type!=="newline"&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),P.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&P.source.includes(" ")&&(S=P),p=!0;break;case"comment":{p||a(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=P.source.substring(1)||" ";m?m+=y+I:m=I,y="",f=!1;break}case"newline":f?m?m+=P.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=P.source,f=!0,v=!0,(j||N)&&(O=P),p=!0;break;case"anchor":j&&a(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&a(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=P,T??(T=P.offset),f=!1,p=!1,w=!0;break;case"tag":{N&&a(P,"MULTIPLE_TAGS","A node can have at most one tag"),N=P,T??(T=P.offset),f=!1,p=!1,w=!0;break}case n:(j||N)&&a(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),C&&a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`),C=P,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=P,f=!1,p=!1;break}default:a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),f=!1,p=!1}const E=e[e.length-1],A=E?E.offset+E.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(f&&S.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:N,newlineAfterProp:O,end:A,start:T??A}}function Bf(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
178
|
-
`))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(Bf(t.key)||Bf(t.value))return!0}return!1;default:return!0}}function A1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Bf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function _$(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Vt(a)&&Vt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const xT="All mapping items must start at the same column";function hle({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??bi,u=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:w}=p,S=ju(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!S.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",xT)),!S.anchor&&!S.tag&&!v){f=S.end,S.comment&&(u.comment?u.comment+=`
|
|
179
|
-
`+S.comment:u.comment=S.comment);continue}(S.newlineAfterProp||Bf(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==r.indent&&i(d,"BAD_INDENT",xT);n.atKey=!0;const N=S.end,O=y?e(n,y,S,i):t(n,N,m,null,S,i);n.schema.compat&&A1(r.indent,y,i),n.atKey=!1,_$(n,u.items,O)&&i(N,"DUPLICATE_KEY","Map keys must be unique");const _=ju(v??[],{indicator:"map-value-ind",next:w,offset:O.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(w?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<_.found.offset-1024&&i(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=w?e(n,w,_,i):t(n,d,v,null,_,i);n.schema.compat&&A1(r.indent,w,i),d=C.range[2];const T=new pr(O,C);n.options.keepSourceTokens&&(T.srcToken=p),u.items.push(T)}else{j&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(O.comment?O.comment+=`
|
|
180
|
-
`+_.comment:O.comment=_.comment);const C=new pr(O);n.options.keepSourceTokens&&(C.srcToken=p),u.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function ple({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Pl,u=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=ju(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(u.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&A1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function mh(e,t,n,r){let i="";if(e){let a=!1,o="";for(const u of e){const{source:d,type:f}=u;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const iw="Block collections are not allowed within flow collections",aw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function mle({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",u=o?"flow map":"flow sequence",d=a?.nodeClass??(o?bi:Pl),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const N=r.items[j],{start:O,key:_,sep:C,value:T}=N,E=ju(O,{flow:u,indicator:"explicit-key-ind",next:_??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!T){j===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),E.comment&&(f.comment?f.comment+=`
|
|
181
|
-
`+E.comment:f.comment=E.comment),m=E.end;continue}!o&&n.options.strict&&Bf(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${u} items`),E.comment){let A="";e:for(const P of O)switch(P.type){case"comma":case"space":break;case"comment":A=P.source.substring(1);break e;default:break e}if(A){let P=f.items[f.items.length-1];Sn(P)&&(P=P.value??P.key),P.comment?P.comment+=`
|
|
182
|
-
`+A:P.comment=A,E.comment=E.comment.substring(A.length+1)}}if(!o&&!C&&!E.found){const A=T?e(n,T,E,i):t(n,E.end,C,null,E,i);f.items.push(A),m=A.range[2],aw(T)&&i(A.range,"BLOCK_IN_FLOW",iw)}else{n.atKey=!0;const A=E.end,P=_?e(n,_,E,i):t(n,A,O,null,E,i);aw(_)&&i(P.range,"BLOCK_IN_FLOW",iw),n.atKey=!1;const I=ju(C??[],{flow:u,indicator:"map-value-ind",next:T,offset:P.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(I.found){if(!o&&!E.found&&n.options.strict){if(C)for(const $ of C){if($===I.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<I.found.offset-1024&&i(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${u}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const q=T?e(n,T,I,i):I.found?t(n,I.end,C,null,I,i):null;q?aw(T)&&i(q.range,"BLOCK_IN_FLOW",iw):I.comment&&(P.comment?P.comment+=`
|
|
183
|
-
`+I.comment:P.comment=I.comment);const B=new pr(P,q);if(n.options.keepSourceTokens&&(B.srcToken=N),o){const $=f;_$(n,$.items,P)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(B)}else{const $=new bi(n.schema);$.flow=!0,$.items.push(B);const V=(q??P).range;$.range=[P.range[0],V[1],V[2]],f.items.push($)}m=q?q.range[2]:I.end}}const y=o?"}":"]",[v,...w]=r.end;let S=m;if(v?.source===y)S=v.offset+v.source.length;else{const j=u[0].toUpperCase()+u.substring(1),N=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=mh(w,S,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
184
|
-
`+j.comment:f.comment=j.comment),f.range=[r.offset,S,j.offset]}else f.range=[r.offset,S,S];return f}function sw(e,t,n,r,i,a){const o=n.type==="block-map"?hle(e,t,n,r,a):n.type==="block-seq"?ple(e,t,n,r,a):mle(e,t,n,r,a),u=o.constructor;return i==="!"||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}function gle(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&a?y.offset>a.offset?y:a:y??a;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===bi.tagName&&u==="map"||o===Pl.tagName&&u==="seq")return sw(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===u);if(!d){const y=t.schema.knownTags[o];if(y?.collection===u)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${u} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),sw(e,t,n,i,o)}const f=sw(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=wn(p)?p:new Qe(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function yle(e,t,n){const r=t.offset,i=vle(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?Qe.BLOCK_FOLDED:Qe.BLOCK_LITERAL,o=t.source?ble(t.source):[];let u=o.length;for(let S=o.length-1;S>=0;--S){const j=o[S][1];if(j===""||j==="\r")u=S;else break}if(u===0){const S=i.chomp==="+"&&o.length>0?`
|
|
185
|
-
`.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:S,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let S=0;S<u;++S){const[j,N]=o[S];if(N===""||N==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=S,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+N.length+1}for(let S=o.length-1;S>=u;--S)o[S][0].length>d&&(u=S+1);let m="",y="",v=!1;for(let S=0;S<p;++S)m+=o[S][0].slice(d)+`
|
|
186
|
-
`;for(let S=p;S<u;++S){let[j,N]=o[S];f+=j.length+N.length+1;const O=N[N.length-1]==="\r";if(O&&(N=N.slice(0,-1)),N&&j.length<d){const C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-N.length-(O?2:1),"BAD_INDENT",C),j=""}a===Qe.BLOCK_LITERAL?(m+=y+j.slice(d)+N,y=`
|
|
187
|
-
`):j.length>d||N[0]===" "?(y===" "?y=`
|
|
188
|
-
`:!v&&y===`
|
|
189
|
-
`&&(y=`
|
|
190
|
-
|
|
191
|
-
`),m+=y+j.slice(d)+N,y=`
|
|
192
|
-
`,v=!0):N===""?y===`
|
|
193
|
-
`?m+=`
|
|
194
|
-
`:y=`
|
|
195
|
-
`:(m+=y+N,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let S=u;S<o.length;++S)m+=`
|
|
196
|
-
`+o[S][0].slice(d);m[m.length-1]!==`
|
|
197
|
-
`&&(m+=`
|
|
198
|
-
`);break;default:m+=`
|
|
199
|
-
`}const w=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,w,w]}}function vle({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,u="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!u&&(v==="-"||v==="+"))u=v;else{const w=Number(v);!o&&w?o=w:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const S=v.source;S&&typeof S=="string"&&(m+=S.length)}}}return{mode:a,indent:o,chomp:u,comment:p,length:m}}function ble(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function xle(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let u,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":u=Qe.PLAIN,d=wle(a,f);break;case"single-quoted-scalar":u=Qe.QUOTE_SINGLE,d=Sle(a,f);break;case"double-quoted-scalar":u=Qe.QUOTE_DOUBLE,d=jle(a,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const p=r+a.length,m=mh(o,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function wle(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}`),A$(e)}function Sle(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),A$(e.slice(1,-1)).replace(/''/g,"'")}function A$(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
200
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
201
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
-
`?i+=a:a=`
|
|
203
|
-
`:(i+=a+r[1],a=" "),o=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=o,r=u.exec(e),i+a+(r?.[1]??"")}function jle(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
204
|
-
`))if(i===`
|
|
205
|
-
`){const{fold:a,offset:o}=kle(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=Nle[a];if(o)n+=o;else if(a===`
|
|
206
|
-
`)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
|
|
207
|
-
`)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=Cle(e,r+1,u,t),r+=u}else{const u=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(i===" "||i===" "){const a=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
208
|
-
`&&!(o==="\r"&&e[r+2]===`
|
|
209
|
-
`)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function kle(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
210
|
-
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
211
|
-
`);)r===`
|
|
212
|
-
`&&(n+=`
|
|
213
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Nle={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Cle(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(o)}function O$(e,t,n,r){const{value:i,type:a,comment:o,range:u}=t.type==="block-scalar"?yle(e,t,r):xle(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[ba]:d?f=_le(e.schema,i,d,n,r):t.type==="scalar"?f=Ale(e,i,t,r):f=e.schema[ba];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Vt(m)?m:new Qe(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new Qe(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function _le(e,t,n,r,i){if(n==="!")return e[ba];const a=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)a.push(u);else return u;for(const u of a)if(u.test?.test(t))return u;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ba])}function Ale({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[ba];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[ba];if(o.tag!==u.tag){const d=t.tagString(o.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Ole(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 Ele={composeNode:E$,composeEmptyNode:Yk};function E$(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=zle(e,t,r),(u||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=O$(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=gle(Ele,e,t,n,r),u&&(f.anchor=u.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=Yk(e,t.offset,void 0,null,n,r),p=!1}}return u&&f.anchor===""&&r(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Vt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Yk(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:u,end:d},f){const p={type:"scalar",offset:Ole(t,n,r),indent:-1,source:""},m=O$(e,p,u,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function zle({options:e},{offset:t,source:n,end:r},i){const a=new Ik(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,u=mh(r,o,e.strict,i);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function Tle(e,t,{offset:n,start:r,value:i,end:a},o){const u=Object.assign({_directives:t},e),d=new pv(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=ju(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?E$(f,i,p,o):Yk(f,p.end,r,null,p,o);const m=d.contents.range[2],y=mh(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function ef(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 wT(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
215
|
-
|
|
216
|
-
`:`
|
|
217
|
-
`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class Ple{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=ef(n);a?this.warnings.push(new fle(o,r,i)):this.errors.push(new km(o,r,i))},this.directives=new dr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=wT(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
218
|
-
${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(xn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Sn(o)&&(o=o.key);const u=o.commentBefore;o.commentBefore=u?`${r}
|
|
219
|
-
${u}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
|
|
220
|
-
${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:wT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const a=ef(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Tle(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 km(ef(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 km(ef(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=mh(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}
|
|
221
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new km(ef(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 pv(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 z$="\uFEFF",T$="",P$="",O1="";function Rle(e){switch(e){case z$:return"byte-order-mark";case T$:return"doc-mode";case P$:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
222
|
-
`:case`\r
|
|
223
|
-
`: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 Bi(e){switch(e){case void 0:case" ":case`
|
|
224
|
-
`:case"\r":case" ":return!0;default:return!1}}const ST=new Set("0123456789ABCDEFabcdef"),Dle=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Nm=new Set(",[]{}"),Mle=new Set(` ,[]{}
|
|
225
|
-
\r `),ow=e=>!e||Mle.has(e);class Ile{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===`
|
|
226
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
227
|
-
`:!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===`
|
|
228
|
-
`||!i&&!this.atEnd)return t+r+1}return n===`
|
|
229
|
-
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Bi(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(`
|
|
230
|
-
`,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]===z$&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const a=t[r-1];if(a===" "||a===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield T$,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==="...")&&Bi(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&&!Bi(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===":")&&Bi(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(ow),"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("..."))&&Bi(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield P$,yield*this.parseLineStart();let a=0;for(;i[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ow),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Bi(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
231
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
|
|
232
|
-
`,a)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Bi(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
|
|
233
|
-
`:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
234
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
235
|
-
`,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
236
|
-
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const u=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
237
|
-
`&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield O1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const a=this.buffer[r+1];if(Bi(a)||t&&Nm.has(a))break;n=r}else if(Bi(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
|
|
238
|
-
`?(r+=1,i=`
|
|
239
|
-
`,a=this.buffer[r+1]):n=r),a==="#"||t&&Nm.has(a))break;if(i===`
|
|
240
|
-
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Nm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield O1,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(ow))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Bi(n)||t&&Nm.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(;!Bi(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(Dle.has(n))n=this.buffer[++t];else if(n==="%"&&ST.has(this.buffer[t+1])&&ST.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===`
|
|
241
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
242
|
-
`?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 Lle{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const a=n+r>>1;this.lineStarts[a]<t?n=a+1:r=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function Ws(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function jT(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 R$(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 Cm(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 Fc(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 kT(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ws(t.start,"explicit-key-ind")&&!Ws(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,R$(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 $le{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 Ile,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=Rle(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"&&kT(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&&jT(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{jT(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=Cm(this.peek(2)),r=Fc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
243
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
244
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":o.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ws(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(R$(n.key)&&!Ws(n.sep,"newline")){const o=Fc(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ws(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Fc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ws(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ws(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ws(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=Cm(r),a=Fc(i);kT(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
245
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
246
|
-
`,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=Cm(t),r=Fc(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=Cm(t),r=Fc(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 Ble(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Lle||null,prettyErrors:t}}function Ule(e,t={}){const{lineCounter:n,prettyErrors:r}=Ble(t),i=new $le(n?.addNewLine),a=new Ple(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of o)u.errors.forEach(bT(e,n)),u.warnings.forEach(bT(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Fle({onApplied:e}){const[t,n]=b.useState(""),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=Ule(t),m=[],y=[];for(let v=0;v<p.length;v++){const w=p[v];if(w.errors.length>0){m.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const j=await g7(S);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(ht({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return c.jsxs("section",{className:"mt-8",children:[c.jsx("div",{className:"page-section-divider"}),c.jsx("div",{className:"section-head mt-6",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),c.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",c.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",c.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),c.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
247
|
-
kind: Project
|
|
248
|
-
metadata:
|
|
249
|
-
name: my-project
|
|
250
|
-
spec:
|
|
251
|
-
canonicalDomain: example.com
|
|
252
|
-
country: US
|
|
253
|
-
language: en
|
|
254
|
-
keywords: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>c.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>c.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),c.jsx("div",{className:"mt-3",children:c.jsx(be,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function qle(){const{dashboard:e,isLoading:t,refetch:n}=Zl();if(!e||t)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-28"}),c.jsx("div",{className:"skeleton-text-sm w-40"})]}),c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[c.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(A=>c.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>c.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[c.jsxs("div",{className:"flex-1 space-y-1",children:[c.jsx("div",{className:"skeleton-text w-28"}),c.jsx("div",{className:"skeleton-text-sm w-16"})]}),c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),c.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),c.jsx("div",{className:"skeleton-text-sm w-8"})]},A))]})]});const r=e.projects,i=So(),[a,o]=b.useState(!1),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,w]=b.useState("US"),[S,j]=b.useState("en"),[N,O]=b.useState(!1),[_,C]=b.useState(null),T=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),E=async()=>{if(!(!T||!m)){O(!0),C(null);try{const A=await Uy(T,{displayName:f||u,canonicalDomain:m,country:v,language:S});ht({title:"Project created",detail:`${A.displayName||A.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${A.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){C(A instanceof Error?A.message:"Failed to create project")}finally{O(!1)}}};return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Projects"}),c.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),c.jsx("div",{className:"page-header-right",children:c.jsxs(be,{type:"button",onClick:()=>o(A=>!A),children:[c.jsx(S2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?c.jsxs(Be,{className:"surface-card mb-6",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),c.jsxs("div",{className:"compact-stack mt-4",children:[c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),c.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:A=>d(A.target.value)}),T&&T!==u?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),c.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:A=>p(A.target.value)})]})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),c.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:A=>y(A.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),c.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:A=>w(A.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),c.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:A=>j(A.target.value.toLowerCase())})]})]})]}),_?c.jsx("p",{className:"text-rose-400 text-sm mt-3",children:_}):null,c.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[c.jsx(be,{type:"button",disabled:!T||!m||N,onClick:E,children:N?"Creating...":"Create project"}),c.jsx(be,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?c.jsx("div",{className:"data-table-wrapper",children:c.jsxs("table",{className:"data-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Name"}),c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Visibility"}),c.jsx("th",{children:"Last run"}),c.jsx("th",{className:"text-right",children:"Country"})]})}),c.jsx("tbody",{children:r.map(A=>{const P=A.recentRuns[0];return c.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[c.jsxs("td",{children:[c.jsx(qt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:I=>I.stopPropagation(),children:A.project.displayName||A.project.name}),c.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),c.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),c.jsx("td",{children:c.jsx(vt,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),c.jsx("td",{className:"text-zinc-500 text-sm",children:P?c.jsx(Yy,{status:P.status}):c.jsx("span",{className:"text-zinc-600",children:"No runs"})}),c.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):a?null:c.jsxs(Be,{className:"surface-card empty-card",children:[c.jsx("h3",{children:"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),c.jsxs(be,{type:"button",onClick:()=>o(!0),children:[c.jsx(S2,{className:"size-4 mr-1.5"}),"Add project"]})]}),c.jsx(Fle,{onApplied:()=>{n()}})]})}function E1({state:e}){return c.jsx(vt,{tone:GX(e),children:Gy(e)})}function D$({run:e}){const{openRun:t}=Mu();return c.jsxs("article",{className:"run-row",children:[c.jsxs("div",{className:"run-row-main",children:[c.jsxs("div",{className:"run-row-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:e.summary}),c.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),c.jsx(Yy,{status:e.status})]}),c.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),c.jsxs("dl",{className:"run-row-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Started"}),c.jsx("dd",{children:e.startedAt})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Duration"}),c.jsx("dd",{children:e.duration})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Trigger"}),c.jsx("dd",{children:e.triggerLabel})]})]}),c.jsx(be,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function M$({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),1):o&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=m*(1-v);return c.jsxs("div",{className:"score-gauge",children:[c.jsxs("div",{className:"gauge-ring-wrapper",children:[c.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[c.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),c.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:w,transform:"rotate(-90 60 60)"})]}),c.jsx("div",{className:"gauge-center",children:c.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),c.jsxs("p",{className:"gauge-label",children:[t,a&&c.jsx(Wn,{text:a})]}),c.jsx("p",{className:"gauge-delta",children:n}),d&&c.jsx("p",{className:"gauge-provider-coverage",children:d}),c.jsx("p",{className:"gauge-description",children:i})]})}function NT({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return c.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),a=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),c.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,u)=>c.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},u))}),c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Hle(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const a=t.get(i.createdAt);a?a.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:a}])=>({runId:a,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function Kle({evidence:e}){const{openEvidence:t}=Mu(),[n,r]=b.useState(new Set),i=b.useMemo(()=>{const o=new Map;for(const u of e){const d=o.get(u.keyword)??[];o.set(u.keyword,[...d,u])}return[...o.entries()].map(([u,d])=>({phrase:u,items:d}))},[e]),a=o=>{r(u=>{const d=new Set(u);return d.has(o)?d.delete(o):d.add(o),d})};return c.jsx("div",{className:"evidence-table-wrap",children:c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{style:{width:"2rem"}}),c.jsx("th",{children:"Key Phrase"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Citation History"}),c.jsx("th",{children:"Change"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:i.map(({phrase:o,items:u})=>{const d=n.has(o),f=u.map(w=>w.citationState),p=f.includes("cited")?"cited":f.includes("emerging")?"emerging":f.includes("lost")?"lost":f.every(w=>w==="pending")?"pending":"not-cited",m=Hle(u),y=u.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,v=(()=>{if(m.length===0)return"Awaiting first run";if(m.length===1)return"First observation";const w=m[m.length-1].citationState,S=m[m.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let j=0;for(let N=m.length-1;N>=0&&m[N].citationState===w;N--)j++;return w==="cited"?j<=1?"Cited in latest run":`Cited for ${j} runs`:j<=1?"Not cited in latest run":`Not cited across ${j} runs`})();return c.jsxs(b.Fragment,{children:[c.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>a(o),"aria-expanded":d,children:[c.jsx("td",{children:c.jsx(oh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${d?"rotate-90":""}`})}),c.jsx("td",{className:"evidence-keyword-cell",children:c.jsxs("div",{children:[c.jsx("span",{className:"font-medium text-zinc-100",children:o}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:u.map(w=>c.jsx(Df,{provider:w.provider},w.id))})]})}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(E1,{state:p}),c.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",u.length]})]})}),c.jsx("td",{children:c.jsx(NT,{history:m})}),c.jsx("td",{className:"evidence-change-cell",children:v}),c.jsx("td",{})]}),d&&u.map(w=>c.jsxs("tr",{className:"bg-zinc-900/30",children:[c.jsx("td",{}),c.jsx("td",{className:"evidence-keyword-cell pl-5",children:c.jsx(Df,{provider:w.provider})}),c.jsx("td",{children:c.jsx(E1,{state:w.citationState})}),c.jsx("td",{children:c.jsx(NT,{history:w.runHistory})}),c.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),c.jsx("td",{children:c.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},o)})})]})})}function Gle({competitors:e}){return e.length===0?c.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):c.jsx("div",{className:"competitor-table-wrap",children:c.jsxs("table",{className:"competitor-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Pressure"}),c.jsx("th",{children:"Citations"}),c.jsx("th",{children:"Key Phrases"})]})}),c.jsx("tbody",{children:e.map(t=>c.jsxs("tr",{children:[c.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),c.jsx("td",{children:c.jsx(vt,{tone:VX(t.pressureLabel),children:t.pressureLabel})}),c.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),c.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}function CT({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:u,updatedAt:d,active:f,onClick:p}){return c.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${f?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),c.jsx("h3",{children:t})]}),c.jsx(vt,{tone:r,children:n})]}),c.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),c.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),c.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:[c.jsx("span",{children:u}),c.jsx("span",{children:d?`Updated ${Fi(d)}`:"No recent sync yet"})]})]})}function _m({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),c.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Vle=["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 Wk(e){if(typeof e!="string")return!1;var t=Vle;return t.includes(e)}var Zle=["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"],Yle=new Set(Zle);function I$(e){return typeof e!="string"?!1:Yle.has(e)}function L$(e){return typeof e=="string"&&e.startsWith("data-")}function Vi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(I$(n)||L$(n))&&(t[n]=e[n]);return t}function mv(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Vi(t)}return typeof e=="object"&&!Array.isArray(e)?Vi(e):null}function Pr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(I$(n)||L$(n)||Wk(n))&&(t[n]=e[n]);return t}function Wle(e){return e==null?null:b.isValidElement(e)?Pr(e.props):typeof e=="object"&&!Array.isArray(e)?Pr(e):null}var Qle=["children","width","height","viewBox","className","style","title","desc"];function z1(){return z1=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},z1.apply(null,arguments)}function Xle(e,t){if(e==null)return{};var n,r,i=Jle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jle(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 Qk=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:u,title:d,desc:f}=e,p=Xle(e,Qle),m=a||{width:r,height:i,x:0,y:0},y=Et("recharts-surface",o);return b.createElement("svg",z1({},Pr(p),{className:y,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),b.createElement("title",null,d),b.createElement("desc",null,f),n)}),ece=["children","className"];function T1(){return T1=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},T1.apply(null,arguments)}function tce(e,t){if(e==null)return{};var n,r,i=nce(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nce(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 Zi=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=tce(e,ece),a=Et("recharts-layer",r);return b.createElement("g",T1({className:a},Pr(i),{ref:t}),n)}),$$=b.createContext(null),rce=()=>b.useContext($$);function Ht(e){return function(){return e}}const B$=Math.cos,Rg=Math.sin,Xi=Math.sqrt,Dg=Math.PI,gv=2*Dg,P1=Math.PI,R1=2*P1,sl=1e-6,ice=R1-sl;function U$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ace(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return U$;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class sce{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?U$:ace(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,u=this._y1,d=r-t,f=i-n,p=o-t,m=u-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>sl)if(!(Math.abs(m*d-f*p)>sl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,w=i-u,S=d*d+f*f,j=v*v+w*w,N=Math.sqrt(S),O=Math.sqrt(y),_=a*Math.tan((P1-Math.acos((S+y-j)/(2*N*O)))/2),C=_/O,T=_/N;Math.abs(C-1)>sl&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+T*d},${this._y1=n+T*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>sl||Math.abs(this._y1-p)>sl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%R1+R1),y>ice?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>sl&&this._append`A${r},${r},0,${+(y>=P1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Xk(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 sce(t)}function Jk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function F$(e){this._context=e}F$.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 yv(e){return new F$(e)}function q$(e){return e[0]}function H$(e){return e[1]}function K$(e,t){var n=Ht(!0),r=null,i=yv,a=null,o=Xk(u);e=typeof e=="function"?e:e===void 0?q$:Ht(e),t=typeof t=="function"?t:t===void 0?H$:Ht(t);function u(d){var f,p=(d=Jk(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Ht(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Ht(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Ht(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function Am(e,t,n){var r=null,i=Ht(!0),a=null,o=yv,u=null,d=Xk(f);e=typeof e=="function"?e:e===void 0?q$:Ht(+e),t=typeof t=="function"?t:Ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?H$:Ht(+n);function f(m){var y,v,w,S=(m=Jk(m)).length,j,N=!1,O,_=new Array(S),C=new Array(S);for(a==null&&(u=o(O=d())),y=0;y<=S;++y){if(!(y<S&&i(j=m[y],y,m))===N)if(N=!N)v=y,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=y-1;w>=v;--w)u.point(_[w],C[w]);u.lineEnd(),u.areaEnd()}N&&(_[y]=+e(j,y,m),C[y]=+t(j,y,m),u.point(r?+r(j,y,m):_[y],n?+n(j,y,m):C[y]))}if(O)return u=null,O+""||null}function p(){return K$().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Ht(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Ht(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Ht(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(u=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=u=null:u=o(a=m),f):a},f}class G${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 oce(e){return new G$(e,!0)}function lce(e){return new G$(e,!1)}const eN={draw(e,t){const n=Xi(t/Dg);e.moveTo(n,0),e.arc(0,0,n,0,gv)}},cce={draw(e,t){const n=Xi(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()}},V$=Xi(1/3),uce=V$*2,dce={draw(e,t){const n=Xi(t/uce),r=n*V$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},fce={draw(e,t){const n=Xi(t),r=-n/2;e.rect(r,r,n,n)}},hce=.8908130915292852,Z$=Rg(Dg/10)/Rg(7*Dg/10),pce=Rg(gv/10)*Z$,mce=-B$(gv/10)*Z$,gce={draw(e,t){const n=Xi(t*hce),r=pce*n,i=mce*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=gv*a/5,u=B$(o),d=Rg(o);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},lw=Xi(3),yce={draw(e,t){const n=-Xi(t/(lw*3));e.moveTo(0,n*2),e.lineTo(-lw*n,-n),e.lineTo(lw*n,-n),e.closePath()}},fi=-.5,hi=Xi(3)/2,D1=1/Xi(12),vce=(D1/2+1)*3,bce={draw(e,t){const n=Xi(t/vce),r=n/2,i=n*D1,a=r,o=n*D1+n,u=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(u,d),e.lineTo(fi*r-hi*i,hi*r+fi*i),e.lineTo(fi*a-hi*o,hi*a+fi*o),e.lineTo(fi*u-hi*d,hi*u+fi*d),e.lineTo(fi*r+hi*i,fi*i-hi*r),e.lineTo(fi*a+hi*o,fi*o-hi*a),e.lineTo(fi*u+hi*d,fi*d-hi*u),e.closePath()}};function xce(e,t){let n=null,r=Xk(i);e=typeof e=="function"?e:Ht(e||eN),t=typeof t=="function"?t:Ht(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ht(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ht(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Mg(){}function Ig(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 Y$(e){this._context=e}Y$.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:Ig(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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wce(e){return new Y$(e)}function W$(e){this._context=e}W$.prototype={areaStart:Mg,areaEnd:Mg,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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Sce(e){return new W$(e)}function Q$(e){this._context=e}Q$.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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jce(e){return new Q$(e)}function X$(e){this._context=e}X$.prototype={areaStart:Mg,areaEnd:Mg,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 kce(e){return new X$(e)}function _T(e){return e<0?-1:1}function AT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(_T(a)+_T(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function OT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function cw(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,o-u*n,a,o)}function Lg(e){this._context=e}Lg.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:cw(this,this._t0,OT(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,cw(this,OT(this,n=AT(this,e,t)),n);break;default:cw(this,this._t0,n=AT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function J$(e){this._context=new e3(e)}(J$.prototype=Object.create(Lg.prototype)).point=function(e,t){Lg.prototype.point.call(this,t,e)};function e3(e){this._context=e}e3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Nce(e){return new Lg(e)}function Cce(e){return new J$(e)}function t3(e){this._context=e}t3.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=ET(e),i=ET(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ET(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function _ce(e){return new t3(e)}function vv(e,t){this._context=e,this._t=t}vv.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 Ace(e){return new vv(e,.5)}function Oce(e){return new vv(e,0)}function Ece(e){return new vv(e,1)}function Rl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,u=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function M1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function zce(e,t){return e[t]}function Tce(e){const t=[];return t.key=e,t}function Pce(){var e=Ht([]),t=M1,n=Rl,r=zce;function i(a){var o=Array.from(e.apply(this,arguments),Tce),u,d=o.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(o[u][f]=[0,+r(m,o[u].key,f,a)]).data=m;for(u=0,p=Jk(t(o));u<d;++u)o[p[u]].index=u;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Ht(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Ht(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?M1:typeof a=="function"?a:Ht(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Rl,i):n},i}function Rce(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Rl(e,t)}}function Dce(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,u=0;o<i;++o)u+=e[o][n][1]||0;r[n][1]+=r[n][0]=-u/2}Rl(e,t)}}function Mce(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var u=0,d=0,f=0;u<o;++u){for(var p=e[t[u]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,N=S[r-1][1]||0;v+=j-N}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,Rl(e,t)}}var uw={},dw={},zT;function Ice(){return zT||(zT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(dw)),dw}var fw={},TT;function n3(){return TT||(TT=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})(fw)),fw}var hw={},PT;function tN(){return PT||(PT=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})(hw)),hw}var pw={},mw={},RT;function Lce(){return RT||(RT=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})(mw)),mw}var DT;function nN(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lce(),n=tN();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<o;){const m=i[u];f?m==="\\"&&u+1<o?(u++,d+=i[u]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(pw)),pw}var MT;function rN(){return MT||(MT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ice(),n=n3(),r=tN(),i=nN();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?n.isDeepKey(d)?a(u,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=u[d];return p===void 0?f:p}default:{if(Array.isArray(d))return o(u,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?f:p}}}function o(u,d,f){if(d.length===0)return f;let p=u;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(uw)),uw}var gw,IT;function $ce(){return IT||(IT=1,gw=rN().get),gw}var Bce=$ce();const bv=ka(Bce);var Uce=4;function io(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uce,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var u=n[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+io(u)+a:i+a},"")}var xi=e=>e===0?0:e>0?1:-1,xa=e=>typeof e=="number"&&e!=+e,Dl=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Le=e=>(typeof e=="number"||e instanceof Number)&&!xa(e),_i=e=>Le(e)||typeof e=="string",Fce=0,Uf=e=>{var t=++Fce;return"".concat(e||"").concat(t)},bo=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(!Le(t)&&typeof t!="string")return r;var a;if(Dl(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return xa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},r3=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 ua(e,t,n){return Le(e)&&Le(t)?io(e+n*(t-e)):t}function i3(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):bv(r,t))===n)}var Xn=e=>e===null||typeof e>"u",gh=e=>Xn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Or(e){return e!=null}function qu(){}var qce=["type","size","sizeType"];function I1(){return I1=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},I1.apply(null,arguments)}function LT(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 $T(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LT(Object(n),!0).forEach(function(r){Hce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hce(e,t,n){return(t=Kce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kce(e){var t=Gce(e,"string");return typeof t=="symbol"?t:t+""}function Gce(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 Vce(e,t){if(e==null)return{};var n,r,i=Zce(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zce(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 a3={symbolCircle:eN,symbolCross:cce,symbolDiamond:dce,symbolSquare:fce,symbolStar:gce,symbolTriangle:yce,symbolWye:bce},Yce=Math.PI/180,Wce=e=>{var t="symbol".concat(gh(e));return a3[t]||eN},Qce=(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*Yce;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}},Xce=(e,t)=>{a3["symbol".concat(gh(e))]=t},s3=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Vce(e,qce),a=$T($T({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var u=()=>{var y=Wce(o),v=xce().type(y).size(Qce(n,r,o)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Pr(a);return Le(f)&&Le(p)&&Le(n)?b.createElement("path",I1({},m,{className:Et("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};s3.registerSymbol=Xce;var o3=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,iN=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Wk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Jce=(e,t,n)=>r=>(e(t,n,r),null),l3=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Wk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Jce(a,t,n))}),r};function BT(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 eue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BT(Object(n),!0).forEach(function(r){tue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tue(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=rue(e,"string");return typeof t=="symbol"?t:t+""}function rue(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 gr(e,t){var n=eue({},e),r=t,i=Object.keys(t),a=i.reduce((o,u)=>(o[u]===void 0&&r[u]!==void 0&&(o[u]=r[u]),o),n);return a}function $g(){return $g=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},$g.apply(null,arguments)}function UT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function c3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UT(Object(n),!0).forEach(function(r){iue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iue(e,t,n){return(t=aue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aue(e){var t=sue(e,"string");return typeof t=="symbol"?t:t+""}function sue(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 gi=32,oue={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function lue(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function cue(e){var{data:t,iconType:n,inactiveColor:r}=e,i=gi/2,a=gi/6,o=gi/3,u=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return b.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:lue(t.payload),x1:0,y1:i,x2:gi,y2:i,className:"recharts-legend-icon"});if(d==="line")return b.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(o,`
|
|
255
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
256
|
-
H`).concat(gi,"M").concat(2*o,",").concat(i,`
|
|
257
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return b.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(gi/8,"h").concat(gi,"v").concat(gi*3/4,"h").concat(-gi,"z"),className:"recharts-legend-icon"});if(b.isValidElement(t.legendIcon)){var f=c3({},t);return delete f.legendIcon,b.cloneElement(t.legendIcon,f)}return b.createElement(s3,{fill:u,cx:i,cy:i,size:gi,sizeType:"diameter",type:d})}function uue(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:u}=e,d={x:0,y:0,width:gi,height:gi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,w=Et({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var S=typeof u=="object"?c3({},u):{};S.color=m.inactive?a:S.color||m.color;var j=v?v(m.value,m,y):m.value;return b.createElement("li",$g({className:w,style:f,key:"legend-item-".concat(y)},l3(e,m,y)),b.createElement(Qk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},b.createElement(cue,{data:m,iconType:o,inactiveColor:a})),b.createElement("span",{className:"recharts-legend-item-text",style:S},j))})}var due=e=>{var t=gr(e,oue),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return b.createElement("ul",{className:"recharts-default-legend",style:a},b.createElement(uue,$g({},t,{payload:n})))},yw={},vw={},FT;function fue(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],u=r(o,a,n);i.has(u)||i.set(u,o)}return Array.from(i.values())}e.uniqBy=t})(vw)),vw}var bw={},qT;function hue(){return qT||(qT=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})(bw)),bw}var xw={},HT;function u3(){return HT||(HT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(xw)),xw}var ww={},Sw={},jw={},KT;function pue(){return KT||(KT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(jw)),jw}var GT;function d3(){return GT||(GT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pue();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Sw)),Sw}var kw={},VT;function mue(){return VT||(VT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(kw)),kw}var ZT;function gue(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d3(),n=mue();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(ww)),ww}var Nw={},Cw={},YT;function yue(){return YT||(YT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rN();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Cw)),Cw}var _w={},Aw={},Ow={},Ew={},WT;function f3(){return WT||(WT=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})(Ew)),Ew}var zw={},QT;function h3(){return QT||(QT=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})(zw)),zw}var Tw={},XT;function p3(){return XT||(XT=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})(Tw)),Tw}var JT;function vue(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=f3(),n=h3(),r=p3();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,S,j,N,O,_){const C=y(w,S,j,N,O,_);return C!==void 0?!!C:a(w,S,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return u(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const w=Object.keys(m);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let S=0;S<w.length;S++){const j=w[S];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,S]of m.entries()){const j=p.get(w);if(y(j,S,w,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let S=0;S<m.length;S++){const j=m[S];let N=!1;for(let O=0;O<p.length;O++){if(w.has(O))continue;const _=p[O];let C=!1;if(y(_,j,S,p,m,v)&&(C=!0),C){w.add(O),N=!0;break}}if(!N)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Ow)),Ow}var eP;function m3(){return eP||(eP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vue();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Aw)),Aw}var Pw={},Rw={},Dw={},tP;function bue(){return tP||(tP=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})(Dw)),Dw}var Mw={},nP;function aN(){return nP||(nP=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})(Mw)),Mw}var Iw={},rP;function g3(){return rP||(rP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",O="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",T="[object Int8Array]",E="[object Int16Array]",A="[object Int32Array]",P="[object BigInt64Array]",I="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=I,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=E,e.int32ArrayTag=A,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=O,e.uint32ArrayTag=_,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=N})(Iw)),Iw}var Lw={},iP;function xue(){return iP||(iP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Lw)),Lw}var aP;function y3(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bue(),n=aN(),r=g3(),i=h3(),a=xue();function o(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,y,v=new Map,w=void 0){const S=w?.(p,m,y,v);if(S!==void 0)return S;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let N=0;N<p.length;N++)j[N]=u(p[N],N,y,v,w);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[N,O]of p)j.set(N,u(O,N,y,v,w));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const N of p)j.add(u(N,void 0,y,v,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let N=0;N<p.length;N++)j[N]=u(p[N],N,y,v,w);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,w),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,w),j}return p}function d(p,m,y=p,v,w){const S=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<S.length;j++){const N=S[j],O=Object.getOwnPropertyDescriptor(p,N);(O==null||O.writable)&&(p[N]=u(m[N],N,y,v,w))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=u,e.copyProperties=d})(Rw)),Rw}var sP;function wue(){return sP||(sP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=y3();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Pw)),Pw}var oP;function Sue(){return oP||(oP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=m3(),n=wue();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(_w)),_w}var $w={},Bw={},Uw={},lP;function jue(){return lP||(lP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=y3(),n=aN(),r=g3();function i(a,o){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=o?.(u,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Uw)),Uw}var cP;function kue(){return cP||(cP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jue();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Bw)),Bw}var Fw={},qw={},uP;function v3(){return uP||(uP=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})(qw)),qw}var Hw={},dP;function Nue(){return dP||(dP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aN();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Hw)),Hw}var fP;function Cue(){return fP||(fP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=n3(),n=v3(),r=Nue(),i=nN();function a(o,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&o?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(Fw)),Fw}var hP;function _ue(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=m3(),n=tN(),r=kue(),i=rN(),a=Cue();function o(u,d){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,u);return p===void 0?a.has(f,u):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=o})($w)),$w}var pP;function Aue(){return pP||(pP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u3(),n=yue(),r=Sue(),i=_ue();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(Nw)),Nw}var mP;function Oue(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fue(),n=hue(),r=u3(),i=gue(),a=Aue();function o(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(yw)),yw}var Kw,gP;function Eue(){return gP||(gP=1,Kw=Oue().uniqBy),Kw}var zue=Eue();const yP=ka(zue);function b3(e,t,n){return t===!0?yP(e,n):typeof t=="function"?yP(e,t):e}var sN=b.createContext(null),Tue=e=>e,fn=()=>{var e=b.useContext(sN);return e?e.store.dispatch:Tue},ig=()=>{},Pue=()=>ig,Rue=(e,t)=>e===t;function Ue(e){var t=b.useContext(sN),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:ig,[t,e]);return MI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Pue,t?t.store.getState:ig,t?t.store.getState:ig,n,Rue)}function Due(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Mue(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Iue(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 vP=e=>Array.isArray(e)?e:[e];function Lue(e){const t=Array.isArray(e[0])?e[0]:e;return Iue(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $ue(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Bue=class{constructor(e){this.value=e}deref(){return this.value}},Uue=typeof WeakRef<"u"?WeakRef:Bue,Fue=0,bP=1;function Om(){return{s:Fue,v:void 0,o:null,p:null}}function x3(e,t={}){let n=Om();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let u=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=u.o;w===null&&(u.o=w=new WeakMap);const S=w.get(v);S===void 0?(u=Om(),w.set(v,u)):u=S}else{let w=u.p;w===null&&(u.p=w=new Map);const S=w.get(v);S===void 0?(u=Om(),w.set(v,u)):u=S}}const f=u;let p;if(u.s===bP)p=u.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Uue(p):p}return f.s=bP,f.v=p,p}return o.clearCache=()=>{n=Om(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function que(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Due(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=x3,argsMemoizeOptions:w=[]}=p,S=vP(y),j=vP(w),N=Lue(i),O=m(function(){return a++,f.apply(null,arguments)},...S),_=v(function(){o++;const T=$ue(N,arguments);return u=O.apply(null,T),u},...j);return Object.assign(_,{resultFunc:f,memoizedResultFunc:O,dependencies:N,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var ce=que(x3),Hue=Object.assign((e,t=ce)=>{Mue(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,u,d)=>(o[n[d]]=u,o),{}))},{withTypes:()=>Hue}),Gw={},Vw={},Zw={},xP;function Kue(){return xP||(xP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),u=t(i);if(o===u&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-o:o-u}return 0};e.compareValues=n})(Zw)),Zw}var Yw={},Ww={},wP;function w3(){return wP||(wP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Ww)),Ww}var SP;function Gue(){return SP||(SP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w3(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(Yw)),Yw}var jP;function Vue(){return jP||(jP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kue(),n=Gue(),r=nN();function i(a,o,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,w)=>{let S=v;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},p=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:f(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?f(w,v):typeof w=="object"?w[v]:w,m=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(w=>p(w,v))})).slice().sort((v,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(v.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(Vw)),Vw}var Qw={},kP;function Zue(){return kP||(kP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(Qw)),Qw}var Xw={},NP;function S3(){return NP||(NP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=v3(),n=d3(),r=f3(),i=p3();function a(o,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],o):!1}e.isIterateeCall=a})(Xw)),Xw}var CP;function Yue(){return CP||(CP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vue(),n=Zue(),r=S3();function i(a,...o){const u=o.length;return u>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:u>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(Gw)),Gw}var Jw,_P;function Wue(){return _P||(_P=1,Jw=Yue().sortBy),Jw}var Que=Wue();const xv=ka(Que);var j3=e=>e.legend.settings,Xue=e=>e.legend.size,Jue=e=>e.legend.payload,ede=ce([Jue,j3],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?xv(r,n):r});function tde(){return Ue(ede)}var Em=1;function k3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=b.useState({height:0,left:0,top:0,width:0}),r=b.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>Em||Math.abs(o.left-t.left)>Em||Math.abs(o.top-t.top)>Em||Math.abs(o.width-t.width)>Em)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Vn(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 nde=typeof Symbol=="function"&&Symbol.observable||"@@observable",AP=nde,eS=()=>Math.random().toString(36).substring(7).split("").join("."),rde={INIT:`@@redux/INIT${eS()}`,REPLACE:`@@redux/REPLACE${eS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${eS()}`},Bg=rde;function oN(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 N3(e,t,n){if(typeof e!="function")throw new Error(Vn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Vn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Vn(1));return n(N3)(e,t)}let r=e,i=t,a=new Map,o=a,u=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,N)=>{o.set(N,j)}))}function p(){if(d)throw new Error(Vn(3));return i}function m(j){if(typeof j!="function")throw new Error(Vn(4));if(d)throw new Error(Vn(5));let N=!0;f();const O=u++;return o.set(O,j),function(){if(N){if(d)throw new Error(Vn(6));N=!1,f(),o.delete(O),a=null}}}function y(j){if(!oN(j))throw new Error(Vn(7));if(typeof j.type>"u")throw new Error(Vn(8));if(typeof j.type!="string")throw new Error(Vn(17));if(d)throw new Error(Vn(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(O=>{O()}),j}function v(j){if(typeof j!="function")throw new Error(Vn(10));r=j,y({type:Bg.REPLACE})}function w(){const j=m;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Vn(11));function O(){const C=N;C.next&&C.next(p())}return O(),{unsubscribe:j(O)}},[AP](){return this}}}return y({type:Bg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[AP]:w}}function ide(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Bg.INIT})>"u")throw new Error(Vn(12));if(typeof n(void 0,{type:Bg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Vn(13))})}function C3(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{ide(n)}catch(a){i=a}return function(o={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],w=y(v,u);if(typeof w>"u")throw u&&u.type,new Error(Vn(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function Ug(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ade(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Vn(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(o));return a=Ug(...u)(i.dispatch),{...i,dispatch:a}}}function _3(e){return oN(e)&&"type"in e&&typeof e.type=="string"}var A3=Symbol.for("immer-nothing"),OP=Symbol.for("immer-draftable"),mr=Symbol.for("immer-state");function Hi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yr=Object,ku=Yr.getPrototypeOf,Fg="constructor",wv="prototype",L1="configurable",qg="enumerable",ag="writable",Ff="value",os=e=>!!e&&!!e[mr];function Yi(e){return e?O3(e)||jv(e)||!!e[OP]||!!e[Fg]?.[OP]||kv(e)||Nv(e):!1}var sde=Yr[wv][Fg].toString(),EP=new WeakMap;function O3(e){if(!e||!lN(e))return!1;const t=ku(e);if(t===null||t===Yr[wv])return!0;const n=Yr.hasOwnProperty.call(t,Fg)&&t[Fg];if(n===Object)return!0;if(!Jc(n))return!1;let r=EP.get(n);return r===void 0&&(r=Function.toString.call(n),EP.set(n,r)),r===sde}function Sv(e,t,n=!0){yh(e)===0?(n?Reflect.ownKeys(e):Yr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function yh(e){const t=e[mr];return t?t.type_:jv(e)?1:kv(e)?2:Nv(e)?3:0}var zP=(e,t,n=yh(e))=>n===2?e.has(t):Yr[wv].hasOwnProperty.call(e,t),$1=(e,t,n=yh(e))=>n===2?e.get(t):e[t],Hg=(e,t,n,r=yh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ode(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var jv=Array.isArray,kv=e=>e instanceof Map,Nv=e=>e instanceof Set,lN=e=>typeof e=="object",Jc=e=>typeof e=="function",tS=e=>typeof e=="boolean";function lde(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Qa=e=>e.copy_||e.base_,cN=e=>e.modified_?e.copy_:e.base_;function B1(e,t){if(kv(e))return new Map(e);if(Nv(e))return new Set(e);if(jv(e))return Array[wv].slice.call(e);const n=O3(e);if(t===!0||t==="class_only"&&!n){const r=Yr.getOwnPropertyDescriptors(e);delete r[mr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u[ag]===!1&&(u[ag]=!0,u[L1]=!0),(u.get||u.set)&&(r[o]={[L1]:!0,[ag]:!0,[qg]:u[qg],[Ff]:e[o]})}return Yr.create(ku(e),r)}else{const r=ku(e);if(r!==null&&n)return{...e};const i=Yr.create(r);return Yr.assign(i,e)}}function uN(e,t=!1){return Cv(e)||os(e)||!Yi(e)||(yh(e)>1&&Yr.defineProperties(e,{set:zm,add:zm,clear:zm,delete:zm}),Yr.freeze(e),t&&Sv(e,(n,r)=>{uN(r,!0)},!1)),e}function cde(){Hi(2)}var zm={[Ff]:cde};function Cv(e){return e===null||!lN(e)?!0:Yr.isFrozen(e)}var Kg="MapSet",U1="Patches",TP="ArrayMethods",E3={};function Ml(e){const t=E3[e];return t||Hi(0,e),t}var PP=e=>!!E3[e],qf,z3=()=>qf,ude=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:PP(Kg)?Ml(Kg):void 0,arrayMethodsPlugin_:PP(TP)?Ml(TP):void 0});function RP(e,t){t&&(e.patchPlugin_=Ml(U1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function F1(e){q1(e),e.drafts_.forEach(dde),e.drafts_=null}function q1(e){e===qf&&(qf=e.parent_)}var DP=e=>qf=ude(qf,e);function dde(e){const t=e[mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function MP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[mr].modified_&&(F1(t),Hi(4)),Yi(e)&&(e=IP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[mr].base_,e,t)}else e=IP(t,n);return fde(t,e,!0),F1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==A3?e:void 0}function IP(e,t){if(Cv(t))return t;const n=t[mr];if(!n)return Gg(t,e.handledSet_,e);if(!_v(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);R3(n,e)}return n.copy_}function fde(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uN(t,n)}function T3(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var _v=(e,t)=>e.scope_===t,hde=[];function P3(e,t,n,r){const i=Qa(e),a=e.type_;if(r!==void 0&&$1(i,r,a)===t){Hg(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Sv(i,(d,f)=>{if(os(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const o=e.draftLocations_.get(t)??hde;for(const u of o)Hg(i,u,n,a)}function pde(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!_v(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=cN(a);P3(e,a.draft_??a,o,n),R3(a,i)})}function R3(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)}T3(e)}}function mde(e,t,n){const{scope_:r}=e;if(os(n)){const i=n[mr];_v(i,r)&&i.callbacks_.push(function(){sg(e);const o=cN(i);P3(e,n,o,t)})}else Yi(n)&&e.callbacks_.push(function(){const a=Qa(e);e.type_===3?a.has(n)&&Gg(n,r.handledSet_,r):$1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Gg($1(e.copy_,t,e.type_),r.handledSet_,r)})}function Gg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||os(e)||t.has(e)||!Yi(e)||Cv(e)||(t.add(e),Sv(e,(r,i)=>{if(os(i)){const a=i[mr];if(_v(a,n)){const o=cN(a);Hg(e,r,o,e.type_),T3(a)}}else Yi(i)&&Gg(i,t,n)})),e}function gde(e,t){const n=jv(e),r={type_:n?1:0,scope_:t?t.scope_:z3(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Vg;n&&(i=[r],a=Hf);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,[u,r]}var Vg={get(e,t){if(t===mr)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=Qa(e);if(!zP(i,t,e.type_))return yde(e,i,t);const a=i[t];if(e.finalized_||!Yi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&lde(t))return a;if(a===nS(e.base_,t)){sg(e);const o=e.type_===1?+t:t,u=K1(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in Qa(e)},ownKeys(e){return Reflect.ownKeys(Qa(e))},set(e,t,n){const r=D3(Qa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=nS(Qa(e),t),a=i?.[mr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ode(n,i)&&(n!==void 0||zP(e.base_,t,e.type_)))return!0;sg(e),H1(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),mde(e,t,n)),!0},deleteProperty(e,t){return sg(e),nS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),H1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Qa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ag]:!0,[L1]:e.type_!==1||t!=="length",[qg]:r[qg],[Ff]:n[t]}},defineProperty(){Hi(11)},getPrototypeOf(e){return ku(e.base_)},setPrototypeOf(){Hi(12)}},Hf={};for(let e in Vg){let t=Vg[e];Hf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Hf.deleteProperty=function(e,t){return Hf.set.call(this,e,t,void 0)};Hf.set=function(e,t,n){return Vg.set.call(this,e[0],t,n,e[0])};function nS(e,t){const n=e[mr];return(n?Qa(n):e)[t]}function yde(e,t,n){const r=D3(t,n);return r?Ff in r?r[Ff]:r.get?.call(e.draft_):void 0}function D3(e,t){if(!(t in e))return;let n=ku(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ku(n)}}function H1(e){e.modified_||(e.modified_=!0,e.parent_&&H1(e.parent_))}function sg(e){e.copy_||(e.assigned_=new Map,e.copy_=B1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vde=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Jc(n)&&!Jc(r)){const o=r;r=n;const u=this;return function(f=o,...p){return u.produce(f,m=>r.call(this,m,...p))}}Jc(r)||Hi(6),i!==void 0&&!Jc(i)&&Hi(7);let a;if(Yi(n)){const o=DP(this),u=K1(o,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?F1(o):q1(o)}return RP(o,i),MP(a,o)}else if(!n||!lN(n)){if(a=r(n),a===void 0&&(a=n),a===A3&&(a=void 0),this.autoFreeze_&&uN(a,!0),i){const o=[],u=[];Ml(U1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else Hi(1,n)},this.produceWithPatches=(n,r)=>{if(Jc(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},tS(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),tS(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),tS(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Yi(t)||Hi(8),os(t)&&(t=wi(t));const n=DP(this),r=K1(n,t,void 0);return r[mr].isManual_=!0,q1(n),r}finishDraft(t,n){const r=t&&t[mr];(!r||!r.isManual_)&&Hi(9);const{scope_:i}=r;return RP(i,n),MP(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Ml(U1).applyPatches_;return os(t)?i(t,n):this.produce(t,a=>i(a,n))}};function K1(e,t,n,r){const[i,a]=kv(t)?Ml(Kg).proxyMap_(t,n):Nv(t)?Ml(Kg).proxySet_(t,n):gde(t,n);return(n?.scope_??z3()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?pde(n,a,r):a.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function wi(e){return os(e)||Hi(10,e),M3(e)}function M3(e){if(!Yi(e)||Cv(e))return e;const t=e[mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=B1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=B1(e,!0);return Sv(n,(i,a)=>{Hg(n,i,M3(a))},r),t&&(t.finalized_=!1),n}var bde=new vde,I3=bde.produce;function L3(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var xde=L3(),wde=L3,Sde=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ug:Ug.apply(null,arguments)};function Qr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Wr(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=>_3(r)&&r.type===e,n}var $3=class pf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,pf.prototype)}static get[Symbol.species](){return pf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new pf(...t[0].concat(this)):new pf(...t.concat(this))}};function LP(e){return Yi(e)?I3(e,()=>{}):e}function Tm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function jde(e){return typeof e=="boolean"}var kde=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new $3;return n&&(jde(n)?o.push(xde):o.push(wde(n.extraArgument))),o},B3="RTK_autoBatch",Wt=()=>e=>({payload:e,meta:{[B3]:!0}}),$P=e=>t=>{setTimeout(t,e)},U3=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:$P(10):e.type==="callback"?e.queueNotification:$P(e.timeout),f=()=>{o=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return u.add(p),()=>{y(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[B3],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Nde=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new $3(e);return r&&i.push(U3(typeof r=="object"?r:void 0)),i};function Cde(e){const t=kde(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(oN(n))u=C3(n);else throw new Error(Wr(1));let d;typeof r=="function"?d=r(t):d=t();let f=Ug;i&&(f=Sde({trace:!1,...typeof i=="object"&&i}));const p=ade(...d),m=Nde(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return N3(u,a,v)}function F3(e){const t={},n=[];let r;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Wr(28));if(u in t)throw new Error(Wr(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function _de(e){return typeof e=="function"}function Ade(e,t){let[n,r,i]=F3(t),a;if(_de(e))a=()=>LP(e());else{const u=LP(e);a=()=>u}function o(u=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(os(p)){const v=m(p,d);return v===void 0?p:v}else{if(Yi(p))return I3(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},u)}return o.getInitialState=a,o}var Ode="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ede=(e=21)=>{let t="",n=e;for(;n--;)t+=Ode[Math.random()*64|0];return t},zde=Symbol.for("rtk-slice-createasyncthunk");function Tde(e,t){return`${e}/${t}`}function Pde({creators:e}={}){const t=e?.asyncThunk?.[zde];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Wr(11));const o=(typeof r.reducers=="function"?r.reducers(Dde()):r.reducers)||{},u=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,C){const T=typeof _=="string"?_:_.type;if(!T)throw new Error(Wr(12));if(T in d.sliceCaseReducersByType)throw new Error(Wr(13));return d.sliceCaseReducersByType[T]=C,f},addMatcher(_,C){return d.sliceMatchers.push({matcher:_,reducer:C}),f},exposeAction(_,C){return d.actionCreators[_]=C,f},exposeCaseReducer(_,C){return d.sliceCaseReducersByName[_]=C,f}};u.forEach(_=>{const C=o[_],T={reducerName:_,type:Tde(i,_),createNotation:typeof r.reducers=="function"};Ide(C)?$de(T,C,f,t):Mde(T,C,f)});function p(){const[_={},C=[],T=void 0]=typeof r.extraReducers=="function"?F3(r.extraReducers):[r.extraReducers],E={..._,...d.sliceCaseReducersByType};return Ade(r.initialState,A=>{for(let P in E)A.addCase(P,E[P]);for(let P of d.sliceMatchers)A.addMatcher(P.matcher,P.reducer);for(let P of C)A.addMatcher(P.matcher,P.reducer);T&&A.addDefaultCase(T)})}const m=_=>_,y=new Map,v=new WeakMap;let w;function S(_,C){return w||(w=p()),w(_,C)}function j(){return w||(w=p()),w.getInitialState()}function N(_,C=!1){function T(A){let P=A[_];return typeof P>"u"&&C&&(P=Tm(v,T,j)),P}function E(A=m){const P=Tm(y,C,()=>new WeakMap);return Tm(P,A,()=>{const I={};for(const[q,B]of Object.entries(r.selectors??{}))I[q]=Rde(B,A,()=>Tm(v,A,j),C);return I})}return{reducerPath:_,getSelectors:E,get selectors(){return E(T)},selectSlice:T}}const O={name:i,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...N(a),injectInto(_,{reducerPath:C,...T}={}){const E=C??a;return _.inject({reducerPath:E,reducer:S},T),{...O,...N(E,!0)}}};return O}}function Rde(e,t,n,r){function i(a,...o){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...o)}return i.unwrapped=e,i}var or=Pde();function Dde(){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 Mde({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Lde(r))throw new Error(Wr(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Qr(e,o):Qr(e))}function Ide(e){return e._reducerDefinitionType==="asyncThunk"}function Lde(e){return e._reducerDefinitionType==="reducerWithPrepare"}function $de({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Wr(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Pm,pending:u||Pm,rejected:d||Pm,settled:f||Pm})}function Pm(){}var Bde="task",q3="listener",H3="completed",dN="cancelled",Ude=`task-${dN}`,Fde=`task-${H3}`,G1=`${q3}-${dN}`,qde=`${q3}-${H3}`,Av=class{constructor(e){this.code=e,this.message=`${Bde} ${dN} (reason: ${e})`}name="TaskAbortError";message},fN=(e,t)=>{if(typeof e!="function")throw new TypeError(Wr(32))},Zg=()=>{},K3=(e,t=Zg)=>(e.catch(t),e),G3=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),kl=e=>{if(e.aborted)throw new Av(e.reason)};function V3(e,t){let n=Zg;return new Promise((r,i)=>{const a=()=>i(new Av(e.reason));if(e.aborted){a();return}n=G3(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Zg})}var Hde=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Av?"cancelled":"rejected",error:n}}finally{t?.()}},Yg=e=>t=>K3(V3(e,t).then(n=>(kl(e),n))),Z3=e=>{const t=Yg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:pu}=Object,BP={},Ov="listenerMiddleware",Kde=(e,t)=>{const n=r=>G3(e,()=>r.abort(e.reason));return(r,i)=>{fN(r);const a=new AbortController;n(a);const o=Hde(async()=>{kl(e),kl(a.signal);const u=await r({pause:Yg(a.signal),delay:Z3(a.signal),signal:a.signal});return kl(a.signal),u},()=>a.abort(Fde));return i?.autoJoin&&t.push(o.catch(Zg)),{result:Yg(e)(o),cancel(){a.abort(Ude)}}}},Gde=(e,t)=>{const n=async(r,i)=>{kl(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await V3(t,Promise.race(u));return kl(t),d}finally{a()}};return(r,i)=>K3(n(r,i))},Y3=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Qr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Wr(21));return fN(a),{predicate:i,type:t,effect:a}},W3=pu(e=>{const{type:t,predicate:n,effect:r}=Y3(e);return{id:Ede(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Wr(22))}}},{withTypes:()=>W3}),UP=(e,t)=>{const{type:n,effect:r,predicate:i}=Y3(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},V1=e=>{e.pending.forEach(t=>{t.abort(G1)})},Vde=(e,t)=>()=>{for(const n of t.keys())V1(n);e.clear()},FP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Q3=pu(Qr(`${Ov}/add`),{withTypes:()=>Q3}),Zde=Qr(`${Ov}/removeAll`),X3=pu(Qr(`${Ov}/remove`),{withTypes:()=>X3}),Yde=(...e)=>{console.error(`${Ov}/error`,...e)},vh=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:a,onError:o=Yde}=e;fN(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&V1(v)}),d=v=>{const w=UP(t,v)??W3(v);return u(w)};pu(d,{withTypes:()=>d});const f=v=>{const w=UP(t,v);return w&&(w.unsubscribe(),v.cancelActive&&V1(w)),!!w};pu(f,{withTypes:()=>f});const p=async(v,w,S,j)=>{const N=new AbortController,O=Gde(d,N.signal),_=[];try{v.pending.add(N),r(v),await Promise.resolve(v.effect(w,pu({},S,{getOriginalState:j,condition:(C,T)=>O(C,T).then(Boolean),take:O,delay:Z3(N.signal),pause:Yg(N.signal),extra:a,signal:N.signal,fork:Kde(N.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,T,E)=>{C!==N&&(C.abort(G1),E.delete(C))})},cancel:()=>{N.abort(G1),v.pending.delete(N)},throwIfCancelled:()=>{kl(N.signal)}})))}catch(C){C instanceof Av||FP(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),N.abort(qde),i(v),v.pending.delete(N)}},m=Vde(t,n);return{middleware:v=>w=>S=>{if(!_3(S))return w(S);if(Q3.match(S))return d(S.payload);if(Zde.match(S)){m();return}if(X3.match(S))return f(S.payload);let j=v.getState();const N=()=>{if(j===BP)throw new Error(Wr(23));return j};let O;try{if(O=w(S),t.size>0){const _=v.getState(),C=Array.from(t.values());for(const T of C){let E=!1;try{E=T.predicate(S,_,j)}catch(A){E=!1,FP(o,A,{raisedBy:"predicate"})}E&&p(T,S,v,N)}}}finally{j=BP}return O},startListening:d,stopListening:f,clearListeners:m}};function Wr(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 Wde={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},J3=or({name:"chartLayout",initialState:Wde,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Qde,setLayout:Xde,setChartSize:Jde,setScale:efe}=J3.actions,tfe=J3.reducer;function eB(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Je(e){return Number.isFinite(e)}function wa(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){nfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nfe(e,t,n){return(t=rfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rfe(e){var t=ife(e,"string");return typeof t=="symbol"?t:t+""}function ife(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 $n(e,t,n){return Xn(e)||Xn(t)?n:_i(t)?bv(e,t,n):typeof t=="function"?t(e):n}var afe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:u}=t;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&Le(e[a]))return au(au({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&Le(e[o]))return au(au({},e),{},{[o]:e[o]+(i||0)})}return e},Na=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",tB=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,o=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||o.push(t),a||o.push(n),o},nB=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var w=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,S=i==="category"&&o.bandwidth?o.bandwidth()/w:0;if(S=v==="angleAxis"&&a&&a.length>=2?xi(a[0]-a[1])*2*S:S,m||y){var j=(m||y||[]).map((N,O)=>{var _=r?r.indexOf(N):N,C=o.map(_);return Je(C)?{coordinate:C+S,value:N,offset:S,index:O}:null}).filter(Or);return j}return d&&f?f.map((N,O)=>{var _=o.map(N);return Je(_)?{coordinate:_+S,value:N,index:O,offset:S}:null}).filter(Or):o.ticks&&p!=null?o.ticks(p).map((N,O)=>{var _=o.map(N);return Je(_)?{coordinate:_+S,value:N,index:O,offset:S}:null}).filter(Or):o.domain().map((N,O)=>{var _=o.map(N);return Je(_)?{coordinate:_+S,value:r?r[N]:N,index:O,offset:S}:null}).filter(Or)},sfe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=xa(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},ofe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var u=e[o],d=u?.[i];if(d!=null){var f=xa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},lfe={sign:sfe,expand:Rce,none:Rl,silhouette:Dce,wiggle:Mce,positive:ofe},cfe=(e,t,n)=>{var r,i=(r=lfe[n])!==null&&r!==void 0?r:Rl,a=Pce().keys(t).value((u,d)=>Number($n(u,d,0))).order(M1).offset(i),o=a(e);return o.forEach((u,d)=>{u.forEach((f,p)=>{var m=$n(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Le(m[0])&&Le(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function ufe(e){return e==null?void 0:String(e)}function HP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Xn(i[t.dataKey])){var u=i3(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=$n(i,Xn(o)?t.dataKey:o),f=t.scale.map(d);return Le(f)?f:null}var dfe=e=>{var t=e.flat(2).filter(Le);return[Math.min(...t),Math.max(...t)]},ffe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],hfe=(e,t,n)=>{if(e!=null)return ffe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,u=o.reduce((d,f)=>{var p=eB(f,t,n),m=dfe(p);return!Je(m[0])||!Je(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},KP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,GP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wg=(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=xv(t,p=>p.coordinate),a=1/0,o=1,u=i.length;o<u;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function VP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return au(au({},t),{},{dataKey:n,payload:r,value:i,name:a})}function rB(e,t){if(e)return String(e);if(typeof t=="string")return t}var pfe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},mfe=(e,t)=>t==="centric"?e.angle:e.radius,hs=e=>e.layout.width,ps=e=>e.layout.height,gfe=e=>e.layout.scale,iB=e=>e.layout.margin,Ev=ce(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),zv=ce(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),yfe="data-recharts-item-index",vfe="data-recharts-item-id",bh=60;function ZP(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 Rm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(n),!0).forEach(function(r){bfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bfe(e,t,n){return(t=xfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xfe(e){var t=wfe(e,"string");return typeof t=="symbol"?t:t+""}function wfe(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 Sfe=e=>e.brush.height;function jfe(e){var t=zv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bh;return n+i}return n},0)}function kfe(e){var t=zv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:bh;return n+i}return n},0)}function Nfe(e){var t=Ev(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Cfe(e){var t=Ev(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Jn=ce([hs,ps,iB,Sfe,jfe,kfe,Nfe,Cfe,j3,Xue],(e,t,n,r,i,a,o,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+u},y=Rm(Rm({},m),p),v=y.bottom;y.bottom+=r,y=afe(y,d,f);var w=e-y.left-y.right,S=t-y.top-y.bottom;return Rm(Rm({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(S,0)})}),_fe=ce(Jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),aB=ce(hs,ps,(e,t)=>({x:0,y:0,width:e,height:t})),Afe=b.createContext(null),yr=()=>b.useContext(Afe)!=null,Tv=e=>e.brush,Pv=ce([Tv,Jn,iB],(e,t,n)=>({height:e.height,x:Le(e.x)?e.x:t.left,y:Le(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Le(e.width)?e.width:t.width})),rS={},iS={},aS={},YP;function Ofe(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(o,u),o=void 0,u=null)},m=()=>{f&&p(),S()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{w(),o=void 0,u=null},j=()=>{p()},N=function(...O){if(i?.aborted)return;o=this,u=O;const _=y==null;v(),d&&_&&p()};return N.schedule=v,N.cancel=S,N.flush=j,i?.addEventListener("abort",S,{once:!0}),N}e.debounce=t})(aS)),aS}var WP;function Efe(){return WP||(WP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ofe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...S){p=r.apply(this,S),m=null},i,{edges:f}),v=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,S),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,S),p)},w=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(iS)),iS}var QP;function zfe(){return QP||(QP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Efe();function n(r,i=0,a={}){const{leading:o=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:u})}e.throttle=n})(rS)),rS}var sS,XP;function Tfe(){return XP||(XP=1,sS=zfe().throttle),sS}var Pfe=Tfe();const Rfe=ka(Pfe);var Qg=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},ha={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},sB=(e,t,n)=>{var{width:r=ha.width,height:i=ha.height,aspect:a,maxHeight:o}=n,u=Dl(r)?e:Number(r),d=Dl(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:u,calculatedHeight:d}},Dfe={width:0,height:0,overflow:"visible"},Mfe={width:0,overflowX:"visible"},Ife={height:0,overflowY:"visible"},Lfe={},$fe=e=>{var{width:t,height:n}=e,r=Dl(t),i=Dl(n);return r&&i?Dfe:r?Mfe:i?Ife:Lfe};function Bfe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=ha.width,a=ha.height):i===void 0?i=r&&r>0?void 0:ha.width:a===void 0&&(a=r&&r>0?void 0:ha.height),{width:i,height:a}}function Z1(){return Z1=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},Z1.apply(null,arguments)}function JP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){Ufe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ufe(e,t,n){return(t=Ffe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ffe(e){var t=qfe(e,"string");return typeof t=="symbol"?t:t+""}function qfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oB=b.createContext(ha.initialDimension);function Hfe(e){return wa(e.width)&&wa(e.height)}function lB(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return Hfe(i)?b.createElement(oB.Provider,{value:i},t):null}var hN=()=>b.useContext(oB),Kfe=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=ha.initialDimension,width:i,height:a,minWidth:o=ha.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=ha.debounce,id:m,className:y,onResize:v,style:w={}}=e,S=b.useRef(null),j=b.useRef();j.current=v,b.useImperativeHandle(t,()=>S.current);var[N,O]=b.useState({containerWidth:r.width,containerHeight:r.height}),_=b.useCallback((P,I)=>{O(q=>{var B=Math.round(P),$=Math.round(I);return q.containerWidth===B&&q.containerHeight===$?q:{containerWidth:B,containerHeight:$}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return qu;var P=$=>{var V,te=$[0];if(te!=null){var{width:Y,height:H}=te.contentRect;_(Y,H),(V=j.current)===null||V===void 0||V.call(j,Y,H)}};p>0&&(P=Rfe(P,p,{trailing:!0,leading:!1}));var I=new ResizeObserver(P),{width:q,height:B}=S.current.getBoundingClientRect();return _(q,B),I.observe(S.current),()=>{I.disconnect()}},[_,p]);var{containerWidth:C,containerHeight:T}=N;Qg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:E,calculatedHeight:A}=sB(C,T,{width:i,height:a,aspect:n,maxHeight:d});return Qg(E!=null&&E>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
258
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
259
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
260
|
-
height and width.`,E,A,i,a,o,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:Et("recharts-responsive-container",y),style:eR(eR({},w),{},{width:i,height:a,minWidth:o,minHeight:u,maxHeight:d}),ref:S},b.createElement("div",{style:$fe({width:i,height:a})},b.createElement(lB,{width:E,height:A},f)))}),Xg=b.forwardRef((e,t)=>{var n=hN();if(wa(n.width)&&wa(n.height))return e.children;var{width:r,height:i}=Bfe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=sB(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Le(a)&&Le(o)?b.createElement(lB,{width:a,height:o},e.children):b.createElement(Kfe,Z1({},e,{width:r,height:i,ref:t}))});function pN(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 xh=()=>{var e,t=yr(),n=Ue(_fe),r=Ue(Pv),i=(e=Ue(Tv))===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}},Gfe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},cB=()=>{var e;return(e=Ue(Jn))!==null&&e!==void 0?e:Gfe},mN=()=>Ue(hs),gN=()=>Ue(ps),Vfe=()=>Ue(e=>e.layout.margin),sn=e=>e.layout.layoutType,Hu=()=>Ue(sn),yN=()=>{var e=Hu();if(e==="horizontal"||e==="vertical")return e},uB=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Zfe=()=>{var e=Hu();return e!==void 0},wh=e=>{var t=fn(),n=yr(),{width:r,height:i}=e,a=hN(),o=r,u=i;return a&&(o=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&wa(o)&&wa(u)&&t(Jde({width:o,height:u}))},[t,n,o,u]),null},dB=Symbol.for("immer-nothing"),tR=Symbol.for("immer-draftable"),Xr=Symbol.for("immer-state");function Ki(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Kf=Object.getPrototypeOf;function Nu(e){return!!e&&!!e[Xr]}function Il(e){return e?fB(e)||Array.isArray(e)||!!e[tR]||!!e.constructor?.[tR]||Sh(e)||Dv(e):!1}var Yfe=Object.prototype.constructor.toString(),nR=new WeakMap;function fB(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=nR.get(n);return r===void 0&&(r=Function.toString.call(n),nR.set(n,r)),r===Yfe}function Jg(e,t,n=!0){Rv(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 Rv(e){const t=e[Xr];return t?t.type_:Array.isArray(e)?1:Sh(e)?2:Dv(e)?3:0}function Y1(e,t){return Rv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function hB(e,t,n){const r=Rv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Wfe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Sh(e){return e instanceof Map}function Dv(e){return e instanceof Set}function ol(e){return e.copy_||e.base_}function W1(e,t){if(Sh(e))return new Map(e);if(Dv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=fB(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Xr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[o]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[o]})}return Object.create(Kf(e),r)}else{const r=Kf(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function vN(e,t=!1){return Mv(e)||Nu(e)||!Il(e)||(Rv(e)>1&&Object.defineProperties(e,{set:Dm,add:Dm,clear:Dm,delete:Dm}),Object.freeze(e),t&&Object.values(e).forEach(n=>vN(n,!0))),e}function Qfe(){Ki(2)}var Dm={value:Qfe};function Mv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Xfe={};function Ll(e){const t=Xfe[e];return t||Ki(0,e),t}var Gf;function pB(){return Gf}function Jfe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rR(e,t){t&&(Ll("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Q1(e){X1(e),e.drafts_.forEach(ehe),e.drafts_=null}function X1(e){e===Gf&&(Gf=e.parent_)}function iR(e){return Gf=Jfe(Gf,e)}function ehe(e){const t=e[Xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function aR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Xr].modified_&&(Q1(t),Ki(4)),Il(e)&&(e=ey(t,e),t.parent_||ty(t,e)),t.patches_&&Ll("Patches").generateReplacementPatches_(n[Xr].base_,e,t.patches_,t.inversePatches_)):e=ey(t,n,[]),Q1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dB?e:void 0}function ey(e,t,n){if(Mv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Xr];if(!i)return Jg(t,(a,o)=>sR(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return ty(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),Jg(o,(d,f)=>sR(e,i,a,d,f,n,u),r),ty(e,a,!1),n&&e.patches_&&Ll("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function sR(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=Mv(i);if(!(u&&!o)){if(Nu(i)){const d=a&&t&&t.type_!==3&&!Y1(t.assigned_,r)?a.concat(r):void 0,f=ey(e,i,d);if(hB(n,r,f),Nu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Il(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;ey(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Sh(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&ty(e,i)}}}function ty(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vN(t,n)}function the(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:pB(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=bN;n&&(i=[r],a=Vf);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,u}var bN={get(e,t){if(t===Xr)return e;const n=ol(e);if(!Y1(n,t))return nhe(e,n,t);const r=n[t];return e.finalized_||!Il(r)?r:r===oS(e.base_,t)?(lS(e),e.copy_[t]=ej(r,e)):r},has(e,t){return t in ol(e)},ownKeys(e){return Reflect.ownKeys(ol(e))},set(e,t,n){const r=mB(ol(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=oS(ol(e),t),a=i?.[Xr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Wfe(n,i)&&(n!==void 0||Y1(e.base_,t)))return!0;lS(e),J1(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 oS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,lS(e),J1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ol(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 Kf(e.base_)},setPrototypeOf(){Ki(12)}},Vf={};Jg(bN,(e,t)=>{Vf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Vf.deleteProperty=function(e,t){return Vf.set.call(this,e,t,void 0)};Vf.set=function(e,t,n){return bN.set.call(this,e[0],t,n,e[0])};function oS(e,t){const n=e[Xr];return(n?ol(n):e)[t]}function nhe(e,t,n){const r=mB(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function mB(e,t){if(!(t in e))return;let n=Kf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kf(n)}}function J1(e){e.modified_||(e.modified_=!0,e.parent_&&J1(e.parent_))}function lS(e){e.copy_||(e.copy_=W1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rhe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&Ki(6),r!==void 0&&typeof r!="function"&&Ki(7);let i;if(Il(t)){const a=iR(this),o=ej(t,void 0);let u=!0;try{i=n(o),u=!1}finally{u?Q1(a):X1(a)}return rR(a,r),aR(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===dB&&(i=void 0),this.autoFreeze_&&vN(i,!0),r){const a=[],o=[];Ll("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Ki(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,d=>t(d,...u));let r,i;return[this.produce(t,n,(o,u)=>{r=o,i=u}),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){Il(e)||Ki(8),Nu(e)&&(e=ihe(e));const t=iR(this),n=ej(e,void 0);return n[Xr].isManual_=!0,X1(t),n}finishDraft(e,t){const n=e&&e[Xr];(!n||!n.isManual_)&&Ki(9);const{scope_:r}=n;return rR(r,t),aR(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=Ll("Patches").applyPatches_;return Nu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ej(e,t){const n=Sh(e)?Ll("MapSet").proxyMap_(e,t):Dv(e)?Ll("MapSet").proxySet_(e,t):the(e,t);return(t?t.scope_:pB()).drafts_.push(n),n}function ihe(e){return Nu(e)||Ki(10,e),gB(e)}function gB(e){if(!Il(e)||Mv(e))return e;const t=e[Xr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=W1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=W1(e,!0);return Jg(n,(i,a)=>{hB(n,i,gB(a))},r),t&&(t.finalized_=!1),n}var ahe=new rhe;ahe.produce;var she={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},yB=or({name:"legend",initialState:she,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:Wt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=wi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Wt()},removeLegendPayload:{reducer(e,t){var n=wi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Wt()}}}),{setLegendSize:oR,setLegendSettings:ohe,addLegendPayload:lhe,replaceLegendPayload:che,removeLegendPayload:uhe}=yB.actions,dhe=yB.reducer,cS={exports:{}},uS={};var lR;function fhe(){if(lR)return uS;lR=1;var e=Pu();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return uS.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=o(function(){function j(T){if(!N){if(N=!0,O=T,T=m(T),y!==void 0&&w.hasValue){var E=w.value;if(y(E,T))return _=E}return _=T}if(E=_,n(O,T))return E;var A=m(T);return y!==void 0&&y(E,A)?(O=T,E):(O=T,_=A)}var N=!1,O,_,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var S=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},uS}var cR;function hhe(){return cR||(cR=1,cS.exports=fhe()),cS.exports}hhe();function phe(e){e()}function mhe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){phe(()=>{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 uR={notify(){},get:()=>[]};function ghe(e,t){let n,r=uR,i=0,a=!1;function o(S){p();const j=r.subscribe(S);let N=!1;return()=>{N||(N=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=mhe())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=uR)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var yhe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vhe=yhe(),bhe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",xhe=bhe(),whe=()=>vhe||xhe?b.useLayoutEffect:b.useEffect,She=whe();function dR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function jhe(e,t){if(dR(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])||!dR(e[n[i]],t[n[i]]))return!1;return!0}var khe=Symbol.for("react-redux-context"),Nhe=typeof globalThis<"u"?globalThis:{};function Che(){if(!b.createContext)return{};const e=Nhe[khe]??=new Map;let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var _he=Che();function Ahe(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=ghe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=b.useMemo(()=>i.getState(),[i]);She(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const u=n||_he;return b.createElement(u.Provider,{value:a},t)}var Ohe=Ahe,Ehe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function zhe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function jh(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Ehe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!jhe(e[r],t[r]))return!1}else if(!zhe(e[r],t[r]))return!1;return!0}var The=["contextPayload"];function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tj.apply(null,arguments)}function fR(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 Cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(r){Phe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Phe(e,t,n){return(t=Rhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rhe(e){var t=Dhe(e,"string");return typeof t=="symbol"?t:t+""}function Dhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mhe(e,t){if(e==null)return{};var n,r,i=Ihe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function 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 Lhe(e){return e.value}function $he(e){var{contextPayload:t}=e,n=Mhe(e,The),r=b3(t,e.payloadUniqBy,Lhe),i=Cu(Cu({},n),{},{payload:r});return b.isValidElement(e.content)?b.cloneElement(e.content,i):typeof e.content=="function"?b.createElement(e.content,i):b.createElement(due,i)}function Bhe(e,t,n,r,i,a){var{layout:o,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=u==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Cu(Cu({},f),p)}function Uhe(e){var t=fn();return b.useEffect(()=>{t(ohe(e))},[t,e]),null}function Fhe(e){var t=fn();return b.useEffect(()=>(t(oR(e)),()=>{t(oR({width:0,height:0}))}),[t,e]),null}function qhe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Hhe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Khe(e){var t=gr(e,Hhe),n=tde(),r=rce(),i=Vfe(),{width:a,height:o,wrapperStyle:u,portal:d}=t,[f,p]=k3([n]),m=mN(),y=gN();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=qhe(t.layout,o,a,v),S=d?u:Cu(Cu({position:"absolute",width:w?.width||a||"auto",height:w?.height||o||"auto"},Bhe(u,t,i,m,y,f)),u),j=d??r;if(j==null||n==null)return null;var N=b.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},b.createElement(Uhe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&b.createElement(Fhe,{width:f.width,height:f.height}),b.createElement($he,tj({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return ql.createPortal(N,j)}var nj=b.memo(Khe,jh);nj.displayName="Legend";function rj(){return rj=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},rj.apply(null,arguments)}function hR(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 tf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hR(Object(n),!0).forEach(function(r){Ghe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ghe(e,t,n){return(t=Vhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vhe(e){var t=Zhe(e,"string");return typeof t=="symbol"?t:t+""}function Zhe(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 Yhe(e){return Array.isArray(e)&&_i(e[0])&&_i(e[1])?e.join(" ~ "):e}var qc={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 Whe(e,t){return t==null?e:xv(e,t)}var Qhe=e=>{var{separator:t=qc.separator,contentStyle:n,itemStyle:r,labelStyle:i=qc.labelStyle,payload:a,formatter:o,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=qc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var T={padding:0,margin:0},E=Whe(a,u),A=E.map((P,I)=>{if(!P||P.type==="none")return null;var q=P.formatter||o||Yhe,{value:B,name:$}=P,V=B,te=$;if(q){var Y=q(B,$,P,I,a);if(Array.isArray(Y))[V,te]=Y;else if(Y!=null)V=Y;else return null}var H=tf(tf({},qc.itemStyle),{},{color:P.color||qc.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:H},_i(te)?b.createElement("span",{className:"recharts-tooltip-item-name"},te):null,_i(te)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},V),b.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:T},A)}return null},w=tf(tf({},qc.contentStyle),n),S=tf({margin:0},i),j=!Xn(p),N=j?p:"",O=Et("recharts-default-tooltip",d),_=Et("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(N=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",rj({className:O,style:w},C),b.createElement("p",{className:_,style:S},b.isValidElement(N)?N:"".concat(N)),v())},nf="recharts-tooltip-wrapper",Xhe={visibility:"hidden"};function Jhe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Et(nf,{["".concat(nf,"-right")]:Le(n)&&t&&Le(t.x)&&n>=t.x,["".concat(nf,"-left")]:Le(n)&&t&&Le(t.x)&&n<t.x,["".concat(nf,"-bottom")]:Le(r)&&t&&Le(t.y)&&r>=t.y,["".concat(nf,"-top")]:Le(r)&&t&&Le(t.y)&&r<t.y})}function pR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Le(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,w=y;return v<w?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var S=m+u,j=y+f;return S>j?Math.max(p,y):Math.max(m,y)}function epe(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 tpe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,y;return u.height>0&&u.width>0&&n?(m=pR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),y=pR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=epe({translateX:m,translateY:y,useTranslate3d:d})):p=Xhe,{cssProperties:p,cssClasses:Jhe({translateX:m,translateY:y,coordinate:n})}}var npe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),kh={isSsr:npe()};function vB(){var[e,t]=b.useState(()=>kh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return b.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 mR(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?mR(Object(n),!0).forEach(function(r){rpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rpe(e,t,n){return(t=ipe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ipe(e){var t=ape(e,"string");return typeof t=="symbol"?t:t+""}function ape(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 spe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function ope(e){var t,n,r,i,a,o,u=vB(),[d,f]=b.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));b.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var j,N,O,_;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(N=e.coordinate)===null||N===void 0?void 0:N.x)!==null&&j!==void 0?j:0,y:(O=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Hc(Hc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=tpe({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:Hc(Hc({transition:spe({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Hc(Hc({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var lpe=b.memo(ope),bB=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function ij(){return ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ij.apply(null,arguments)}function gR(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 yR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(r){cpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cpe(e,t,n){return(t=upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function upe(e){var t=dpe(e,"string");return typeof t=="symbol"?t:t+""}function dpe(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 vR={curveBasisClosed:Sce,curveBasisOpen:jce,curveBasis:wce,curveBumpX:oce,curveBumpY:lce,curveLinearClosed:kce,curveLinear:yv,curveMonotoneX:Nce,curveMonotoneY:Cce,curveNatural:_ce,curveStep:Ace,curveStepAfter:Ece,curveStepBefore:Oce},ny=e=>Je(e.x)&&Je(e.y),bR=e=>e.base!=null&&ny(e.base)&&ny(e),rf=e=>e.x,af=e=>e.y,fpe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(gh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=vR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return vR[n]||yv},xR={connectNulls:!1,type:"linear"},hpe=e=>{var{type:t=xR.type,points:n=[],baseLine:r,layout:i,connectNulls:a=xR.connectNulls}=e,o=fpe(t,i),u=a?n.filter(ny):n;if(Array.isArray(r)){var d,f=n.map((w,S)=>yR(yR({},w),{},{base:r[S]}));i==="vertical"?d=Am().y(af).x1(rf).x0(w=>w.base.x):d=Am().x(rf).y1(af).y0(w=>w.base.y);var p=d.defined(bR).curve(o),m=a?f.filter(bR):f;return p(m)}var y;i==="vertical"&&Le(r)?y=Am().y(af).x1(rf).x0(r):Le(r)?y=Am().x(rf).y1(af).y0(r):y=K$().x(rf).y(af);var v=y.defined(ny).curve(o);return v(u)},og=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Hu();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?hpe(o):r;return b.createElement("path",ij({},Vi(e),iN(e),{className:Et("recharts-curve",t),d:u===null?void 0:u,ref:i}))},ppe=["x","y","top","left","width","height","className"];function aj(){return aj=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},aj.apply(null,arguments)}function wR(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 mpe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){gpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gpe(e,t,n){return(t=ype(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ype(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 bpe(e,t){if(e==null)return{};var n,r,i=xpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xpe(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 wpe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Spe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:u}=e,d=bpe(e,ppe),f=mpe({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Le(t)||!Le(n)||!Le(a)||!Le(o)||!Le(r)||!Le(i)?null:b.createElement("path",aj({},Pr(f),{className:Et("recharts-cross",u),d:wpe(t,n,a,o,r,i)}))};function jpe(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 SR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(r){kpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=Cpe(e,"string");return typeof t=="symbol"?t:t+""}function Cpe(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 _pe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Ape=(e,t,n)=>e.map(r=>"".concat(_pe(r)," ").concat(t,"ms ").concat(n)).join(","),Ope=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Zf=(e,t)=>Object.keys(t).reduce((n,r)=>jR(jR({},n),{},{[r]:e(r,t[r])}),{});function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Epe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Epe(e,t,n){return(t=zpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zpe(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)}var ry=(e,t,n)=>e+(t-e)*n,sj=e=>{var{from:t,to:n}=e;return t!==n},xB=(e,t,n)=>{var r=Zf((i,a)=>{if(sj(a)){var[o,u]=e(a.from,a.to,a.velocity);return Rn(Rn({},a),{},{from:o,velocity:u})}return a},t);return n<1?Zf((i,a)=>sj(a)&&r[i]!=null?Rn(Rn({},a),{},{velocity:ry(a.velocity,r[i].velocity,n),from:ry(a.from,r[i].from,n)}):a,t):xB(e,r,n-1)};function Ppe(e,t,n,r,i,a){var o,u=r.reduce((y,v)=>Rn(Rn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Zf((y,v)=>v.from,u),f=()=>!Object.values(u).filter(sj).length,p=null,m=y=>{o||(o=y);var v=y-o,w=v/n.dt;u=xB(n,u,w),i(Rn(Rn(Rn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function Rpe(e,t,n,r,i,a,o){var u=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Rn(Rn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=Zf((S,j)=>ry(...j,n(y)),d);if(a(Rn(Rn(Rn({},e),t),v)),y<1)u=o.setTimeout(p);else{var w=Zf((S,j)=>ry(...j,n(1)),d);a(Rn(Rn(Rn({},e),t),w))}};return()=>(u=o.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const Dpe=(e,t,n,r,i,a)=>{var o=Ope(e,t);return n==null?()=>(i(Rn(Rn({},e),t)),()=>{}):n.isStepper===!0?Ppe(e,t,n,o,i,a):Rpe(e,t,n,r,o,i,a)};var iy=1e-4,wB=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],SB=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),NR=(e,t)=>n=>{var r=wB(e,t);return SB(r,n)},Mpe=(e,t)=>n=>{var r=wB(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return SB(i,n)},Ipe=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},Lpe=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=Ipe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},$pe=(e,t,n,r)=>{var i=NR(e,n),a=NR(t,r),o=Mpe(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,w=o(m);if(Math.abs(v-p)<iy||w<iy)return a(m);m=u(m-v/w)}return a(m)};return d.isStepper=!1,d},CR=function(){return $pe(...Lpe(...arguments))},Bpe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,u,d)=>{var f=-(o-u)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-u)<iy&&Math.abs(m)<iy?[u,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Upe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return CR(e);case"spring":return Bpe();default:if(e.split("(")[0]==="cubic-bezier")return CR(e)}return typeof e=="function"?e:null};function Fpe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var u=o,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class qpe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Hpe(){return Fpe(new qpe)}var Kpe=b.createContext(Hpe);function Gpe(e,t){var n=b.useContext(Kpe);return b.useMemo(()=>t??n(e),[e,t,n])}var Vpe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},_R={t:0},dS={t:1};function jB(e){var t=gr(e,Vpe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=vB(),m=n==="auto"?!kh.isSsr&&!p:n,y=Gpe(t.animationId,t.animationManager),[v,w]=b.useState(m?_R:dS),S=b.useRef(null);return b.useEffect(()=>{m||w(dS)},[m]),b.useEffect(()=>{if(!m||!r)return qu;var j=Dpe(_R,dS,Upe(a),i,w,y.getTimeoutController()),N=()=>{S.current=j()};return y.start([d,o,N,i,u]),()=>{y.stop(),S.current&&S.current(),u()}},[m,r,i,a,o,d,u,y]),f(v.t)}function kB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(Uf(t)),r=b.useRef(e);return r.current!==e&&(n.current=Uf(t),r.current=e),n.current}var Zpe=["radius"],Ype=["radius"],AR,OR,ER,zR,TR,PR,RR,DR,MR,IR;function LR(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 $R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){Wpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wpe(e,t,n){return(t=Qpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qpe(e){var t=Xpe(e,"string");return typeof t=="symbol"?t:t+""}function Xpe(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 ay(){return ay=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},ay.apply(null,arguments)}function BR(e,t){if(e==null)return{};var n,r,i=Jpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jpe(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 ia(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var UR=(e,t,n,r,i)=>{var a=io(n),o=io(r),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var S,j=(S=i[v])!==null&&S!==void 0?S:0;y[v]=j>u?u:j}m=Zn(AR||(AR=ia(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Zn(OR||(OR=ia(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Zn(ER||(ER=ia(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Zn(zR||(zR=ia(["A ",",",",0,0,",`,
|
|
261
|
-
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Zn(TR||(TR=ia(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Zn(PR||(PR=ia(["A ",",",",0,0,",`,
|
|
262
|
-
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Zn(RR||(RR=ia(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Zn(DR||(DR=ia(["A ",",",",0,0,",`,
|
|
263
|
-
`,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var N=Math.min(u,i);m=Zn(MR||(MR=ia(["M ",",",`
|
|
264
|
-
A `,",",",0,0,",",",",",`
|
|
265
|
-
L `,",",`
|
|
266
|
-
A `,",",",0,0,",",",",",`
|
|
267
|
-
L `,",",`
|
|
268
|
-
A `,",",",0,0,",",",",",`
|
|
269
|
-
L `,",",`
|
|
270
|
-
A `,",",",0,0,",",",","," Z"])),e,t+d*N,N,N,p,e+f*N,t,e+n-f*N,t,N,N,p,e+n,t+d*N,e+n,t+r-d*N,N,N,p,e+n-f*N,t+r,e+f*N,t+r,N,N,p,e,t+r-d*N)}else m=Zn(IR||(IR=ia(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},FR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eme=e=>{var t=gr(e,FR),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:o,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=b.useRef(u),N=b.useRef(d),O=b.useRef(a),_=b.useRef(o),C=b.useMemo(()=>({x:a,y:o,width:u,height:d,radius:f}),[a,o,u,d,f]),T=kB(C,"rectangle-");if(a!==+a||o!==+o||u!==+u||d!==+d||u===0||d===0)return null;var E=Et("recharts-rectangle",p);if(!S){var A=Pr(t),{radius:P}=A,I=BR(A,Zpe);return b.createElement("path",ay({},I,{x:io(a),y:io(o),width:io(u),height:io(d),radius:typeof f=="number"?f:void 0,className:E,d:UR(a,o,u,d,f)}))}var q=j.current,B=N.current,$=O.current,V=_.current,te="0px ".concat(r===-1?1:r,"px"),Y="".concat(r,"px ").concat(r,"px"),H=Ape(["strokeDasharray"],y,typeof m=="string"?m:FR.animationEasing);return b.createElement(jB,{animationId:T,key:T,canBegin:r>0,duration:y,easing:m,isActive:S,begin:v},J=>{var pe=ua(q,u,J),Se=ua(B,d,J),R=ua($,a,J),U=ua(V,o,J);n.current&&(j.current=pe,N.current=Se,O.current=R,_.current=U);var F;w?J>0?F={transition:H,strokeDasharray:Y}:F={strokeDasharray:te}:F={strokeDasharray:Y};var D=Pr(t),{radius:Q}=D,se=BR(D,Ype);return b.createElement("path",ay({},se,{radius:typeof f=="number"?f:void 0,className:E,d:UR(R,U,pe,Se,f),ref:n,style:$R($R({},F),t.style)}))})};function qR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(r){tme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tme(e,t,n){return(t=nme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nme(e){var t=rme(e,"string");return typeof t=="symbol"?t:t+""}function rme(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 sy=Math.PI/180,ime=e=>e*180/Math.PI,Qn=(e,t,n,r)=>({x:e+Math.cos(-sy*r)*n,y:t+Math.sin(-sy*r)*n}),ame=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},sme=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},ome=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=sme({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(n-i)/o,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:o,angle:ime(d),angleInRadian:d}},lme=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},cme=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},ume=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=ome({x:n,y:r},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:d,endAngle:f}=lme(t),p=a,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?HR(HR({},t),{},{radius:i,angle:cme(p,t)}):null};function NB(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Qn(t,n,r,i),u=Qn(t,n,r,a);return{points:[o,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var KR,GR,VR,ZR,YR,WR,QR;function oj(){return oj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oj.apply(null,arguments)}function ml(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dme=(e,t)=>{var n=xi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Mm=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:u,cornerIsExternal:d}=e,f=u*(o?1:-1)+r,p=Math.asin(u/f)/sy,m=d?i:i+a*p,y=Qn(t,n,f,m),v=Qn(t,n,r,m),w=d?i-a*p:i,S=Qn(t,n,f*Math.cos(p*sy),w);return{center:y,circleTangency:v,lineTangency:S,theta:p}},CB=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,u=dme(a,o),d=a+u,f=Qn(t,n,i,a),p=Qn(t,n,i,d),m=Zn(KR||(KR=ml(["M ",",",`
|
|
271
|
-
A `,",",`,0,
|
|
272
|
-
`,",",`,
|
|
273
|
-
`,",",`
|
|
274
|
-
`])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var y=Qn(t,n,r,a),v=Qn(t,n,r,d);m+=Zn(GR||(GR=ml(["L ",",",`
|
|
275
|
-
A `,",",`,0,
|
|
276
|
-
`,",",`,
|
|
277
|
-
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),y.x,y.y)}else m+=Zn(VR||(VR=ml(["L ",","," Z"])),t,n);return m},fme=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=xi(f-d),{circleTangency:m,lineTangency:y,theta:v}=Mm({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=Mm({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:u}),N=u?Math.abs(d-f):Math.abs(d-f)-v-j;if(N<0)return o?Zn(ZR||(ZR=ml(["M ",",",`
|
|
278
|
-
a`,",",",0,0,1,",`,0
|
|
279
|
-
a`,",",",0,0,1,",`,0
|
|
280
|
-
`])),y.x,y.y,a,a,a*2,a,a,-a*2):CB({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=Zn(YR||(YR=ml(["M ",",",`
|
|
281
|
-
A`,",",",0,0,",",",",",`
|
|
282
|
-
A`,",",",0,",",",",",",",`
|
|
283
|
-
A`,",",",0,0,",",",",",`
|
|
284
|
-
`])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(N>180),+(p<0),w.x,w.y,a,a,+(p<0),S.x,S.y);if(r>0){var{circleTangency:_,lineTangency:C,theta:T}=Mm({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:E,lineTangency:A,theta:P}=Mm({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),I=u?Math.abs(d-f):Math.abs(d-f)-T-P;if(I<0&&a===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=Zn(WR||(WR=ml(["L",",",`
|
|
285
|
-
A`,",",",0,0,",",",",",`
|
|
286
|
-
A`,",",",0,",",",",",",",`
|
|
287
|
-
A`,",",",0,0,",",",",","Z"])),A.x,A.y,a,a,+(p<0),E.x,E.y,r,r,+(I>180),+(p>0),_.x,_.y,a,a,+(p<0),C.x,C.y)}else O+=Zn(QR||(QR=ml(["L",",","Z"])),t,n);return O},hme={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pme=e=>{var t=gr(e,hme),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Et("recharts-sector",m),v=a-i,w=bo(o,v,0,!0),S;return w>0&&Math.abs(f-p)<360?S=fme({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):S=CB({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),b.createElement("path",oj({},Pr(t),{className:y,d:S}))};function mme(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(o3(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:u}=t,d=Qn(r,i,a,u),f=Qn(r,i,o,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return NB(t)}}var fS={},hS={},pS={},XR;function gme(){return XR||(XR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w3();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(pS)),pS}var JR;function yme(){return JR||(JR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gme();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})(hS)),hS}var eD;function vme(){return eD||(eD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S3(),n=yme();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const u=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=o;return d}e.range=r})(fS)),fS}var mS,tD;function bme(){return tD||(tD=1,mS=vme().range),mS}var xme=bme();const _B=ka(xme);var Ji=e=>e.chartData,xN=ce([Ji],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Iv=(e,t,n,r)=>r?xN(e):Ji(e),wme=(e,t,n)=>n?xN(e):Ji(e),Sme=ce([Iv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});ce([xN],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var jme=ce([Ji],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ma(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Je(t)&&Je(n))return!0}return!1}function nD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function AB(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Je(n))i=n;else if(typeof n=="function")return;if(Je(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ma(o))return o}}function kme(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ma(r))return nD(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,u;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Le(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&KP.test(i)){var d=KP.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Le(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&GP.test(a)){var p=GP.exec(a);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t?.[1];var y=[o,u];if(ma(y))return t==null?y:nD(y,t,n)}}}var Ku=1e9,Nme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},SN,rn=!0,Ai="[DecimalError] ",Nl=Ai+"Invalid argument: ",wN=Ai+"Exponent out of range: ",Gu=Math.floor,ll=Math.pow,Cme=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vr,Ln=1e7,Qt=7,OB=9007199254740991,oy=Gu(OB/Qt),Pe={};Pe.absoluteValue=Pe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Pe.comparedTo=Pe.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Qt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Pe.dividedBy=Pe.div=function(e){return as(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return Bt(as(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return On(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Vr))throw Error(Ai+"NaN");if(n.s<1)throw Error(Ai+(n.s?"NaN":"-Infinity"));return n.eq(Vr)?new r(0):(rn=!1,t=as(Yf(n,a),Yf(e,a),a),rn=!0,Bt(t,i))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?TB(t,e):EB(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ai+"NaN");return n.s?(rn=!1,t=as(n,e,0,1).times(e),rn=!0,n.minus(t)):Bt(new r(n),i)};Pe.naturalExponential=Pe.exp=function(){return zB(this)};Pe.naturalLogarithm=Pe.ln=function(){return Yf(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?EB(t,e):TB(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Nl+e);if(t=On(i)+1,r=i.d.length-1,n=r*Qt+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};Pe.squareRoot=Pe.sqrt=function(){var e,t,n,r,i,a,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Ai+"NaN")}for(e=On(u),rn=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=pa(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Gu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=o=n+3;;)if(a=r,r=a.plus(as(u,a,o+2)).times(.5),pa(a.d).slice(0,o)===(t=pa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Bt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;o+=4}return rn=!0,Bt(r,n)};Pe.times=Pe.mul=function(e){var t,n,r,i,a,o,u,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*y[i-r-1]+t,a[i--]=u%Ln|0,t=u/Ln|0;a[i]=(a[i]+t)%Ln|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,rn?Bt(e,m.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Sa(e,0,Ku),t===void 0?t=r.rounding:Sa(t,0,8),Bt(n,e+On(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=$l(r,!0):(Sa(e,0,Ku),t===void 0?t=i.rounding:Sa(t,0,8),r=Bt(new i(r),e+1,t),n=$l(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?$l(i):(Sa(e,0,Ku),t===void 0?t=a.rounding:Sa(t,0,8),r=Bt(new a(i),e+On(i)+1,t),n=$l(r.abs(),!1,e+On(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return Bt(new t(e),On(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,n,r,i,a,o,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Vr);if(u=new d(u),!u.s){if(e.s<1)throw Error(Ai+"Infinity");return u}if(u.eq(Vr))return u;if(r=d.precision,e.eq(Vr))return Bt(u,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=u.s,o){if((n=p<0?-p:p)<=OB){for(i=new d(Vr),t=Math.ceil(r/Qt+4),rn=!1;n%2&&(i=i.times(u),iD(i.d,t)),n=Gu(n/2),n!==0;)u=u.times(u),iD(u.d,t);return rn=!0,e.s<0?new d(Vr).div(i):Bt(i,r)}}else if(a<0)throw Error(Ai+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,rn=!1,i=e.times(Yf(u,r+f)),rn=!0,i=zB(i),i.s=a,i};Pe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=On(i),r=$l(i,n<=a.toExpNeg||n>=a.toExpPos)):(Sa(e,1,Ku),t===void 0?t=a.rounding:Sa(t,0,8),i=Bt(new a(i),e,t),n=On(i),r=$l(i,e<=n||n<=a.toExpNeg,e)),r};Pe.toSignificantDigits=Pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Sa(e,1,Ku),t===void 0?t=r.rounding:Sa(t,0,8)),Bt(new r(n),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=On(e),n=e.constructor;return $l(e,t<=n.toExpNeg||t>=n.toExpPos)};function EB(e,t){var n,r,i,a,o,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),rn?Bt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=o,u=d.length),o=Math.ceil(m/Qt),u=o>u?o+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Ln|0,d[a]%=Ln;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,rn?Bt(t,m):t}function Sa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Nl+e)}function pa(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=Qt-r.length,n&&(a+=Qs(n)),a+=r;o=e[t],r=o+"",n=Qt-r.length,n&&(a+=Qs(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var as=(function(){function e(r,i){var a,o=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+o,r[u]=a%Ln|0,o=a/Ln|0;return o&&r.unshift(o),r}function t(r,i,a,o){var u,d;if(a!=o)d=a>o?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Ln+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var u,d,f,p,m,y,v,w,S,j,N,O,_,C,T,E,A,P,I=r.constructor,q=r.s==i.s?1:-1,B=r.d,$=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(Ai+"Division by zero");for(d=r.e-i.e,A=$.length,T=B.length,v=new I(q),w=v.d=[],f=0;$[f]==(B[f]||0);)++f;if($[f]>(B[f]||0)&&--d,a==null?O=a=I.precision:o?O=a+(On(r)-On(i))+1:O=a,O<0)return new I(0);if(O=O/Qt+2|0,f=0,A==1)for(p=0,$=$[0],O++;(f<T||p)&&O--;f++)_=p*Ln+(B[f]||0),w[f]=_/$|0,p=_%$|0;else{for(p=Ln/($[0]+1)|0,p>1&&($=e($,p),B=e(B,p),A=$.length,T=B.length),C=A,S=B.slice(0,A),j=S.length;j<A;)S[j++]=0;P=$.slice(),P.unshift(0),E=$[0],$[1]>=Ln/2&&++E;do p=0,u=t($,S,A,j),u<0?(N=S[0],A!=j&&(N=N*Ln+(S[1]||0)),p=N/E|0,p>1?(p>=Ln&&(p=Ln-1),m=e($,p),y=m.length,j=S.length,u=t(m,S,y,j),u==1&&(p--,n(m,A<y?P:$,y))):(p==0&&(u=p=1),m=$.slice()),y=m.length,y<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t($,S,A,j),u<1&&(p++,n(S,A<j?P:$,j))),j=S.length):u===0&&(p++,S=[0]),w[f++]=p,u&&S[0]?S[j++]=B[C]||0:(S=[B[C]],j=1);while((C++<T||S[0]!==void 0)&&O--)}return w[0]||w.shift(),v.e=d,Bt(v,o?a+On(v)+1:a)}})();function zB(e,t){var n,r,i,a,o,u,d=0,f=0,p=e.constructor,m=p.precision;if(On(e)>16)throw Error(wN+On(e));if(!e.s)return new p(Vr);for(rn=!1,u=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(ll(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(Vr),p.precision=u;;){if(i=Bt(i.times(e),u),n=n.times(++d),o=a.plus(as(i,n,u)),pa(o.d).slice(0,u)===pa(a.d).slice(0,u)){for(;f--;)a=Bt(a.times(a),u);return p.precision=m,t==null?(rn=!0,Bt(a,m)):a}a=o}}function On(e){for(var t=e.e*Qt,n=e.d[0];n>=10;n/=10)t++;return t}function gS(e,t,n){if(t>e.LN10.sd())throw rn=!0,n&&(e.precision=n),Error(Ai+"LN10 precision limit exceeded");return Bt(new e(e.LN10),t)}function Qs(e){for(var t="";e--;)t+="0";return t}function Yf(e,t){var n,r,i,a,o,u,d,f,p,m=1,y=10,v=e,w=v.d,S=v.constructor,j=S.precision;if(v.s<1)throw Error(Ai+(v.s?"NaN":"-Infinity"));if(v.eq(Vr))return new S(0);if(t==null?(rn=!1,f=j):f=t,v.eq(10))return t==null&&(rn=!0),gS(S,f);if(f+=y,S.precision=f,n=pa(w),r=n.charAt(0),a=On(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=pa(v.d),r=n.charAt(0),m++;a=On(v),r>1?(v=new S("0."+n),a++):v=new S(r+"."+n.slice(1))}else return d=gS(S,f+2,j).times(a+""),v=Yf(new S(r+"."+n.slice(1)),f-y).plus(d),S.precision=j,t==null?(rn=!0,Bt(v,j)):v;for(u=o=v=as(v.minus(Vr),v.plus(Vr),f),p=Bt(v.times(v),f),i=3;;){if(o=Bt(o.times(p),f),d=u.plus(as(o,new S(i),f)),pa(d.d).slice(0,f)===pa(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(gS(S,f+2,j).times(a+""))),u=as(u,new S(m),f),S.precision=j,t==null?(rn=!0,Bt(u,j)):u;u=d,i+=2}}function rD(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=Gu(n/Qt),e.d=[],r=(n+1)%Qt,n<0&&(r+=Qt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Qt;r<i;)e.d.push(+t.slice(r,r+=Qt));t=t.slice(r),r=Qt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),rn&&(e.e>oy||e.e<-oy))throw Error(wN+n)}else e.s=0,e.e=0,e.d=[0];return e}function Bt(e,t,n){var r,i,a,o,u,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Qt,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/Qt),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=Qt,i=r-Qt+o}if(n!==void 0&&(a=ll(10,o-i-1),u=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?f/ll(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=On(e),m.length=1,t=t-a-1,m[0]=ll(10,(Qt-t%Qt)%Qt),e.e=Gu(-t/Qt)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=ll(10,Qt-r),m[p]=i>0?(f/ll(10,o-i)%ll(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Ln&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Ln)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(rn&&(e.e>oy||e.e<-oy))throw Error(wN+On(e));return e}function TB(e,t){var n,r,i,a,o,u,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),rn?Bt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/Qt),u)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}o=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Ln-1;--d[a],d[i]+=Ln}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,rn?Bt(t,v):t):new y(0)}function $l(e,t,n){var r,i=On(e),a=pa(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Qs(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Qs(-i-1)+a,n&&(r=n-o)>0&&(a+=Qs(r))):i>=o?(a+=Qs(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Qs(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Qs(r))),e.s<0?"-"+a:a}function iD(e,t){if(e.length>t)return e.length=t,!0}function PB(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Nl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return rD(o,a.toString())}else if(typeof a!="string")throw Error(Nl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Cme.test(a))rD(o,a);else throw Error(Nl+a)}if(i.prototype=Pe,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=PB,i.config=i.set=_me,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 _me(e){if(!e||typeof e!="object")throw Error(Ai+"Object expected");var t,n,r,i=["precision",1,Ku,"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(Gu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Nl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Nl+n+": "+r);return this}var SN=PB(Nme);Vr=new SN(1);const yt=SN;function RB(e){var t;return e===0?t=1:t=Math.floor(new yt(e).abs().log(10).toNumber())+1,t}function DB(e,t,n){for(var r=new yt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var MB=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},jN=(e,t,n)=>{if(e.lte(0))return new yt(0);var r=RB(e.toNumber()),i=new yt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,u=new yt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=u.mul(i);return t?new yt(d.toNumber()):new yt(Math.ceil(d.toNumber()))},IB=(e,t,n)=>{var r;if(e.lte(0))return new yt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new yt(a).abs().log(10).toNumber()),u=new yt(10).pow(o),d=e.div(u).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,u=u.mul(new yt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new yt(m).mul(u);return t?y:new yt(Math.ceil(y.toNumber()))},Ame=(e,t,n)=>{var r=new yt(1),i=new yt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new yt(10).pow(RB(e)-1),i=new yt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new yt(Math.floor(e)))}else e===0?i=new yt(Math.floor((t-1)/2)):n||(i=new yt(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new yt(d-o).mul(r)).toNumber());return u},LB=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:jN;if(!Number.isFinite((n-t)/(r-1)))return{step:new yt(0),tickMin:new yt(0),tickMax:new yt(0)};var u=o(new yt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new yt(0):(d=new yt(t).add(n).div(2),d=d.sub(new yt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new yt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?LB(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new yt(f).mul(u)),tickMax:d.add(new yt(p).mul(u))})},aD=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=MB([n,r]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?p.reverse():p}if(d===f)return Ame(d,i,a);var m=o==="snap125"?IB:jN,{step:y,tickMin:v,tickMax:w}=LB(d,f,u,a,0,m),S=DB(v,w.add(new yt(.1).mul(y)),y);return n>r?S.reverse():S},sD=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=MB([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=o==="snap125"?IB:jN,p=Math.max(n,2),m=f(new yt(d).sub(u).div(p-1),a,0),y=[...DB(new yt(u),new yt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},Ome=e=>e.rootProps.barCategoryGap,Lv=e=>e.rootProps.stackOffset,$B=e=>e.rootProps.reverseStackOrder,kN=e=>e.options.chartName,NN=e=>e.rootProps.syncId,BB=e=>e.rootProps.syncMethod,CN=e=>e.options.eventEmitter,Eme=e=>e.rootProps.baseValue,ar={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},el={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},aa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},$v=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Bv(e,t,n){if(n!=="auto")return n;if(e!=null)return Na(e,t)?"category":"number"}function oD(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 ly(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oD(Object(n),!0).forEach(function(r){zme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zme(e,t,n){return(t=Tme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tme(e){var t=Pme(e,"string");return typeof t=="symbol"?t:t+""}function Pme(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 lD={allowDataOverflow:el.allowDataOverflow,allowDecimals:el.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:el.angleAxisId,includeHidden:!1,name:void 0,reversed:el.reversed,scale:el.scale,tick:el.tick,tickCount:void 0,ticks:void 0,type:el.type,unit:void 0,niceTicks:"auto"},cD={allowDataOverflow:aa.allowDataOverflow,allowDecimals:aa.allowDecimals,allowDuplicatedCategory:aa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:aa.radiusAxisId,includeHidden:aa.includeHidden,name:void 0,reversed:aa.reversed,scale:aa.scale,tick:aa.tick,tickCount:aa.tickCount,ticks:void 0,type:aa.type,unit:void 0,niceTicks:"auto"},Rme=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},_N=ce([Rme,uB],(e,t)=>{var n;if(e!=null)return e;var r=(n=Bv(t,"angleAxis",lD.type))!==null&&n!==void 0?n:"category";return ly(ly({},lD),{},{type:r})}),Dme=(e,t)=>e.polarAxis.radiusAxis[t],AN=ce([Dme,uB],(e,t)=>{var n;if(e!=null)return e;var r=(n=Bv(t,"radiusAxis",cD.type))!==null&&n!==void 0?n:"category";return ly(ly({},cD),{},{type:r})}),Uv=e=>e.polarOptions,ON=ce([hs,ps,Jn],ame),UB=ce([Uv,ON],(e,t)=>{if(e!=null)return bo(e.innerRadius,t,0)}),FB=ce([Uv,ON],(e,t)=>{if(e!=null)return bo(e.outerRadius,t,t*.8)}),Mme=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},qB=ce([Uv],Mme);ce([_N,qB],$v);var HB=ce([ON,UB,FB],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ce([AN,HB],$v);var KB=ce([sn,Uv,UB,FB,hs,ps],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:u,startAngle:d,endAngle:f}=t;return{cx:bo(o,i,i/2),cy:bo(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Bn=(e,t)=>t,Fv=(e,t,n)=>n;function EN(e){return e?.id}function GB(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=EN(u);f.forEach((m,y)=>{var v=a==null||i?y:String($n(m,a,null)),w=$n(m,u.dataKey,0),S;o.has(v)?S=o.get(v):S={},Object.assign(S,{[p]:w}),o.set(v,S)})}}),Array.from(o.values())}function zN(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var qv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Hv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ime(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Un=e=>{var t=sn(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Vu=e=>e.tooltip.settings.axisId;function TN(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var Lme=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ma(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Je(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function ho(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $me(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function PN(e){let t,n,r;e.length!==2?(t=ho,n=(u,d)=>ho(e(u),d),r=(u,d)=>e(u)-d):(t=e===ho||e===$me?e:Bme,n=e,r=e);function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function o(u,d,f=0,p=u.length){const m=i(u,d,f,p-1);return m>f&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:o,right:a}}function Bme(){return 0}function VB(e){return e===null?NaN:+e}function*Ume(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Fme=PN(ho),Nh=Fme.right;PN(VB).center;class uD extends Map{constructor(t,n=Kme){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(dD(this,t))}has(t){return super.has(dD(this,t))}set(t,n){return super.set(qme(this,t),n)}delete(t){return super.delete(Hme(this,t))}}function dD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function qme({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Hme({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Kme(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Gme(e=ho){if(e===ho)return ZB;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 ZB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Vme=Math.sqrt(50),Zme=Math.sqrt(10),Yme=Math.sqrt(2);function cy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Vme?10:a>=Zme?5:a>=Yme?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/o,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*o,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?cy(e,t,n*2):[u,d,f]}function lj(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?cy(t,e,n):cy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(o<0)for(let f=0;f<u;++f)d[f]=(a-f)/-o;else for(let f=0;f<u;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<u;++f)d[f]=(i+f)/-o;else for(let f=0;f<u;++f)d[f]=(i+f)*o;return d}function cj(e,t,n){return t=+t,e=+e,n=+n,cy(e,t,n)[2]}function uj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?cj(t,e,n):cj(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function fD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function hD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function YB(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?ZB:Gme(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),w=Math.min(r,Math.floor(t+(d-f)*m/d+y));YB(e,t,v,w,i)}const a=e[t];let o=n,u=r;for(sf(e,n,t),i(e[r],a)>0&&sf(e,n,r);o<u;){for(sf(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?sf(e,n,u):(++u,sf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function sf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wme(e,t,n){if(e=Float64Array.from(Ume(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return hD(e);if(t>=1)return fD(e);var r,i=(r-1)*t,a=Math.floor(i),o=fD(YB(e,a).subarray(0,a+1)),u=hD(e.subarray(a+1));return o+(u-o)*(i-a)}}function Qme(e,t,n=VB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function Xme(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Ti(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ms(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 dj=Symbol("implicit");function RN(){var e=new uD,t=[],n=[],r=dj;function i(a){let o=e.get(a);if(o===void 0){if(r!==dj)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new uD;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return RN(t,n).unknown(r)},Ti.apply(i,arguments),i}function DN(){var e=RN().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,w=v?i:r,S=v?r:i;a=(S-w)/Math.max(1,y-d+f*2),u&&(a=Math.floor(a)),w+=(S-w-a*(y-d))*p,o=a*(1-d),u&&(w=Math.round(w),o=Math.round(o));var j=Xme(y).map(function(N){return w+a*N});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(u=!!y,m()):u},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return DN(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Ti.apply(m(),arguments)}function WB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return WB(t())},e}function Jme(){return WB(DN.apply(null,arguments).paddingInner(1))}function MN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function QB(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ch(){}var Wf=.7,uy=1/Wf,mu="\\s*([+-]?\\d+)\\s*",Qf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ege=/^#([0-9a-f]{3,8})$/,tge=new RegExp(`^rgb\\(${mu},${mu},${mu}\\)$`),nge=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),rge=new RegExp(`^rgba\\(${mu},${mu},${mu},${Qf}\\)$`),ige=new RegExp(`^rgba\\(${ga},${ga},${ga},${Qf}\\)$`),age=new RegExp(`^hsl\\(${Qf},${ga},${ga}\\)$`),sge=new RegExp(`^hsla\\(${Qf},${ga},${ga},${Qf}\\)$`),pD={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};MN(Ch,Xf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mD,formatHex:mD,formatHex8:oge,formatHsl:lge,formatRgb:gD,toString:gD});function mD(){return this.rgb().formatHex()}function oge(){return this.rgb().formatHex8()}function lge(){return XB(this).formatHsl()}function gD(){return this.rgb().formatRgb()}function Xf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ege.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yD(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Im(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Im(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=tge.exec(e))?new Er(t[1],t[2],t[3],1):(t=nge.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rge.exec(e))?Im(t[1],t[2],t[3],t[4]):(t=ige.exec(e))?Im(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=age.exec(e))?xD(t[1],t[2]/100,t[3]/100,1):(t=sge.exec(e))?xD(t[1],t[2]/100,t[3]/100,t[4]):pD.hasOwnProperty(e)?yD(pD[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function yD(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Im(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function cge(e){return e instanceof Ch||(e=Xf(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function fj(e,t,n,r){return arguments.length===1?cge(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}MN(Er,fj,QB(Ch,{brighter(e){return e=e==null?uy:Math.pow(uy,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wf:Math.pow(Wf,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(Cl(this.r),Cl(this.g),Cl(this.b),dy(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:vD,formatHex:vD,formatHex8:uge,formatRgb:bD,toString:bD}));function vD(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function uge(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function bD(){const e=dy(this.opacity);return`${e===1?"rgb(":"rgba("}${Cl(this.r)}, ${Cl(this.g)}, ${Cl(this.b)}${e===1?")":`, ${e})`}`}function dy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gl(e){return e=Cl(e),(e<16?"0":"")+e.toString(16)}function xD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Gi(e,t,n,r)}function XB(e){if(e instanceof Gi)return new Gi(e.h,e.s,e.l,e.opacity);if(e instanceof Ch||(e=Xf(e)),!e)return new Gi;if(e instanceof Gi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,u=a-i,d=(a+i)/2;return u?(t===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-t)/u+2:o=(t-n)/u+4,u/=d<.5?a+i:2-a-i,o*=60):u=d>0&&d<1?0:o,new Gi(o,u,d,e.opacity)}function dge(e,t,n,r){return arguments.length===1?XB(e):new Gi(e,t,n,r??1)}function Gi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}MN(Gi,dge,QB(Ch,{brighter(e){return e=e==null?uy:Math.pow(uy,e),new Gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wf:Math.pow(Wf,e),new Gi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Er(yS(e>=240?e-240:e+120,i,r),yS(e,i,r),yS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Gi(wD(this.h),Lm(this.s),Lm(this.l),dy(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=dy(this.opacity);return`${e===1?"hsl(":"hsla("}${wD(this.h)}, ${Lm(this.s)*100}%, ${Lm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wD(e){return e=(e||0)%360,e<0?e+360:e}function Lm(e){return Math.max(0,Math.min(1,e||0))}function yS(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 IN=e=>()=>e;function fge(e,t){return function(n){return e+n*t}}function hge(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 pge(e){return(e=+e)==1?JB:function(t,n){return n-t?hge(t,n,e):IN(isNaN(t)?n:t)}}function JB(e,t){var n=t-e;return n?fge(e,n):IN(isNaN(e)?t:e)}const SD=(function e(t){var n=pge(t);function r(i,a){var o=n((i=fj(i)).r,(a=fj(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=JB(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function mge(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function gge(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yge(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Zu(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function vge(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function fy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bge(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]=Zu(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var hj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vS=new RegExp(hj.source,"g");function xge(e){return function(){return e}}function wge(e){return function(t){return e(t)+""}}function Sge(e,t){var n=hj.lastIndex=vS.lastIndex=0,r,i,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(r=hj.exec(e))&&(i=vS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,d.push({i:o,x:fy(r,i)})),n=vS.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?wge(d[0].x):xge(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function Zu(e,t){var n=typeof t,r;return t==null||n==="boolean"?IN(t):(n==="number"?fy:n==="string"?(r=Xf(t))?(t=r,SD):Sge:t instanceof Xf?SD:t instanceof Date?vge:gge(t)?mge:Array.isArray(t)?yge:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bge:fy)(e,t)}function LN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jge(e,t){t===void 0&&(t=e,e=Zu);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var u=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[u](o-u)}}function kge(e){return function(){return e}}function hy(e){return+e}var jD=[0,1];function fr(e){return e}function pj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kge(isNaN(t)?NaN:.5)}function Nge(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Cge(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=pj(i,r),a=n(o,a)):(r=pj(r,i),a=n(a,o)),function(u){return a(r(u))}}function _ge(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=pj(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(u){var d=Nh(e,u,1,r)-1;return a[d](i[d](u))}}function _h(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kv(){var e=jD,t=jD,n=Zu,r,i,a,o=fr,u,d,f;function p(){var y=Math.min(e.length,t.length);return o!==fr&&(o=Nge(e[0],e[y-1])),u=y>2?_ge:Cge,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=u(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=u(t,e.map(r),fy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,hy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=LN,p()},m.clamp=function(y){return arguments.length?(o=y?!0:fr,p()):o!==fr},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function $N(){return Kv()(fr,fr)}function Age(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function py(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 _u(e){return e=py(Math.abs(e)),e?e[1]:NaN}function Oge(e,t){return function(n,r){for(var i=n.length,a=[],o=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Ege(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zge=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jf(e){if(!(t=zge.exec(e)))throw new Error("invalid format: "+e);var t;return new BN({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]})}Jf.prototype=BN.prototype;function BN(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+""}BN.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 Tge(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 my;function Pge(e,t){var n=py(e,t);if(!n)return my=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(my=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+py(e,Math.max(0,t+a-1))[0]}function kD(e,t){var n=py(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 ND={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Age,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)=>kD(e*100,t),r:kD,s:Pge,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function CD(e){return e}var _D=Array.prototype.map,AD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rge(e){var t=e.grouping===void 0||e.thousands===void 0?CD:Oge(_D.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?CD:Ege(_D.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Jf(m);var v=m.fill,w=m.align,S=m.sign,j=m.symbol,N=m.zero,O=m.width,_=m.comma,C=m.precision,T=m.trim,E=m.type;E==="n"?(_=!0,E="g"):ND[E]||(C===void 0&&(C=12),T=!0,E="g"),(N||v==="0"&&w==="=")&&(N=!0,v="0",w="=");var A=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),P=(j==="$"?r:/[%p]/.test(E)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),I=ND[E],q=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function B($){var V=A,te=P,Y,H,J;if(E==="c")te=I($)+te,$="";else{$=+$;var pe=$<0||1/$<0;if($=isNaN($)?d:I(Math.abs($),C),T&&($=Tge($)),pe&&+$==0&&S!=="+"&&(pe=!1),V=(pe?S==="("?S:u:S==="-"||S==="("?"":S)+V,te=(E==="s"&&!isNaN($)&&my!==void 0?AD[8+my/3]:"")+te+(pe&&S==="("?")":""),q){for(Y=-1,H=$.length;++Y<H;)if(J=$.charCodeAt(Y),48>J||J>57){te=(J===46?i+$.slice(Y+1):$.slice(Y))+te,$=$.slice(0,Y);break}}}_&&!N&&($=t($,1/0));var Se=V.length+$.length+te.length,R=Se<O?new Array(O-Se+1).join(v):"";switch(_&&N&&($=t(R+$,R.length?O-te.length:1/0),R=""),w){case"<":$=V+$+te+R;break;case"=":$=V+R+$+te;break;case"^":$=R.slice(0,Se=R.length>>1)+V+$+te+R.slice(Se);break;default:$=R+V+$+te;break}return a($)}return B.toString=function(){return m+""},B}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(_u(y)/3)))*3,w=Math.pow(10,-v),S=f((m=Jf(m),m.type="f",m),{suffix:AD[8+v/3]});return function(j){return S(w*j)}}return{format:f,formatPrefix:p}}var $m,UN,e6;Dge({thousands:",",grouping:[3],currency:["$",""]});function Dge(e){return $m=Rge(e),UN=$m.format,e6=$m.formatPrefix,$m}function Mge(e){return Math.max(0,-_u(Math.abs(e)))}function Ige(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_u(t)/3)))*3-_u(Math.abs(e)))}function Lge(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_u(t)-_u(e))+1}function t6(e,t,n,r){var i=uj(e,t,n),a;switch(r=Jf(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ige(i,o))&&(r.precision=a),e6(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Lge(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Mge(i))&&(r.precision=a-(r.type==="%")*2);break}}return UN(r)}function _o(e){var t=e.domain;return e.ticks=function(n){var r=t();return lj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return t6(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],u=r[a],d,f,p=10;for(u<o&&(f=o,o=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=cj(o,u,n),f===d)return r[i]=o,r[a]=u,t(r);if(f>0)o=Math.floor(o/f)*f,u=Math.ceil(u/f)*f;else if(f<0)o=Math.ceil(o*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function n6(){var e=$N();return e.copy=function(){return _h(e,n6())},Ti.apply(e,arguments),_o(e)}function r6(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,hy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return r6(e).unknown(t)},e=arguments.length?Array.from(e,hy):[0,1],_o(n)}function i6(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function OD(e){return Math.log(e)}function ED(e){return Math.exp(e)}function $ge(e){return-Math.log(-e)}function Bge(e){return-Math.exp(-e)}function Uge(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Fge(e){return e===10?Uge:e===Math.E?Math.exp:t=>Math.pow(e,t)}function qge(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 zD(e){return(t,n)=>-e(-t,n)}function FN(e){const t=e(OD,ED),n=t.domain;let r=10,i,a;function o(){return i=qge(r),a=Fge(r),n()[0]<0?(i=zD(i),a=zD(a),e($ge,Bge)):e(OD,ED),t}return t.base=function(u){return arguments.length?(r=+u,o()):r},t.domain=function(u){return arguments.length?(n(u),o()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let y=i(f),v=i(p),w,S;const j=u==null?10:+u;let N=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(w=1;w<r;++w)if(S=y<0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;N.push(S)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(S=y>0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;N.push(S)}N.length*2<j&&(N=lj(f,p,j))}else N=lj(y,v,Math.min(v-y,j)).map(a);return m?N.reverse():N},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Jf(d)).precision==null&&(d.trim=!0),d=UN(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(i6(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function a6(){const e=FN(Kv()).domain([1,10]);return e.copy=()=>_h(e,a6()).base(e.base()),Ti.apply(e,arguments),e}function TD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function PD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function qN(e){var t=1,n=e(TD(t),PD(t));return n.constant=function(r){return arguments.length?e(TD(t=+r),PD(t)):t},_o(n)}function s6(){var e=qN(Kv());return e.copy=function(){return _h(e,s6()).constant(e.constant())},Ti.apply(e,arguments)}function RD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Hge(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Kge(e){return e<0?-e*e:e*e}function HN(e){var t=e(fr,fr),n=1;function r(){return n===1?e(fr,fr):n===.5?e(Hge,Kge):e(RD(n),RD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},_o(t)}function KN(){var e=HN(Kv());return e.copy=function(){return _h(e,KN()).exponent(e.exponent())},Ti.apply(e,arguments),e}function Gge(){return KN.apply(null,arguments).exponent(.5)}function DD(e){return Math.sign(e)*e*e}function Vge(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function o6(){var e=$N(),t=[0,1],n=!1,r;function i(a){var o=Vge(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(DD(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,hy)).map(DD)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return o6(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ti.apply(i,arguments),_o(i)}function l6(){var e=[],t=[],n=[],r;function i(){var o=0,u=Math.max(1,t.length);for(n=new Array(u-1);++o<u;)n[o-1]=Qme(e,o/u);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Nh(n,o)]}return a.invertExtent=function(o){var u=t.indexOf(o);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let u of o)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(ho),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return l6().domain(e).range(t).unknown(r)},Ti.apply(a,arguments)}function c6(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[Nh(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return c6().domain([e,t]).range(i).unknown(a)},Ti.apply(_o(o),arguments)}function u6(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Nh(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return u6().domain(e).range(t).unknown(n)},Ti.apply(i,arguments)}const bS=new Date,xS=new Date;function Dn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<o);return d},i.filter=a=>Dn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(bS.setTime(+a),xS.setTime(+o),e(bS),e(xS),Math.floor(n(bS,xS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const gy=Dn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Dn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):gy);gy.range;const ts=1e3,Si=ts*60,ns=Si*60,ls=ns*24,GN=ls*7,MD=ls*30,wS=ls*365,yl=Dn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ts)},(e,t)=>(t-e)/ts,e=>e.getUTCSeconds());yl.range;const VN=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ts)},(e,t)=>{e.setTime(+e+t*Si)},(e,t)=>(t-e)/Si,e=>e.getMinutes());VN.range;const ZN=Dn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Si)},(e,t)=>(t-e)/Si,e=>e.getUTCMinutes());ZN.range;const YN=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ts-e.getMinutes()*Si)},(e,t)=>{e.setTime(+e+t*ns)},(e,t)=>(t-e)/ns,e=>e.getHours());YN.range;const WN=Dn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ns)},(e,t)=>(t-e)/ns,e=>e.getUTCHours());WN.range;const Ah=Dn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Si)/ls,e=>e.getDate()-1);Ah.range;const Gv=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ls,e=>e.getUTCDate()-1);Gv.range;const d6=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ls,e=>Math.floor(e/ls));d6.range;function Ql(e){return Dn(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())*Si)/GN)}const Vv=Ql(0),yy=Ql(1),Zge=Ql(2),Yge=Ql(3),Au=Ql(4),Wge=Ql(5),Qge=Ql(6);Vv.range;yy.range;Zge.range;Yge.range;Au.range;Wge.range;Qge.range;function Xl(e){return Dn(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)/GN)}const Zv=Xl(0),vy=Xl(1),Xge=Xl(2),Jge=Xl(3),Ou=Xl(4),eye=Xl(5),tye=Xl(6);Zv.range;vy.range;Xge.range;Jge.range;Ou.range;eye.range;tye.range;const QN=Dn(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());QN.range;const XN=Dn(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());XN.range;const cs=Dn(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());cs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(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)});cs.range;const us=Dn(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());us.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(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)});us.range;function f6(e,t,n,r,i,a){const o=[[yl,1,ts],[yl,5,5*ts],[yl,15,15*ts],[yl,30,30*ts],[a,1,Si],[a,5,5*Si],[a,15,15*Si],[a,30,30*Si],[i,1,ns],[i,3,3*ns],[i,6,6*ns],[i,12,12*ns],[r,1,ls],[r,2,2*ls],[n,1,GN],[t,1,MD],[t,3,3*MD],[e,1,wS]];function u(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return y?w.reverse():w}function d(f,p,m){const y=Math.abs(p-f)/m,v=PN(([,,j])=>j).right(o,y);if(v===o.length)return e.every(uj(f/wS,p/wS,m));if(v===0)return gy.every(Math.max(uj(f,p,m),1));const[w,S]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return w.every(S)}return[u,d]}const[nye,rye]=f6(us,XN,Zv,d6,WN,ZN),[iye,aye]=f6(cs,QN,Vv,Ah,YN,VN);function SS(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 jS(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 of(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sye(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,u=e.months,d=e.shortMonths,f=lf(i),p=cf(i),m=lf(a),y=cf(a),v=lf(o),w=cf(o),S=lf(u),j=cf(u),N=lf(d),O=cf(d),_={a:J,A:pe,b:Se,B:R,c:null,d:FD,e:FD,f:Oye,g:$ye,G:Uye,H:Cye,I:_ye,j:Aye,L:h6,m:Eye,M:zye,p:U,q:F,Q:KD,s:GD,S:Tye,u:Pye,U:Rye,V:Dye,w:Mye,W:Iye,x:null,X:null,y:Lye,Y:Bye,Z:Fye,"%":HD},C={a:D,A:Q,b:se,B:ae,c:null,d:qD,e:qD,f:Gye,g:nve,G:ive,H:qye,I:Hye,j:Kye,L:m6,m:Vye,M:Zye,p:he,q:Ne,Q:KD,s:GD,S:Yye,u:Wye,U:Qye,V:Xye,w:Jye,W:eve,x:null,X:null,y:tve,Y:rve,Z:ave,"%":HD},T={a:q,A:B,b:$,B:V,c:te,d:BD,e:BD,f:Sye,g:$D,G:LD,H:UD,I:UD,j:vye,L:wye,m:yye,M:bye,p:I,q:gye,Q:kye,s:Nye,S:xye,u:dye,U:fye,V:hye,w:uye,W:pye,x:Y,X:H,y:$D,Y:LD,Z:mye,"%":jye};_.x=E(n,_),_.X=E(r,_),_.c=E(t,_),C.x=E(n,C),C.X=E(r,C),C.c=E(t,C);function E(ne,de){return function(Ee){var X=[],Fe=-1,De=0,et=ne.length,tt,Ut,Xt;for(Ee instanceof Date||(Ee=new Date(+Ee));++Fe<et;)ne.charCodeAt(Fe)===37&&(X.push(ne.slice(De,Fe)),(Ut=ID[tt=ne.charAt(++Fe)])!=null?tt=ne.charAt(++Fe):Ut=tt==="e"?" ":"0",(Xt=de[tt])&&(tt=Xt(Ee,Ut)),X.push(tt),De=Fe+1);return X.push(ne.slice(De,Fe)),X.join("")}}function A(ne,de){return function(Ee){var X=of(1900,void 0,1),Fe=P(X,ne,Ee+="",0),De,et;if(Fe!=Ee.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(de&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(De=jS(of(X.y,0,1)),et=De.getUTCDay(),De=et>4||et===0?vy.ceil(De):vy(De),De=Gv.offset(De,(X.V-1)*7),X.y=De.getUTCFullYear(),X.m=De.getUTCMonth(),X.d=De.getUTCDate()+(X.w+6)%7):(De=SS(of(X.y,0,1)),et=De.getDay(),De=et>4||et===0?yy.ceil(De):yy(De),De=Ah.offset(De,(X.V-1)*7),X.y=De.getFullYear(),X.m=De.getMonth(),X.d=De.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),et="Z"in X?jS(of(X.y,0,1)).getUTCDay():SS(of(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(et+5)%7:X.w+X.U*7-(et+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,jS(X)):SS(X)}}function P(ne,de,Ee,X){for(var Fe=0,De=de.length,et=Ee.length,tt,Ut;Fe<De;){if(X>=et)return-1;if(tt=de.charCodeAt(Fe++),tt===37){if(tt=de.charAt(Fe++),Ut=T[tt in ID?de.charAt(Fe++):tt],!Ut||(X=Ut(ne,Ee,X))<0)return-1}else if(tt!=Ee.charCodeAt(X++))return-1}return X}function I(ne,de,Ee){var X=f.exec(de.slice(Ee));return X?(ne.p=p.get(X[0].toLowerCase()),Ee+X[0].length):-1}function q(ne,de,Ee){var X=v.exec(de.slice(Ee));return X?(ne.w=w.get(X[0].toLowerCase()),Ee+X[0].length):-1}function B(ne,de,Ee){var X=m.exec(de.slice(Ee));return X?(ne.w=y.get(X[0].toLowerCase()),Ee+X[0].length):-1}function $(ne,de,Ee){var X=N.exec(de.slice(Ee));return X?(ne.m=O.get(X[0].toLowerCase()),Ee+X[0].length):-1}function V(ne,de,Ee){var X=S.exec(de.slice(Ee));return X?(ne.m=j.get(X[0].toLowerCase()),Ee+X[0].length):-1}function te(ne,de,Ee){return P(ne,t,de,Ee)}function Y(ne,de,Ee){return P(ne,n,de,Ee)}function H(ne,de,Ee){return P(ne,r,de,Ee)}function J(ne){return o[ne.getDay()]}function pe(ne){return a[ne.getDay()]}function Se(ne){return d[ne.getMonth()]}function R(ne){return u[ne.getMonth()]}function U(ne){return i[+(ne.getHours()>=12)]}function F(ne){return 1+~~(ne.getMonth()/3)}function D(ne){return o[ne.getUTCDay()]}function Q(ne){return a[ne.getUTCDay()]}function se(ne){return d[ne.getUTCMonth()]}function ae(ne){return u[ne.getUTCMonth()]}function he(ne){return i[+(ne.getUTCHours()>=12)]}function Ne(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var de=E(ne+="",_);return de.toString=function(){return ne},de},parse:function(ne){var de=A(ne+="",!1);return de.toString=function(){return ne},de},utcFormat:function(ne){var de=E(ne+="",C);return de.toString=function(){return ne},de},utcParse:function(ne){var de=A(ne+="",!0);return de.toString=function(){return ne},de}}}var ID={"-":"",_:" ",0:"0"},Fn=/^\s*\d+/,oye=/^%/,lye=/[\\^$*+?|[\]().{}]/g;function Nt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function cye(e){return e.replace(lye,"\\$&")}function lf(e){return new RegExp("^(?:"+e.map(cye).join("|")+")","i")}function cf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function uye(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function dye(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function fye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function hye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function LD(e,t,n){var r=Fn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function $D(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mye(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 gye(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function yye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function BD(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function vye(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function UD(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function bye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function xye(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function wye(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Sye(e,t,n){var r=Fn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jye(e,t,n){var r=oye.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function kye(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Nye(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function FD(e,t){return Nt(e.getDate(),t,2)}function Cye(e,t){return Nt(e.getHours(),t,2)}function _ye(e,t){return Nt(e.getHours()%12||12,t,2)}function Aye(e,t){return Nt(1+Ah.count(cs(e),e),t,3)}function h6(e,t){return Nt(e.getMilliseconds(),t,3)}function Oye(e,t){return h6(e,t)+"000"}function Eye(e,t){return Nt(e.getMonth()+1,t,2)}function zye(e,t){return Nt(e.getMinutes(),t,2)}function Tye(e,t){return Nt(e.getSeconds(),t,2)}function Pye(e){var t=e.getDay();return t===0?7:t}function Rye(e,t){return Nt(Vv.count(cs(e)-1,e),t,2)}function p6(e){var t=e.getDay();return t>=4||t===0?Au(e):Au.ceil(e)}function Dye(e,t){return e=p6(e),Nt(Au.count(cs(e),e)+(cs(e).getDay()===4),t,2)}function Mye(e){return e.getDay()}function Iye(e,t){return Nt(yy.count(cs(e)-1,e),t,2)}function Lye(e,t){return Nt(e.getFullYear()%100,t,2)}function $ye(e,t){return e=p6(e),Nt(e.getFullYear()%100,t,2)}function Bye(e,t){return Nt(e.getFullYear()%1e4,t,4)}function Uye(e,t){var n=e.getDay();return e=n>=4||n===0?Au(e):Au.ceil(e),Nt(e.getFullYear()%1e4,t,4)}function Fye(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Nt(t/60|0,"0",2)+Nt(t%60,"0",2)}function qD(e,t){return Nt(e.getUTCDate(),t,2)}function qye(e,t){return Nt(e.getUTCHours(),t,2)}function Hye(e,t){return Nt(e.getUTCHours()%12||12,t,2)}function Kye(e,t){return Nt(1+Gv.count(us(e),e),t,3)}function m6(e,t){return Nt(e.getUTCMilliseconds(),t,3)}function Gye(e,t){return m6(e,t)+"000"}function Vye(e,t){return Nt(e.getUTCMonth()+1,t,2)}function Zye(e,t){return Nt(e.getUTCMinutes(),t,2)}function Yye(e,t){return Nt(e.getUTCSeconds(),t,2)}function Wye(e){var t=e.getUTCDay();return t===0?7:t}function Qye(e,t){return Nt(Zv.count(us(e)-1,e),t,2)}function g6(e){var t=e.getUTCDay();return t>=4||t===0?Ou(e):Ou.ceil(e)}function Xye(e,t){return e=g6(e),Nt(Ou.count(us(e),e)+(us(e).getUTCDay()===4),t,2)}function Jye(e){return e.getUTCDay()}function eve(e,t){return Nt(vy.count(us(e)-1,e),t,2)}function tve(e,t){return Nt(e.getUTCFullYear()%100,t,2)}function nve(e,t){return e=g6(e),Nt(e.getUTCFullYear()%100,t,2)}function rve(e,t){return Nt(e.getUTCFullYear()%1e4,t,4)}function ive(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ou(e):Ou.ceil(e),Nt(e.getUTCFullYear()%1e4,t,4)}function ave(){return"+0000"}function HD(){return"%"}function KD(e){return+e}function GD(e){return Math.floor(+e/1e3)}var Kc,y6,v6;sve({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 sve(e){return Kc=sye(e),y6=Kc.format,Kc.parse,v6=Kc.utcFormat,Kc.utcParse,Kc}function ove(e){return new Date(e)}function lve(e){return e instanceof Date?+e:+new Date(+e)}function JN(e,t,n,r,i,a,o,u,d,f){var p=$N(),m=p.invert,y=p.domain,v=f(".%L"),w=f(":%S"),S=f("%I:%M"),j=f("%I %p"),N=f("%a %d"),O=f("%b %d"),_=f("%B"),C=f("%Y");function T(E){return(d(E)<E?v:u(E)<E?w:o(E)<E?S:a(E)<E?j:r(E)<E?i(E)<E?N:O:n(E)<E?_:C)(E)}return p.invert=function(E){return new Date(m(E))},p.domain=function(E){return arguments.length?y(Array.from(E,lve)):y().map(ove)},p.ticks=function(E){var A=y();return e(A[0],A[A.length-1],E??10)},p.tickFormat=function(E,A){return A==null?T:f(A)},p.nice=function(E){var A=y();return(!E||typeof E.range!="function")&&(E=t(A[0],A[A.length-1],E??10)),E?y(i6(A,E)):p},p.copy=function(){return _h(p,JN(e,t,n,r,i,a,o,u,d,f))},p}function cve(){return Ti.apply(JN(iye,aye,cs,QN,Vv,Ah,YN,VN,yl,y6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function uve(){return Ti.apply(JN(nye,rye,us,XN,Zv,Gv,WN,ZN,yl,v6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Yv(){var e=0,t=1,n,r,i,a,o=fr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(o=m,f):o};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,o=m(v,w),f):[o(0),o(1)]}}return f.range=p(Zu),f.rangeRound=p(LN),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function Ao(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function b6(){var e=_o(Yv()(fr));return e.copy=function(){return Ao(e,b6())},ms.apply(e,arguments)}function x6(){var e=FN(Yv()).domain([1,10]);return e.copy=function(){return Ao(e,x6()).base(e.base())},ms.apply(e,arguments)}function w6(){var e=qN(Yv());return e.copy=function(){return Ao(e,w6()).constant(e.constant())},ms.apply(e,arguments)}function eC(){var e=HN(Yv());return e.copy=function(){return Ao(e,eC()).exponent(e.exponent())},ms.apply(e,arguments)}function dve(){return eC.apply(null,arguments).exponent(.5)}function S6(){var e=[],t=fr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Nh(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(ho),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Wme(e,a/r))},n.copy=function(){return S6(t).domain(e)},ms.apply(n,arguments)}function Wv(){var e=0,t=.5,n=1,r=1,i,a,o,u,d,f=fr,p,m=!1,y;function v(S){return isNaN(S=+S)?y:(S=.5+((S=+p(S))-a)*(r*S<r*a?u:d),f(m?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),a=p(t=+t),o=p(n=+n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(m=!!S,v):m},v.interpolator=function(S){return arguments.length?(f=S,v):f};function w(S){return function(j){var N,O,_;return arguments.length?([N,O,_]=j,f=jge(S,[N,O,_]),v):[f(0),f(.5),f(1)]}}return v.range=w(Zu),v.rangeRound=w(LN),v.unknown=function(S){return arguments.length?(y=S,v):y},function(S){return p=S,i=S(e),a=S(t),o=S(n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function j6(){var e=_o(Wv()(fr));return e.copy=function(){return Ao(e,j6())},ms.apply(e,arguments)}function k6(){var e=FN(Wv()).domain([.1,1,10]);return e.copy=function(){return Ao(e,k6()).base(e.base())},ms.apply(e,arguments)}function N6(){var e=qN(Wv());return e.copy=function(){return Ao(e,N6()).constant(e.constant())},ms.apply(e,arguments)}function tC(){var e=HN(Wv());return e.copy=function(){return Ao(e,tC()).exponent(e.exponent())},ms.apply(e,arguments)}function fve(){return tC.apply(null,arguments).exponent(.5)}const C6=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:DN,scaleDiverging:j6,scaleDivergingLog:k6,scaleDivergingPow:tC,scaleDivergingSqrt:fve,scaleDivergingSymlog:N6,scaleIdentity:r6,scaleImplicit:dj,scaleLinear:n6,scaleLog:a6,scaleOrdinal:RN,scalePoint:Jme,scalePow:KN,scaleQuantile:l6,scaleQuantize:c6,scaleRadial:o6,scaleSequential:b6,scaleSequentialLog:x6,scaleSequentialPow:eC,scaleSequentialQuantile:S6,scaleSequentialSqrt:dve,scaleSequentialSymlog:w6,scaleSqrt:Gge,scaleSymlog:s6,scaleThreshold:u6,scaleTime:cve,scaleUtc:uve,tickFormat:t6},Symbol.toStringTag,{value:"Module"}));function hve(e){var t=C6;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(gh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function VD(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=hve(e);if(r!=null)return r.domain(t).range(n),r}}function nC(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?VD(e.scale,n,r):VD(t,n,r)}function pve(e){return"scale".concat(gh(e))}function mve(e){return pve(e)in C6}var _6=(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 mve(r)?r:"point"}};function gve(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function A6(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,u,d=gve(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function yve(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):A6(e,void 0)}function ZD(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 by(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(r){vve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vve(e,t,n){return(t=bve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bve(e){var t=xve(e,"string");return typeof t=="symbol"?t:t+""}function xve(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 mj=[0,"auto"],Tn={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"},O6=(e,t)=>e.cartesianAxis.xAxis[t],Ca=(e,t)=>{var n=O6(e,t);return n??Tn},Pn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:mj,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:bh},E6=(e,t)=>e.cartesianAxis.yAxis[t],_a=(e,t)=>{var n=E6(e,t);return n??Pn},wve={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:""},rC=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??wve},vr=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return _a(e,n);case"zAxis":return rC(e,n);case"angleAxis":return _N(e,n);case"radiusAxis":return AN(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Sve=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return _a(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Oh=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return _a(e,n);case"angleAxis":return _N(e,n);case"radiusAxis":return AN(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},z6=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function T6(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 P6=e=>e.graphicalItems.cartesianItems,jve=ce([Bn,Fv],T6),R6=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Yu=ce([P6,vr,jve],R6,{memoizeOptions:{resultEqualityCheck:Hv}}),D6=ce([Yu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(zN)),M6=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),kve=ce([Yu],M6),I6=e=>e.map(t=>t.data).filter(Boolean).flat(1),Nve=ce([Yu],e=>e.some(t=>!t.data)),L6=ce([Yu],I6,{memoizeOptions:{resultEqualityCheck:Hv}}),$6=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},iC=ce([L6,Iv],$6),Cve=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:$n(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:$n(i,r)}))):e.map(r=>({value:r})),B6=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:u,dataEndIndex:d}=r,f=Cve(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(u,d+1),m=p.map(y=>({value:$n(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},Eh=ce([iC,vr,Yu,Iv,Nve,L6],B6);function gu(e){if(_i(e)||e instanceof Date){var t=Number(e);if(Je(t))return t}}function YD(e){if(Array.isArray(e)){var t=[gu(e[0]),gu(e[1])];return ma(t)?t:void 0}var n=gu(e);if(n!=null)return[n,n]}function ja(e){return e.map(gu).filter(Or)}function _ve(e,t){var n=gu(e),r=gu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Ave=ce([Eh],e=>e?.map(t=>t.value).sort(_ve));function U6(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Ove(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!xa(t))r=t;else if(Array.isArray(t)){var i=ja(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:ja(n.flatMap(a=>{var o=$n(e,a.dataKey),u,d;if(Array.isArray(o)?[u,d]=o:u=d=o,!(!Je(u)||!Je(d)))return[r-u,r+d]}))}var Mn=e=>{var t=Un(e),n=Vu(e);return Oh(e,t,n)},Eu=ce([Mn],e=>e?.dataKey),Eve=ce([D6,Iv,Mn],GB),F6=(e,t,n,r)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var d=o[u.stackId];return d==null&&(d=[]),d.push(u),o[u.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[u,d]=o,f=r?[...d].reverse():d,p=f.map(EN);return[u,{stackedData:cfe(e,p,n),graphicalItems:f}]}))},q6=ce([Eve,D6,Lv,$B],F6),H6=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=hfe(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},zve=ce([vr],e=>e.allowDataOverflow),aC=e=>{var t;if(e==null||!("domain"in e))return mj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ja(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:mj},K6=ce([vr],aC),G6=ce([K6,zve],AB),Tve=ce([q6,Ji,Bn,G6],H6,{memoizeOptions:{resultEqualityCheck:qv}}),sC=e=>e.errorBars,Pve=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>U6(n,r)),xy=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),u=Math.max(...a);return[o,u]}},V6=function(t,n,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>U6(a,v));m.forEach(v=>{var w,S=$n(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=Ove(v,S,y);if(j.length>=2){var N=Math.min(...j),O=Math.max(...j);(u==null||N<u)&&(u=N),(d==null||O>d)&&(d=O)}var _=YD(S);_!=null&&(u=u==null?_[0]:Math.min(u,_[0]),d=d==null?_[1]:Math.max(d,_[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=YD($n(f,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),Je(u)&&Je(d))return[u,d]},Rve=ce([iC,vr,kve,sC,Bn,Sme],V6,{memoizeOptions:{resultEqualityCheck:qv}});function Dve(e){var{value:t}=e;if(_i(t)||t instanceof Date)return t}var Mve=(e,t,n)=>{var r=e.map(Dve).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&r3(r))?_B(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Z6=e=>e.referenceElements.dots,Wu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Ive=ce([Z6,Bn,Fv],Wu),Y6=e=>e.referenceElements.areas,Lve=ce([Y6,Bn,Fv],Wu),W6=e=>e.referenceElements.lines,$ve=ce([W6,Bn,Fv],Wu),Q6=(e,t)=>{if(e!=null){var n=ja(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Bve=ce(Ive,Bn,Q6),X6=(e,t)=>{if(e!=null){var n=ja(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)]}},Uve=ce([Lve,Bn],X6);function Fve(e){var t;if(e.x!=null)return ja([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ja(n)}function qve(e){var t;if(e.y!=null)return ja([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ja(n)}var J6=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Fve(r):qve(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Hve=ce([$ve,Bn],J6),Kve=ce(Bve,Hve,Uve,(e,t,n)=>xy(e,n,t)),eU=(e,t,n,r,i,a,o,u)=>{if(n!=null)return n;var d=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",f=d?xy(r,a,i):xy(a,i);return kme(t,f,e.allowDataOverflow)},Gve=ce([vr,K6,G6,Tve,Rve,Kve,sn,Bn],eU,{memoizeOptions:{resultEqualityCheck:qv}}),Vve=[0,1],tU=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:u,type:d}=e,f=Na(t,a);if(f&&u==null){var p;return _B(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Mve(r,e,f):i==="expand"&&!f?Vve:o}},oC=ce([vr,sn,iC,Eh,Lv,Bn,Gve],tU),Qu=ce([vr,z6,kN],_6),nU=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=aC(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ma(e)){if(a)return aD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return sD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ma(e))return aD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ma(e))return sD(e,t.tickCount,t.allowDecimals,"adaptive")}}},lC=ce([oC,Oh,Qu],nU),rU=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ma(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,u),Math.max(d,f)]}return t},Zve=ce([vr,oC,lC,Bn],rU),Yve=ce(Eh,vr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ja(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],f=r[u+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/o}}),iU=ce(Yve,sn,Ome,Jn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Je(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=bo(n,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),Wve=(e,t,n)=>{var r=Ca(e,t);return r==null||typeof r.padding!="string"?0:iU(e,"xAxis",t,n,r.padding)},Qve=(e,t,n)=>{var r=_a(e,t);return r==null||typeof r.padding!="string"?0:iU(e,"yAxis",t,n,r.padding)},Xve=ce(Ca,Wve,(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}}),Jve=ce(_a,Qve,(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}}),e0e=ce([Jn,Xve,Pv,Tv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),t0e=ce([Jn,sn,Jve,Pv,Tv,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),zh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return e0e(e,n,r);case"yAxis":return t0e(e,n,r);case"zAxis":return(i=rC(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return qB(e);case"radiusAxis":return HB(e,n);default:return}},aU=ce([vr,zh],$v),n0e=ce([Qu,Zve],Lme),cC=ce([vr,Qu,n0e,aU],nC),sU=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Na(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},uC=ce([sn,Eh,Oh,Bn],sU),zu=ce([cC],TN);ce([cC],yve);ce([cC,Ave],A6);ce([Yu,sC,Bn],Pve);function oU(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Qv=(e,t)=>t,Xv=(e,t,n)=>n,r0e=ce(Ev,Qv,Xv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(oU)),i0e=ce(zv,Qv,Xv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(oU)),lU=(e,t)=>({width:e.width,height:t.height}),a0e=(e,t)=>{var n=typeof t.width=="number"?t.width:bh;return{width:n,height:e.height}},s0e=ce(Jn,Ca,lU),o0e=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},l0e=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},c0e=ce(ps,Jn,r0e,Qv,Xv,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=lU(t,u);o==null&&(o=o0e(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),u0e=ce(hs,Jn,i0e,Qv,Xv,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=a0e(t,u);o==null&&(o=l0e(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),d0e=(e,t)=>{var n=Ca(e,t);if(n!=null)return c0e(e,n.orientation,n.mirror)},f0e=ce([Jn,Ca,d0e,(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}}}),h0e=(e,t)=>{var n=_a(e,t);if(n!=null)return u0e(e,n.orientation,n.mirror)},p0e=ce([Jn,_a,h0e,(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}}}),m0e=ce(Jn,_a,(e,t)=>{var n=typeof t.width=="number"?t.width:bh;return{width:n,height:e.height}}),cU=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,u=Na(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&u&&a==="category"&&i&&r3(f))return d}},dC=ce([sn,Eh,vr,Bn],cU),WD=ce([sn,Sve,Qu,zu,dC,uC,zh,lC,Bn],(e,t,n,r,i,a,o,u,d)=>{if(t!=null){var f=Na(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:u,range:o,realScaleType:n,scale:r}}}),g0e=(e,t,n,r,i,a,o,u,d)=>{if(!(t==null||r==null)){var f=Na(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?xi(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,N)=>{var O=o?o.indexOf(j):j,_=r.map(O);return Je(_)?{index:N,coordinate:_+w,value:j,offset:w}:null}).filter(Or):f&&u?u.map((j,N)=>{var O=r.map(j);return Je(O)?{coordinate:O+w,value:j,index:N,offset:w}:null}).filter(Or):r.ticks?r.ticks(y).map((j,N)=>{var O=r.map(j);return Je(O)?{coordinate:O+w,value:j,index:N,offset:w}:null}).filter(Or):r.domain().map((j,N)=>{var O=r.map(j);return Je(O)?{coordinate:O+w,value:o?o[j]:j,index:N,offset:w}:null}).filter(Or)}},uU=ce([sn,Oh,Qu,zu,lC,zh,dC,uC,Bn],g0e),y0e=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Na(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?xi(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var y=n.map(p);return Je(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return Je(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.domain().map((p,m)=>{var y=n.map(p);return Je(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Or)}},dU=ce([sn,Oh,zu,zh,dC,uC,Bn],y0e),fU=ce(vr,zu,(e,t)=>{if(!(e==null||t==null))return by(by({},e),{},{scale:t})}),v0e=ce([vr,Qu,oC,aU],nC),b0e=ce([v0e],TN);ce((e,t,n)=>rC(e,n),b0e,(e,t)=>{if(!(e==null||t==null))return by(by({},e),{},{scale:t})});var x0e=ce([sn,Ev,zv],(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}}),w0e=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ce([w0e],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var hU=e=>e.options.defaultTooltipEventType,pU=e=>e.options.validateTooltipEventTypes;function mU(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Th(e,t){var n=hU(e),r=pU(e);return mU(t,n,r)}function S0e(e){return Ue(t=>Th(t,e))}var gU=(e,t)=>{var n,r=Number(t);if(!(xa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},j0e=e=>e.tooltip.settings,Js={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},k0e={itemInteraction:{click:Js,hover:Js},axisInteraction:{click:Js,hover:Js},keyboardInteraction:Js,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}},yU=or({name:"tooltip",initialState:k0e,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Wt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=wi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Wt()},removeTooltipEntrySettings:{reducer(e,t){var n=wi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Wt()},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:N0e,replaceTooltipEntrySettings:C0e,removeTooltipEntrySettings:_0e,setTooltipSettingsState:A0e,setActiveMouseOverItemIndex:O0e,mouseLeaveItem:mCe,mouseLeaveChart:vU,setActiveClickItemIndex:gCe,setMouseOverAxisIndex:bU,setMouseClickAxisIndex:E0e,setSyncInteraction:mf,setKeyboardInteraction:wy}=yU.actions,z0e=yU.reducer;function QD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QD(Object(n),!0).forEach(function(r){T0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T0e(e,t,n){return(t=P0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P0e(e){var t=R0e(e,"string");return typeof t=="symbol"?t:t+""}function R0e(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 D0e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function M0e(e){return e.index!=null}var xU=(e,t,n,r)=>{if(t==null)return Js;var i=D0e(e,t,n);if(i==null)return Js;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(M0e(i)){if(a)return Bm(Bm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Bm(Bm({},Js),{},{coordinate:i.coordinate})};function I0e(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 L0e(e,t){var n=I0e(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function $0e(e,t,n){if(n==null||t==null)return!0;var r=$n(e,t);return r==null||!ma(n)?!0:L0e(r,n)}var Nf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Je(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(o,Math.min(a,u)),f=t[d];return f==null||$0e(f,n,r)?String(d):null},wU=(e,t,n,r,i,a,o)=>{if(a!=null){var u=o[0],d=u?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},SU=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},jU=e=>e.options.tooltipPayloadSearcher,Xu=e=>e.tooltip;function XD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XD(Object(n),!0).forEach(function(r){B0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B0e(e,t,n){return(t=U0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U0e(e){var t=F0e(e,"string");return typeof t=="symbol"?t:t+""}function F0e(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 q0e(e){if(typeof e=="string"||typeof e=="number")return e}function H0e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function K0e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function eM(e){if(typeof e=="string")return e}function G0e(e){if(!(e==null||typeof e!="object")){var t="name"in e?q0e(e.name):void 0,n="unit"in e?H0e(e.unit):void 0,r="dataKey"in e?K0e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?eM(e.color):void 0,o="fill"in e?eM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function V0e(e,t){return e??t}var kU=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:S,settings:j}=v,N=V0e(S,u),O=Array.isArray(N)?eB(N,f,p):N,_=(w=j?.dataKey)!==null&&w!==void 0?w:r,C=j?.nameKey,T;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&o==="axis"?T=i3(O,r,i):T=a(O,t,d,C),Array.isArray(T))T.forEach(A=>{var P,I,q=G0e(A),B=q?.name,$=q?.dataKey,V=q?.payload,te=JD(JD({},j),{},{name:B,unit:q?.unit,color:(P=q?.color)!==null&&P!==void 0?P:j?.color,fill:(I=q?.fill)!==null&&I!==void 0?I:j?.fill});y.push(VP({tooltipEntrySettings:te,dataKey:$,payload:V,value:$n(V,$),name:B==null?void 0:String(B)}))});else{var E;y.push(VP({tooltipEntrySettings:j,dataKey:_,payload:T,value:$n(T,_),name:(E=$n(T,C))!==null&&E!==void 0?E:j?.name}))}return y},m)}},fC=ce([Mn,z6,kN],_6),Z0e=ce([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Y0e=ce([Un,Vu],T6),Jl=ce([Z0e,Mn,Y0e],R6,{memoizeOptions:{resultEqualityCheck:Hv}}),W0e=ce([Jl],e=>e.filter(zN)),NU=ce([Jl],I6,{memoizeOptions:{resultEqualityCheck:Hv}}),Q0e=ce([Jl],e=>e.some(t=>!t.data)),Bl=ce([NU,Ji],$6),X0e=ce([W0e,Ji,Mn],GB),hC=ce([Bl,Mn,Jl,Ji,Q0e,NU],B6),CU=ce([Mn],aC),J0e=ce([Mn],e=>e.allowDataOverflow),_U=ce([CU,J0e],AB),ebe=ce([Jl],e=>e.filter(zN)),tbe=ce([X0e,ebe,Lv,$B],F6),nbe=ce([tbe,Ji,Un,_U],H6),rbe=ce([Jl],M6),ibe=ce([Bl,Mn,rbe,sC,Un,jme],V6,{memoizeOptions:{resultEqualityCheck:qv}}),abe=ce([Z6,Un,Vu],Wu),sbe=ce([abe,Un],Q6),obe=ce([Y6,Un,Vu],Wu),lbe=ce([obe,Un],X6),cbe=ce([W6,Un,Vu],Wu),ube=ce([cbe,Un],J6),dbe=ce([sbe,ube,lbe],xy),fbe=ce([Mn,CU,_U,nbe,ibe,dbe,sn,Un],eU),Tu=ce([Mn,sn,Bl,hC,Lv,Un,fbe],tU),hbe=ce([Tu,Mn,fC],nU),pbe=ce([Mn,Tu,hbe,Un],rU),AU=e=>{var t=Un(e),n=Vu(e),r=!1;return zh(e,t,n,r)},OU=ce([Mn,AU],$v),mbe=ce([Mn,fC,pbe,OU],nC),EU=ce([mbe],TN),gbe=ce([sn,hC,Mn,Un],cU),ybe=ce([sn,hC,Mn,Un],sU),vbe=(e,t,n,r,i,a,o,u)=>{if(t){var{type:d}=t,f=Na(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=u==="angleAxis"&&i!=null&&i?.length>=2?xi(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var w=r.map(y);return Je(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(Or):r.domain().map((y,v)=>{var w=r.map(y);return Je(w)?{coordinate:w+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Or)}}},gs=ce([sn,Mn,fC,EU,AU,gbe,ybe,Un],vbe),pC=ce([hU,pU,j0e],(e,t,n)=>mU(n.shared,e,t)),zU=e=>e.tooltip.settings.trigger,mC=e=>e.tooltip.settings.defaultIndex,Ph=ce([Xu,pC,zU,mC],xU),eh=ce([Ph,Bl,Eu,Tu],Nf),TU=ce([gs,eh],gU),bbe=ce([Ph],e=>{if(e)return e.dataKey}),xbe=ce([Ph],e=>{if(e)return e.graphicalItemId}),PU=ce([Xu,pC,zU,mC],SU),wbe=ce([hs,ps,sn,Jn,gs,mC,PU],wU),Sbe=ce([Ph,wbe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),jbe=ce([Ph],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),kbe=ce([PU,eh,Ji,Eu,TU,jU,pC],kU),Nbe=ce([kbe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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 nM(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){Cbe(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 Cbe(e,t,n){return(t=_be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _be(e){var t=Abe(e,"string");return typeof t=="symbol"?t:t+""}function Abe(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 Obe=()=>Ue(Mn),Ebe=()=>{var e=Obe(),t=Ue(gs),n=Ue(EU);return Wg(!e||!n?void 0:nM(nM({},e),{},{scale:n}),t)};function rM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rM(Object(n),!0).forEach(function(r){zbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zbe(e,t,n){return(t=Tbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tbe(e){var t=Pbe(e,"string");return typeof t=="symbol"?t:t+""}function Pbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rbe=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Dbe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Gc(Gc(Gc({},r),Qn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:d}=r;return Gc(Gc(Gc({},r),Qn(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Mbe(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 RU=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<o;u++){var d,f,p,m,y,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[u])===null||p===void 0?void 0:p.coordinate,S=u>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[u+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||S==null))if(xi(w-v)!==xi(S-w)){var N=[];if(xi(S-w)===xi(i[1]-i[0])){j=S;var O=w+i[1]-i[0];N[0]=Math.min(O,(O+v)/2),N[1]=Math.max(O,(O+v)/2)}else{j=v;var _=S+i[1]-i[0];N[0]=Math.min(w,(_+w)/2),N[1]=Math.max(w,(_+w)/2)}var C=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>C[0]&&e<=C[1]||e>=N[0]&&e<=N[1]){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}else{var E=Math.min(v,S),A=Math.max(v,S);if(e>(E+w)/2&&e<=(A+w)/2){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}}else if(t)for(var I=0;I<o;I++){var q=t[I];if(q!=null){var B=t[I+1],$=t[I-1];if(I===0&&B!=null&&e<=(q.coordinate+B.coordinate)/2||I===o-1&&$!=null&&e>(q.coordinate+$.coordinate)/2||I>0&&I<o-1&&$!=null&&B!=null&&e>(q.coordinate+$.coordinate)/2&&e<=(q.coordinate+B.coordinate)/2)return q.index}}return-1},DU=()=>Ue(kN),gC=(e,t)=>t,MU=(e,t,n)=>n,yC=(e,t,n,r)=>r,Ibe=ce(gs,e=>xv(e,t=>t.coordinate)),vC=ce([Xu,gC,MU,yC],xU),bC=ce([vC,Bl,Eu,Tu],Nf),Lbe=(e,t,n)=>{if(t!=null){var r=Xu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},IU=ce([Xu,gC,MU,yC],SU),Sy=ce([hs,ps,sn,Jn,gs,yC,IU],wU),$be=ce([vC,Sy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),LU=ce([gs,bC],gU),Bbe=ce([IU,bC,Ji,Eu,LU,jU,gC],kU),Ube=ce([vC,bC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Fbe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&Mbe(e,o)){var u=pfe(e,t),d=RU(u,a,i,n,r),f=Rbe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},qbe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var u=ume(e,n);if(u){var d=mfe(u,t),f=RU(d,o,a,r,i),p=Dbe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},Hbe=(e,t,n,r,i,a,o,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Fbe(e,t,r,i,a,o,u):qbe(e,t,n,r,i,a,o)},Kbe=ce(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}}),Gbe=ce(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(ar)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ime}});function iM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){Vbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vbe(e,t,n){return(t=Zbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zbe(e){var t=Ybe(e,"string");return typeof t=="symbol"?t:t+""}function Ybe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wbe={},Qbe={zIndexMap:Object.values(ar).reduce((e,t)=>aM(aM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Wbe)},Xbe=new Set(Object.values(ar));function Jbe(e){return Xbe.has(e)}var $U=or({name:"zIndex",initialState:Qbe,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:Wt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Jbe(n)&&delete e.zIndexMap[n])},prepare:Wt()},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:Wt()},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:Wt()}}}),{registerZIndexPortal:exe,unregisterZIndexPortal:kS,registerZIndexPortalElement:txe,unregisterZIndexPortalElement:nxe}=$U.actions,rxe=$U.reducer;function Aa(e){var{zIndex:t,children:n}=e,r=Zfe(),i=r&&t!==void 0&&t!==0,a=yr(),o=b.useRef(void 0),u=b.useRef(new Set),d=fn(),f=Ue(m=>Kbe(m,t,a));if(b.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(kS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(u.current.has(t)||(d(exe({zIndex:t})),u.current.add(t)),f){o.current=f;var y=u.current;y.forEach(v=>{v!==t&&(d(kS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),b.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(y=>{d(kS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?ql.createPortal(n,p):null}function gj(){return gj=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},gj.apply(null,arguments)}function sM(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 Um(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sM(Object(n),!0).forEach(function(r){ixe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ixe(e,t,n){return(t=axe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function axe(e){var t=sxe(e,"string");return typeof t=="symbol"?t:t+""}function sxe(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 oxe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function lxe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,S,j;if(p==="ScatterChart")w=m,S=Spe,j=ar.cursorLine;else if(p==="BarChart")w=jpe(u,m,a,o),S=eme,j=ar.cursorRectangle;else if(u==="radial"&&o3(m)){var{cx:N,cy:O,radius:_,startAngle:C,endAngle:T}=NB(m);w={cx:N,cy:O,startAngle:C,endAngle:T,innerRadius:_,outerRadius:_},S=pme,j=ar.cursorLine}else w={points:mme(u,m,a)},S=og,j=ar.cursorLine;var E=typeof d=="object"&&"className"in d?d.className:void 0,A=Um(Um(Um(Um({stroke:"#ccc",pointerEvents:"none"},a),w),mv(d)),{},{payload:y,payloadIndex:v,className:Et("recharts-tooltip-cursor",E)});return b.createElement(Aa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(oxe,{cursor:d,cursorComp:S,cursorProps:A}))}function cxe(e){var t=Ebe(),n=cB(),r=Hu(),i=DU();return t==null||n==null||r==null||i==null?null:b.createElement(lxe,gj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var BU=b.createContext(null),uxe=()=>b.useContext(BU),NS={exports:{}},oM;function dxe(){return oM||(oM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,v=m.length,w=new Array(v);y<v;y++)w[y]=m[y].fn;return w},u.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,y,v,w){var S=n?n+f:f;if(!this._events[S])return!1;var j=this._events[S],N=arguments.length,O,_;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),N){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,w),!0}for(_=1,O=new Array(N-1);_<N;_++)O[_-1]=arguments[_];j.fn.apply(j.context,O)}else{var C=j.length,T;for(_=0;_<C;_++)switch(j[_].once&&this.removeListener(f,j[_].fn,void 0,!0),N){case 1:j[_].fn.call(j[_].context);break;case 2:j[_].fn.call(j[_].context,p);break;case 3:j[_].fn.call(j[_].context,p,m);break;case 4:j[_].fn.call(j[_].context,p,m,y);break;default:if(!O)for(T=1,O=new Array(N-1);T<N;T++)O[T-1]=arguments[T];j[_].fn.apply(j[_].context,O)}}return!0},u.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&o(this,v);else{for(var S=0,j=[],N=w.length;S<N;S++)(w[S].fn!==p||y&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(NS)),NS.exports}var fxe=dxe();const hxe=ka(fxe);var th=new hxe,yj="recharts.syncEvent.tooltip",lM="recharts.syncEvent.brush",pxe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!xa(n))return e[n]}},mxe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},UU=or({name:"options",initialState:mxe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),gxe=UU.reducer,{createEventEmitter:yxe}=UU.actions;function vxe(e){return e.tooltip.syncInteraction}var bxe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},FU=or({name:"chartData",initialState:bxe,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:cM,setDataStartEndIndexes:xxe,setComputedData:yCe}=FU.actions,wxe=FU.reducer,Sxe=["x","y"];function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){jxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jxe(e,t,n){return(t=kxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kxe(e){var t=Nxe(e,"string");return typeof t=="symbol"?t:t+""}function Nxe(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 Cxe(e,t){if(e==null)return{};var n,r,i=_xe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _xe(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 Axe(){var e=Ue(NN),t=Ue(CN),n=fn(),r=Ue(BB),i=Ue(gs),a=Hu(),o=xh(),u=Ue(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return qu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(mf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:S}=v,j=Cxe(v,Sxe),{x:N,y:O,width:_,height:C}=p.payload.sourceViewBox,T=Vc(Vc({},j),{},{x:o.x+(_?(w-N)/_:0)*o.width,y:o.y+(C?(S-O)/C:0)*o.height});n(Vc(Vc({},p),{},{payload:Vc(Vc({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var E;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);E=i[P]}else r==="value"&&(E=i.find(H=>String(H.value)===p.payload.label));var{coordinate:I}=p.payload;if(I==null||o==null){n(mf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(E==null){n(mf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:q,y:B}=I,$=Math.min(q,o.x+o.width),V=Math.min(B,o.y+o.height),te={x:a==="horizontal"?E.coordinate:$,y:a==="horizontal"?V:E.coordinate},Y=mf({active:p.payload.active,coordinate:te,dataKey:p.payload.dataKey,index:String(E.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Y)}}};return th.on(yj,d),()=>{th.off(yj,d)}},[u,n,t,e,r,i,a,o])}function Oxe(){var e=Ue(NN),t=Ue(CN),n=fn();b.useEffect(()=>{if(e==null)return qu;var r=(i,a,o)=>{t!==o&&e===i&&n(xxe(a))};return th.on(lM,r),()=>{th.off(lM,r)}},[n,t,e])}function Exe(){var e=fn();b.useEffect(()=>{e(yxe())},[e]),Axe(),Oxe()}function zxe(e,t,n,r,i,a){var o=Ue(w=>Lbe(w,e,t)),u=Ue(xbe),d=Ue(CN),f=Ue(NN),p=Ue(BB),m=Ue(vxe),y=m?.sourceViewBox!=null,v=xh();b.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=mf({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});th.emit(yj,f,w,d)}},[y,n,o,u,i,r,d,f,p,a,v])}function dM(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 fM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dM(Object(n),!0).forEach(function(r){Txe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Txe(e,t,n){return(t=Pxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pxe(e){var t=Rxe(e,"string");return typeof t=="symbol"?t:t+""}function Rxe(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 Dxe(e){return e.dataKey}function Mxe(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(Qhe,t)}var hM=[],Ixe={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 jy(e){var t,n,r=gr(e,Ixe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:N,shared:O,trigger:_,defaultIndex:C,portal:T,axisId:E}=r,A=fn(),P=typeof C=="number"?String(C):C;b.useEffect(()=>{A(A0e({shared:O,trigger:_,axisId:E,active:i,defaultIndex:P}))},[A,O,_,E,i,P]);var I=xh(),q=bB(),B=S0e(O),{activeIndex:$,isActive:V}=(t=Ue(Ne=>Ube(Ne,B,_,P)))!==null&&t!==void 0?t:{},te=Ue(Ne=>Bbe(Ne,B,_,P)),Y=Ue(Ne=>LU(Ne,B,_,P)),H=Ue(Ne=>$be(Ne,B,_,P)),J=te,pe=uxe(),Se=(n=i??V)!==null&&n!==void 0?n:!1,[R,U]=k3([J,Se]),F=B==="axis"?Y:void 0;zxe(B,_,H,F,$,Se);var D=T??pe;if(D==null||I==null||B==null)return null;var Q=J??hM;Se||(Q=hM),f&&Q.length&&(Q=b3(Q.filter(Ne=>Ne.value!=null&&(Ne.hide!==!0||r.includeHidden)),y,Dxe));var se=Q.length>0,ae=fM(fM({},r),{},{payload:Q,label:F,active:Se,activeIndex:$,coordinate:H,accessibilityLayer:q}),he=b.createElement(lpe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:p,active:Se,coordinate:H,hasPayload:se,offset:m,position:v,reverseDirection:w,useTranslate3d:S,viewBox:I,wrapperStyle:j,lastBoundingBox:R,innerRef:U,hasPortalFromProps:!!T},Mxe(d,ae));return b.createElement(b.Fragment,null,ql.createPortal(he,D),Se&&b.createElement(cxe,{cursor:N,tooltipEventType:B,coordinate:H,payload:Q,index:$}))}function Lxe(e,t,n){return(t=$xe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $xe(e){var t=Bxe(e,"string");return typeof t=="symbol"?t:t+""}function Bxe(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 Uxe{constructor(t){Lxe(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 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 Fxe(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){qxe(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 qxe(e,t,n){return(t=Hxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hxe(e){var t=Kxe(e,"string");return typeof t=="symbol"?t:t+""}function Kxe(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 Gxe={cacheSize:2e3,enableCache:!0},qU=Fxe({},Gxe),mM=new Uxe(qU.cacheSize),Vxe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},gM="recharts_measurement_span";function Zxe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(u)}var yM=(e,t)=>{try{var n=document.getElementById(gM);n||(n=document.createElement("span"),n.setAttribute("id",gM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Vxe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Cf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||kh.isSsr)return{width:0,height:0};if(!qU.enableCache)return yM(t,n);var r=Zxe(t,n),i=mM.get(r);if(i)return i;var a=yM(t,n);return mM.set(r,a),a},HU;function Yxe(e,t,n){return(t=Wxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wxe(e){var t=Qxe(e,"string");return typeof t=="symbol"?t:t+""}function Qxe(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 vM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Xxe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Jxe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ewe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},twe=["cm","mm","pt","pc","in","Q","px"];function nwe(e){return twe.includes(e)}var su="NaN";function rwe(e,t){return e*ewe[t]}class Yn{static parse(t){var n,[,r,i]=(n=Jxe.exec(t))!==null&&n!==void 0?n:[];return r==null?Yn.NaN:new Yn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,xa(t)&&(this.unit=""),n!==""&&!Xxe.test(n)&&(this.num=NaN,this.unit=""),nwe(n)&&(this.num=rwe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return xa(this.num)}}HU=Yn;Yxe(Yn,"NaN",new HU(NaN,""));function KU(e){if(e==null||e.includes(su))return su;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=vM.exec(t))!==null&&n!==void 0?n:[],o=Yn.parse(r??""),u=Yn.parse(a??""),d=i==="*"?o.multiply(u):o.divide(u);if(d.isNaN())return su;t=t.replace(vM,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=bM.exec(t))!==null&&f!==void 0?f:[],v=Yn.parse(p??""),w=Yn.parse(y??""),S=m==="+"?v.add(w):v.subtract(w);if(S.isNaN())return su;t=t.replace(bM,S.toString())}return t}var xM=/\(([^()]*)\)/;function iwe(e){for(var t=e,n;(n=xM.exec(t))!=null;){var[,r]=n;t=t.replace(xM,KU(r))}return t}function awe(e){var t=e.replace(/\s+/g,"");return t=iwe(t),t=KU(t),t}function swe(e){try{return awe(e)}catch{return su}}function CS(e){var t=swe(e.slice(5,-1));return t===su?"":t}var owe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],lwe=["dx","dy","angle","className","breakAll"];function vj(){return vj=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},vj.apply(null,arguments)}function wM(e,t){if(e==null)return{};var n,r,i=cwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cwe(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 GU=/[ \f\n\r\t\v\u2028\u2029]+/,VU=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Xn(t)||(n?i=t.toString().split(""):i=t.toString().split(GU));var a=i.map(u=>({word:u,width:Cf(u,r).width})),o=n?0:Cf(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function ZU(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function uwe(e){return Xn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var YU=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(o),d.width+=u+n;else{var f={words:[o],width:u};i.push(f)}return i},[]),WU=e=>e.reduce((t,n)=>t.width>n.width?t:n),dwe="…",SM=(e,t,n,r,i,a,o,u)=>{var d=e.slice(0,t),f=VU({breakAll:n,style:r,children:d+dwe});if(!f)return[!1,[]];var p=YU(f.wordsWithComputedWidth,a,o,u),m=p.length>i||WU(p).width>Number(a);return[m,p]},fwe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:u,breakAll:d}=e,f=Le(a),p=String(o),m=YU(t,r,n,i);if(!f||i)return m;var y=m.length>a||WU(m).width>Number(r);if(!y)return m;for(var v=0,w=p.length-1,S=0,j;v<=w&&S<=p.length-1;){var N=Math.floor((v+w)/2),O=N-1,[_,C]=SM(p,O,d,u,a,r,n,i),[T]=SM(p,N,d,u,a,r,n,i);if(!_&&!T&&(v=N+1),_&&T&&(w=N-1),!_&&T){j=C;break}S++}return j||m},jM=e=>{var t=Xn(e)?[]:e.toString().split(GU);return[{words:t,width:void 0}]},hwe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!kh.isSsr){var u,d,f=VU({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return jM(r);return fwe({breakAll:a,children:r,maxLines:o,style:i},u,d,t,!!n)}return jM(r)},QU="#808080",pwe={angle:0,breakAll:!1,capHeight:"0.71em",fill:QU,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},xC=b.forwardRef((e,t)=>{var n=gr(e,pwe),{x:r,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=wM(n,owe),y=b.useMemo(()=>hwe({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:w,angle:S,className:j,breakAll:N}=m,O=wM(m,lwe);if(!_i(r)||!_i(i)||y.length===0)return null;var _=Number(r)+(Le(v)?v:0),C=Number(i)+(Le(w)?w:0);if(!Je(_)||!Je(C))return null;var T;switch(p){case"start":T=CS("calc(".concat(o,")"));break;case"middle":T=CS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:T=CS("calc(".concat(y.length-1," * -").concat(a,")"));break}var E=[],A=y[0];if(d&&A!=null){var P=A.width,{width:I}=m;E.push("scale(".concat(Le(I)&&Le(P)?I/P:1,")"))}return S&&E.push("rotate(".concat(S,", ").concat(_,", ").concat(C,")")),E.length&&(O.transform=E.join(" ")),b.createElement("text",vj({},Pr(O),{ref:t,x:_,y:C,className:Et("recharts-text",j),textAnchor:f,fill:u.includes("url")?QU:u}),y.map((q,B)=>{var $=q.words.join(N?"":" ");return b.createElement("tspan",{x:_,dy:B===0?T:a,key:"".concat($,"-").concat(B)},$)}))});xC.displayName="Text";function kM(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 sa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kM(Object(n),!0).forEach(function(r){mwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mwe(e,t,n){return(t=gwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gwe(e){var t=ywe(e,"string");return typeof t=="symbol"?t:t+""}function ywe(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 vwe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:u,upperWidth:d,lowerWidth:f}=pN(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=p+d/2,S=u>=0?1:-1,j=S*r,N=S>0?"end":"start",O=S>0?"start":"end",_=d>=0?1:-1,C=_*r,T=_>0?"end":"start",E=_>0?"start":"end",A=i;if(n==="top"){var P={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:N};return A&&(P.height=Math.max(o-A.y,0),P.width=d),P}if(n==="bottom"){var I={x:m+f/2,y:o+u+j,horizontalAnchor:"middle",verticalAnchor:O};return A&&(I.height=Math.max(A.y+A.height-(o+u),0),I.width=f),I}if(n==="left"){var q={x:y-C,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return A&&(q.width=Math.max(q.x-A.x,0),q.height=u),q}if(n==="right"){var B={x:y+v+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"};return A&&(B.width=Math.max(A.x+A.width-B.x,0),B.height=u),B}var $=A?{width:v,height:u}:{};return n==="insideLeft"?sa({x:y+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"},$):n==="insideRight"?sa({x:y+v-C,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"},$):n==="insideTop"?sa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:O},$):n==="insideBottom"?sa({x:m+f/2,y:o+u-j,horizontalAnchor:"middle",verticalAnchor:N},$):n==="insideTopLeft"?sa({x:p+C,y:o+j,horizontalAnchor:E,verticalAnchor:O},$):n==="insideTopRight"?sa({x:p+d-C,y:o+j,horizontalAnchor:T,verticalAnchor:O},$):n==="insideBottomLeft"?sa({x:m+C,y:o+u-j,horizontalAnchor:E,verticalAnchor:N},$):n==="insideBottomRight"?sa({x:m+f-C,y:o+u-j,horizontalAnchor:T,verticalAnchor:N},$):n&&typeof n=="object"&&(Le(n.x)||Dl(n.x))&&(Le(n.y)||Dl(n.y))?sa({x:a+bo(n.x,v),y:o+bo(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},$):sa({x:w,y:o+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},bwe=["labelRef"],xwe=["content"];function NM(e,t){if(e==null)return{};var n,r,i=wwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wwe(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 CM(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 gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){Swe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Swe(e,t,n){return(t=jwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jwe(e){var t=kwe(e,"string");return typeof t=="symbol"?t:t+""}function kwe(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 Ja(){return Ja=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},Ja.apply(null,arguments)}var XU=b.createContext(null),JU=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return b.createElement(XU.Provider,{value:d},u)},e8=()=>{var e=b.useContext(XU),t=xh();return e||(t?pN(t):void 0)},Nwe=b.createContext(null),Cwe=()=>{var e=b.useContext(Nwe),t=Ue(KB);return e||t},_we=e=>{var{value:t,formatter:n}=e,r=Xn(e.children)?t:e.children;return typeof n=="function"?n(r):r},wC=e=>e!=null&&typeof e=="function",Awe=(e,t)=>{var n=xi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Owe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,S=Awe(m,y),j=S>=0?1:-1,N,O;switch(t){case"insideStart":N=m+j*a,O=v;break;case"insideEnd":N=y-j*a,O=!v;break;case"end":N=y+j*a,O=v;break;default:throw new Error("Unsupported position ".concat(t))}O=S<=0?O:!O;var _=Qn(u,d,w,N),C=Qn(u,d,w,N+(O?1:-1)*359),T="M".concat(_.x,",").concat(_.y,`
|
|
288
|
-
A`).concat(w,",").concat(w,",0,1,").concat(O?0:1,`,
|
|
289
|
-
`).concat(C.x,",").concat(C.y),E=Xn(e.id)?Uf("recharts-radial-line-"):e.id;return b.createElement("text",Ja({},r,{dominantBaseline:"central",className:Et("recharts-radial-bar-label",o)}),b.createElement("defs",null,b.createElement("path",{id:E,d:T})),b.createElement("textPath",{xlinkHref:"#".concat(E)},n))},Ewe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=Qn(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+o)/2,{x:v,y:w}=Qn(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},lg=e=>e!=null&&"cx"in e&&Le(e.cx),zwe={angle:0,offset:5,zIndex:ar.label,position:"middle",textBreakAll:!1};function Twe(e){if(!lg(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 Xs(e){var t=gr(e,zwe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=Cwe(),y=e8(),v=i==="center"?y:m??y,w,S,j;n==null?w=v:lg(n)?w=n:w=pN(n);var N=Twe(w);if(!w||Xn(a)&&Xn(o)&&!b.isValidElement(u)&&typeof u!="function")return null;var O=gf(gf({},t),{},{viewBox:w});if(b.isValidElement(u)){var{labelRef:_}=O,C=NM(O,bwe);return b.cloneElement(u,C)}if(typeof u=="function"){var{content:T}=O,E=NM(O,xwe);if(S=b.createElement(u,E),b.isValidElement(S))return S}else S=_we(t);var A=Pr(t);if(lg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Owe(t,i,S,A,w);j=Ewe(w,t.offset,t.position)}else{if(!N)return null;var P=vwe({viewBox:N,position:i,offset:t.offset,parentViewBox:lg(r)?void 0:r});j=gf(gf({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 b.createElement(Aa,{zIndex:t.zIndex},b.createElement(xC,Ja({ref:p,className:Et("recharts-label",d)},A,j,{textAnchor:ZU(A.textAnchor)?A.textAnchor:j.textAnchor,breakAll:f}),S))}Xs.displayName="Label";var Pwe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(Xs,Ja({key:"label-implicit"},r)):_i(e)?b.createElement(Xs,Ja({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===Xs?b.cloneElement(e,gf({key:"label-implicit"},r)):b.createElement(Xs,Ja({key:"label-implicit",content:e},r)):wC(e)?b.createElement(Xs,Ja({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(Xs,Ja({},e,{key:"label-implicit"},r)):null};function t8(e){var{label:t,labelRef:n}=e,r=e8();return Pwe(t,r,n)||null}var Rwe=["valueAccessor"],Dwe=["dataKey","clockWise","id","textBreakAll","zIndex"];function ky(){return ky=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},ky.apply(null,arguments)}function _M(e,t){if(e==null)return{};var n,r,i=Mwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mwe(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 Iwe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(uwe(t))return t},n8=b.createContext(void 0),Lwe=n8.Provider,r8=b.createContext(void 0);r8.Provider;function $we(){return b.useContext(n8)}function Bwe(){return b.useContext(r8)}function cg(e){var{valueAccessor:t=Iwe}=e,n=_M(e,Rwe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:u}=n,d=_M(n,Dwe),f=$we(),p=Bwe(),m=f||p;return!m||!m.length?null:b.createElement(Aa,{zIndex:u??ar.label},b.createElement(Zi,{className:"recharts-label-list"},m.map((y,v)=>{var w,S=Xn(r)?t(y,v):$n(y.payload,r),j=Xn(a)?{}:{id:"".concat(a,"-").concat(v)};return b.createElement(Xs,ky({key:"label-".concat(v)},Pr(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}cg.displayName="LabelList";function Uwe(e){var{label:t}=e;return t?t===!0?b.createElement(cg,{key:"labelList-implicit"}):b.isValidElement(t)||wC(t)?b.createElement(cg,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(cg,ky({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function bj(){return bj=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},bj.apply(null,arguments)}var i8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Et("recharts-dot",i);return Le(t)&&Le(n)&&Le(r)?b.createElement("circle",bj({},Vi(e),iN(e),{className:a,cx:t,cy:n,r})):null},Fwe={radiusAxis:{},angleAxis:{}},a8=or({name:"polarAxis",initialState:Fwe,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:vCe,removeRadiusAxis:bCe,addAngleAxis:xCe,removeAngleAxis:wCe}=a8.actions,qwe=a8.reducer;function Hwe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var s8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Kwe(e){var{tooltipEntrySettings:t}=e,n=fn(),r=yr(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(N0e(t)):i.current!==t&&n(C0e({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(_0e(i.current)),i.current=null)},[n]),null}function Gwe(e){var{legendPayload:t}=e,n=fn(),r=yr(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(lhe(t)):i.current!==t&&n(che({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(uhe(i.current)),i.current=null)},[n]),null}var _S,Vwe=()=>{var[e]=b.useState(()=>Uf("uid-"));return e},Zwe=(_S=Ry.useId)!==null&&_S!==void 0?_S:Vwe;function Ywe(e,t){var n=Zwe();return t||(e?"".concat(e,"-").concat(n):n)}var Wwe=b.createContext(void 0),Qwe=e=>{var{id:t,type:n,children:r}=e,i=Ywe("recharts-".concat(n),t);return b.createElement(Wwe.Provider,{value:i},r(i))},Xwe={cartesianItems:[],polarItems:[]},o8=or({name:"graphicalItems",initialState:Xwe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Wt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=wi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Wt()},removeCartesianGraphicalItem:{reducer(e,t){var n=wi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Wt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Wt()},removePolarGraphicalItem:{reducer(e,t){var n=wi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Wt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=wi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Wt()}}}),{addCartesianGraphicalItem:Jwe,replaceCartesianGraphicalItem:eSe,removeCartesianGraphicalItem:tSe,addPolarGraphicalItem:SCe,removePolarGraphicalItem:jCe,replacePolarGraphicalItem:kCe}=o8.actions,nSe=o8.reducer,rSe=e=>{var t=fn(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(Jwe(e)):n.current!==e&&t(eSe({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(tSe(n.current)),n.current=null)},[t]),null},iSe=b.memo(rSe),aSe=["points"];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 AS(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){sSe(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 sSe(e,t,n){return(t=oSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oSe(e){var t=lSe(e,"string");return typeof t=="symbol"?t:t+""}function lSe(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 Ny(){return Ny=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},Ny.apply(null,arguments)}function cSe(e,t){if(e==null)return{};var n,r,i=uSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uSe(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 dSe(e){var{option:t,dotProps:n,className:r}=e;if(b.isValidElement(t))return b.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Et(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,u=cSe(a,aSe);return b.createElement(i8,Ny({},u,{className:i}))}function fSe(e,t){return e==null?!1:t?!0:e.length===1}function hSe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:d,zIndex:f=ar.scatter}=e;if(!fSe(t,n))return null;var p=s8(n),m=Wle(n),y=t.map((w,S)=>{var j,N,O=AS(AS(AS({r:3},o),m),{},{index:S,cx:(j=w.x)!==null&&j!==void 0?j:void 0,cy:(N=w.y)!==null&&N!==void 0?N:void 0,dataKey:a,value:w.value,payload:w.payload,points:t});return b.createElement(dSe,{key:"dot-".concat(S),option:n,dotProps:O,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),b.createElement(Aa,{zIndex:f},b.createElement(Zi,Ny({className:r},v),y))}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 EM(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){pSe(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 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 l8=0,ySe={xAxis:{},yAxis:{},zAxis:{}},c8=or({name:"cartesianAxis",initialState:ySe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Wt()},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:Wt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Wt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Wt()},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:Wt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Wt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Wt()},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:Wt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Wt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...o,r].slice(-3);e.yAxis[n]=EM(EM({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:vSe,replaceXAxis:bSe,removeXAxis:xSe,addYAxis:wSe,replaceYAxis:SSe,removeYAxis:jSe,addZAxis:NCe,replaceZAxis:CCe,removeZAxis:_Ce,updateYAxisWidth:kSe}=c8.actions,NSe=c8.reducer,CSe=ce([Jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),_Se=ce([CSe,hs,ps],(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)}}),SC=()=>Ue(_Se),ASe=()=>Ue(Nbe);function zM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){OSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OSe(e,t,n){return(t=ESe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ESe(e){var t=zSe(e,"string");return typeof t=="symbol"?t:t+""}function zSe(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 TSe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=OS(OS(OS({},u),mv(i)),iN(i)),f;return b.isValidElement(i)?f=b.cloneElement(i,d):typeof i=="function"?f=i(d):f=b.createElement(i8,d),b.createElement(Zi,{className:"recharts-active-dot",clipPath:o},f)};function TM(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=ar.activeDot}=e,u=Ue(eh),d=ASe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return Xn(f)?null:b.createElement(Aa,{zIndex:o},b.createElement(TSe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var PSe=e=>{var{chartData:t}=e,n=fn(),r=yr();return b.useEffect(()=>r?()=>{}:(n(cM(t)),()=>{n(cM(void 0))}),[t,n,r]),null},PM={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},u8=or({name:"brush",initialState:PM,reducers:{setBrushSettings(e,t){return t.payload==null?PM:t.payload}}}),{setBrushSettings:ACe}=u8.actions,RSe=u8.reducer,DSe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},MSe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return DSe({x:t,y:n},{x:r,y:i})};function ISe(e){return(e%180+180)%180}var LSe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ISe(i),o=a*Math.PI/180,u=Math.atan(r/n),d=o>u&&o<Math.PI-u?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},$Se={dots:[],areas:[],lines:[]},d8=or({name:"referenceElements",initialState:$Se,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=wi(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=wi(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=wi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:OCe,removeDot:ECe,addArea:zCe,removeArea:TCe,addLine:BSe,removeLine:USe}=d8.actions,FSe=d8.reducer,f8=b.createContext(void 0),qSe=e=>{var{children:t}=e,[n]=b.useState("".concat(Uf("recharts"),"-clip")),r=SC();if(r==null)return null;var{x:i,y:a,width:o,height:u}=r;return b.createElement(f8.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:o}))),t)},HSe=()=>b.useContext(f8);class KSe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:a}=n;return{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:a,fallback:o}=n,u,d;return o==="rangeMin"?u=this.yAxisScale.rangeMin():o==="rangeMax"?u=this.yAxisScale.rangeMax():u=0,o==="rangeMin"?d=this.xAxisScale.rangeMin():o==="rangeMax"?d=this.xAxisScale.rangeMax():d=0,{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:d,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:u}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),a=r==null||this.yAxisScale.isInRange(r);return i&&a}}function RM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){GSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GSe(e,t,n){return(t=VSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VSe(e){var t=ZSe(e,"string");return typeof t=="symbol"?t:t+""}function ZSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cy.apply(null,arguments)}var YSe=(e,t)=>{var n;if(b.isValidElement(e))n=b.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!Je(t.x1)||!Je(t.y1)||!Je(t.x2)||!Je(t.y2))return null;n=b.createElement("line",Cy({},t,{className:"recharts-reference-line-line"}))}return n},WSe=(e,t,n,r,i,a)=>{var{x:o,width:u}=a,d=i.map(e,{position:n});if(!Je(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:o+u,y:d},{x:o,y:d}];return r==="left"?f.reverse():f},QSe=(e,t,n,r,i,a)=>{var{y:o,height:u}=a,d=i.map(e,{position:n});if(!Je(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:d,y:o+u},{x:d,y:o}];return r==="top"?f.reverse():f},XSe=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(a=>!r.isInRange(a))?null:i},JSe=(e,t,n,r,i,a,o)=>{var{x:u,y:d,segment:f,ifOverflow:p}=o,m=_i(u),y=_i(d);return y?WSe(d,p,r,a,t,n):m?QSe(u,p,r,i,e,n):f!=null&&f.length===2?XSe(f,p,r,new KSe({x:e,y:t})):null};function e1e(e){var t=fn();return b.useEffect(()=>(t(BSe(e)),()=>{t(USe(e))})),null}function t1e(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:a}=e,o=yr(),u=HSe(),d=Ue(A=>Ca(A,t)),f=Ue(A=>_a(A,n)),p=Ue(A=>zu(A,"xAxis",t,o)),m=Ue(A=>zu(A,"yAxis",n,o)),y=xh();if(!u||!y||d==null||f==null||p==null||m==null)return null;var v=JSe(p,m,y,e.position,d.orientation,f.orientation,e);if(!v)return null;var w=v[0],S=v[1];if(w==null||S==null)return null;var{x:j,y:N}=w,{x:O,y:_}=S,C=a==="hidden"?"url(#".concat(u,")"):void 0,T=DM(DM({clipPath:C},Pr(e)),{},{x1:j,y1:N,x2:O,y2:_}),E=MSe({x1:j,y1:N,x2:O,y2:_});return b.createElement(Aa,{zIndex:e.zIndex},b.createElement(Zi,{className:Et("recharts-reference-line",i)},YSe(r,T),b.createElement(JU,Cy({},E,{lowerWidth:E.width,upperWidth:E.width}),b.createElement(t8,{label:e.label}),e.children)))}var n1e={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ar.line};function h8(e){var t=gr(e,n1e);return b.createElement(b.Fragment,null,b.createElement(e1e,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),b.createElement(t1e,t))}h8.displayName="ReferenceLine";function p8(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 r1e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return LSe(r,n)}function i1e(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:u}=e;return t===1?{start:r?i:a,end:r?i+o:a+u}:{start:r?i+o:a+u,end:r?i:a}}function nh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function a1e(e,t){return p8(e,t+1)}function s1e(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:u}=t,d=0,f=1,p=o,m=function(){var w=r?.[d];if(w===void 0)return{v:p8(r,f)};var S=d,j,N=()=>(j===void 0&&(j=n(w,S)),j),O=w.coordinate,_=d===0||nh(e,O,N,p,u);_||(d=0,p=o,f+=1),_&&(p=O+e*(N()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function o1e(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:u,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=u,y=!0,v=function(){var C=r[S];if(C==null)return 0;var T=S,E,A=()=>(E===void 0&&(E=n(C,T)),E),P=C.coordinate,I=S===p||nh(e,P,A,m,d);if(!I)return y=!1,1;I&&(m=P+e*(A()/2+i))},w,S=p;S<o&&(w=v(),!(w!==0&&w===1));S+=f);if(y){for(var j=[],N=p;N<o;N+=f){var O=r[N];O!=null&&j.push(O)}return j}}return[]}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 tr(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){l1e(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 l1e(e,t,n){return(t=c1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c1e(e){var t=u1e(e,"string");return typeof t=="symbol"?t:t+""}function u1e(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 d1e(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:u}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var w=v,S,j=()=>(S===void 0&&(S=n(v,y)),S);if(y===o-1){var N=e*(w.coordinate+e*j()/2-d);a[y]=w=tr(tr({},w),{},{tickCoord:N>0?w.coordinate-N*e:w.coordinate})}else a[y]=w=tr(tr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var O=nh(e,w.tickCoord,j,u,d);O&&(d=w.tickCoord-e*(j()/2+i),a[y]=tr(tr({},w),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function f1e(e,t,n,r,i,a){var o=(r||[]).slice(),u=o.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),y=e*(p.coordinate+e*m/2-f);if(o[u-1]=p=tr(tr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=nh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[u-1]=tr(tr({},p),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(O){var _=o[O];if(_==null)return 1;var C=_,T,E=()=>(T===void 0&&(T=n(_,O)),T);if(O===0){var A=e*(C.coordinate-e*E()/2-d);o[O]=C=tr(tr({},C),{},{tickCoord:A<0?C.coordinate-A*e:C.coordinate})}else o[O]=C=tr(tr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var P=nh(e,C.tickCoord,E,d,f);P&&(d=C.tickCoord+e*(E()/2+i),o[O]=tr(tr({},C),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return o}function jC(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Le(d)||kh.isSsr){var y;return(y=a1e(i,Le(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=u==="top"||u==="bottom"?"width":"height",S=p&&w==="width"?Cf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(T,E)=>{var A=typeof f=="function"?f(T.value,E):T.value;return w==="width"?r1e(Cf(A,{fontSize:t,letterSpacing:n}),S,m):Cf(A,{fontSize:t,letterSpacing:n})[w]},N=i[0],O=i[1],_=i.length>=2&&N!=null&&O!=null?xi(O.coordinate-N.coordinate):1,C=i1e(a,_,w);return d==="equidistantPreserveStart"?s1e(_,C,j,i,o):d==="equidistantPreserveEnd"?o1e(_,C,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=f1e(_,C,j,i,o,d==="preserveStartEnd"):v=d1e(_,C,j,i,o),v.filter(T=>T.isShow))}var h1e=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+u+(n?r:0);return Math.round(f)}return 0},p1e={xAxis:{},yAxis:{}},m8=or({name:"renderedTicks",initialState:p1e,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:m1e,removeRenderedTicks:g1e}=m8.actions,y1e=m8.reducer,v1e=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function b1e(e,t){if(e==null)return{};var n,r,i=x1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x1e(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 Ul(){return Ul=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},Ul.apply(null,arguments)}function IM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(r){w1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w1e(e,t,n){return(t=S1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S1e(e){var t=j1e(e,"string");return typeof t=="symbol"?t:t+""}function j1e(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 ss={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:ar.axis};function k1e(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=mn(mn(mn({},d),Vi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=mn(mn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=mn(mn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return b.createElement("line",Ul({},f,{className:Et("recharts-cartesian-axis-line",bv(u,"className"))}))}function N1e(e,t,n,r,i,a,o,u,d){var f,p,m,y,v,w,S=u?-1:1,j=e.tickSize||o,N=Le(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!u*i,m=y-S*j,w=m-S*d,v=N;break;case"left":m=y=e.coordinate,p=t+ +!u*r,f=p-S*j,v=f-S*d,w=N;break;case"right":m=y=e.coordinate,p=t+ +u*r,f=p+S*j,v=f+S*d,w=N;break;default:f=p=e.coordinate,y=n+ +u*i,m=y+S*j,w=m+S*d,v=N;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:w}}}function C1e(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function _1e(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function A1e(e){var{option:t,tickProps:n,value:r}=e,i,a=Et(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.cloneElement(t,mn(mn({},n),{},{className:a}));else if(typeof t=="function")i=t(mn(mn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Et(o,Hwe(t))),i=b.createElement(xC,Ul({},n,{className:o}),r)}return i}function O1e(e){var{ticks:t,axisType:n,axisId:r}=e,i=fn();return b.useEffect(()=>{if(r==null||n==null)return qu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(m1e({ticks:a,axisId:r,axisType:n})),()=>{i(g1e({axisId:r,axisType:n}))}},[i,t,r,n]),null}var E1e=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:S,tickSize:j,tickMargin:N,fontSize:O,letterSpacing:_,getTicksConfig:C,events:T,axisType:E,axisId:A}=e,P=jC(mn(mn({},C),{},{ticks:n}),O,_),I=Vi(C),q=mv(r),B=ZU(I.textAnchor)?I.textAnchor:C1e(p,m),$=_1e(p,m),V={};typeof i=="object"&&(V=i);var te=mn(mn({},I),{},{fill:"none"},V),Y=P.map(pe=>mn({entry:pe},N1e(pe,y,v,w,S,p,j,m,N))),H=Y.map(pe=>{var{entry:Se,line:R}=pe;return b.createElement(Zi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Se.value,"-").concat(Se.coordinate,"-").concat(Se.tickCoord)},i&&b.createElement("line",Ul({},te,R,{className:Et("recharts-cartesian-axis-tick-line",bv(i,"className"))})))}),J=Y.map((pe,Se)=>{var R,U,{entry:F,tick:D}=pe,Q=mn(mn(mn(mn({verticalAnchor:$},I),{},{textAnchor:B,stroke:"none",fill:a},D),{},{index:Se,payload:F,visibleTicksCount:P.length,tickFormatter:o,padding:d},f),{},{angle:(R=(U=f?.angle)!==null&&U!==void 0?U:I.angle)!==null&&R!==void 0?R:0}),se=mn(mn({},Q),q);return b.createElement(Zi,Ul({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},l3(T,F,Se)),r&&b.createElement(A1e,{option:r,tickProps:se,value:"".concat(typeof o=="function"?o(F.value,Se):F.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(O1e,{ticks:P,axisId:A,axisType:E}),J.length>0&&b.createElement(Aa,{zIndex:ar.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},J)),H.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},H))}),z1e=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:u,axisType:d,axisId:f}=e,p=b1e(e,v1e),[m,y]=b.useState(""),[v,w]=b.useState(""),S=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var N;return h1e({ticks:S.current,label:(N=e.labelRef)===null||N===void 0?void 0:N.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=b.useCallback(N=>{if(N){var O=N.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=O;var _=O[0];if(_){var C=window.getComputedStyle(_),T=C.fontSize,E=C.letterSpacing;(T!==m||E!==v)&&(y(T),w(E))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(Aa,{zIndex:e.zIndex},b.createElement(Zi,{className:Et("recharts-cartesian-axis",a)},b.createElement(k1e,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Vi(e)}),b.createElement(E1e,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),b.createElement(JU,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(t8,{label:e.label,labelRef:e.labelRef}),e.children)))}),kC=b.forwardRef((e,t)=>{var n=gr(e,ss);return b.createElement(z1e,Ul({},n,{ref:t}))});kC.displayName="CartesianAxis";var T1e=["x1","y1","x2","y2","key"],P1e=["offset"],R1e=["xAxisId","yAxisId"],D1e=["xAxisId","yAxisId"];function LM(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 ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(r){M1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M1e(e,t,n){return(t=I1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I1e(e){var t=L1e(e,"string");return typeof t=="symbol"?t:t+""}function L1e(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 vl(){return vl=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},vl.apply(null,arguments)}function _y(e,t){if(e==null)return{};var n,r,i=$1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $1e(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 B1e=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:u}=e;return b.createElement("rect",{x:r,y:i,ry:u,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function g8(e){var{option:t,lineItemProps:n}=e,r;if(b.isValidElement(t))r=b.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:u,y2:d,key:f}=n,p=_y(n,T1e),m=(i=Vi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=_y(m,P1e);r=b.createElement("line",vl({},v,{x1:a,y1:o,x2:u,y2:d,fill:"none",key:f}))}return r}function U1e(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=_y(e,R1e),d=i.map((f,p)=>{var m=ir(ir({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return b.createElement(g8,{key:"line-".concat(p),option:r,lineItemProps:m})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function F1e(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=_y(e,D1e),d=i.map((f,p)=>{var m=ir(ir({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return b.createElement(g8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function q1e(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%t.length;return b.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:S,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function H1e(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%n.length;return b.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:S,height:u,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var K1e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return tB(jC(ir(ir(ir({},ss),n),{},{ticks:nB(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},G1e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return tB(jC(ir(ir(ir({},ss),n),{},{ticks:nB(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},V1e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:ar.grid};function y8(e){var t=mN(),n=gN(),r=cB(),i=ir(ir({},gr(e,V1e)),{},{x:Le(e.x)?e.x:r.left,y:Le(e.y)?e.y:r.top,width:Le(e.width)?e.width:r.width,height:Le(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=yr(),S=Ue(I=>WD(I,"xAxis",a,w)),j=Ue(I=>WD(I,"yAxis",o,w));if(!wa(f)||!wa(p)||!Le(u)||!Le(d))return null;var N=i.verticalCoordinatesGenerator||K1e,O=i.horizontalCoordinatesGenerator||G1e,{horizontalPoints:_,verticalPoints:C}=i;if((!_||!_.length)&&typeof O=="function"){var T=y&&y.length,E=O({yAxis:j?ir(ir({},j),{},{ticks:T?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},T?!0:m);Qg(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(_=E)}if((!C||!C.length)&&typeof N=="function"){var A=v&&v.length,P=N({xAxis:S?ir(ir({},S),{},{ticks:A?v:S.ticks}):void 0,width:t??f,height:n??p,offset:r},A?!0:m);Qg(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(C=P)}return b.createElement(Aa,{zIndex:i.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(B1e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),b.createElement(q1e,vl({},i,{horizontalPoints:_})),b.createElement(H1e,vl({},i,{verticalPoints:C})),b.createElement(U1e,vl({},i,{offset:r,horizontalPoints:_,xAxis:S,yAxis:j})),b.createElement(F1e,vl({},i,{offset:r,verticalPoints:C,xAxis:S,yAxis:j}))))}y8.displayName="CartesianGrid";var Z1e={},v8=or({name:"errorBars",initialState:Z1e,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:PCe,replaceErrorBar:RCe,removeErrorBar:DCe}=v8.actions,Y1e=v8.reducer;function b8(e,t){var n,r,i=Ue(f=>Ca(f,e)),a=Ue(f=>_a(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Tn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Pn.allowDataOverflow,d=o||u;return{needClip:d,needClipX:o,needClipY:u}}function W1e(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=SC(),{needClipX:a,needClipY:o,needClip:u}=b8(t,n);if(!u||!i)return null;var{x:d,y:f,width:p,height:m}=i;return b.createElement("clipPath",{id:"clipPath-".concat(r)},b.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function Q1e(e){var t=mv(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(u)||u<0)&&(u=r),{r:o,strokeWidth:u}}return{r:n,strokeWidth:r}}function NC(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:l8}function CC(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:l8}var x8=(e,t,n)=>fU(e,"xAxis",NC(e,t),n),w8=(e,t,n)=>dU(e,"xAxis",NC(e,t),n),S8=(e,t,n)=>fU(e,"yAxis",CC(e,t),n),j8=(e,t,n)=>dU(e,"yAxis",CC(e,t),n),X1e=ce([sn,x8,S8,w8,j8],(e,t,n,r,i)=>Na(e,"xAxis")?Wg(t,r,!1):Wg(n,i,!1)),J1e=(e,t)=>t,k8=ce([P6,J1e],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),N8=e=>{var t=sn(e),n=Na(t,"xAxis");return n?"yAxis":"xAxis"},eje=(e,t)=>{var n=N8(e);return n==="yAxis"?CC(e,t):NC(e,t)},tje=(e,t,n)=>q6(e,N8(e),eje(e,t),n),nje=ce([k8,tje],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=EN(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),rje=ce([sn,x8,S8,w8,j8,nje,wme,X1e,k8,Eme],(e,t,n,r,i,a,o,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return jje({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:u})}}),ije=["id"],aje=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function _l(){return _l=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},_l.apply(null,arguments)}function C8(e,t){if(e==null)return{};var n,r,i=sje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function sje(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 $M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ou(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){oje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oje(e,t,n){return(t=lje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lje(e){var t=cje(e,"string");return typeof t=="symbol"?t:t+""}function cje(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 Ay(e,t){return e&&e!=="none"?e:t}var uje=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Ay(r,i),value:rB(n,t),payload:e}]},dje=b.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:qu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:rB(o,t),hide:u,type:f,color:Ay(r,a),unit:d,graphicalItemId:p}};return b.createElement(Kwe,{tooltipEntrySettings:m})});function fje(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,u=Vi(r);return b.createElement(hSe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function hje(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,u,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ou(ou({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return b.createElement(Lwe,{value:t?i:void 0},n)}function BM(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=C8(a,ije),v=Vi(y),w=Pr(y);return b.createElement(b.Fragment,null,t?.length>1&&b.createElement(Zi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},b.createElement(og,_l({},w,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&b.createElement(og,_l({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&b.createElement(og,_l({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:n}))),b.createElement(fje,{points:t,props:y,clipPathId:i}))}function pje(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!Je(u)||!Je(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Le(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Le(p)?b.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function mje(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!Je(u)||!Je(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Le(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Le(p)?b.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function gje(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?b.createElement(pje,{alpha:t,points:r,baseLine:i,strokeWidth:a}):b.createElement(mje,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function yje(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=b.useMemo(()=>({points:o,baseLine:u}),[o,u]),S=kB(w,"recharts-area-"),j=yN(),[N,O]=b.useState(!1),_=!N,C=b.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),T=b.useCallback(()=>{typeof y=="function"&&y(),O(!0)},[y]);if(j==null)return null;var E=i.current,A=a.current;return b.createElement(hje,{showLabels:_,points:o},r.children,b.createElement(jB,{animationId:S,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:T,key:S},P=>{if(E){var I=E.length/o.length,q=P===1?o:o.map(($,V)=>{var te=Math.floor(V*I);if(E[te]){var Y=E[te];return ou(ou({},$),{},{x:ua(Y.x,$.x,P),y:ua(Y.y,$.y,P)})}return $}),B;return Le(u)?B=ua(A,u,P):Xn(u)||xa(u)?B=ua(A,0,P):B=u.map(($,V)=>{var te=Math.floor(V*I);if(Array.isArray(A)&&A[te]){var Y=A[te];return ou(ou({},$),{},{x:ua(Y.x,$.x,P),y:ua(Y.y,$.y,P)})}return $}),P>0&&(i.current=q,a.current=B),b.createElement(BM,{points:q,baseLine:B,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=o,a.current=u),b.createElement(Zi,null,d&&b.createElement("defs",null,b.createElement("clipPath",{id:"animationClipPath-".concat(n)},b.createElement(gje,{alpha:P,points:o,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),b.createElement(Zi,{clipPath:"url(#animationClipPath-".concat(n,")")},b.createElement(BM,{points:o,baseLine:u,needClip:t,clipPathId:n,props:r})))}),b.createElement(Uwe,{label:r.label}))}function vje(e){var{needClip:t,clipPathId:n,props:r}=e,i=b.useRef(null),a=b.useRef();return b.createElement(yje,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class bje extends b.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var S=Et("recharts-area",i),j=y,{r:N,strokeWidth:O}=Q1e(n),_=s8(n),C=N*2+O,T=u?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return b.createElement(Aa,{zIndex:w},b.createElement(Zi,{className:S},u&&b.createElement("defs",null,b.createElement(W1e,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&b.createElement("clipPath",{id:"clipPath-dots-".concat(j)},b.createElement("rect",{x:o-C/2,y:a-C/2,width:p+C,height:m+C}))),b.createElement(vje,{needClip:u,clipPathId:j,props:this.props})),b.createElement(TM,{points:r,mainColor:Ay(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&b.createElement(TM,{points:v,mainColor:Ay(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var xje={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:ar.area};function wje(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:S}=e,j=C8(e,aje),N=Hu(),O=DU(),{needClip:_}=b8(w,S),C=yr(),{points:T,isRange:E,baseLine:A}=(t=Ue(V=>rje(V,e.id,C)))!==null&&t!==void 0?t:{},P=SC();if(N!=="horizontal"&&N!=="vertical"||P==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:I,width:q,x:B,y:$}=P;return!T||!T.length?null:b.createElement(bje,_l({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:A,connectNulls:o,dot:u,fill:d,fillOpacity:f,height:I,hide:p,layout:N,isAnimationActive:m,isRange:E,legendType:y,needClip:_,points:T,stroke:v,width:q,left:B,top:$,xAxisId:w,yAxisId:S}))}var Sje=(e,t,n,r,i)=>{var a=n??t;if(Le(a))return a;var o=e==="horizontal"?i:r,u=o.scale.domain();if(o.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function jje(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,S=Sje(a,o,n,u,d),j=a==="horizontal",N=!1,O=f.map((C,T)=>{var E,A,P,I;if(w)I=i[p+T];else{var q=$n(C,r);Array.isArray(q)?(I=q,N=!0):I=[S,q]}var B=(E=(A=I)===null||A===void 0?void 0:A[1])!==null&&E!==void 0?E:null,$=B==null||w&&!t&&$n(C,r)==null;if(j){var V;return{x:HP({axis:u,ticks:m,bandSize:v,entry:C,index:T}),y:$?null:(V=d.scale.map(B))!==null&&V!==void 0?V:null,value:I,payload:C}}return{x:$?null:(P=u.scale.map(B))!==null&&P!==void 0?P:null,y:HP({axis:d,ticks:y,bandSize:v,entry:C,index:T}),value:I,payload:C}}),_;return w||N?_=O.map(C=>{var T,E=Array.isArray(C.value)?C.value[0]:null;if(j){var A;return{x:C.x,y:E!=null&&C.y!=null&&(A=d.scale.map(E))!==null&&A!==void 0?A:null,payload:C.payload}}return{x:E!=null&&(T=u.scale.map(E))!==null&&T!==void 0?T:null,y:C.y,payload:C.payload}}):_=j?d.scale.map(S):u.scale.map(S),{points:O,baseLine:_??0,isRange:N}}function kje(e){var t=gr(e,xje),n=yr();return b.createElement(Qwe,{id:t.id,type:"area"},r=>b.createElement(b.Fragment,null,b.createElement(Gwe,{legendPayload:uje(t)}),b.createElement(dje,{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}),b.createElement(iSe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ufe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),b.createElement(wje,_l({},t,{id:r}))))}var bl=b.memo(kje,jh);bl.displayName="Area";var Nje=["domain","range"],Cje=["domain","range"];function UM(e,t){if(e==null)return{};var n,r,i=_je(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _je(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 FM(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 _8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=UM(e,Nje),{domain:a,range:o}=t,u=UM(t,Cje);return!FM(n,a)||!FM(r,o)?!1:jh(i,u)}var Aje=["type"],Oje=["dangerouslySetInnerHTML","ticks","scale"],Eje=["id","scale"];function xj(){return xj=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},xj.apply(null,arguments)}function qM(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 HM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qM(Object(n),!0).forEach(function(r){zje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zje(e,t,n){return(t=Tje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tje(e){var t=Pje(e,"string");return typeof t=="symbol"?t:t+""}function Pje(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 wj(e,t){if(e==null)return{};var n,r,i=Rje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rje(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 Dje(e){var t=fn(),n=b.useRef(null),r=yN(),{type:i}=e,a=wj(e,Aje),o=Bv(r,"xAxis",i),u=b.useMemo(()=>{if(o!=null)return HM(HM({},a),{},{type:o})},[a,o]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(vSe(u)):n.current!==u&&t(bSe({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(xSe(n.current)),n.current=null)},[t]),null}var Mje=e=>{var{xAxisId:t,className:n}=e,r=Ue(aB),i=yr(),a="xAxis",o=Ue(N=>uU(N,a,t,i)),u=Ue(N=>s0e(N,t)),d=Ue(N=>f0e(N,t)),f=Ue(N=>O6(N,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=wj(e,Oje),{id:w,scale:S}=f,j=wj(f,Eje);return b.createElement(kC,xj({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:Et("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},Ije={allowDataOverflow:Tn.allowDataOverflow,allowDecimals:Tn.allowDecimals,allowDuplicatedCategory:Tn.allowDuplicatedCategory,angle:Tn.angle,axisLine:ss.axisLine,height:Tn.height,hide:!1,includeHidden:Tn.includeHidden,interval:Tn.interval,label:!1,minTickGap:Tn.minTickGap,mirror:Tn.mirror,orientation:Tn.orientation,padding:Tn.padding,reversed:Tn.reversed,scale:Tn.scale,tick:Tn.tick,tickCount:Tn.tickCount,tickLine:ss.tickLine,tickSize:ss.tickSize,type:Tn.type,niceTicks:Tn.niceTicks,xAxisId:0},Lje=e=>{var t=gr(e,Ije);return b.createElement(b.Fragment,null,b.createElement(Dje,{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}),b.createElement(Mje,t))},rh=b.memo(Lje,_8);rh.displayName="XAxis";var $je=["type"],Bje=["dangerouslySetInnerHTML","ticks","scale"],Uje=["id","scale"];function Sj(){return Sj=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},Sj.apply(null,arguments)}function KM(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 GM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(n),!0).forEach(function(r){Fje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fje(e,t,n){return(t=qje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qje(e){var t=Hje(e,"string");return typeof t=="symbol"?t:t+""}function Hje(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 jj(e,t){if(e==null)return{};var n,r,i=Kje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Kje(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 Gje(e){var t=fn(),n=b.useRef(null),r=yN(),{type:i}=e,a=jj(e,$je),o=Bv(r,"yAxis",i),u=b.useMemo(()=>{if(o!=null)return GM(GM({},a),{},{type:o})},[o,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(wSe(u)):n.current!==u&&t(SSe({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(jSe(n.current)),n.current=null)},[t]),null}function Vje(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),o=b.useRef(null),u=Ue(aB),d=yr(),f=fn(),p="yAxis",m=Ue(E=>m0e(E,t)),y=Ue(E=>p0e(E,t)),v=Ue(E=>uU(E,p,t,d)),w=Ue(E=>E6(E,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||wC(i)||b.isValidElement(i)||w==null)){var E=a.current;if(E){var A=E.getCalculatedWidth();Math.round(m.width)!==Math.round(A)&&f(kSe({id:t,width:A}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:N}=e,O=jj(e,Bje),{id:_,scale:C}=w,T=jj(w,Uje);return b.createElement(kC,Sj({},O,T,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Et("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var Zje={allowDataOverflow:Pn.allowDataOverflow,allowDecimals:Pn.allowDecimals,allowDuplicatedCategory:Pn.allowDuplicatedCategory,angle:Pn.angle,axisLine:ss.axisLine,hide:!1,includeHidden:Pn.includeHidden,interval:Pn.interval,label:!1,minTickGap:Pn.minTickGap,mirror:Pn.mirror,orientation:Pn.orientation,padding:Pn.padding,reversed:Pn.reversed,scale:Pn.scale,tick:Pn.tick,tickCount:Pn.tickCount,tickLine:ss.tickLine,tickSize:ss.tickSize,type:Pn.type,niceTicks:Pn.niceTicks,width:Pn.width,yAxisId:0},Yje=e=>{var t=gr(e,Zje);return b.createElement(b.Fragment,null,b.createElement(Gje,{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}),b.createElement(Vje,t))},ih=b.memo(Yje,_8);ih.displayName="YAxis";var Wje=(e,t)=>t,_C=ce([Wje,sn,KB,Un,OU,gs,Ibe,Jn],Hbe);function Qje(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function AC(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Qje(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(u,d)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var A8=Qr("mouseClick"),O8=vh();O8.startListening({actionCreator:A8,effect:(e,t)=>{var n=e.payload,r=_C(t.getState(),AC(n));r?.activeIndex!=null&&t.dispatch(E0e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var kj=Qr("mouseMove"),E8=vh(),Zc=null,tl=null,ES=null;E8.startListening({actionCreator:kj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Zc!==null&&(cancelAnimationFrame(Zc),Zc=null),tl!==null&&(typeof i!="number"||!o)&&(clearTimeout(tl),tl=null),ES=AC(n);var u=()=>{var d=t.getState(),f=Th(d,d.tooltip.settings.shared);if(!ES){Zc=null,tl=null;return}if(f==="axis"){var p=_C(d,ES);p?.activeIndex!=null?t.dispatch(bU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(vU())}Zc=null,tl=null};if(!o){u();return}i==="raf"?Zc=requestAnimationFrame(u):typeof i=="number"&&tl===null&&(tl=setTimeout(u,i))}});function Xje(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 VM={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},z8=or({name:"rootProps",initialState:VM,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:VM.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}}}),Jje=z8.reducer,{updateOptions:eke}=z8.actions,tke=null,nke={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)},T8=or({name:"polarOptions",initialState:tke,reducers:nke}),{updatePolarOptions:MCe}=T8.actions,rke=T8.reducer,P8=Qr("keyDown"),R8=Qr("focus"),D8=Qr("blur"),Jv=vh(),Yc=null,nl=null,Fm=null;Jv.startListening({actionCreator:P8,effect:(e,t)=>{Fm=e.payload,Yc!==null&&(cancelAnimationFrame(Yc),Yc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");nl!==null&&(typeof r!="number"||!a)&&(clearTimeout(nl),nl=null);var o=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=Fm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=Nf(f,Bl(u),Eu(u),Tu(u)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=gs(u),S=Bl(u),j=Th(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var N=Sy(u,j,"hover",String(f.index));t.dispatch(wy({active:!f.active,activeIndex:f.index,activeCoordinate:N}));return}var O=x0e(u),_=O==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,T;if(v){var E=Eu(u),A=Tu(u),P=C*_,I=te=>({active:!1,index:String(te),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,P>0){for(var q=0;q<S.length;q++)if(Nf(I(q),S,E,A)!=null){T=q;break}}else for(var B=S.length-1;B>=0;B--)if(Nf(I(B),S,E,A)!=null){T=B;break}if(T<0)return}else{T=y+C*_;var $=w?.length||S.length;if($===0||T>=$||T<0)return}var V=Sy(u,j,"hover",String(T));t.dispatch(wy({active:!0,activeIndex:T.toString(),activeCoordinate:V}))}finally{Yc=null,nl=null}};if(!a){o();return}r==="raf"?Yc=requestAnimationFrame(o):typeof r=="number"&&nl===null&&(o(),Fm=null,nl=setTimeout(()=>{Fm?o():(nl=null,Yc=null)},r))}});Jv.startListening({actionCreator:R8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=Th(n,n.tooltip.settings.shared),u=Sy(n,o,"hover",String(a));t.dispatch(wy({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Jv.startListening({actionCreator:D8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(wy({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function M8(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 mi=Qr("externalEvent"),I8=vh(),qm=new Map,uf=new Map,zS=new Map;I8.startListening({actionCreator:mi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=M8(r);zS.set(i,{handler:n,reactEvent:a});var o=qm.get(i);o!==void 0&&(cancelAnimationFrame(o),qm.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),y=uf.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),uf.delete(i));var v=()=>{var j=zS.get(i);try{if(!j)return;var{handler:N,reactEvent:O}=j,_=t.getState(),C={activeCoordinate:Sbe(_),activeDataKey:bbe(_),activeIndex:eh(_),activeLabel:TU(_),activeTooltipIndex:eh(_),isTooltipActive:jbe(_)};N&&N(C,O)}finally{qm.delete(i),uf.delete(i),zS.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);qm.set(i,w)}else if(typeof d=="number"){if(!uf.has(i)){v();var S=setTimeout(v,d);uf.set(i,S)}}else v()}}});var ike=ce([Xu],e=>e.tooltipItemPayloads),ake=ce([ike,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),L8=Qr("touchMove"),$8=vh(),rl=null,Gs=null,ZM=null,df=null;$8.startListening({actionCreator:L8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){df=M8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");rl!==null&&(cancelAnimationFrame(rl),rl=null),Gs!==null&&(typeof i!="number"||!o)&&(clearTimeout(Gs),Gs=null),ZM=Array.from(n.touches).map(d=>AC({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(df!=null){var d=t.getState(),f=Th(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=ZM)===null||p===void 0?void 0:p[0];if(m==null){rl=null,Gs=null;return}var y=_C(d,m);y?.activeIndex!=null&&t.dispatch(bU({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=df.touches[0];if(document.elementFromPoint==null||w==null)return;var S=document.elementFromPoint(w.clientX,w.clientY);if(!S||!S.getAttribute)return;var j=S.getAttribute(yfe),N=(v=S.getAttribute(vfe))!==null&&v!==void 0?v:void 0,O=Jl(d).find(T=>T.id===N);if(j==null||O==null||N==null)return;var{dataKey:_}=O,C=ake(d,j,N);t.dispatch(O0e({activeDataKey:_,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:N}))}rl=null,Gs=null}};if(!o){u();return}i==="raf"?rl=requestAnimationFrame(u):typeof i=="number"&&Gs===null&&(u(),df=null,Gs=setTimeout(()=>{df?u():(Gs=null,rl=null)},i))}}});var B8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},U8=or({name:"eventSettings",initialState:B8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:ske}=U8.actions,oke=U8.reducer,lke=C3({brush:RSe,cartesianAxis:NSe,chartData:wxe,errorBars:Y1e,eventSettings:oke,graphicalItems:nSe,layout:tfe,legend:dhe,options:gxe,polarAxis:qwe,polarOptions:rke,referenceElements:FSe,renderedTicks:y1e,rootProps:Jje,tooltip:z0e,zIndex:rxe}),cke=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Cde({reducer:lke,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([O8.middleware,E8.middleware,Jv.middleware,I8.middleware,$8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(U3({type:"raf"}))},devTools:{serialize:{replacer:Xje},name:"recharts-".concat(n)}})};function uke(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=yr(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=cke(t,r));var o=sN;return b.createElement(Ohe,{context:o,store:a.current},n)}function dke(e){var{layout:t,margin:n}=e,r=fn(),i=yr();return b.useEffect(()=>{i||(r(Xde(t)),r(Qde(n)))},[r,i,t,n]),null}var fke=b.memo(dke,jh);function hke(e){var t=fn();return b.useEffect(()=>{t(eke(e))},[t,e]),null}var pke=e=>{var t=fn();return b.useEffect(()=>{t(ske(e))},[t,e]),null},mke=b.memo(pke,jh);function YM(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=fn();return b.useLayoutEffect(()=>(r.current&&i(txe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(nxe({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function WM(e){var{children:t,isPanorama:n}=e,r=Ue(Gbe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return b.createElement(b.Fragment,null,i.map(o=>b.createElement(YM,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>b.createElement(YM,{key:o,zIndex:o,isPanorama:n})))}var gke=["children"];function yke(e,t){if(e==null)return{};var n,r,i=vke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vke(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 Oy(){return Oy=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},Oy.apply(null,arguments)}var bke={width:"100%",height:"100%",display:"block"},xke=b.forwardRef((e,t)=>{var n=mN(),r=gN(),i=bB();if(!wa(n)||!wa(r))return null;var{children:a,otherAttributes:o,title:u,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),b.createElement(Qk,Oy({},o,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:bke,ref:t}),a)}),wke=e=>{var{children:t}=e,n=Ue(Pv);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return b.createElement(Qk,{width:r,height:i,x:o,y:a},t)},QM=b.forwardRef((e,t)=>{var{children:n}=e,r=yke(e,gke),i=yr();return i?b.createElement(wke,null,b.createElement(WM,{isPanorama:!0},n)):b.createElement(xke,Oy({ref:t},r),b.createElement(WM,{isPanorama:!1},n))});function Ske(){var e=fn(),[t,n]=b.useState(null),r=Ue(gfe);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Je(a)&&a!==r&&e(efe(a))}},[t,e,r]),n}function XM(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 jke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(n),!0).forEach(function(r){kke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kke(e,t,n){return(t=Nke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nke(e){var t=Cke(e,"string");return typeof t=="symbol"?t:t+""}function Cke(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 po(){return po=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},po.apply(null,arguments)}var _ke=()=>(Exe(),null);function Ey(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Ake=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,o]=b.useState({containerWidth:Ey((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ey((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=b.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();u(p,m);var y=w=>{var S=w[0];if(S!=null){var{width:j,height:N}=S.contentRect;u(j,N)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,u]);return b.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(wh,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",po({ref:d},e)))}),Oke=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:Ey(n),containerHeight:Ey(r)}),o=b.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return b.createElement(b.Fragment,null,b.createElement(wh,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",po({ref:u},e)))}),Eke=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(wh,{width:n,height:r}),b.createElement("div",po({ref:t},e)))}),zke=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(Oke,po({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(Eke,po({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(wh,{width:n,height:r}),b.createElement("div",po({ref:t},e)))});function Tke(e){return e?Ake:zke}var Pke=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:j,width:N,responsive:O,dispatchTouchEvents:_=!0}=e,C=b.useRef(null),T=fn(),[E,A]=b.useState(null),[P,I]=b.useState(null),q=Ske(),B=hN(),$=B?.width>0?B.width:N,V=B?.height>0?B.height:i,te=b.useCallback(de=>{q(de),typeof t=="function"&&t(de),A(de),I(de),de!=null&&(C.current=de)},[q,t,A,I]),Y=b.useCallback(de=>{T(A8(de)),T(mi({handler:a,reactEvent:de}))},[T,a]),H=b.useCallback(de=>{T(kj(de)),T(mi({handler:f,reactEvent:de}))},[T,f]),J=b.useCallback(de=>{T(vU()),T(mi({handler:p,reactEvent:de}))},[T,p]),pe=b.useCallback(de=>{T(kj(de)),T(mi({handler:m,reactEvent:de}))},[T,m]),Se=b.useCallback(()=>{T(R8())},[T]),R=b.useCallback(()=>{T(D8())},[T]),U=b.useCallback(de=>{T(P8(de.key))},[T]),F=b.useCallback(de=>{T(mi({handler:o,reactEvent:de}))},[T,o]),D=b.useCallback(de=>{T(mi({handler:u,reactEvent:de}))},[T,u]),Q=b.useCallback(de=>{T(mi({handler:d,reactEvent:de}))},[T,d]),se=b.useCallback(de=>{T(mi({handler:y,reactEvent:de}))},[T,y]),ae=b.useCallback(de=>{T(mi({handler:S,reactEvent:de}))},[T,S]),he=b.useCallback(de=>{_&&T(L8(de)),T(mi({handler:w,reactEvent:de}))},[T,_,w]),Ne=b.useCallback(de=>{T(mi({handler:v,reactEvent:de}))},[T,v]),ne=Tke(O);return b.createElement(BU.Provider,{value:E},b.createElement($$.Provider,{value:P},b.createElement(ne,{width:$??j?.width,height:V??j?.height,className:Et("recharts-wrapper",r),style:jke({position:"relative",cursor:"default",width:$,height:V},j),onClick:Y,onContextMenu:F,onDoubleClick:D,onFocus:Se,onBlur:R,onKeyDown:U,onMouseDown:Q,onMouseEnter:H,onMouseLeave:J,onMouseMove:pe,onMouseUp:se,onTouchEnd:Ne,onTouchMove:he,onTouchStart:ae,ref:te},b.createElement(_ke,null),n)))}),Rke=["width","height","responsive","children","className","style","compact","title","desc"];function Dke(e,t){if(e==null)return{};var n,r,i=Mke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mke(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 Ike=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:u,compact:d,title:f,desc:p}=e,m=Dke(e,Rke),y=Vi(m);return d?b.createElement(b.Fragment,null,b.createElement(wh,{width:n,height:r}),b.createElement(QM,{otherAttributes:y,title:f,desc:p},a)):b.createElement(Pke,{className:o,style:u,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},b.createElement(QM,{otherAttributes:y,title:f,desc:p,ref:t},b.createElement(qSe,null,a)))});function Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(null,arguments)}function JM(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 Lke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JM(Object(n),!0).forEach(function(r){$ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ke(e,t,n){return(t=Bke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bke(e){var t=Uke(e,"string");return typeof t=="symbol"?t:t+""}function Uke(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 Fke={top:5,right:5,bottom:5,left:5},qke=Lke({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Fke,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},B8),Hke=b.forwardRef(function(t,n){var r,i=gr(t.categoricalChartProps,qke),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(uke,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},b.createElement(PSe,{chartData:f.data}),b.createElement(fke,{layout:i.layout,margin:i.margin}),b.createElement(mke,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),b.createElement(hke,{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}),b.createElement(Ike,Nj({},i,{ref:n})))}),Kke=["axis"],zy=b.forwardRef((e,t)=>b.createElement(Hke,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Kke,tooltipPayloadSearcher:pxe,categoricalChartProps:e,ref:t}));const yu={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},ao={fill:"#71717a",fontSize:11},Gke="#27272a",ah="#27272a",so=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function F8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function Ty(e){return F8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Py(e){const t=F8(e);return`${t.getMonth()+1}/${t.getDate()}`}const Vke=["7d","30d","90d","all"],Zke=["gap","cited","uncited"],q8={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"},Yke={[no.answer]:"Answer",[no.citation]:"Sources"};function Wke({projectName:e}){const[t,n]=b.useState("30d"),[r,i]=b.useState(no.answer),[a,o]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(null),[m,y]=b.useState(null),[v,w]=b.useState(!0);if(b.useEffect(()=>{let P=!1;return w(!0),Promise.all([L7(e,t),$7(e,t),B7(e,t)]).then(([I,q,B])=>{P||(o(I),d(q),p(B),w(!1))}).catch(()=>{P||w(!1)}),()=>{P=!0}},[e,t]),b.useEffect(()=>{y(null)},[r]),v&&!a)return c.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const S=r===no.answer,j=a?S?a.overall.answerRate:a.overall.citationRate:0,N=a?S?a.overall.answerMentionedCount:a.overall.cited:0,O=a?.overall.total??0,_=a?S?a.answerTrend:a.trend:"stable",C=_==="improving"?"positive":_==="declining"?"negative":"neutral",T=u?S?u.mentionedKeywords:u.cited:[],E=u?S?u.mentionGap:u.gap:[],A=u?S?u.notMentioned:u.uncited:[];return c.jsxs(c.Fragment,{children:[c.jsxs("section",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:S?"Visibility Metrics":"Citation Metrics"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:[S?"Answer Visibility Trends":"Source Citation Trends",c.jsx(Wn,{text:S?"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."})]})]}),c.jsx("div",{className:"sidebar-tabs ml-2",children:[no.answer,no.citation].map(P=>c.jsx("button",{type:"button",className:`sidebar-tab ${r===P?"sidebar-tab--active":""}`,onClick:()=>i(P),children:Yke[P]},P))})]}),c.jsx("div",{className:"flex gap-1",children:Vke.map(P=>c.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))})]}),a&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsx(M$,{value:`${Math.round(j*100)}`,label:S?"Answer Rate":"Citation Rate",delta:`${N} / ${O}`,tone:C,description:`Trend: ${_}`,isNumeric:!0}),c.jsxs("div",{className:"flex-1 space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),c.jsx(vt,{tone:C,children:_})]}),Object.keys(a.byProvider).length>0&&c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),c.jsx("th",{className:"text-right py-1 font-medium",children:S?"Mentioned / Total":"Cited / Total"})]})}),c.jsx("tbody",{children:Object.entries(a.byProvider).map(([P,I])=>{const q=S?I.answerRate:I.citationRate,B=S?I.answerMentionedCount:I.cited;return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-300",children:P}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(q*100).toFixed(1),"%"]}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[B," / ",I.total]})]},P)})})]})]})]}),a.buckets.length>=1&&c.jsx(Qke,{buckets:a.buckets,keywordChanges:a.keywordChanges??[],metricMode:r})]})]}),c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsx("div",{className:"flex items-center justify-between mb-4",children:c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",c.jsx(Wn,{text:S?"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."})]})]})}),u&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex gap-1 mb-4",children:Zke.map(P=>{const I=P==="cited"?T.length:P==="gap"?E.length:A.length,q=m===P,B=P==="gap"?"Gap":P==="cited"?S?"Mentioned":"Cited":S?"Not Mentioned":"Not Cited";return c.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${q?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:()=>y(q?null:P),children:[B," (",I,")"]},P)})}),c.jsx(Xke,{citedRows:T,gapRows:E,uncitedRows:A,filter:m,metricMode:r})]})]}),c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",c.jsx(Wn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&c.jsxs("div",{className:"space-y-4",children:[c.jsx(Jke,{categories:f.overall}),c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),c.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),c.jsx("tbody",{children:f.overall.map(P=>c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[c.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${q8[P.category]??"bg-zinc-600"}`}),P.label]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:P.count}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(P.percentage*100).toFixed(1),"%"]}),c.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:P.topDomains.slice(0,3).map(I=>I.domain).join(", ")})]},P.category))})]})]}),f&&f.overall.length===0&&c.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function Qke({buckets:e,keywordChanges:t,metricMode:n}){const r=n===no.answer,i=r?"answerRate":"citationRate",a=r?"Answer Rate":"Citation Rate",o=e.map(d=>({date:d.startDate,answerRate:Math.round(d.answerRate*1e3)/10,citationRate:Math.round(d.citationRate*1e3)/10,keywordCount:d.keywordCount??0})),u=b.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const d=new Date(e[0].startDate).getTime(),f=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const m=new Date(p.date).getTime();return m>=d&&m<=f}).map(p=>{const m=new Date(p.date).getTime();let y=e[0].startDate,v=Math.abs(m-new Date(y).getTime());for(const w of e){const S=Math.abs(m-new Date(w.startDate).getTime());S<v&&(y=w.startDate,v=S)}return{...p,date:y}})},[e,t]);return c.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[c.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),c.jsx("div",{className:"h-40",role:"img","aria-label":`${a} trend chart`,children:c.jsx(Xg,{width:"100%",height:"100%",children:c.jsxs(zy,{data:o,margin:{top:8,right:8,bottom:0,left:0},children:[c.jsx(y8,{strokeDasharray:"3 3",stroke:Gke,vertical:!1}),c.jsx(rh,{dataKey:"date",tick:ao,tickLine:!1,axisLine:{stroke:ah},tickFormatter:Py}),c.jsx(ih,{tick:ao,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:d=>`${d}%`,width:40}),c.jsx(jy,{...yu,labelFormatter:Ty,formatter:(d,f)=>{const p=typeof d=="number"?d:Number(d??0);return String(f)===i?[`${p.toFixed(1)}%`,a]:[String(p),String(f)]}}),u.map(d=>c.jsx(h8,{x:d.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:d.label,position:"top",fill:"#71717a",fontSize:9}},d.date)),c.jsx(bl,{type:"monotone",dataKey:i,stroke:so[0],fill:so[0],fillOpacity:.15,strokeWidth:2,dot:{fill:so[0],r:3,strokeWidth:0},activeDot:{fill:so[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Xke({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const a=i===no.answer,o=b.useMemo(()=>{const u=[...t.map(d=>({...d,_sort:0})),...e.map(d=>({...d,_sort:1})),...n.map(d=>({...d,_sort:2}))];return r?u.filter(d=>d.category===r):u.sort((d,f)=>d._sort-f._sort)},[e,t,n,r]);return o.length===0?c.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",r?` with status "${r}"`:"","."]}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),c.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),c.jsx("th",{className:"text-left py-1 font-medium",children:a?"Providers Mentioning":"Providers Citing"}),c.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),c.jsx("tbody",{children:o.map(u=>{const d=u.category==="cited"?"positive":u.category==="gap"?"caution":"neutral",f=u.category==="gap"?"Gap":u.category==="cited"?a?"Mentioned":"Cited":a?"Not Mentioned":"Not Cited",p=a?u.consistency.mentionedRuns:u.consistency.citedRuns;return c.jsxs("tr",{className:`border-t border-zinc-800/40 ${u.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[c.jsx("td",{className:"py-1.5 text-zinc-200",children:u.keyword}),c.jsx("td",{className:"py-1.5",children:c.jsx(vt,{tone:d,children:f})}),c.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.providers.length>0?u.providers.join(", "):"—"}),c.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.competitorsCiting.length>0?u.competitorsCiting.join(", "):"—"}),c.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:u.consistency.totalRuns>0?`${p}/${u.consistency.totalRuns} runs`:"—"})]},u.keywordId)})})]})}function Jke({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:c.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:c.jsx("div",{className:`${q8[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const eNe=["7d","30d","90d","all"],Vs=so;function Hm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function tNe(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 nNe({projectName:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,o]=b.useState(!0),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(null),[v,w]=b.useState(null),[S,j]=b.useState("sessions"),[N,O]=b.useState("desc"),[_,C]=b.useState("sessions"),[T,E]=b.useState("desc"),[A,P]=b.useState("sessions"),[I,q]=b.useState("desc"),[B,$]=b.useState([]),[V,te]=b.useState([]),[Y,H]=b.useState([]),[J,pe]=b.useState("30d");function Se(G){o(!0),p2(e).then(le=>{if(!G.current)return n(le),le.connected?Promise.all([m2(e,void 0,J),g2(e,J).catch(()=>[]),v2(e,J).catch(()=>[]),y2(e,J).catch(()=>[])]):null}).then(le=>{G.current||(Array.isArray(le)?(i(le[0]),$(le[1]),te(le[2]),H(le[3])):(i(null),$([]),te([]),H([])),o(!1))}).catch(le=>{G.current||(y(le instanceof Error?le.message:"Failed to load GA4 data"),o(!1))})}b.useEffect(()=>{const G={current:!1};return Se(G),()=>{G.current=!0}},[e,J]);async function R(){d(!0),y(null),w(null);try{const G=await WI(e);w(`Synced ${G.rowCount.toLocaleString()} page rows, ${G.aiReferralCount.toLocaleString()} AI and ${G.socialReferralCount.toLocaleString()} social referral rows (${G.days} days)`);const[le,je,Ae,qe]=await Promise.all([m2(e,void 0,J),g2(e,J).catch(()=>[]),v2(e,J).catch(()=>[]),y2(e,J).catch(()=>[])]);i(le),$(je),te(Ae),H(qe);const en=await p2(e);n(en)}catch(G){y(G instanceof Error?G.message:"Sync failed")}finally{d(!1)}}async function U(){p(!0),y(null),w(null);try{await F7(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),w("GA4 disconnected")}catch(G){y(G instanceof Error?G.message:"Disconnect failed")}finally{p(!1)}}function F(G){S===G?O(le=>le==="desc"?"asc":"desc"):(j(G),O("desc"))}function D(G){_===G?E(le=>le==="desc"?"asc":"desc"):(C(G),E("desc"))}function Q(G){A===G?q(le=>le==="desc"?"asc":"desc"):(P(G),q("desc"))}const se=b.useMemo(()=>r?.topPages?[...r.topPages].sort((G,le)=>{const je=G[S],Ae=le[S];return typeof je=="string"&&typeof Ae=="string"?N==="asc"?je.localeCompare(Ae):Ae.localeCompare(je):N==="asc"?je-Ae:Ae-je}):[],[r?.topPages,S,N]),ae=b.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((G,le)=>{const je=G[_],Ae=le[_];return typeof je=="string"&&typeof Ae=="string"?T==="asc"?je.localeCompare(Ae):Ae.localeCompare(je):T==="asc"?je-Ae:Ae-je}):[],[r?.aiReferrals,_,T]),he=b.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((G,le)=>{const je=G[A],Ae=le[A];return typeof je=="string"&&typeof Ae=="string"?I==="asc"?je.localeCompare(Ae):Ae.localeCompare(je):I==="asc"?je-Ae:Ae-je}):[],[r?.socialReferrals,A,I]),{socialChartData:Ne,socialChartSources:ne}=b.useMemo(()=>{const G=[...new Set(Y.map(Ae=>Ae.source))],le=new Map;for(const Ae of Y){let qe=le.get(Ae.date);qe||(qe={_socialTotal:0},le.set(Ae.date,qe)),qe[Ae.source]=(qe[Ae.source]??0)+Ae.sessions,qe._socialTotal=(qe._socialTotal??0)+Ae.sessions}return{socialChartData:[...le.entries()].sort(([Ae],[qe])=>Ae.localeCompare(qe)).map(([Ae,qe])=>({date:Ae,...qe})),socialChartSources:G}},[Y]),{chartData:de,chartSources:Ee,dateRange:X}=b.useMemo(()=>{const G=[...new Set(B.map(wt=>wt.source))],le=new Map;for(const wt of V)le.set(wt.date,{_totalSessions:wt.sessions,_organicSessions:wt.organicSessions});const je=new Map;for(const wt of B){const Ge=`${wt.date}::${wt.source}`,zt=je.get(Ge)??0;je.set(Ge,Math.max(zt,wt.sessions))}for(const[wt,Ge]of je){const[zt,Tt]=wt.split("::");let Te=le.get(zt);Te||(Te={_totalSessions:0,_organicSessions:0},le.set(zt,Te)),Te[Tt]=(Te[Tt]??0)+Ge}const Ae=[...le.entries()].sort(([wt],[Ge])=>wt.localeCompare(Ge)).map(([wt,Ge])=>({date:wt,...Ge})),qe=Ae.map(wt=>wt.date),en=qe.length>0?{start:qe[0],end:qe[qe.length-1]}:null;return{chartData:Ae,chartSources:G,dateRange:en}},[B,V]);if(a&&!t)return c.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return c.jsx(rNe,{projectName:e,onConnected:()=>Se({current:!1})});const Fe=r?.organicSharePct??0,De=r?.totalOrganicSessions??0,et=r?.aiSessionsDeduped??0,tt=r?.aiSessionsBySession??0,Ut=r?.aiSharePctBySession??0,Xt=r?new Set(r.aiReferrals.map(G=>G.source.toLowerCase())).size:0,on=ae[0]??null,we=r?.totalDirectSessions??0,Ze=r?.directSharePct??0,bt=r?.socialSessions??0,Jt=r?.socialSharePct??0,lt=r?new Set(r.socialReferrals.map(G=>G.source.toLowerCase())).size:0,ct=he[0]??null;return c.jsxs(c.Fragment,{children:[m&&c.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:m}),v&&c.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:v}),c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",c.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(be,{variant:"outline",size:"sm",disabled:u,onClick:R,children:[c.jsx(j2,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),u?"Syncing…":"Sync"]}),c.jsxs(be,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:f,onClick:U,children:[c.jsx(tV,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",c.jsx(Wn,{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.`})]})]}),c.jsx("div",{className:"flex gap-1",children:eNe.map(G=>c.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${J===G?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>pe(G),children:G==="all"?"All":G},G))})]}),r?c.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[c.jsx(TS,{value:Hm(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),c.jsx(TS,{value:Hm(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Fe}% of total`,tone:"positive"}),c.jsx(TS,{value:Hm(r.totalUsers),label:"Total Users",subtitle:r.totalUsers.toLocaleString(),tone:"neutral"})]}):c.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),c.jsxs(be,{variant:"outline",size:"sm",disabled:u,onClick:R,children:[c.jsx(j2,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),"Sync from GA4"]})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",c.jsx(Wn,{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."})]})]}),X&&c.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(X.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(X.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),de.length>0&&c.jsxs(Be,{className:"surface-card p-5 mb-4",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:Ee.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Ee.length===0&&c.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Ee.length===0&&c.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),c.jsx("div",{className:"h-64",children:c.jsx(Xg,{width:"100%",height:"100%",children:c.jsxs(zy,{data:de,margin:{top:4,right:4,bottom:0,left:0},children:[c.jsx(rh,{dataKey:"date",tick:ao,tickLine:!1,axisLine:{stroke:ah},tickFormatter:Py}),c.jsx(ih,{tick:ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),c.jsx(jy,{...yu,labelFormatter:Ty,formatter:(G,le)=>{const je=typeof G=="number"?G.toLocaleString():String(G??0),Ae=String(le??"");return Ae==="_totalSessions"?[je,"Total Sessions"]:Ae==="_organicSessions"?[je,"Organic Sessions"]:[je,Ae]}}),c.jsx(nj,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:G=>G==="_totalSessions"?"Total Sessions":G==="_organicSessions"?"Organic Sessions":G}),c.jsx(bl,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Ee.map((G,le)=>c.jsx(bl,{type:"monotone",dataKey:G,stackId:"ai",stroke:Vs[le%Vs.length],fill:Vs[le%Vs.length],fillOpacity:.4,strokeWidth:1.5},G))]})})})]}),c.jsxs(Be,{className:"surface-card p-5 mb-4",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[c.jsx(oa,{label:"Organic",value:`${Fe}%`,hint:`${De.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),c.jsx(oa,{label:"Social",value:`${Jt}%`,hint:`${bt.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),c.jsx(oa,{label:"Direct",value:`${Ze}%`,hint:`${we.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions with no source — bookmarks, typed URLs, untagged email, in-app browsers, and AI-driven traffic whose referrer header was stripped."}),c.jsx(oa,{label:"Known AI referrers (lower bound)",value:`${Ut}%`,hint:`${tt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). Disjoint from Direct/Organic/Social. This is a strict lower bound: most AI traffic strips the referrer and falls into Direct, so the true AI share is typically higher than what's shown here. The detail table below also surfaces firstUserSource and UTM-tagged AI signals."})]}),on&&c.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: ",c.jsx("span",{className:"font-medium",children:on.source})," via ",on.medium,", accounting for ",on.sessions.toLocaleString()," sessions."]})]}),c.jsxs(Be,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:r.aiReferrals.length>0?`${Xt} unique sources, ${r.aiReferrals.length} rows`:"No source rows"})]}),r.aiReferrals.length>0?c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Source",sortKey:"source",current:_,dir:T,onSort:D,align:"left"}),c.jsx(pi,{label:"Medium",sortKey:"medium",current:_,dir:T,onSort:D,align:"left"}),c.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:_,dir:T,onSort:D,align:"right"}),c.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),c.jsx(pi,{label:"Users",sortKey:"users",current:_,dir:T,onSort:D,align:"right"})]})}),c.jsx("tbody",{children:ae.map(G=>c.jsx(oNe,{referral:G,totalSessions:et},`${G.source}:${G.medium}:${G.sourceDimension}`))})]})}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),c.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"AI engines that preserve a referrer (Perplexity, copy/paste from ChatGPT, etc.) will appear here. Most AI traffic strips the referrer — see the Direct cell above for the upper bound."})]})]})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",c.jsx(Wn,{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."})]})]}),Ne.length>0&&c.jsxs(Be,{className:"surface-card p-5 mb-4",children:[c.jsx("div",{className:"mb-4 flex items-end justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]})}),c.jsx("div",{className:"h-64",children:c.jsx(Xg,{width:"100%",height:"100%",children:c.jsxs(zy,{data:Ne,margin:{top:4,right:4,bottom:0,left:0},children:[c.jsx(rh,{dataKey:"date",tick:ao,tickLine:!1,axisLine:{stroke:ah},tickFormatter:Py}),c.jsx(ih,{tick:ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),c.jsx(jy,{...yu,labelFormatter:Ty,formatter:(G,le)=>{const je=typeof G=="number"?G.toLocaleString():String(G??0),Ae=String(le??"");return Ae==="_socialTotal"?[je,"Total Social"]:[je,Ae]}}),c.jsx(nj,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:G=>G==="_socialTotal"?"Total Social":G}),c.jsx(bl,{type:"monotone",dataKey:"_socialTotal",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),ne.map((G,le)=>c.jsx(bl,{type:"monotone",dataKey:G,stackId:"social",stroke:Vs[le%Vs.length],fill:Vs[le%Vs.length],fillOpacity:.4,strokeWidth:1.5},G))]})})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[c.jsxs(Be,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),r.socialReferrals.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(oa,{label:"Social Sessions",value:Hm(bt),hint:`${bt.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),c.jsx(oa,{label:"Share of Traffic",value:`${Jt}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),c.jsx(oa,{label:"Platforms",value:String(lt),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."})]}),ct&&c.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: ",c.jsx("span",{className:"font-medium",children:ct.source})," via ",ct.medium,", accounting for ",ct.sessions.toLocaleString()," sessions."]})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(oa,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),c.jsx(oa,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),c.jsx(oa,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[c.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),c.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."})]})]})]}),c.jsxs(Be,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:r.socialReferrals.length>0?`${r.socialReferrals.length} rows`:"No source rows"})]}),r.socialReferrals.length>0?c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Source",sortKey:"source",current:A,dir:I,onSort:Q,align:"left"}),c.jsx(pi,{label:"Medium",sortKey:"medium",current:A,dir:I,onSort:Q,align:"left"}),c.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:A,dir:I,onSort:Q,align:"right"}),c.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),c.jsx(pi,{label:"Users",sortKey:"users",current:A,dir:I,onSort:Q,align:"right"})]})}),c.jsx("tbody",{children:he.map(G=>c.jsx(lNe,{referral:G,totalSessions:bt},`${G.source}:${G.medium}:${G.channelGroup}`))})]})}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),c.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&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",c.jsx(Wn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Landing Page",sortKey:"landingPage",current:S,dir:N,onSort:F,align:"left"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:S,dir:N,onSort:F,align:"right"}),c.jsx(pi,{label:"Organic",sortKey:"organicSessions",current:S,dir:N,onSort:F,align:"right"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),c.jsx(pi,{label:"Users",sortKey:"users",current:S,dir:N,onSort:F,align:"right"})]})}),c.jsx("tbody",{children:se.map(G=>c.jsx(iNe,{page:G},G.landingPage))})]})})]})]}),c.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[c.jsx("span",{children:r?.lastSyncedAt?`Last synced ${tNe(r.lastSyncedAt)}`:"Never synced"}),c.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function rNe({projectName:e,onConnected:t}){const[n,r]=b.useState(""),[i,a]=b.useState(null),[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(null),y=b.useRef(null),v=b.useCallback(S=>{const j=S.target.files?.[0];if(!j)return;m(null),a(j.name);const N=new FileReader;N.onload=()=>{const O=N.result;try{const _=JSON.parse(O);if(!_.client_email||!_.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),u(null);return}u(O)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),u(null)}},N.onerror=()=>{m("Failed to read file."),u(null)},N.readAsText(j)},[]);async function w(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await U7(e,{propertyId:n.trim(),keyJson:o});try{await WI(e)}catch{}t()}catch(S){m(S instanceof Error?S.message:"Failed to connect GA4")}finally{f(!1)}}return c.jsxs(Be,{className:"surface-card p-6",children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),c.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&&c.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}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),c.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:S=>r(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),c.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)."})]}),c.jsxs("div",{className:"mb-5",children:[c.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),c.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),c.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[c.jsx(rV,{className:"w-4 h-4 shrink-0"}),i?c.jsx("span",{className:"text-zinc-200 truncate",children:i}):c.jsx("span",{children:"Upload .json key file"})]}),c.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 ",c.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),c.jsx(be,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function pi({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return c.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,o&&c.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const H8={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function TS({value:e,label:t,subtitle:n,tone:r}){return c.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),c.jsx("p",{className:`text-2xl font-bold tabular-nums ${H8[r]}`,children:e}),c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function oa({value:e,label:t,hint:n,tone:r,tooltip:i}){return c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[c.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&c.jsx(Wn,{text:i})]}),c.jsx("p",{className:`text-xl font-semibold tabular-nums ${H8[r]}`,children:e}),c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function iNe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),c.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const aNe={session:"Session",first_user:"First Visit",manual_utm:"UTM"},sNe={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 oNe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=aNe[e.sourceDimension]??e.sourceDimension,i=sNe[e.sourceDimension]??"";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),c.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),c.jsx("td",{className:"py-1.5",children:c.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})}),c.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function lNe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),c.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),c.jsx("td",{className:"py-1.5",children:c.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})}),c.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function Rh(e){e.invalidateQueries({queryKey:Ar.runs.all}),e.invalidateQueries({queryKey:Ar.projects.all})}function cNe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function uNe(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 e0(e,t){a5({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),ht({title:cNe(e.kind),detail:uNe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function dNe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){ht({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)a5({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=rJ({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});ht({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 t0(e,t){if(e instanceof Ni&&e.code==="RUN_IN_PROGRESS"){ht({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}ht({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function K8(){const e=xo();return sh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>XK(t,n),onSuccess:(t,n)=>{Rh(e),e0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{t0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function fNe(){const e=xo();return sh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>y7(t),onSuccess:t=>{Rh(e),dNe(t)},onError:t=>{ht({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function hNe(){const e=xo();return sh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>GI(t,n),onSuccess:(t,n)=>{Rh(e),e0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{t0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function pNe(){const e=xo();return sh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>E7(t),onSuccess:(t,n)=>{Rh(e),e0(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{t0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function mNe(){const e=xo();return sh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>A7(t,n),onSuccess:(t,n)=>{Rh(e),e0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{t0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const gNe=["7d","30d","90d","all"];function yNe({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState([]),[a,o]=b.useState([]),[u,d]=b.useState([]),[f,p]=b.useState([]),[m,y]=b.useState([]),[v,w]=b.useState(null),[S,j]=b.useState(""),[N,O]=b.useState(""),[_,C]=b.useState("30"),[T,E]=b.useState(!1),[A,P]=b.useState("30d"),[I,q]=b.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,$]=b.useState(""),[V,te]=b.useState(!0),[Y,H]=b.useState(!1),[J,pe]=b.useState(!1),[Se,R]=b.useState(!1),[U,F]=b.useState(!1),[D,Q]=b.useState(!1),[se,ae]=b.useState(!1),[he,Ne]=b.useState(null),[ne,de]=b.useState(!1),[Ee,X]=b.useState(!1),[Fe,De]=b.useState(null),[et,tt]=b.useState(""),[Ut,Xt]=b.useState(!1),[on,we]=b.useState(!1),[Ze,bt]=b.useState("indexed"),[Jt,lt]=b.useState(null),ct=b.useMemo(()=>{if(!Jt)return u;const{key:Z,dir:Ce}=Jt;return[...u].sort((xt,ut)=>{const Pt=Z===ro.CTR?Number.isFinite(xt.ctr)?xt.ctr:0:xt[Z],Ir=Z===ro.CTR?Number.isFinite(ut.ctr)?ut.ctr:0:ut[Z];return Ce==="asc"?Pt-Ir:Ir-Pt})},[u,Jt]),[G,le]=b.useState([]),[je,Ae]=b.useState(null),[qe,en]=b.useState(!1),[wt,Ge]=b.useState(null),[zt,Tt]=b.useState(null),Te=r.find(Z=>Z.connectionType==="gsc"),Jr=u.length>0||f.length>0||m.length>0,ke=hNe(),lr=pNe(),ys=mNe();async function Oo(Z){if(!Z){o([]),j("");return}pe(!0);try{const{sites:Ce}=await x7(e);o(Ce),j(Z.propertyId??Ce[0]?.siteUrl??"")}catch(Ce){o([]),Ge(Ce instanceof Error?Ce.message:"Failed to load Search Console properties")}finally{pe(!1)}}async function Oa(){F(!0);try{const Z=await j7(e,{startDate:I.startDate||void 0,endDate:I.endDate||void 0,query:I.query||void 0,page:I.page||void 0,limit:parseInt(I.limit,10)||20,window:A});d(Z)}catch(Z){d([]),Ge(Z instanceof Error?Z.message:"Failed to load GSC performance data")}finally{F(!1)}}async function ei(){Q(!0);try{const[Z,Ce]=await Promise.all([N7(e,{url:B.trim()||void 0,limit:20}),C7(e)]);p(Z),y(Ce)}catch(Z){p([]),y([]),Ge(Z instanceof Error?Z.message:"Failed to load GSC inspection history")}finally{Q(!1)}}async function Eo(){de(!0);try{const[Z,Ce]=await Promise.all([Zj(e),_7(e).catch(()=>[])]);Ne(Z),le(Ce)}catch(Z){Ne(null),le([]),Ge(Z instanceof Error?Z.message:"Failed to load coverage data")}finally{de(!1)}}async function vs(Z){en(!0),Ge(null);try{const Ce=await f2(e,{urls:Z}),{succeeded:xt,failed:ut,total:Pt}=Ce.summary;ht({title:"Indexing requested",detail:ut===0?`${xt} URL${xt!==1?"s":""} submitted for indexing.`:`${xt}/${Pt} submitted successfully, ${ut} failed.`,tone:ut===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ce){Ge(Ce instanceof Error?Ce.message:"Failed to request indexing")}finally{en(!1)}}async function n0(){en(!0),Ge(null);try{const Z=await f2(e,{urls:[],allUnindexed:!0}),{succeeded:Ce,failed:xt,total:ut}=Z.summary;ht({title:"Indexing requested",detail:xt===0?`${Ce} unindexed URL${Ce!==1?"s":""} submitted for indexing.`:`${Ce}/${ut} submitted successfully, ${xt} failed.`,tone:xt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to request indexing")}finally{en(!1)}}async function zo(){if(et.trim()){Xt(!0),Ge(null);try{await S7(e,"gsc",et.trim()),i(Z=>Z.map(Ce=>Ce.connectionType==="gsc"?{...Ce,sitemapUrl:et.trim()}:Ce)),ht({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),tt("")}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to save sitemap URL")}finally{Xt(!1)}}}async function ec(){Ge(null);try{const Z=await lr.mutateAsync({projectName:e,projectLabel:e});De(Z.sitemaps),i(Ce=>Ce.map(xt=>xt.connectionType==="gsc"?{...xt,sitemapUrl:Z.primarySitemapUrl}:xt))}catch{}}async function To(){X(!0),Ge(null);try{const Z=await O7(e);De(Z.sitemaps),Z.sitemaps.length===0&&Tt("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to list sitemaps")}finally{X(!1)}}async function Mh(){te(!0),Ge(null);try{const[Z,Ce]=await Promise.all([Vj().catch(()=>null),KI(e).catch(()=>[])]);n(!!Z?.google?.configured),i(Ce);const xt=Ce.find(ut=>ut.connectionType==="gsc");await Promise.all([Oo(xt),Oa(),ei(),Eo()])}finally{te(!1)}}b.useEffect(()=>{Mh()},[e]),b.useEffect(()=>{Oa()},[A]);async function Ih(){if(!t){Ge("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}H(!0),Ge(null),Tt(null);try{const{authUrl:Z}=await v7(e,"gsc");if(!Z.startsWith("https://accounts.google.com/")){Ge("Unexpected OAuth redirect URL. Please try again.");return}const Ce=window.open(Z,"_blank","width=600,height=700");if(!Ce){window.location.assign(Z);return}Tt("Finish the Google consent flow in the popup, then close it to refresh this project.");const xt=window.setInterval(()=>{Ce.closed&&(window.clearInterval(xt),Tt(null),Mh())},1e3)}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to start OAuth flow")}finally{H(!1)}}async function Lh(){Ge(null),Tt(null);try{await b7(e,"gsc"),i(Z=>Z.filter(Ce=>Ce.connectionType!=="gsc")),o([]),j("")}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to disconnect")}}async function $h(){if(S){R(!0),Ge(null);try{await w7(e,"gsc",S),i(Z=>Z.map(Ce=>Ce.connectionType==="gsc"?{...Ce,propertyId:S}:Ce)),ht({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to save GSC property")}finally{R(!1)}}}async function ed(){Ge(null),Tt(null);try{await ke.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(_,10)||void 0,full:T||void 0}})}catch{}}async function tc(){if(N.trim()){ae(!0),Ge(null),Tt(null);try{const Z=await k7(e,N.trim());w(Z),O(""),await ei()}catch(Z){Ge(Z instanceof Error?Z.message:"Failed to inspect URL")}finally{ae(!1)}}}return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),c.jsx("h2",{children:"Google Search Console"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex gap-1",children:gNe.map(Z=>c.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${A===Z?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>P(Z),children:Z==="all"?"All":Z},Z))}),Te&&c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:U,onClick:()=>{Oa()},children:U?"Refreshing…":"Refresh data"})]})]}),wt&&c.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:[wt,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ge(null),children:"×"})]}),zt&&c.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:[zt,c.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Tt(null),children:"×"})]}),V?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsx(vt,{tone:Te?"positive":t?"caution":"negative",children:Te?"Connected":t?"Ready to connect":"App credentials missing"})]}),Te?c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:Te.domain}),c.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Lh,children:"Disconnect"})]}),c.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",c.jsx("code",{children:Te.domain}),"."]})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Te.propertyId??"No property selected yet"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Fi(Te.updatedAt)})]})]})]}):c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[c.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."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:Y,onClick:Ih,children:Y?"Opening…":"Connect Google Search Console"}):c.jsx(be,{type:"button",variant:"outline",size:"sm",asChild:!0,children:c.jsx(qt,{to:"/settings",children:"Open Settings"})}),!t&&c.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Te&&!Te.sitemapUrl&&c.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"mt-0.5 text-amber-400",children:c.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:c.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"})})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),c.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."}),c.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.jsx(be,{type:"button",size:"sm",disabled:lr.isPending||!Te.propertyId,onClick:ec,children:lr.isPending?"Discovering…":"Auto-discover from GSC"}),c.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:et,onChange:Z=>tt(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&void zo()}),c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Ut||!et.trim(),onClick:zo,children:Ut?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Te||Jr)&&c.jsxs(c.Fragment,{children:[c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),c.jsx("h3",{children:"Index coverage"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[he&&he.notIndexed.length>0&&c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:qe,onClick:()=>{n0()},children:qe?"Requesting…":`Request indexing (${he.notIndexed.length})`}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:ne,onClick:()=>{Eo()},children:ne?"Loading…":"Refresh coverage"})]})]}),he&&he.summary.total>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Z=he.summary.indexed+he.summary.notIndexed,Ce=Z>0?he.summary.indexed/Z:0,xt=Z>0?he.summary.notIndexed/Z:0,ut=54,Pt=2*Math.PI*ut,Ir=Pt*(1-Ce),Pi=Pt*xt,bs=Pt*Ce;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative h-48 w-48",children:[c.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Pt,strokeDashoffset:Ir,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),he.summary.notIndexed>0&&c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Pi} ${Pt-Pi}`,strokeDashoffset:-bs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ce*100).toFixed(0),"%"]}),c.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.indexed.toLocaleString()}),c.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),c.jsx("div",{className:"h-8 w-px bg-zinc-800"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.notIndexed.toLocaleString()}),c.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(he.reasonGroups??[]).length>0&&c.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(he.reasonGroups??[]).length," ",(he.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),he.summary.deindexed>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-8 w-px bg-zinc-800"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.deindexed.toLocaleString()}),c.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),c.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Z=>{const Ce=Z==="indexed"?he.indexed.length:Z==="notIndexed"?he.notIndexed.length:he.deindexed.length,xt=Z==="indexed"?"Indexed":Z==="notIndexed"?"Not Indexed":"Deindexed";return c.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ze===Z?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{bt(Z),Ae(null)},children:[xt," (",Ce,")"]},Z)})}),c.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&he.indexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Last Crawl"}),c.jsx("th",{className:"text-left",children:"Mobile"})]})}),c.jsx("tbody",{children:he.indexed.map(Z=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),c.jsx("td",{className:"text-zinc-400",children:Z.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Z.crawlTime?Z.crawlTime.split("T")[0]:"—"}),c.jsx("td",{className:"text-zinc-400",children:Z.isMobileFriendly===!0?"Yes":Z.isMobileFriendly===!1?"No":"—"})]},Z.id))})]}),Ze==="notIndexed"&&!je&&(he.reasonGroups??[]).length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Reason"}),c.jsx("th",{className:"text-right",children:"Pages"})]})}),c.jsx("tbody",{children:(he.reasonGroups??[]).map(Z=>c.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ae(Z.reason),children:[c.jsx("td",{className:"text-zinc-200",children:Z.reason}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.count})]},Z.reason))})]}),Ze==="notIndexed"&&!je&&(he.reasonGroups??[]).length===0&&he.notIndexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing State"}),c.jsx("th",{className:"text-left",children:"Coverage"})]})}),c.jsx("tbody",{children:he.notIndexed.map(Z=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),c.jsx("td",{className:"text-zinc-400",children:Z.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Z.coverageState??"Unknown"})]},Z.id))})]}),Ze==="notIndexed"&&je&&(()=>{const Z=(he.reasonGroups??[]).find(Ce=>Ce.reason===je);return Z?c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center gap-2 mb-3",children:c.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ae(null),children:["←"," Back to reasons"]})}),c.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Z.reason}),c.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Z.count," affected page",Z.count!==1?"s":""]})]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:qe,onClick:()=>{vs(Z.urls.map(Ce=>Ce.url))},children:qe?"Requesting…":`Request indexing (${Z.count})`})]}),c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Last Crawl"}),c.jsx("th",{className:"w-8"})]})}),c.jsx("tbody",{children:Z.urls.map(Ce=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ce.url}),c.jsx("td",{className:"text-zinc-400",children:Ce.crawlTime?Ce.crawlTime.split("T")[0]:"—"}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:qe,onClick:()=>{vs([Ce.url])},title:"Request indexing",children:"Index"})})]},Ce.id))})]})]}):null})(),Ze==="deindexed"&&he.deindexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Detected"})]})}),c.jsx("tbody",{children:he.deindexed.map((Z,Ce)=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),c.jsx("td",{className:"text-zinc-400",children:Z.previousState}),c.jsx("td",{className:"text-zinc-400",children:Z.currentState}),c.jsx("td",{className:"text-zinc-400",children:Z.transitionDate.split("T")[0]})]},`${Z.url}-${Ce}`))})]}),(Ze==="indexed"&&he.indexed.length===0||Ze==="notIndexed"&&!je&&he.notIndexed.length===0||Ze==="deindexed"&&he.deindexed.length===0)&&c.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ne?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),c.jsx("h3",{children:"Search performance"})]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:U,onClick:()=>{Oa()},children:U?"Loading…":"Apply filters"})]}),u.length>0&&(()=>{const Z=new Map;for(const nt of u){const St=Z.get(nt.date);St?(St.clicks+=nt.clicks,St.impressions+=nt.impressions):Z.set(nt.date,{clicks:nt.clicks,impressions:nt.impressions})}const Ce=[...Z.entries()].sort(([nt],[St])=>nt.localeCompare(St));if(Ce.length===0)return null;const xt=Math.max(...Ce.map(([,nt])=>nt.impressions),1),ut=Ce.reduce((nt,[,St])=>nt+St.clicks,0),Pt=Ce.reduce((nt,[,St])=>nt+St.impressions,0),Ir=Pt>0?(ut/Pt*100).toFixed(1):"0.0",Pi=700,bs=220,br={top:12,bottom:36,left:48,right:12},Bh=Pi-br.left-br.right,ti=bs-br.top-br.bottom,Ea=Bh/Ce.length,Ri=Math.max(Math.min(Ea*.35,24),4),za=Math.max(Ri*.15,1),Po=nt=>{if(nt<=0)return 1;const St=Math.pow(10,Math.floor(Math.log10(nt))),Lr=nt/St,Mi=Lr<=1.5?1.5:Lr<=3?3:Lr<=5?5:10;return Math.ceil(Mi*St)},Di=4,ln=Math.ceil(Po(xt)/Di)*Di,Uh=Array.from({length:Di+1},(nt,St)=>ln/Di*St),Fh=nt=>nt>=1e3?`${(nt/1e3).toFixed(nt>=1e4?0:1)}k`:String(nt);return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:ut.toLocaleString()})]})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Pt.toLocaleString()})]})]}),c.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",c.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Ir,"%"]})]})]}),c.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Pi} / ${bs}`},children:c.jsxs("svg",{viewBox:`0 0 ${Pi} ${bs}`,className:"h-full w-full",children:[Uh.map((nt,St)=>{const Lr=br.top+ti-nt/ln*ti;return c.jsxs("g",{children:[c.jsx("line",{x1:br.left,y1:Lr,x2:Pi-br.right,y2:Lr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),c.jsx("text",{x:br.left-6,y:Lr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Fh(nt)})]},`t-${St}`)}),Ce.map(([nt,St],Lr)=>{const Mi=br.left+Ea*Lr+Ea/2,Ro=St.impressions/ln*ti,qh=St.clicks/ln*ti;return c.jsxs("g",{children:[c.jsx("title",{children:`${nt}
|
|
290
|
-
Clicks: ${St.clicks}
|
|
291
|
-
Impressions: ${St.impressions}
|
|
292
|
-
CTR: ${St.impressions>0?(St.clicks/St.impressions*100).toFixed(1):0}%`}),c.jsx("rect",{x:Mi-Ri-za/2,y:br.top+ti-Ro,width:Ri,height:Math.max(Ro,1),rx:2,fill:"#3b82f6",opacity:.85}),c.jsx("rect",{x:Mi+za/2,y:br.top+ti-qh,width:Ri,height:Math.max(qh,1),rx:2,fill:"#10b981",opacity:.85})]},nt)}),(()=>{const nt=Math.min(Ce.length,7);return Array.from({length:nt},(St,Lr)=>{const Mi=Ce.length===1?0:Math.round(Lr/(nt-1)*(Ce.length-1)),Ro=br.left+Ea*Mi+Ea/2;return c.jsx("text",{x:Ro,y:bs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ce[Mi][0].slice(5)},`xl-${Mi}`)})})()]})})]})})(),c.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:I.startDate,onChange:Z=>q(Ce=>({...Ce,startDate:Z.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:I.endDate,onChange:Z=>q(Ce=>({...Ce,endDate:Z.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:I.query,onChange:Z=>q(Ce=>({...Ce,query:Z.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:I.page,onChange:Z=>q(Ce=>({...Ce,page:Z.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:I.limit,onChange:Z=>q(Ce=>({...Ce,limit:Z.target.value}))})]}),u.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Date"}),c.jsx("th",{className:"text-left",children:"Query"}),c.jsx("th",{className:"text-left",children:"Page"}),Object.values(ro).map(Z=>c.jsx("th",{className:"text-right","aria-sort":Jt?.key===Z?Jt.dir==="asc"?"ascending":"descending":"none",children:c.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:()=>lt(Ce=>Ce?.key===Z?Ce.dir==="desc"?{key:Z,dir:"asc"}:null:{key:Z,dir:"desc"}),children:[UX[Z],Jt?.key===Z?Jt.dir==="desc"?" ↓":" ↑":""]})},Z))]})}),c.jsx("tbody",{children:ct.map((Z,Ce)=>c.jsxs("tr",{children:[c.jsx("td",{className:"text-zinc-400",children:Z.date}),c.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Z.query}),c.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Z.page}),c.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Z.clicks.toLocaleString()}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.impressions.toLocaleString()}),c.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Z.ctr)?Z.ctr*100:0).toFixed(1),"%"]}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.position.toFixed(1)})]},`${Z.date}:${Z.query}:${Z.page}:${Ce}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),c.jsx("h3",{children:"Inspect a URL"})]})}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:N,onChange:Z=>O(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&void tc()}),c.jsx(be,{type:"button",size:"sm",disabled:se||!Te?.propertyId||!N.trim(),onClick:tc,children:se?"Inspecting…":"Inspect URL"})]}),v&&c.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.indexingState??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.verdict??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Y2(v.isMobileFriendly)})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Fi(v.crawlTime)})]})]})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),c.jsx("h3",{children:"Inspection log"})]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{ei()},children:D?"Loading…":"Refresh history"})]}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:B,onChange:Z=>$(Z.target.value)}),c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:D,onClick:()=>{ei()},children:"Apply filter"})]}),f.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Coverage"}),c.jsx("th",{className:"text-left",children:"Mobile"}),c.jsx("th",{className:"text-left",children:"Inspected"})]})}),c.jsx("tbody",{children:f.map(Z=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),c.jsx("td",{className:"text-zinc-300",children:Z.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Z.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Z.coverageState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Y2(Z.isMobileFriendly)}),c.jsx("td",{className:"text-zinc-400",children:Fi(Z.inspectedAt)})]},Z.id))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),c.jsx("h3",{children:"Recent indexing losses"})]})}),m.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Changed at"})]})}),c.jsx("tbody",{children:m.map(Z=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),c.jsx("td",{className:"text-zinc-400",children:Z.previousState??"Unknown"}),c.jsx("td",{className:"text-zinc-300",children:Z.currentState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Fi(Z.transitionDate)})]},`${Z.url}:${Z.transitionDate}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Te&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>we(Z=>!Z),children:[c.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 ${on?"rotate-90":""}`,"aria-hidden":"true",children:c.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"})}),c.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),on&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),c.jsx("h3",{children:"Pick the Search Console property"})]})}),c.jsxs("div",{className:"mt-3 space-y-2",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),c.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:J||a.length===0,onChange:Z=>j(Z.target.value),children:a.length===0?c.jsx("option",{value:"",children:J?"Loading properties…":"No properties available"}):a.map(Z=>c.jsxs("option",{value:Z.siteUrl,children:[Z.siteUrl," · ",Z.permissionLevel]},Z.siteUrl))}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:J,onClick:()=>{Oo(Te)},children:J?"Refreshing…":"Refresh properties"}),c.jsx(be,{type:"button",size:"sm",disabled:!S||Se,onClick:$h,children:Se?"Saving…":"Save property"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),c.jsx("h3",{children:"Import GSC performance data"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),c.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:_,onChange:Z=>C(Z.target.value)})]}),c.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:[c.jsx("input",{type:"checkbox",checked:T,onChange:Z=>E(Z.target.checked)}),"Replace existing imported rows for the requested range"]})]}),c.jsx(be,{type:"button",size:"sm",disabled:ke.isPending||!Te.propertyId,onClick:ed,children:ke.isPending?"Queueing…":"Queue sync"}),!Te.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),c.jsx("h3",{children:"Sitemap configuration"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[Te.sitemapUrl&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Te.sitemapUrl})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Ee||!Te.propertyId,onClick:()=>{To()},children:Ee?"Loading…":"Browse sitemaps from GSC"}),c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:lr.isPending||!Te.propertyId,onClick:ec,children:lr.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),c.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."}),Fe&&Fe.length>0&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Fe.length,")"]}),Fe.map(Z=>{const Ce=Z.contents?.[0];return c.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-200 break-all",children:Z.path}),Z.lastSubmitted&&c.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Z.lastSubmitted.split("T")[0]]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ce&&c.jsxs("div",{className:"text-right",children:[c.jsxs("p",{className:"text-zinc-300",children:[Ce.indexed," / ",Ce.submitted]}),c.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>tt(Z.path),children:"Use"})]})]},Z.path)})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:Te.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:et,onChange:Z=>tt(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&et.trim()&&void zo()}),c.jsx(be,{type:"button",size:"sm",disabled:Ut||!et.trim(),onClick:zo,children:Ut?"Saving…":Te.sitemapUrl?"Update":"Save"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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}`}),c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:ys.isPending||!Te.propertyId,onClick:async()=>{const Ce=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Te.sitemapUrl||void 0;Ge(null),Tt(null);try{await ys.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ce}})}catch{}},children:ys.isPending?"Queueing…":"Inspect sitemap"})]}),!Te.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function PS({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.useState(!1);return c.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[c.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:c.jsx(nL,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&c.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const il=50;function Wc(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Km(e){return e.toLocaleString()}function vNe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function bNe(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 xNe(e){const t=e.filter(n=>n.kind===Kt["backlink-extract"]&&!ck(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function wNe(e,t){const n=new Date(e??t).getTime(),r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return a===0?`${i}m`:`${i}m ${a}s`}function SNe({projectName:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,o]=b.useState([]),[u,d]=b.useState(null),[f,p]=b.useState(null),[m,y]=b.useState(null),[v,w]=b.useState(Date.now()),[S,j]=b.useState(0),[N,O]=b.useState(!0),[_,C]=b.useState(!1),[T,E]=b.useState(null),A=b.useRef(null),P=b.useCallback(async()=>{O(!0),E(null);try{const[Y,H,J,pe,Se]=await Promise.all([QI().catch(()=>null),X7(e).catch(()=>null),J7(e,{limit:il,offset:S}).catch(U=>{if(U instanceof Ni&&U.code==="NOT_FOUND")return null;throw U}),eG(e).catch(()=>[]),VK(e).catch(()=>[])]);d(Y),n(H),i(J),o(pe);const R=xNe(Se);p(R),A.current=R?.id??null}catch(Y){E(Y instanceof Error?Y.message:"Failed to load backlinks")}finally{O(!1)}},[e,S]);b.useEffect(()=>{P()},[P]),b.useEffect(()=>{if(!f)return;const Y=f.id;let H=!1;const J=async()=>{try{const Se=await El(Y);if(H)return;ck(Se.status)?(p(null),y(Se),await P()):p(R=>R?.id===Se.id?{...R,...Se}:R)}catch{}},pe=window.setInterval(()=>{J()},3e3);return()=>{H=!0,window.clearInterval(pe)}},[f,P]),b.useEffect(()=>{if(!f)return;const Y=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(Y)},[f]),b.useEffect(()=>{if(!m||m.status==="failed")return;const Y=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(Y)},[m]);async function I(){C(!0),E(null);try{const Y=await tG(e);p(Y),A.current=Y.id}catch(Y){Y instanceof Ni&&Y.code==="MISSING_DEPENDENCY"?E("DuckDB is not installed. Visit the Backlinks admin page to install it."):E(Y instanceof Error?Y.message:"Failed to trigger extract")}finally{C(!1)}}const q=b.useMemo(()=>a.slice().sort((Y,H)=>Y.queriedAt.localeCompare(H.queriedAt)).map(Y=>({date:Y.queriedAt,linkingDomains:Y.totalLinkingDomains})),[a]),B=r&&r.total>il,$=Math.floor(S/il)+1,V=r?Math.max(1,Math.ceil(r.total/il)):1;return c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),c.jsx("h2",{children:"Referring domains"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",c.jsx("span",{className:"text-zinc-300",children:e}),", extracted from the Common Crawl hyperlink graph. Updates when a release sync completes — no live scraping, no paid API."]})]})}),T&&c.jsx(Be,{className:"surface-card p-4 mb-4 border-rose-800/60",children:c.jsx("p",{className:"text-sm text-rose-300",children:T})}),f&&c.jsx(Be,{className:"surface-card p-4 mb-4 border-sky-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(iL,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),c.jsx(vt,{tone:"neutral",children:f.status}),c.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[wNe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),c.jsxs("span",{className:"sr-only",children:["now=",v]})]}),c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",c.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",c.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&c.jsx(Be,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?c.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):c.jsx(tL,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:`text-sm font-medium ${m.status==="failed"?"text-rose-300":"text-emerald-300"}`,children:m.status==="failed"?"Extract failed":"Extract complete"}),m.error?c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:FX(m.error)}):m.status!=="failed"?c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),te()]});function te(){if(N)return c.jsx(Be,{className:"surface-card p-6",children:c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const Y=t!==null&&t.totalLinkingDomains>0,H=m?.status==="failed",J=t!==null&&t.totalLinkingDomains===0&&!H,pe=u?.status==="ready",Se=u?.status==="failed",R=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return Y?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"gauge-row",children:[c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:Km(t.totalLinkingDomains)})}),c.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:Km(t.totalHosts)})}),c.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:vNe(t.top10HostsShare)})}),c.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),c.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",c.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",bNe(t.queriedAt)]}),q.length>=2&&c.jsxs(Be,{className:"surface-card p-4 mt-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),c.jsx("div",{className:"h-40 mt-2",children:c.jsx(Xg,{width:"100%",height:"100%",children:c.jsxs(zy,{data:q,margin:{top:8,right:12,bottom:0,left:12},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:so[0],stopOpacity:.4}),c.jsx("stop",{offset:"100%",stopColor:so[0],stopOpacity:0})]})}),c.jsx(rh,{dataKey:"date",tick:ao,stroke:ah,tickFormatter:Py}),c.jsx(ih,{tick:ao,stroke:ah,allowDecimals:!1}),c.jsx(jy,{contentStyle:yu.contentStyle,labelStyle:yu.labelStyle,itemStyle:yu.itemStyle,labelFormatter:Ty}),c.jsx(bl,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:so[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),B&&c.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",$," of ",V," · ",Km(r.total)," total"]})]}),c.jsx(Be,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),c.jsxs("tbody",{children:[(r?.rows??[]).map(U=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:U.linkingDomain}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Km(U.numHosts)})]},U.linkingDomain)),r?.rows.length===0&&c.jsx("tr",{children:c.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:"No referring domains in this release."})})]})]})}),B&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:S===0,onClick:()=>j(U=>Math.max(0,U-il)),children:"Previous"}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:S+il>=(r?.total??0),onClick:()=>j(U=>U+il),children:"Next"})]})]}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:I,children:[c.jsx(Qj,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),c.jsxs(PS,{label:"What does Re-run extract do?",children:[c.jsxs("span",{className:"block",children:["Re-queries the ",c.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",c.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:[c.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",c.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),c.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"Open admin"})})]})]}):c.jsx(Be,{className:"surface-card p-6",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:c.jsx(rL,{className:"h-5 w-5","aria-hidden":!0})}),c.jsxs("div",{className:"flex-1",children:[!u&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),c.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Run a workspace release sync to populate backlinks for every project in this workspace."}),c.jsx("div",{className:"mt-4",children:c.jsx(be,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"Set up backlinks"})})})]}),R&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",u.status,u.phaseDetail?` — ${u.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),c.jsx("div",{className:"mt-4",children:c.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"View sync status"})})})]}),Se&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),c.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),c.jsx("div",{className:"mt-4",children:c.jsx(be,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"Go to Backlinks admin"})})})]}),pe&&!R&&!J&&!H&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",c.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",c.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsxs(be,{type:"button",size:"sm",disabled:_||f!==null,onClick:I,children:[c.jsx(xg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Run extract"]}),c.jsxs(PS,{label:"What does Run extract do?",children:[c.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",c.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",c.jsx("span",{className:"text-zinc-200",children:e}),"."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",c.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),H&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",c.jsx("code",{className:"text-zinc-300",children:u?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),c.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:c.jsx(be,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"Go to Backlinks admin"})})})]}),J&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",c.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",c.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",c.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),c.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[c.jsx("li",{children:"the domain is newer than the release’s crawl window"}),c.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),c.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),c.jsx("p",{className:"text-sm text-zinc-500 mt-3",children:"Try syncing a newer release — each Common Crawl dump is a different snapshot of the web graph."}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsx(be,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Wc("/backlinks"),children:"Go to Backlinks admin"})}),c.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:I,children:[c.jsx(xg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),c.jsxs(PS,{label:"What does Re-run extract do?",children:[c.jsxs("span",{className:"block",children:["Re-queries the cached release for ",c.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),c.jsx("span",{className:"mt-2 block text-zinc-400",children:"No re-download. ~5 min. If the release genuinely has no links for your domain, this won’t help — sync a different release instead."})]})]})]})]})]})})}}function jNe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=b.useState(!1),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(e.displayName),[m,y]=b.useState(e.canonicalDomain),[v,w]=b.useState(e.country),[S,j]=b.useState(e.language),[N,O]=b.useState(e.ownedDomains??[]),[_,C]=b.useState(""),[T,E]=b.useState(null),[A,P]=b.useState(!1),[I,q]=b.useState(!1),[B,$]=b.useState(""),[V,te]=b.useState(""),[Y,H]=b.useState(""),[J,pe]=b.useState(""),[Se,R]=b.useState("");b.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]))},[e,r]);function U(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]),C("")}function F(){const X=_.trim();X&&(N.includes(X)||O([...N,X]),C(""))}function D(X){O(N.filter(Fe=>Fe!==X))}async function Q(){if(!(!f.trim()||!m.trim()||!v.trim()||!S.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:N,country:v.trim(),language:S.trim()}),i(!1),ht({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(X){d(X instanceof Error?X.message:"Failed to save")}finally{o(!1)}}}async function se(){const X=B.trim(),Fe=V.trim(),De=Y.trim(),et=J.trim();if(!(!X||!Fe||!De||!et)){P(!0),E(null);try{const tt={label:X,city:Fe,region:De,country:et};Se.trim()&&(tt.timezone=Se.trim()),await JK(e.name,tt),n(),$(""),te(""),H(""),pe(""),R(""),q(!1),ht({title:"Location added",detail:`${X} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${X}`,dedupeMode:"drop"})}catch(tt){E(tt instanceof Error?tt.message:"Failed to add location")}finally{P(!1)}}}async function ae(X){P(!0),E(null);try{await e7(e.name,X),n(),ht({title:"Location removed",detail:`${X} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${X}`,dedupeMode:"drop"})}catch(Fe){E(Fe instanceof Error?Fe.message:"Failed to remove location")}finally{P(!1)}}async function he(X){P(!0),E(null);try{await t7(e.name,X),n(),ht({title:"Default location updated",detail:`${X} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Fe){E(Fe instanceof Error?Fe.message:"Failed to set default location")}finally{P(!1)}}const Ne=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||S!==e.language||JSON.stringify(N)!==JSON.stringify(e.ownedDomains??[]),ne="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",de="block text-xs font-medium text-zinc-400 mb-1",Ee=B.trim()&&V.trim()&&Y.trim()&&J.trim();return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),c.jsx("h2",{children:"Project settings"})]}),!r&&c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&c.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:[u,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:de,children:"Display name"}),c.jsx("input",{className:ne,type:"text",value:f,onChange:X=>p(X.target.value),placeholder:"My Project"})]}),c.jsxs("div",{children:[c.jsx("label",{className:de,children:"Canonical domain"}),c.jsx("input",{className:ne,type:"text",value:m,onChange:X=>y(X.target.value),placeholder:"example.com"})]}),c.jsxs("div",{children:[c.jsx("label",{className:de,children:"Country"}),c.jsx("input",{className:ne,type:"text",value:v,onChange:X=>w(X.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{children:[c.jsx("label",{className:de,children:"Language"}),c.jsx("input",{className:ne,type:"text",value:S,onChange:X=>j(X.target.value),placeholder:"en"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:de,children:"Owned domains"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:N.map(X=>c.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:[X,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(X),"aria-label":`Remove ${X}`,children:"×"})]},X))}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${ne} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:X=>C(X.target.value),onKeyDown:X=>X.key==="Enter"&&(X.preventDefault(),F())}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:F,children:"Add"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[c.jsx(be,{type:"button",disabled:a||!Ne||!f.trim()||!m.trim(),onClick:Q,children:a?"Saving...":"Save changes"}),c.jsx(be,{type:"button",variant:"outline",disabled:a,onClick:U,children:"Cancel"})]})]}):c.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:c.jsx("table",{className:"w-full text-sm",children:c.jsxs("tbody",{children:[c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),c.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(X=>c.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:X},X))}):c.jsx("span",{className:"text-zinc-500",children:"—"})})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),c.jsxs("td",{className:"px-4 py-2.5",children:[T&&c.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,c.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>E(null),children:"×"})]}),(e.locations??[]).length>0?c.jsxs("table",{className:"w-full text-xs mb-2",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-zinc-600",children:[c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),c.jsx("th",{className:"pb-1"})]})}),c.jsx("tbody",{children:e.locations.map(X=>c.jsxs("tr",{className:"border-t border-zinc-800/30",children:[c.jsx("td",{className:"py-1.5 pr-3",children:c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${X.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:[X.label,X.label===e.defaultLocation?" ★":""]})}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.city}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.region}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.country}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:X.timezone??"—"}),c.jsx("td",{className:"py-1.5",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[X.label!==e.defaultLocation&&c.jsx("button",{type:"button",disabled:A,onClick:()=>he(X.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${X.label} as default location`,children:"Set default"}),c.jsx("button",{type:"button",disabled:A,onClick:()=>ae(X.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${X.label}`,children:"Remove"})]})})]},X.label))})]}):c.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),I?c.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[c.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),c.jsx("input",{className:ne,type:"text",value:B,onChange:X=>$(X.target.value),placeholder:"nyc"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),c.jsx("input",{className:ne,type:"text",value:V,onChange:X=>te(X.target.value),placeholder:"New York"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),c.jsx("input",{className:ne,type:"text",value:Y,onChange:X=>H(X.target.value),placeholder:"NY"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),c.jsx("input",{className:ne,type:"text",value:J,onChange:X=>pe(X.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{className:"col-span-2",children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),c.jsx("input",{className:ne,type:"text",value:Se,onChange:X=>R(X.target.value),placeholder:"America/New_York"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[c.jsx(be,{type:"button",size:"sm",disabled:A||!Ee,onClick:se,children:A?"Adding...":"Add location"}),c.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{q(!1),E(null)},children:"Cancel"})]})]}):c.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>q(!0),children:"+ Add location"})]})]})]})})})]})}const kNe=[{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"}],eI=["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 NNe({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState("daily"),[u,d]=b.useState(6),[f,p]=b.useState(""),[m,y]=b.useState("UTC"),[v,w]=b.useState(!1),[S,j]=b.useState(""),[N,O]=b.useState(!1),[_,C]=b.useState(!1),[T,E]=b.useState(null);b.useEffect(()=>{c7(e).then(n).catch(()=>n(null))},[e]);const A=()=>{if(t&&t!=="loading"){const B=KX(t.preset??null,t.cronExpr);o(B.freq),d(B.hour),p(B.customCron);const $=eI.includes(t.timezone);y($?t.timezone:"Other"),w(!$),j($?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),w(!1),j("");E(null),i(!0)},P=async()=>{O(!0),E(null);try{const $={timezone:v?S.trim()||"UTC":m};a==="custom"?$.cron=f.trim():$.preset=HX(a,u);const V=await u2(e,$);n(V),i(!1),ht({title:"Schedule saved",detail:Ex(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(B){E(B instanceof Error?B.message:"Failed to save schedule")}finally{O(!1)}},I=async()=>{if(!(!t||t==="loading")){O(!0),E(null);try{const B={timezone:t.timezone,enabled:!t.enabled};t.preset?B.preset=t.preset:B.cron=t.cronExpr;const $=await u2(e,B);n($),ht({title:$.enabled?"Schedule resumed":"Schedule paused",detail:Ex($.preset??null,$.cronExpr,$.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(B){E(B instanceof Error?B.message:"Failed to update schedule")}finally{O(!1)}}},q=async()=>{C(!0),E(null);try{await u7(e),n(null),i(!1),ht({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(B){E(B instanceof Error?B.message:"Failed to remove schedule")}finally{C(!1)}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&c.jsx(Be,{className:"surface-card compact-card",children:c.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&c.jsxs(Be,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Ex(t.preset??null,t.cronExpr,t.timezone)}),c.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",c.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(vt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:N,onClick:I,children:t.enabled?"Pause":"Resume"}),c.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:q,children:_?"Removing...":"Remove"})]})]}),T&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),r&&c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),c.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:a,onChange:B=>o(B.target.value),children:kNe.map(B=>c.jsx("option",{value:B.value,children:B.label},B.value))})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),c.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:u,disabled:a==="twice-daily"||a==="custom",onChange:B=>d(parseInt(B.target.value)),children:Array.from({length:24},(B,$)=>c.jsx("option",{value:$,children:i1($)},$))})]})]}),a==="custom"&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),c.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:f,onChange:B=>p(B.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),c.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:v?"Other":m,onChange:B=>{B.target.value==="Other"?(w(!0),y("Other")):(w(!1),y(B.target.value))},children:[eI.map(B=>c.jsx("option",{value:B,children:B},B)),c.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&c.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:B=>j(B.target.value)})]}),T&&c.jsx("p",{className:"text-rose-400 text-sm",children:T}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),E(null)},children:"Cancel"}),c.jsx(be,{type:"button",size:"sm",disabled:N||a==="custom"&&!f.trim(),onClick:P,children:N?"Saving...":"Save schedule"})]})]})]})}const CNe=[{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 _Ne({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState(""),[u,d]=b.useState(["citation.lost","citation.gained"]),[f,p]=b.useState(!1),[m,y]=b.useState(null),[v,w]=b.useState({});b.useEffect(()=>{d7(e).then(n).catch(()=>n([]))},[e]);const S=_=>{d(C=>C.includes(_)?C.filter(T=>T!==_):[...C,_])},j=async()=>{if(!(!a.trim()||u.length===0)){p(!0),y(null);try{const _=await f7(e,{channel:"webhook",url:a.trim(),events:u});n(C=>C==="loading"?[_]:[...C,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),ht({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},N=async _=>{try{await h7(e,_),n(C=>C==="loading"?C:C.filter(T=>T.id!==_)),ht({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}},O=async _=>{w(C=>({...C,[_]:{state:"testing"}}));try{const C=await p7(e,_);w(T=>({...T,[_]:{state:C.ok?"ok":"fail",status:C.status}})),C.ok&&ht({title:"Test notification sent",detail:`Webhook returned status ${C.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{w(C=>({...C,[_]:{state:"fail"}}))}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),c.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:a,onChange:_=>o(_.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),c.jsx("div",{className:"flex flex-wrap gap-3",children:CNe.map(_=>c.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(_.value),onChange:()=>S(_.value)}),c.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.value))})]}),m&&c.jsx("p",{className:"text-rose-400 text-sm",children:m}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),c.jsx(be,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:j,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&c.jsx(Be,{className:"surface-card compact-card",children:c.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&&c.jsxs("div",{className:"evidence-table-wrap",children:[c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Endpoint"}),c.jsx("th",{children:"Events"}),c.jsx("th",{children:"Status"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:t.map(_=>c.jsxs("tr",{children:[c.jsx("td",{className:"evidence-keyword-cell",children:c.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:_.urlHost,children:_.urlDisplay??_.url})}),c.jsx("td",{children:c.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(C=>c.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:C.replace("."," ")},C))})}),c.jsx("td",{children:c.jsx(vt,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const C=v[_.id],T=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return c.jsx(vt,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:T})})(),c.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>O(_.id),children:"Test"}),c.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:()=>N(_.id),children:"Remove"})]})})]},_.id))})]}),m&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function ANe({projectName:e,refreshNonce:t}){const[n,r]=b.useState(null),[i,a]=b.useState([]),[o,u]=b.useState(null),[d,f]=b.useState([]),[p,m]=b.useState([]),[y,v]=b.useState(null),[w,S]=b.useState(""),[j,N]=b.useState(""),[O,_]=b.useState(""),[C,T]=b.useState(!0),[E,A]=b.useState(!1),[P,I]=b.useState(null),[q,B]=b.useState("coverage");b.useEffect(()=>{$()},[e,t]);async function $(){T(!0),I(null);try{const R=await VI(e);if(r(R),R.connected){const[U,F,D,Q]=await Promise.all([Yj(e).catch(()=>null),ZI(e).catch(()=>[]),M7(e).catch(()=>[]),R.siteUrl?Promise.resolve([]):R7(e).then(se=>se.sites).catch(()=>[])]);u(U),f(F),m(D),a(Q)}else u(null),f([]),m([]),a([])}catch(R){I(R instanceof Error?R.message:"Failed to load Bing data")}finally{T(!1)}}async function V(){if(j.trim()){I(null);try{const R=await T7(e,j.trim());N(""),R.availableSites.length>0&&a(R.availableSites),await $()}catch(R){I(R instanceof Error?R.message:"Failed to connect")}}}async function te(){try{await P7(e),r(null),a([]),u(null),f([]),m([]),v(null),_(""),I(null)}catch(R){I(R instanceof Error?R.message:"Failed to disconnect")}}async function Y(){if(O)try{await D7(e,O),await $()}catch(R){I(R instanceof Error?R.message:"Failed to set site")}}async function H(){if(w.trim())try{const R=await YI(e,w.trim());v(R),f(U=>[R,...U])}catch(R){I(R instanceof Error?R.message:"Inspection failed")}}async function J(R){A(!0),I(null);try{const U=await h2(e,{urls:[R]}),{succeeded:F,failed:D,total:Q}=U.summary;ht({title:"Bing submission requested",detail:D===0?`${F} URL submitted to Bing.`:`${F}/${Q} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}catch(U){const F=U instanceof Error?U.message:"Submission failed";I(F),ht({title:"Bing submission failed",detail:F,tone:"negative",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}finally{A(!1)}}async function pe(){A(!0),I(null),ht({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const R=await h2(e,{allUnindexed:!0}),{succeeded:U,failed:F,total:D}=R.summary;ht({title:"Bing submissions requested",detail:F===0?`${U}/${D} URL${D!==1?"s":""} submitted to Bing.`:`${U}/${D} submitted successfully, ${F} failed.`,tone:F===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(R){const U=R instanceof Error?R.message:"Batch submission failed";I(U),ht({title:"Bing submissions failed",detail:U,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{A(!1)}}if(C)return c.jsx(Be,{className:"surface-card",children:c.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsx(vt,{tone:"caution",children:"Not connected"})]}),c.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),c.jsxs("div",{className:"mt-3",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:j,onChange:R=>N(R.target.value),onKeyDown:R=>R.key==="Enter"&&V()}),c.jsx(be,{size:"sm",disabled:!j.trim(),onClick:V,children:"Connect"})]}),c.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",c.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&&c.jsx("p",{className:"mt-3 text-xs text-rose-400",children:P})]});if(!n.siteUrl)return c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vt,{tone:"positive",children:"Connected"}),c.jsx(be,{size:"sm",variant:"ghost",onClick:te,children:"Disconnect"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),c.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."})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?Fi(n.updatedAt):"—"})]})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),i.length>0?c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:O,onChange:R=>_(R.target.value),children:[c.jsx("option",{value:"",children:"Select a site..."}),i.map(R=>c.jsxs("option",{value:R.url,children:[R.url,R.verified?" (verified)":""]},R.url))]}),c.jsx(be,{size:"sm",disabled:!O,onClick:Y,children:"Set Site"})]}):c.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&&c.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 c.jsxs("div",{className:"space-y-3",children:[c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vt,{tone:"positive",children:"Connected"}),c.jsx(be,{size:"sm",variant:"ghost",onClick:te,children:"Disconnect"})]})]}),P&&c.jsx("p",{className:"mb-3 text-xs text-rose-400",children:P}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),c.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",c.jsx("code",{children:n.siteUrl}),"."]})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?Fi(n.updatedAt):"—"})]})]})]})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),c.jsx("h3",{children:"Index monitoring"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:o?.lastInspectedAt?`Last inspected ${Fi(o.lastInspectedAt)}`:"No inspection history yet"})]}),c.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:Se.map(R=>c.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===R.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(R.key),children:R.label},R.key))}),q==="coverage"&&o&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[c.jsx(_m,{label:"Indexed",value:o.summary.indexed,tone:"positive"}),c.jsx(_m,{label:"Not in index",value:o.summary.notIndexed+(o.summary.unknown??0),tone:"negative"}),c.jsx(_m,{label:"Status unknown",value:o.summary.unknown??0,tone:"neutral"}),c.jsx(_m,{label:"Coverage",value:`${o.summary.percentage}%`,tone:"neutral"})]}),o.notIndexed.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[c.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",o.notIndexed.length,")"]}),c.jsx(be,{size:"sm",variant:"ghost",disabled:E,onClick:pe,children:E?"Submitting…":"Submit all to Bing"})]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),c.jsx("tbody",{children:o.notIndexed.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),c.jsx("td",{className:"py-1.5 px-3 text-right",children:c.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:E,onClick:()=>J(R.url),children:"Submit"})})]},R.id))})]})})]}),(o.unknown??[]).length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[c.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(o.unknown??[]).length,")"]}),c.jsx(be,{size:"sm",variant:"ghost",disabled:E,onClick:pe,children:E?"Submitting…":"Submit all to Bing"})]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),c.jsx("tbody",{children:(o.unknown??[]).map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Fi(R.lastCrawledDate):"—"}),c.jsx("td",{className:"py-1.5 px-3 text-right",children:c.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:E,onClick:()=>J(R.url),children:"Submit"})})]},R.id))})]})})]}),o.indexed.length>0&&c.jsxs("div",{children:[c.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",o.indexed.length,")"]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),c.jsx("tbody",{children:o.indexed.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Fi(R.lastCrawledDate):"—"})]},R.id))})]})})]})]}),q==="coverage"&&!o&&c.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:w,onChange:R=>S(R.target.value),onKeyDown:R=>R.key==="Enter"&&H()}),c.jsx(be,{size:"sm",disabled:!w.trim(),onClick:H,children:"Inspect"})]}),y&&c.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[c.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),c.jsxs("div",{className:"text-zinc-400",children:["In Index: ",c.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),d.length>0&&c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),c.jsx("tbody",{children:d.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3",children:c.jsx(vt,{tone:R.inIndex?"positive":"negative",children:R.inIndex?"Yes":"No"})}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:Fi(R.inspectedAt)})]},R.id))})]})})]}),q==="performance"&&c.jsx("div",{className:"mt-4",children:p.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:cm[ro.Clicks]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:cm[ro.Impressions]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:cm[ro.CTR]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:cm[ro.Position]})]})}),c.jsx("tbody",{children:p.map((R,U)=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.query}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:R.clicks}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.impressions}),c.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(R.ctr)?R.ctr*100:0).toFixed(1),"%"]}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.averagePosition.toFixed(1)})]},U))})]})})})]})]})}function ONe({projectName:e}){const[t,n]=b.useState("google"),[r,i]=b.useState(!0),[a,o]=b.useState("idle"),[u,d]=b.useState(null),f=b.useRef(null),[p,m]=b.useState(!1),[y,v]=b.useState(null),[w,S]=b.useState(null),[j,N]=b.useState(!1),[O,_]=b.useState(null),[C,T]=b.useState(null),[E,A]=b.useState(0);async function P(U=!1){U||i(!0),d(null);try{const[F,D,Q]=await Promise.all([Vj().catch(()=>null),KI(e).catch(()=>[]),VI(e).catch(()=>null)]),se=D.find(Ne=>Ne.connectionType==="gsc")??null;m(!!F?.google?.configured),N(!!F?.bing?.configured),v(se),_(Q);const[ae,he]=await Promise.all([se?Zj(e).catch(()=>null):Promise.resolve(null),Q?.connected?Yj(e).catch(()=>null):Promise.resolve(null)]);S(ae),T(he)}catch(F){d(F instanceof Error?F.message:"Failed to load search console overview")}finally{i(!1)}}async function I(){if(a!=="idle")return;f.current?.abort();const U=new AbortController;f.current=U;const F=U.signal;o("syncing"),d(null);const D=[];try{async function Q(){if(!y)return;const Ne=await GI(e);if(!Ne?.id)return;const ne=2e3,Ee=Date.now()+12e4;for(;Date.now()<Ee;){if(F.aborted||(await new Promise(Fe=>setTimeout(Fe,ne)),F.aborted))return;const X=await El(Ne.id).catch(()=>null);if(!X)break;if(["completed","failed","cancelled"].includes(X.status)){X.status!=="completed"&&D.push(`Google sync ${X.status}`);break}}}const se=10;async function ae(){if(!O?.connected)return;const Ne=await ZI(e).catch(()=>[]),ne=[...new Set(Ne.map(de=>de.url))];if(ne.length!==0)for(let de=0;de<ne.length;de+=se){if(F.aborted)return;const Ee=ne.slice(de,de+se),Fe=(await Promise.allSettled(Ee.map(De=>YI(e,De)))).filter(De=>De.status==="rejected").length;Fe>0&&D.push(`${Fe} Bing inspection(s) failed`)}}const he=await Promise.allSettled([Q(),ae()]);for(const Ne of he)Ne.status==="rejected"&&D.push(Ne.reason instanceof Error?Ne.reason.message:"Sync failed");if(F.aborted)return;o("reloading"),await P(!0),A(Ne=>Ne+1),D.length>0&&d(`Partial refresh: ${D.join("; ")}`)}catch(Q){F.aborted||d(Q instanceof Error?Q.message:"Refresh failed")}finally{F.aborted||o("idle")}}b.useEffect(()=>(P(),()=>{f.current?.abort()}),[e]);const q=y?"positive":p?"caution":"negative",B=y?"Connected":p?"Ready to connect":"Needs setup",$=w?`${w.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",V=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",te=w?.lastInspectedAt??y?.updatedAt??null,Y=O?.connected?"positive":j?"caution":"negative",H=O?.connected?"Connected":j?"Ready to connect":"Needs setup",J=C?`${C.summary.percentage}% indexed`:O?.connected?"Awaiting coverage":"No coverage data",pe=C?C.summary.notIndexed+(C.summary.unknown??0):0,Se=C?`${pe} not in index`:O?.connected?"Inspect URLs to populate coverage":j?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",R=C?.lastInspectedAt??O?.updatedAt??null;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),c.jsx("h2",{children:"Search Engine Intelligence"}),c.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."})]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:r||a!=="idle",onClick:()=>{I()},children:r?"Loading…":a==="syncing"?"Refreshing Google & Bing…":a==="reloading"?"Reloading workspaces…":"Refresh all"})]}),u&&c.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:u}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsx(CT,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":B,tone:r?"neutral":q,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":$,note:r?"Loading overview…":V,updatedAt:te,active:t==="google",onClick:()=>n("google")}),c.jsx(CT,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":H,tone:r?"neutral":Y,targetLabel:"Selected site",targetValue:O?.siteUrl??"No site selected",coverageValue:r?"Loading…":J,note:r?"Loading overview…":Se,updatedAt:R,active:t==="bing",onClick:()=>n("bing")})]})]}),c.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([U,F])=>c.jsx("button",{type:"button",role:"tab","aria-selected":t===U,className:`project-subnav-link ${t===U?"project-subnav-link-active":""}`,onClick:()=>n(U),children:F},U))}),t==="google"&&c.jsx(yNe,{projectName:e}),t==="bing"&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),c.jsx("h2",{children:"Bing Webmaster Tools"})]})}),c.jsx(ANe,{projectName:e,refreshNonce:E})]})]})}function ENe({insights:e}){const{openEvidence:t}=Mu(),[n,r]=b.useState(null);return c.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return c.jsxs("div",{children:[c.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&c.jsx(oh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),c.jsx(vt,{tone:i.tone,children:i.actionLabel}),c.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),c.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&c.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&c.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>c.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(E1,{state:u.citationState}),c.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.keyword}),c.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&c.jsx(Df,{provider:u.provider})})]}),u.evidenceId&&c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(u.evidenceId)},children:"View →"})]},u.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Dh({tab:e}){const{projectId:t}=$y({from:"/projects/$projectId"}),n=So(),{dashboard:r,isLoading:i,refetch:a}=Zl();if(!r||i)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-48"}),c.jsx("div",{className:"skeleton-text-sm w-32"})]}),c.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(we=>c.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[c.jsx("div",{className:"skeleton-circle size-20"}),c.jsx("div",{className:"skeleton-text w-16 mt-3"})]},we))}),c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-28"}),c.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(we=>c.jsx("div",{className:"skeleton-text-sm w-full"},we))})]})]});const o=Xte(r,t),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(!1),[v,w]=b.useState(""),[S,j]=b.useState(!1),[N,O]=b.useState(!1),[_,C]=b.useState(""),[T,E]=b.useState(!1),[A,P]=b.useState(!1),[I,q]=b.useState(""),[B,$]=b.useState(!1),[V,te]=b.useState(void 0),[Y,H]=b.useState(!1),[J,pe]=b.useState(null),[Se,R]=b.useState(!1),U=o?.visibilityEvidence??[],F=o?.project.name??"",D=o?.project.displayName||o?.project.name||F,Q=K8(),se=b.useMemo(()=>new Set(U.map(we=>we.location??"")),[U]),ae=se.has(""),he=b.useMemo(()=>[...se].filter(Boolean),[se]);b.useEffect(()=>{if(V===void 0||V===""||!F){pe(null),R(!1);return}R(!0),qI(F,V).then(we=>{pe(we),R(!1)}).catch(()=>{pe(null),R(!1)})},[V,F]);const Ne=b.useMemo(()=>{if(!J)return null;const we=new Map;for(const Ze of J){for(const[bt,Jt]of Object.entries(Ze.providerRuns??{}))we.set(`${Ze.keyword}::${bt}`,Jt.map(lt=>({runId:lt.runId,citationState:lt.citationState,createdAt:lt.createdAt,answerMentioned:lt.answerMentioned,visibilityState:lt.visibilityState,visibilityTransition:lt.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&we.set(`${Ze.keyword}::`,Ze.runs.map(bt=>({runId:bt.runId,citationState:bt.citationState,createdAt:bt.createdAt,answerMentioned:bt.answerMentioned,visibilityState:bt.visibilityState,visibilityTransition:bt.visibilityTransition})))}return we},[J]),ne=b.useMemo(()=>{const we=V!==void 0?U.filter(Ze=>V===""?!Ze.location:Ze.location===V):U;return Ne?we.map(Ze=>{const bt=Ne.get(`${Ze.keyword}::${Ze.provider}`)??Ne.get(`${Ze.keyword}::`);return bt?{...Ze,runHistory:bt}:Ze}):we},[U,V,Ne]);if(!o)return c.jsx("div",{className:"page-container",children:c.jsxs(Be,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Project not found"}),c.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),c.jsx(be,{asChild:!0,children:c.jsx(qt,{to:"/",children:"Return to overview"})})]})});async function de(){try{await Q.mutateAsync({projectName:F,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Ee(){p(!0);try{await n7(F),ht({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${F}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(we){console.error("Failed to delete project:",we)}finally{p(!1)}}async function X(){try{const we=await r7(F),Ze=typeof we=="string"?we:JSON.stringify(we,null,2),bt=new Blob([Ze],{type:"text/yaml"}),Jt=URL.createObjectURL(bt),lt=document.createElement("a");lt.href=Jt,lt.download=`${F}.yaml`,lt.click()}catch(we){ht({title:"Export failed",detail:we instanceof Error?we.message:"Could not export project YAML.",tone:"negative"})}}async function Fe(){const we=v.split(`
|
|
293
|
-
`).map(Ze=>Ze.trim()).filter(Boolean);if(we.length!==0){j(!0);try{await WK(F,we),a(),w(""),y(!1)}finally{j(!1)}}}async function De(){const we=_.trim();if(we){E(!0);try{const bt=(await FI(F)).map(lt=>lt.domain),Jt=[...new Set([...bt,we])];await HI(F,Jt),a(),C(""),O(!1)}finally{E(!1)}}}async function et(){const we=I.trim();if(we){$(!0);try{const Ze=o?.project.ownedDomains??[];await c2(F,[...Ze,we]),a(),q(""),P(!1)}finally{$(!1)}}}async function tt(we){$(!0);try{const Ze=o?.project.ownedDomains??[];await c2(F,Ze.filter(bt=>bt!==we)),a()}finally{$(!1)}}async function Ut(we,Ze){await QK(we,Ze),a()}const Xt=we=>!Number.isNaN(Number.parseInt(we,10)),on=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${o.project.id}/analytics`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return c.jsxs("div",{className:"page-container",children:[u?c.jsxs(Be,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[c.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),c.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",c.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(be,{type:"button",variant:"destructive",disabled:f,onClick:Ee,children:f?"Deleting...":"Yes, delete project"}),c.jsx(be,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),c.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!A&&c.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"})," "," · ",o.contextLabel]}),c.jsxs("div",{className:"tag-row",children:[c.jsx("span",{className:"tag",children:o.project.country}),c.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(we=>c.jsx("span",{className:"tag",children:we},we))]}),((o.project.ownedDomains??[]).length>0||A)&&c.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(we=>c.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:[we,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:B,onClick:()=>tt(we),"aria-label":`Remove ${we}`,children:"×"})]},we)),A?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:I,onChange:we=>q(we.target.value),onKeyDown:we=>we.key==="Enter"&&et(),autoFocus:!0}),c.jsx(be,{type:"button",size:"sm",disabled:!I.trim()||B,onClick:et,children:B?"...":"Add"}),c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{P(!1),q("")},children:"Cancel"})]}):c.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"})]})]}),c.jsxs("div",{className:"page-header-right",children:[c.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:X,"aria-label":"Export project as YAML",children:c.jsx(Qj,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:c.jsx(sL,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(be,{type:"button",disabled:Q.isPending,onClick:de,children:Q.isPending?"Starting...":"Run now"})]})]})]}),c.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:on.map(we=>c.jsx(qt,{to:we.href,className:`project-subnav-link ${we.key===e?"project-subnav-link-active":""}`,"aria-current":we.key===e?"page":void 0,children:we.label},we.key))}),e==="overview"?c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"gauge-row",children:[c.jsx(M$,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:Xt(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",c.jsx(Wn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),c.jsxs("p",{className:"metric-card-big-value",children:[c.jsx("span",{className:"text-zinc-50",children:o.gapKeyPhrases.value}),c.jsxs("span",{className:"text-zinc-600",children:[" / ",o.keywordCounts.total]})]}),c.jsx("div",{className:"metric-card-bar",children:c.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapKeyPhrases.tone}`,style:{width:o.gapKeyPhrases.progress!==void 0?`${o.gapKeyPhrases.progress*100}%`:"0%"}})}),c.jsx("p",{className:"metric-card-detail",children:o.gapKeyPhrases.delta}),c.jsx("p",{className:"metric-card-sub",children:o.gapKeyPhrases.description})]}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",c.jsx(Wn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),c.jsxs("p",{className:"metric-card-big-value",children:[c.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),c.jsx("span",{className:"text-zinc-600",children:"%"})]}),c.jsx("div",{className:"metric-card-bar",children:c.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),c.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),c.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",c.jsx(Wn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?c.jsxs("div",{className:"metric-card-movement",children:[c.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),c.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),c.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):c.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),c.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),o.providerScores.length>1&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),c.jsxs("h2",{children:["Visibility by model ",c.jsx(Wn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),c.jsx("div",{className:"evidence-table-wrap",children:c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Model"}),c.jsx("th",{children:"Score"}),c.jsx("th",{children:"Cited key phrases"})]})}),c.jsx("tbody",{children:o.providerScores.map(we=>c.jsxs("tr",{children:[c.jsx("td",{children:c.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[c.jsx(Df,{provider:we.provider}),we.model&&c.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:we.model})]})}),c.jsx("td",{children:c.jsxs("span",{className:`font-semibold ${we.score>=70?"text-emerald-400":we.score>=40?"text-amber-400":"text-rose-400"}`,children:[we.score,"%"]})}),c.jsxs("td",{className:"text-zinc-500",children:[we.cited," of ",we.total]})]},`${we.provider}::${we.model??"unknown"}`))})]})})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),c.jsx("h2",{children:"Citation signals"})]})}),c.jsx(ENe,{insights:o.insights})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),c.jsx("h2",{children:"Key phrase citation tracking"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(we=>we.keyword)).size," key phrases tracked"]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add key phrases"})]})]}),m&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:v,onChange:we=>w(we.target.value)}),c.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
-
`).filter(we=>we.trim()).length," key phrases"]}),c.jsx(be,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:Fe,children:S?"Adding...":"Add key phrases"})]})]}),o.project.locations&&o.project.locations.length>0&&c.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[c.jsx("button",{className:`filter-chip ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{te(void 0)},children:"All locations"}),o.project.locations.map(we=>se.has(we.label)&&c.jsx("button",{className:`filter-chip ${V===we.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===we.label,onClick:()=>{te(we.label),H(!1)},children:we.label},we.label)),ae&&c.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{te(""),H(!1)},children:"No location"}),he.length>1&&V===void 0&&c.jsx("button",{className:`filter-chip filter-chip-compare ${Y?"filter-chip-active":""}`,type:"button","aria-pressed":Y,onClick:()=>H(we=>!we),title:"Side-by-side location comparison",children:"Compare"})]}),c.jsx(Kle,{evidence:ne})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),c.jsx("h2",{children:"Competitive landscape"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!N),children:N?"Cancel":"+ Add competitor"})]})]}),N&&c.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:_,onChange:we=>C(we.target.value),onKeyDown:we=>we.key==="Enter"&&De()}),c.jsx(be,{type:"button",size:"sm",disabled:!_.trim()||T,onClick:De,children:T?"Adding...":"Add"})]}),c.jsx(Gle,{competitors:o.competitors})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),c.jsx("h2",{children:"Recent execution history"})]})}),c.jsx("div",{className:"run-list",children:o.recentRuns.map(we=>c.jsx(D$,{run:we},we.id))})]}),c.jsx(jNe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Ut,onRefresh:()=>{a()}}),c.jsx(NNe,{projectName:o.project.name}),c.jsx(_Ne,{projectName:o.project.name})]}):e==="analytics"?c.jsx(Wke,{projectName:o.project.name}):e==="traffic"?c.jsx(nNe,{projectName:o.project.name}):e==="inbound"?c.jsx(SNe,{projectName:o.project.name}):c.jsx(ONe,{projectName:o.project.name})]})}function zNe(){const{dashboard:e,isLoading:t}=Zl(),n=fNe();if(!e||t)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-20"}),c.jsx("div",{className:"skeleton-text-sm w-72"})]}),c.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[c.jsxs("div",{className:"flex-1 space-y-1.5",children:[c.jsx("div",{className:"skeleton-text w-40"}),c.jsx("div",{className:"skeleton-text-sm w-56"})]}),c.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=b.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Runs"}),c.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),c.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),c.jsxs("section",{children:[c.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>c.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Gy(d)},d))}),c.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>c.jsx(D$,{run:d},d.id)):c.jsxs(Be,{className:"surface-card empty-card",children:[c.jsx("h2",{children:"No runs match this filter"}),c.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function TNe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=b.useState(""),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,w]=b.useState(""),[S,j]=b.useState(""),[N,O]=b.useState(!1),[_,C]=b.useState(null),[T,E]=b.useState(!1),A=i?u.trim().length>0:a.trim().length>0;async function P(){if(A){O(!0),C(null),E(!1);try{const q=Y=>{const H=parseInt(Y.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},B={},$=q(m);$!==void 0&&(B.maxConcurrency=$);const V=q(v);V!==void 0&&(B.maxRequestsPerMinute=V);const te=q(S);te!==void 0&&(B.maxRequestsPerDay=te),await o7(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(B).length>0?{quota:B}:{}}),o(""),d(""),p(""),y(""),w(""),j(""),E(!0),ht({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(q){C(q instanceof Error?q.message:"Failed to update provider")}finally{O(!1)}}}const I=n??"Use default model";return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),c.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:u,onChange:q=>d(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&c.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 ","↗"]})]}),c.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:q=>o(q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),c.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:I,value:f,onChange:q=>p(q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),c.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:m,onChange:q=>y(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:q=>w(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:q=>j(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&c.jsx("p",{className:"text-xs text-rose-400",children:_}),T&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),c.jsx(be,{type:"button",size:"sm",disabled:!A||N,onClick:P,children:N?"Saving...":"Save"})]})}function PNe({onSaved:e}){const[t,n]=b.useState(""),[r,i]=b.useState(""),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await l7({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),ht({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{o(!1)}}}return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),c.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 ","↗"]})]}),c.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:v=>n(v.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),c.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:r,onChange:v=>i(v.target.value)})]}),c.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",c.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&c.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),c.jsx(be,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function RNe(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[o,u]=b.useState("localhost"),[d,f]=b.useState("9222"),[p,m]=b.useState(!1);return b.useEffect(()=>{d2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),c.jsx("h2",{children:"ChatGPT (CDP)"})]}),c.jsx(vt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&c.jsxs("div",{children:[c.jsx("dt",{children:"Endpoint"}),c.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&c.jsxs("div",{children:[c.jsx("dt",{children:"Browser"}),c.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&c.jsxs("div",{children:[c.jsx("dt",{children:"Tabs"}),c.jsx("dd",{children:e.targets.map(y=>c.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),c.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"}),c.jsx("div",{className:"mt-2",children:c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&c.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await z7(o,parseInt(d,10)||9222);const v=await d2().catch(()=>null);v&&t(v),a(!1),ht({title:"CDP endpoint saved",detail:`${o}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:o,onChange:y=>u(y.target.value),"aria-label":"CDP host"}),c.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:d,onChange:y=>f(y.target.value),"aria-label":"CDP port"})]}),c.jsx("div",{children:c.jsx(be,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const DNe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function MNe(){const e=ch(),{dashboard:t}=Zl(),n=t?.settings??e?.dashboard?.settings,a=ev(!e,e?.health).data??e?.health??DNe,[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[y,v]=b.useState(""),[w,S]=b.useState(!1),[j,N]=b.useState(null),[O,_]=b.useState(!1);return n?c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Settings"}),c.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),c.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(C=>c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),c.jsx("h2",{children:C.displayName??C.name})]}),c.jsx(vt,{tone:C.state==="ready"?"positive":"caution",children:C.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Model"}),c.jsx("dd",{className:"font-mono text-xs",children:C.model})]}),C.quota&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Concurrency"}),c.jsx("dd",{children:C.quota.maxConcurrency})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Rate limit"}),c.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o===C.name?null:C.name),children:o===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===C.name&&c.jsx(TNe,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{u(null)}})]},C.name)),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),c.jsx("h2",{children:"Search Console OAuth"})]}),c.jsx(vt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Auth model"}),c.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Storage"}),c.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&c.jsx(PNe,{onSaved:()=>{f(!1)}})]}),c.jsxs(Be,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),c.jsx("h2",{children:"Webmaster Tools"})]}),c.jsx(vt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Auth model"}),c.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Storage"}),c.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),c.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"})]}),c.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:y,onChange:C=>v(C.target.value)})]}),c.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",c.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&c.jsx("p",{className:"text-xs text-rose-400",children:j}),O&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),c.jsx(be,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){S(!0),N(null),_(!1);try{await I7(y.trim()),v(""),_(!0),m(!1),ht({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){N(C instanceof Error?C.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),c.jsx(RNe,{}),c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),c.jsx("h2",{children:"API and worker"})]})}),c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"API"}),c.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),c.jsx(vt,{tone:Cg(a.apiStatus),title:vo(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"Worker"}),c.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),c.jsx(vt,{tone:Cg(a.workerStatus),title:vo(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),c.jsx("section",{className:"page-section",children:c.jsxs(Be,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),c.jsx("h2",{children:"Operational guidance"})]})}),c.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(C=>c.jsx("li",{children:C},C))}),c.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const INe=[{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 LNe({current:e,labels:t}){return c.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return c.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[c.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),c.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function $Ne(){const e=ch(),{dashboard:t,isLoading:n,refetch:r}=Zl(),i=t??e?.dashboard;if(!i||n)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-24"}),c.jsx("div",{className:"skeleton-text-sm w-80"})]}),c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-32"}),c.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ke=>c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-1 flex-1",children:[c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton-text-sm w-48"})]}),c.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ke))})]})]});const a=i.settings,d=ev(!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=QX(i.setup,d,a),p=So(),[m,y]=b.useState(0),[v,w]=b.useState(""),[S,j]=b.useState(""),[N,O]=b.useState(""),[_,C]=b.useState("US"),[T,E]=b.useState("en"),[A,P]=b.useState(!1),[I,q]=b.useState(null),[B,$]=b.useState(null),[V,te]=b.useState(null),[Y,H]=b.useState(!1),[J,pe]=b.useState(""),[Se,R]=b.useState(!1),[U,F]=b.useState(null),[D,Q]=b.useState(!1),se=a.providerStatuses.filter(ke=>ke.state==="ready"),[ae,he]=b.useState(se[0]?.name??""),[Ne,ne]=b.useState(5),[de,Ee]=b.useState(!1),[X,Fe]=b.useState(null),[De,et]=b.useState(""),[tt,Ut]=b.useState(!1),[Xt,on]=b.useState(null),[we,Ze]=b.useState(!1),[bt,Jt]=b.useState(!1),[lt,ct]=b.useState(!1),G=K8(),le=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),je=J.split(`
|
|
295
|
-
`).map(ke=>ke.trim()).filter(Boolean),Ae=De.split(`
|
|
296
|
-
`).map(ke=>ke.trim()).filter(Boolean),qe=f.healthChecks.some(ke=>ke.id==="api"&&ke.state==="ready"),en=async()=>{if(!(!le||!N)){H(!0),te(null);try{const ke=await Uy(le,{displayName:S||v,canonicalDomain:N,country:_,language:T,autoExtractBacklinks:A});q(le),$(ke.id),ht({title:"Project created",detail:`${ke.displayName||ke.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ke.name}`,dedupeMode:"drop"}),r(),y(2)}catch(ke){te(ke instanceof Error?ke.message:"Failed to create project")}finally{H(!1)}}},wt=async()=>{if(!I)return;const ke=je;if(ke.length!==0){Q(!0),F(null);try{await YK(I,ke),R(!0),r(),y(3)}catch(lr){F(lr instanceof Error?lr.message:"Failed to save key phrases")}finally{Q(!1)}}},Ge=async()=>{if(!(!I||!ae)){Ee(!0),Fe(null);try{const ke=await m7(I,ae,Ne);if(ke.keywords.length>0){const lr=J?J.trimEnd()+`
|
|
297
|
-
`+ke.keywords.join(`
|
|
298
|
-
`):ke.keywords.join(`
|
|
299
|
-
`);pe(lr)}}catch(ke){Fe(ke instanceof Error?ke.message:"Failed to generate key phrases")}finally{Ee(!1)}}},zt=async()=>{if(!I)return;const ke=Ae;if(ke.length!==0){Ze(!0),on(null);try{await HI(I,ke),Ut(!0),r(),y(4)}catch(lr){on(lr instanceof Error?lr.message:"Failed to save competitors")}finally{Ze(!1)}}},Tt=async()=>{if(I){ct(!0);try{await G.mutateAsync({projectName:I,projectLabel:S||v||I,sourceAction:"setup-launch"}),Jt(!0),r()}catch{}finally{ct(!1)}}},Te=()=>y(ke=>Math.max(0,ke-1)),Jr=(()=>{switch(m){case 0:return c.jsxs(Be,{className:"surface-card step-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),c.jsx("h2",{children:"System ready"})]})}),c.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),c.jsx("div",{className:"compact-stack",children:f.healthChecks.map(ke=>c.jsxs("div",{className:"health-check-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:ke.label}),c.jsx("p",{className:"supporting-copy",children:ke.detail}),ke.id==="provider"&&ke.state!=="ready"&&c.jsx(qt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),c.jsx(vt,{tone:ke.state==="ready"?"positive":"caution",title:ke.id==="api"?vo(d.apiStatus):ke.id==="worker"?vo(d.workerStatus):ke.detail,children:ke.state==="ready"?"Ready":"Attention"})]},ke.id))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(be,{type:"button",disabled:!qe,onClick:()=>y(1),children:"Continue"})]})]});case 1:return c.jsxs(Be,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),c.jsx("h2",{children:"Create project"})]}),I?c.jsx(vt,{tone:"positive",children:"Created"}):null]}),I?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-zinc-300",children:["Project ",c.jsx("span",{className:"text-zinc-100 font-medium",children:I})," created successfully."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),c.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:ke=>w(ke.target.value)}),le&&le!==v?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",le]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),c.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ke=>j(ke.target.value)})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),c.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:N,onChange:ke=>O(ke.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),c.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:ke=>C(ke.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),c.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:T,onChange:ke=>E(ke.target.value.toLowerCase())})]})]}),c.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[c.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:A,onChange:ke=>P(ke.target.checked)}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),c.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",c.jsx(qt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?c.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",disabled:!le||!N||Y,onClick:en,children:Y?"Creating...":"Create project"})]})]})]});case 2:return c.jsxs(Be,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),c.jsx("h2",{children:"Add key phrases"})]}),Se?c.jsxs(vt,{tone:"positive",children:[je.length," saved"]}):c.jsxs(vt,{tone:"neutral",children:[je.length," key phrase",je.length!==1?"s":""]})]}),c.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),Se?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:je.map(ke=>c.jsx("li",{children:ke},ke))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[se.length>0?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsxs("div",{className:"setup-field flex-1",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),c.jsx("select",{id:"gen-provider",className:"setup-input",value:ae,onChange:ke=>he(ke.target.value),children:se.map(ke=>c.jsxs("option",{value:ke.name,children:[ke.displayName??ke.name,ke.model?` (${ke.model})`:""]},ke.name))})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),c.jsx("select",{id:"gen-count",className:"setup-input",value:Ne,onChange:ke=>ne(Number(ke.target.value)),children:[3,5,10,15,20].map(ke=>c.jsx("option",{value:ke,children:ke},ke))})]}),c.jsx(be,{type:"button",variant:"outline",disabled:de||!ae,onClick:Ge,children:de?"Analyzing site...":"Generate"})]}),X?c.jsx("p",{className:"text-rose-400 text-sm",children:X}):null]}):null,c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),c.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
300
|
-
best invisalign downtown brooklyn
|
|
301
|
-
pediatric dentist brooklyn heights`,value:J,onChange:ke=>pe(ke.target.value)})]}),U?c.jsx("p",{className:"text-rose-400 text-sm",children:U}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",disabled:je.length===0||D,onClick:wt,children:D?"Saving...":`Save ${je.length} key phrase${je.length!==1?"s":""}`})]})]})]});case 3:return c.jsxs(Be,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),c.jsx("h2",{children:"Add competitors"})]}),tt?c.jsx(vt,{tone:"positive",children:"Saved"}):null]}),c.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),tt?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:Ae.map(ke=>c.jsx("li",{children:ke},ke))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),c.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
-
competitor2.com`,value:De,onChange:ke=>et(ke.target.value)})]}),Xt?c.jsx("p",{className:"text-rose-400 text-sm",children:Xt}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(be,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),c.jsx(be,{type:"button",disabled:Ae.length===0||we,onClick:zt,children:we?"Saving...":`Save ${Ae.length} competitor${Ae.length!==1?"s":""}`})]})]})]})]});case 4:return c.jsxs(Be,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),c.jsx("h2",{children:"Launch first run"})]}),bt?c.jsx(vt,{tone:"positive",children:"Queued"}):null]}),bt?c.jsxs("div",{className:"compact-stack",children:[c.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(be,{type:"button",onClick:()=>p({to:B?`/projects/${B}`:"/"}),children:"Open project"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",c.jsx("span",{className:"text-zinc-100 font-medium",children:I}),"."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(be,{type:"button",variant:"outline",onClick:Te,children:"Back"}),c.jsx(be,{type:"button",disabled:lt,onClick:Tt,children:lt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Setup"}),c.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),c.jsx(LNe,{current:m,labels:INe}),c.jsx("section",{className:"setup-wizard",children:Jr})]})}function Qc({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.useState(!1);return c.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[c.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:c.jsx(nL,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&c.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const BNe="https://commoncrawl.org/web-graphs";function RS(e){return e==null?"—":e>=1e12?`${(e/1e12).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function Gm(e){if(!e)return"—";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 DS(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function UNe(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState([]),[o,u]=b.useState([]),[d,f]=b.useState(null),[p,m]=b.useState(!0),[y,v]=b.useState(!1),[w,S]=b.useState(!1),[j,N]=b.useState(""),[O,_]=b.useState(!1),[C,T]=b.useState(null),[E,A]=b.useState(null),P=b.useCallback(async()=>{m(!0),T(null);try{const[V,te,Y,H,J]=await Promise.all([K7(),QI().catch(()=>null),V7().catch(()=>[]),Y7().catch(()=>[]),W7().catch(()=>null)]);t(V),r(te),a(Y),u(H),f(J)}catch(V){T(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);b.useEffect(()=>{P()},[P]);async function I(){v(!0),T(null),A(null);try{const V=await G7();A(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await P()}catch(V){T(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function q(){const V=j.trim()||void 0;S(!0),T(null),A(null);try{const te=await Z7(V);A(V?`Queued sync for ${te.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${te.release}. Download + query runs in the background.`),N(""),_(!1),await P()}catch(te){te instanceof Ni&&te.code==="MISSING_DEPENDENCY"?T("DuckDB is not installed. Install it first."):T(te instanceof Error?te.message:"Failed to trigger sync")}finally{S(!1)}}async function B(V){T(null),A(null);try{await Q7(V),A(`Pruned cached release ${V}.`),await P()}catch(te){T(te instanceof Error?te.message:"Failed to prune release")}}const $=n?.status==="ready"&&o.every(V=>V.release!==n.release);return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Backlinks"}),c.jsx("p",{className:"page-subtitle",children:"Find domains that link to your projects, computed from the open Common Crawl web graph. Runs entirely on your machine — nothing is sent to third parties."})]})}),c.jsx(Be,{className:"surface-card p-4 mb-6 border-amber-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(wg,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[c.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),c.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[c.jsxs("li",{children:[c.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),c.jsxs("li",{children:[c.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),c.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),c.jsx("h2",{children:"How it works"})]})}),c.jsxs(Be,{className:"surface-card p-5",children:[c.jsxs("p",{className:"text-sm text-zinc-400 leading-relaxed max-w-3xl mb-4",children:["Common Crawl publishes a quarterly snapshot of the public web’s hyperlink graph. Canonry downloads one"," ",c.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),c.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[c.jsxs("li",{className:"flex gap-3",children:[c.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"1"}),c.jsxs("span",{children:[c.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),c.jsxs("li",{className:"flex gap-3",children:[c.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"2"}),c.jsxs("span",{children:[c.jsx("span",{className:"text-zinc-200 font-medium",children:"Query (~5 min)"})," — one DuckDB pass scans the cached files and extracts referring domains for every project’s canonical domain. DuckDB is only used to ",c.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),c.jsxs("li",{className:"flex gap-3",children:[c.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"3"}),c.jsxs("span",{children:[c.jsx("span",{className:"text-zinc-200 font-medium",children:"Persist"})," — results land in the same SQLite database the rest of canonry uses. After the first sync, per-project reads (and re-run extracts against the cached release) are instant."]})]})]})]})]}),C&&c.jsx(Be,{className:"surface-card p-4 mb-4 border-rose-800/60",children:c.jsx("p",{className:"text-sm text-rose-300",children:C})}),E&&c.jsx(Be,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:c.jsx("p",{className:"text-sm text-emerald-300",children:E})}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",c.jsxs(Qc,{label:"Why DuckDB?",children:[c.jsx("span",{className:"block",children:"DuckDB is a query engine canonry uses to scan the ~16 GB Common Crawl dumps and pull out your referring domains."}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",c.jsx("span",{className:"text-zinc-200",children:"not"})," store any canonry data — your backlink results live in SQLite alongside the rest of your projects. DuckDB is purely a tool for processing the raw CSV files."]}),c.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/plugins/"})," so users who never run backlinks don’t pay the ~40 MB install cost."]})]})]})]}),e?.duckdbInstalled?c.jsx(vt,{tone:"positive",children:"Installed"}):c.jsx(vt,{tone:"caution",children:"Not installed"})]}),c.jsx(Be,{className:"surface-card p-5",children:p?c.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(tL,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",c.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(wG,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm text-zinc-200",children:"DuckDB is not installed. It’s the query engine canonry uses to scan Common Crawl dumps — required before you can run a release sync or per-project extract."}),c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Installing doesn’t touch your project data. DuckDB only reads the downloaded CSV files; backlink results are written to the same SQLite database canonry already uses."}),e&&c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",c.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),c.jsx("div",{className:"mt-3",children:c.jsxs(be,{type:"button",size:"sm",disabled:y,onClick:I,children:[c.jsx(Qj,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"Installing…":"Install DuckDB"]})})]})]})})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",c.jsx(Qc,{label:"What is a release sync?",children:"A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files."})]})]}),n&&c.jsx(vt,{tone:DS(n.status),children:n.status})]}),c.jsxs(Be,{className:"surface-card p-5",children:[c.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",c.jsx("code",{className:"text-zinc-400",children:"cc-main-2026-jan-feb-mar"}),"). Syncing it downloads the graph and populates backlinks for every project in this workspace."]}),n?c.jsxs("div",{className:"space-y-2 text-sm",children:[c.jsxs("p",{className:"text-zinc-200",children:["Release ",c.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&c.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),c.jsxs("div",{children:[c.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",c.jsx(Qc,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:Gm(n.downloadStartedAt??n.createdAt)})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:Gm(n.queryFinishedAt)})]})]}),n.error&&c.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):c.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),$&&c.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(wg,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[c.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),c.jsxs("p",{className:"mt-1 text-zinc-400",children:["The sync record in the database says this release finished successfully, but the ~16 GB dump at"," ",c.jsxs("code",{className:"text-zinc-300",children:["~/.canonry/cache/commoncrawl/",n?.release,"/"]})," isn’t on disk. Your backlink data is still intact (it lives in SQLite), but per-project re-run extracts will fail until you either re-sync this release or start a new one."]})]})]})}),c.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?c.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[c.jsx("code",{className:"text-zinc-100",children:d.release}),c.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",RS(d.vertexBytes),", edges ",RS(d.edgesBytes)]})]}):c.jsx("p",{className:"text-sm text-zinc-500 mt-0.5",children:p?"Probing Common Crawl…":"Could not auto-detect — pass an explicit release below."}),c.jsxs("a",{href:BNe,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",children:["Browse all Common Crawl web-graph releases",c.jsx(AG,{className:"h-3 w-3","aria-hidden":!0})]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs(be,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:q,children:[c.jsx(xg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),c.jsxs(Qc,{label:"What does Run sync do?",children:[c.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),", then runs a single DuckDB query that extracts referring domains for every project in this workspace."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",c.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",c.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),O?c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("input",{type:"text",className:"flex-1 min-w-[240px] rounded border border-zinc-700 bg-transparent px-2.5 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"cc-main-2026-jan-feb-mar",value:j,onChange:V=>N(V.target.value),disabled:w,autoFocus:!0}),c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>{N(""),_(!1)},disabled:w,children:"Cancel"})]}):c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>_(!0),disabled:w,children:"Use a different release →"})]}),!e?.duckdbInstalled&&c.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",c.jsxs(Qc,{label:"What is this?",children:[c.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["These files are needed to re-run per-project extracts against a release without re-downloading. Pruning here ",c.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),c.jsx("p",{className:"text-xs text-zinc-500 mb-3 max-w-3xl",children:"Each cached release is a ~16 GB pair of gzipped files. They’re needed to re-query the graph (e.g. for a newly-added project) without re-downloading. Safe to prune — backlink results persist in SQLite."}),c.jsx(Be,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),c.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),c.jsxs("tbody",{children:[o.map(V=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:c.jsx("code",{children:V.release})}),c.jsx("td",{className:"px-4 py-2",children:V.syncStatus?c.jsx(vt,{tone:DS(V.syncStatus),children:V.syncStatus}):c.jsx("span",{className:"text-zinc-600",children:"—"})}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:RS(V.bytes)}),c.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Gm(V.lastUsedAt)}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"inline-flex items-center gap-1",children:[c.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>B(V.release),children:[c.jsx(sL,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),c.jsx(Qc,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},V.release)),o.length===0&&c.jsx("tr",{children:c.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:5,children:"No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts."})})]})]})})]}),i.length>1&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),c.jsx("h2",{children:"Past release syncs"})]})}),c.jsx(Be,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),c.jsx("tbody",{children:i.map(V=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:c.jsx("code",{children:V.release})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx(vt,{tone:DS(V.status),children:V.status})}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),c.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Gm(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function FNe(){return c.jsx("div",{className:"page-container",children:c.jsx("section",{className:"page-section",children:c.jsxs(Be,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Route not found"}),c.jsx("p",{children:"The current path does not map to a dashboard view."}),c.jsx(be,{asChild:!0,children:c.jsx(qt,{to:"/",children:"Return to overview"})})]})})})}function qNe(){return c.jsx(Aoe,{children:c.jsx(_oe,{})})}const ki=_K()({component:qNe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),HNe=Rr({getParentRoute:()=>ki,path:"/",component:zoe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length===0)throw Mj({to:"/setup"})}}),KNe=Rr({getParentRoute:()=>ki,path:"/projects",component:qle}),Ju=Rr({getParentRoute:()=>ki,path:"/projects/$projectId",component:()=>c.jsx(Kj,{})}),GNe=Rr({getParentRoute:()=>Ju,path:"/",component:()=>c.jsx(Dh,{tab:"overview"})}),VNe=Rr({getParentRoute:()=>Ju,path:"/search-console",component:()=>c.jsx(Dh,{tab:"search-console"})}),ZNe=Rr({getParentRoute:()=>Ju,path:"/analytics",component:()=>c.jsx(Dh,{tab:"analytics"})}),YNe=Rr({getParentRoute:()=>Ju,path:"/traffic",component:()=>c.jsx(Dh,{tab:"traffic"})}),WNe=Rr({getParentRoute:()=>Ju,path:"/inbound",component:()=>c.jsx(Dh,{tab:"inbound"})}),QNe=Rr({getParentRoute:()=>ki,path:"/runs",component:zNe}),XNe=Rr({getParentRoute:()=>ki,path:"/settings",component:MNe,beforeLoad:({context:e})=>{}}),JNe=Rr({getParentRoute:()=>ki,path:"/setup",component:$Ne,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length>0)throw Mj({to:"/"})}}),eCe=Rr({getParentRoute:()=>ki,path:"/backlinks",component:UNe}),tCe=Rr({getParentRoute:()=>ki,path:"*",component:FNe}),nCe=ki.addChildren([HNe,KNe,Ju.addChildren([GNe,VNe,ZNe,YNe,WNe]),QNe,XNe,JNe,eCe,tCe]);function rCe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const tI=rCe(),iCe=tI==="/"?"":tI.replace(/\/$/,"");function aCe(e,t){return IK({routeTree:nCe,basepath:iCe||"/",context:{queryClient:e},...t?.initialEntries})}const G8=lG(),sCe=aCe(G8),V8=document.getElementById("root");if(!V8)throw new Error("Expected #root element for web app bootstrap.");function oCe(){const[e,t]=b.useState(l2()?"ready":"checking"),[n,r]=b.useState(""),[i,a]=b.useState(""),[o,u]=b.useState(null),[d,f]=b.useState(!1);b.useEffect(()=>{if(l2())return;let y=!1;return i7().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const p=async y=>{if(y.preventDefault(),!n.trim()||n.trim().length<8){u("Password must be at least 8 characters");return}if(n!==i){u("Passwords do not match");return}f(!0),u(null);try{if(!(await a7(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof Ni||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await s7(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof Ni||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?c.jsx(D9,{client:G8,children:c.jsx(BK,{router:sCe})}):c.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:c.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:c.jsx(Be,{className:"surface-card w-full",children:e==="checking"?c.jsx(eg,{className:"py-8",children:c.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?c.jsxs(c.Fragment,{children:[c.jsxs(w1,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),c.jsx(S1,{children:"Create a dashboard password"}),c.jsx(j1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),c.jsx(eg,{children:c.jsxs("form",{className:"space-y-4",onSubmit:p,children:[c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),c.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"At least 8 characters"})]}),c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),c.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:y=>a(y.target.value),placeholder:"Re-enter password"})]}),o?c.jsx("p",{className:"text-sm text-rose-400",children:o}):null,c.jsx(be,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):c.jsxs(c.Fragment,{children:[c.jsxs(w1,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx(S1,{children:"Sign in to Canonry"}),c.jsx(j1,{children:"Enter your dashboard password to continue."})]}),c.jsx(eg,{children:c.jsxs("form",{className:"space-y-4",onSubmit:m,children:[c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),c.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Dashboard password"})]}),o?c.jsx("p",{className:"text-sm text-rose-400",children:o}):null,c.jsx(be,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}u9.createRoot(V8).render(c.jsx(b.StrictMode,{children:c.jsx(oCe,{})}));
|