@ainyc/canonry 4.1.3 → 4.7.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/agent-workspace/skills/aero/references/reporting.md +2 -1
- package/assets/agent-workspace/skills/canonry-setup/references/canonry-cli.md +1 -1
- package/assets/assets/index-Ca3kZYGw.js +302 -0
- package/assets/assets/{index-D7T5wSBj.css → index-DAS6pOry.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-JV6X6AFT.js → chunk-DVTPGC6O.js} +1087 -348
- package/dist/{chunk-AXMSAMKN.js → chunk-OOADR2Q5.js} +764 -26
- package/dist/{chunk-KCETXLDF.js → chunk-VDEMEI64.js} +19 -7
- package/dist/{chunk-O5JZQUPX.js → chunk-XAW66QUX.js} +87 -2
- package/dist/cli.js +102 -23
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-WPY4PDBU.js → intelligence-service-ABHO5HHA.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +7 -7
- package/assets/assets/index-BbhhYPML.js +0 -302
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
function zH(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 ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pw={exports:{}},If={};var JP;function RH(){if(JP)return If;JP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return If.Fragment=t,If.jsx=n,If.jsxs=n,If}var e2;function DH(){return e2||(e2=1,pw.exports=RH()),pw.exports}var l=DH(),mw={exports:{}},nt={};var t2;function IH(){if(t2)return nt;t2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function N(M,F,D){this.props=M,this.context=F,this.refs=j,this.updater=D||w}N.prototype.isReactComponent={},N.prototype.setState=function(M,F){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,F,"setState")},N.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function O(){}O.prototype=N.prototype;function C(M,F,D){this.props=M,this.context=F,this.refs=j,this.updater=D||w}var A=C.prototype=new O;A.constructor=C,b(A,N.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function E(){}var _={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function I(M,F,D){var V=D.ref;return{$$typeof:e,type:M,key:F,ref:V!==void 0?V:null,props:D}}function q(M,F){return I(M.type,F,M.props)}function U(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function B(M){var F={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(D){return F[D]})}var H=/\/+/g;function W(M,F){return typeof M=="object"&&M!==null&&M.key!=null?B(""+M.key):F.toString(36)}function Y(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(E,E):(M.status="pending",M.then(function(F){M.status==="pending"&&(M.status="fulfilled",M.value=F)},function(F){M.status==="pending"&&(M.status="rejected",M.reason=F)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function K(M,F,D,V,oe){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var Ce=!1;if(M===null)Ce=!0;else switch(re){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(M.$$typeof){case e:case t:Ce=!0;break;case p:return Ce=M._init,K(Ce(M._payload),F,D,V,oe)}}if(Ce)return oe=oe(M),Ce=V===""?"."+W(M,0):V,P(oe)?(D="",Ce!=null&&(D=Ce.replace(H,"$&/")+"/"),K(oe,F,D,"",function(pe){return pe})):oe!=null&&(U(oe)&&(oe=q(oe,D+(oe.key==null||M&&M.key===oe.key?"":(""+oe.key).replace(H,"$&/")+"/")+Ce)),F.push(oe)),1;Ce=0;var je=V===""?".":V+":";if(P(M))for(var ee=0;ee<M.length;ee++)V=M[ee],re=je+W(V,ee),Ce+=K(V,F,D,re,oe);else if(ee=v(M),typeof ee=="function")for(M=ee.call(M),ee=0;!(V=M.next()).done;)V=V.value,re=je+W(V,ee++),Ce+=K(V,F,D,re,oe);else if(re==="object"){if(typeof M.then=="function")return K(Y(M),F,D,V,oe);throw F=String(M),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(M,F,D){if(M==null)return M;var V=[],oe=0;return K(M,V,"","",function(re){return F.call(D,re,oe++)}),V}function se(M){if(M._status===-1){var F=M._result;F=F(),F.then(function(D){(M._status===0||M._status===-1)&&(M._status=1,M._result=D)},function(D){(M._status===0||M._status===-1)&&(M._status=2,M._result=D)}),M._status===-1&&(M._status=0,M._result=F)}if(M._status===1)return M._result.default;throw M._result}var me=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},L={map:J,forEach:function(M,F,D){J(M,function(){F.apply(this,arguments)},D)},count:function(M){var F=0;return J(M,function(){F++}),F},toArray:function(M){return J(M,function(F){return F})||[]},only:function(M){if(!U(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return nt.Activity=m,nt.Children=L,nt.Component=N,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=C,nt.StrictMode=r,nt.Suspense=d,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,nt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return _.H.useMemoCache(M)}},nt.cache=function(M){return function(){return M.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(M,F,D){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var V=b({},M.props),oe=M.key;if(F!=null)for(re in F.key!==void 0&&(oe=""+F.key),F)!z.call(F,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&F.ref===void 0||(V[re]=F[re]);var re=arguments.length-2;if(re===1)V.children=D;else if(1<re){for(var Ce=Array(re),je=0;je<re;je++)Ce[je]=arguments[je+2];V.children=Ce}return I(M.type,oe,V)},nt.createContext=function(M){return M={$$typeof:o,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:a,_context:M},M},nt.createElement=function(M,F,D){var V,oe={},re=null;if(F!=null)for(V in F.key!==void 0&&(re=""+F.key),F)z.call(F,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(oe[V]=F[V]);var Ce=arguments.length-2;if(Ce===1)oe.children=D;else if(1<Ce){for(var je=Array(Ce),ee=0;ee<Ce;ee++)je[ee]=arguments[ee+2];oe.children=je}if(M&&M.defaultProps)for(V in Ce=M.defaultProps,Ce)oe[V]===void 0&&(oe[V]=Ce[V]);return I(M,re,oe)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(M){return{$$typeof:c,render:M}},nt.isValidElement=U,nt.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:se}},nt.memo=function(M,F){return{$$typeof:f,type:M,compare:F===void 0?null:F}},nt.startTransition=function(M){var F=_.T,D={};_.T=D;try{var V=M(),oe=_.S;oe!==null&&oe(D,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(E,me)}catch(re){me(re)}finally{F!==null&&D.types!==null&&(F.types=D.types),_.T=F}},nt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},nt.use=function(M){return _.H.use(M)},nt.useActionState=function(M,F,D){return _.H.useActionState(M,F,D)},nt.useCallback=function(M,F){return _.H.useCallback(M,F)},nt.useContext=function(M){return _.H.useContext(M)},nt.useDebugValue=function(){},nt.useDeferredValue=function(M,F){return _.H.useDeferredValue(M,F)},nt.useEffect=function(M,F){return _.H.useEffect(M,F)},nt.useEffectEvent=function(M){return _.H.useEffectEvent(M)},nt.useId=function(){return _.H.useId()},nt.useImperativeHandle=function(M,F,D){return _.H.useImperativeHandle(M,F,D)},nt.useInsertionEffect=function(M,F){return _.H.useInsertionEffect(M,F)},nt.useLayoutEffect=function(M,F){return _.H.useLayoutEffect(M,F)},nt.useMemo=function(M,F){return _.H.useMemo(M,F)},nt.useOptimistic=function(M,F){return _.H.useOptimistic(M,F)},nt.useReducer=function(M,F,D){return _.H.useReducer(M,F,D)},nt.useRef=function(M){return _.H.useRef(M)},nt.useState=function(M){return _.H.useState(M)},nt.useSyncExternalStore=function(M,F,D){return _.H.useSyncExternalStore(M,F,D)},nt.useTransition=function(){return _.H.useTransition()},nt.version="19.2.4",nt}var n2;function Sd(){return n2||(n2=1,mw.exports=IH()),mw.exports}var x=Sd();const Ui=ga(x),kv=zH({__proto__:null,default:Ui},[x]);var gw={exports:{}},Mf={},yw={exports:{}},vw={};var r2;function MH(){return r2||(r2=1,(function(e){function t(K,J){var se=K.length;K.push(J);e:for(;0<se;){var me=se-1>>>1,L=K[me];if(0<i(L,J))K[me]=J,K[se]=L,se=me;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var J=K[0],se=K.pop();if(se!==J){K[0]=se;e:for(var me=0,L=K.length,M=L>>>1;me<M;){var F=2*(me+1)-1,D=K[F],V=F+1,oe=K[V];if(0>i(D,se))V<L&&0>i(oe,D)?(K[me]=oe,K[V]=se,me=V):(K[me]=D,K[F]=se,me=F);else if(V<L&&0>i(oe,se))K[me]=oe,K[V]=se,me=V;else break e}}return J}function i(K,J){var se=K.sortIndex-J.sortIndex;return se!==0?se:K.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,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],p=1,m=null,g=3,v=!1,w=!1,b=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(K){for(var J=n(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=K)r(f),J.sortIndex=J.expirationTime,t(d,J);else break;J=n(f)}}function P(K){if(b=!1,A(K),!w)if(n(d)!==null)w=!0,E||(E=!0,B());else{var J=n(f);J!==null&&Y(P,J.startTime-K)}}var E=!1,_=-1,z=5,I=-1;function q(){return j?!0:!(e.unstable_now()-I<z)}function U(){if(j=!1,E){var K=e.unstable_now();I=K;var J=!0;try{e:{w=!1,b&&(b=!1,O(_),_=-1),v=!0;var se=g;try{t:{for(A(K),m=n(d);m!==null&&!(m.expirationTime>K&&q());){var me=m.callback;if(typeof me=="function"){m.callback=null,g=m.priorityLevel;var L=me(m.expirationTime<=K);if(K=e.unstable_now(),typeof L=="function"){m.callback=L,A(K),J=!0;break t}m===n(d)&&r(d),A(K)}else r(d);m=n(d)}if(m!==null)J=!0;else{var M=n(f);M!==null&&Y(P,M.startTime-K),J=!1}}break e}finally{m=null,g=se,v=!1}J=void 0}}finally{J?B():E=!1}}}var B;if(typeof C=="function")B=function(){C(U)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,W=H.port2;H.port1.onmessage=U,B=function(){W.postMessage(null)}}else B=function(){N(U,0)};function Y(K,J){_=N(function(){K(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(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(K){switch(g){case 1:case 2:case 3:var J=3;break;default:J=g}var se=g;g=J;try{return K()}finally{g=se}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(K,J){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var se=g;g=K;try{return J()}finally{g=se}},e.unstable_scheduleCallback=function(K,J,se){var me=e.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?me+se:me):se=me,K){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=se+L,K={id:p++,callback:J,priorityLevel:K,startTime:se,expirationTime:L,sortIndex:-1},se>me?(K.sortIndex=se,t(f,K),n(d)===null&&K===n(f)&&(b?(O(_),_=-1):b=!0,Y(P,se-me))):(K.sortIndex=L,t(d,K),w||v||(w=!0,E||(E=!0,B()))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var J=g;return function(){var se=g;g=J;try{return K.apply(this,arguments)}finally{g=se}}}})(vw)),vw}var i2;function LH(){return i2||(i2=1,yw.exports=MH()),yw.exports}var xw={exports:{}},xr={};var a2;function $H(){if(a2)return xr;a2=1;var e=Sd();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return xr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xr.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)},xr.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()}},xr.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))},xr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},xr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),g=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:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},xr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},xr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},xr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},xr.requestFormReset=function(d){r.d.r(d)},xr.unstable_batchedUpdates=function(d,f){return d(f)},xr.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},xr.useFormStatus=function(){return o.H.useHostTransitionStatus()},xr.version="19.2.4",xr}var s2;function h$(){if(s2)return xw.exports;s2=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(),xw.exports=$H(),xw.exports}var o2;function BH(){if(o2)return Mf;o2=1;var e=LH(),t=Sd(),n=h$();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+u+" 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 u=s,h=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(h=u.return),s=u.return;while(s)}return u.tag===3?h:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var h=s,y=u;;){var S=h.return;if(S===null)break;var k=S.alternate;if(k===null){if(y=S.return,y!==null){h=y;continue}break}if(S.child===k.child){for(k=S.child;k;){if(k===h)return d(S),s;if(k===y)return d(S),u;k=k.sibling}throw Error(r(188))}if(h.return!==y.return)h=S,y=k;else{for(var T=!1,$=S.child;$;){if($===h){T=!0,h=S,y=k;break}if($===y){T=!0,y=S,h=k;break}$=$.sibling}if(!T){for($=k.child;$;){if($===h){T=!0,h=k,y=S;break}if($===y){T=!0,y=k,h=S;break}$=$.sibling}if(!T)throw Error(r(189))}}if(h.alternate!==y)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:u}function p(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=p(s),u!==null)return u;s=s.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=U&&s[U]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function W(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case N:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case E:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case C:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case A:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case _:return u=s.displayName||null,u!==null?u:W(s.type)||"Memo";case z:u=s._payload,s=s._init;try{return W(s(u))}catch{}}return null}var Y=Array.isArray,K=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,se={pending:!1,data:null,method:null,action:null},me=[],L=-1;function M(s){return{current:s}}function F(s){0>L||(s.current=me[L],me[L]=null,L--)}function D(s,u){L++,me[L]=s.current,s.current=u}var V=M(null),oe=M(null),re=M(null),Ce=M(null);function je(s,u){switch(D(re,u),D(oe,s),D(V,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?SP(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=SP(u),s=jP(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(V),D(V,s)}function ee(){F(V),F(oe),F(re)}function pe(s){s.memoizedState!==null&&D(Ce,s);var u=V.current,h=jP(u,s.type);u!==h&&(D(oe,s),D(V,h))}function Ee(s){oe.current===s&&(F(V),F(oe)),Ce.current===s&&(F(Ce),Tf._currentValue=se)}var X,Ke;function ze(s){if(X===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);X=u&&u[1]||"",Ke=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+X+s+Ke}var at=!1;function Ve(s,u){if(!s||at)return"";at=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(u){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ue){var le=ue}Reflect.construct(s,[],we)}else{try{we.call()}catch(ue){le=ue}s.call(we.prototype)}}else{try{throw Error()}catch(ue){le=ue}(we=s())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ue){if(ue&&le&&typeof ue.stack=="string")return[ue.stack,le.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=y.DetermineComponentFrameRoot(),T=k[0],$=k[1];if(T&&$){var G=T.split(`
|
|
4
|
-
`),ae=$.split(`
|
|
5
|
-
`);for(S=y=0;y<G.length&&!G[y].includes("DetermineComponentFrameRoot");)y++;for(;S<ae.length&&!ae[S].includes("DetermineComponentFrameRoot");)S++;if(y===G.length||S===ae.length)for(y=G.length-1,S=ae.length-1;1<=y&&0<=S&&G[y]!==ae[S];)S--;for(;1<=y&&0<=S;y--,S--)if(G[y]!==ae[S]){if(y!==1||S!==1)do if(y--,S--,0>S||G[y]!==ae[S]){var ge=`
|
|
6
|
-
`+G[y].replace(" at new "," at ");return s.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",s.displayName)),ge}while(1<=y&&0<=S);break}}}finally{at=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?ze(h):""}function Gt(s,u){switch(s.tag){case 26:case 27:case 5:return ze(s.type);case 16:return ze("Lazy");case 13:return s.child!==u&&u!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Ve(s.type,!1);case 11:return Ve(s.type.render,!1);case 1:return Ve(s.type,!0);case 31:return ze("Activity");default:return""}}function $t(s){try{var u="",h=null;do u+=Gt(s,h),h=s,s=s.return;while(s);return u}catch(y){return`
|
|
7
|
-
Error generating stack: `+y.message+`
|
|
8
|
-
`+y.stack}}var dn=Object.prototype.hasOwnProperty,nn=e.unstable_scheduleCallback,Se=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,Rt=e.unstable_requestPaint,pt=e.unstable_now,Xe=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,ht=e.unstable_IdlePriority,yn=e.log,Tn=e.unstable_setDisableYieldValue,vn=null,We=null;function Vt(s){if(typeof yn=="function"&&Tn(s),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(vn,s)}catch{}}var de=Math.clz32?Math.clz32:Qe,Pe=Math.log,fe=Math.LN2;function Qe(s){return s>>>=0,s===0?32:31-(Pe(s)/fe|0)|0}var Yn=256,Ni=262144,rn=4194304;function zn(s){var u=s&42;if(u!==0)return u;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 Kr(s,u,h){var y=s.pendingLanes;if(y===0)return 0;var S=0,k=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var $=y&134217727;return $!==0?(y=$&~k,y!==0?S=zn(y):(T&=$,T!==0?S=zn(T):h||(h=$&~s,h!==0&&(S=zn(h))))):($=y&~k,$!==0?S=zn($):T!==0?S=zn(T):h||(h=y&~s,h!==0&&(S=zn(h)))),S===0?0:u!==0&&u!==S&&(u&k)===0&&(k=S&-S,h=u&-u,k>=h||k===32&&(h&4194048)!==0)?u:S}function ta(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function Sa(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 _p(){var s=rn;return rn<<=1,(rn&62914560)===0&&(rn=4194304),s}function Gs(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function Vs(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function sx(s,u,h,y,S,k){var T=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 $=s.entanglements,G=s.expirationTimes,ae=s.hiddenUpdates;for(h=T&~h;0<h;){var ge=31-de(h),we=1<<ge;$[ge]=0,G[ge]=-1;var le=ae[ge];if(le!==null)for(ae[ge]=null,ge=0;ge<le.length;ge++){var ue=le[ge];ue!==null&&(ue.lane&=-536870913)}h&=~we}y!==0&&Kd(s,y,0),k!==0&&S===0&&s.tag!==0&&(s.suspendedLanes|=k&~(T&~u))}function Kd(s,u,h){s.pendingLanes|=u,s.suspendedLanes&=~u;var y=31-de(u);s.entangledLanes|=u,s.entanglements[y]=s.entanglements[y]|1073741824|h&261930}function Pp(s,u){var h=s.entangledLanes|=u;for(s=s.entanglements;h;){var y=31-de(h),S=1<<y;S&u|s[y]&u&&(s[y]|=u),h&=~S}}function Tp(s,u){var h=u&-u;return h=(h&42)!==0?1:Hd(h),(h&(s.suspendedLanes|u))!==0?0:h}function Hd(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 Gd(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Vd(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:GP(s.type))}function Q(s,u){var h=J.p;try{return J.p=s,u()}finally{J.p=h}}var ke=Math.random().toString(36).slice(2),et="__reactFiber$"+ke,kt="__reactProps$"+ke,Rn="__reactContainer$"+ke,ja="__reactEvents$"+ke,rs="__reactListeners$"+ke,Qs="__reactHandles$"+ke,Pr="__reactResources$"+ke,ll="__reactMarker$"+ke;function Na(s){delete s[et],delete s[kt],delete s[ja],delete s[rs],delete s[Qs]}function ki(s){var u=s[et];if(u)return u;for(var h=s.parentNode;h;){if(u=h[Rn]||h[et]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(s=_P(s);s!==null;){if(h=s[et])return h;s=_P(s)}return u}s=h,h=s.parentNode}return null}function na(s){if(s=s[et]||s[Rn]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Ws(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Ys(s){var u=s[Pr];return u||(u=s[Pr]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function xn(s){s[ll]=!0}var cl=new Set,zp={};function is(s,u){ut(s,u),ut(s+"Capture",u)}function ut(s,u){for(zp[s]=u,s=0;s<u.length;s++)cl.add(u[s])}var Qt=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]*$"),Hr={},ra={};function Dc(s){return dn.call(ra,s)?!0:dn.call(Hr,s)?!1:Qt.test(s)?ra[s]=!0:(Hr[s]=!0,!1)}function ul(s,u,h){if(Dc(u))if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var y=u.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+h)}}function Rp(s,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+h)}}function as(s,u,h,y){if(y===null)s.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(u,h,""+y)}}function Ci(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function pO(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function C9(s,u,h){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var S=y.get,k=y.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return S.call(this)},set:function(T){h=""+T,k.call(this,T)}}),Object.defineProperty(s,u,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function ox(s){if(!s._valueTracker){var u=pO(s)?"checked":"value";s._valueTracker=C9(s,u,""+s[u])}}function mO(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var h=u.getValue(),y="";return s&&(y=pO(s)?s.checked?"true":"false":s.value),s=y,s!==h?(u.setValue(s),!0):!1}function Dp(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 A9=/[\n"\\]/g;function Ai(s){return s.replace(A9,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function lx(s,u,h,y,S,k,T,$){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),u!=null?T==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Ci(u)):s.value!==""+Ci(u)&&(s.value=""+Ci(u)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),u!=null?cx(s,T,Ci(u)):h!=null?cx(s,T,Ci(h)):y!=null&&s.removeAttribute("value"),S==null&&k!=null&&(s.defaultChecked=!!k),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?s.name=""+Ci($):s.removeAttribute("name")}function gO(s,u,h,y,S,k,T,$){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||h!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){ox(s);return}h=h!=null?""+Ci(h):"",u=u!=null?""+Ci(u):h,$||u===s.value||(s.value=u),s.defaultValue=u}y=y??S,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=$?s.checked:!!y,s.defaultChecked=!!y,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),ox(s)}function cx(s,u,h){u==="number"&&Dp(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Ic(s,u,h,y){if(s=s.options,u){u={};for(var S=0;S<h.length;S++)u["$"+h[S]]=!0;for(h=0;h<s.length;h++)S=u.hasOwnProperty("$"+s[h].value),s[h].selected!==S&&(s[h].selected=S),S&&y&&(s[h].defaultSelected=!0)}else{for(h=""+Ci(h),u=null,S=0;S<s.length;S++){if(s[S].value===h){s[S].selected=!0,y&&(s[S].defaultSelected=!0);return}u!==null||s[S].disabled||(u=s[S])}u!==null&&(u.selected=!0)}}function yO(s,u,h){if(u!=null&&(u=""+Ci(u),u!==s.value&&(s.value=u),h==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=h!=null?""+Ci(h):""}function vO(s,u,h,y){if(u==null){if(y!=null){if(h!=null)throw Error(r(92));if(Y(y)){if(1<y.length)throw Error(r(93));y=y[0]}h=y}h==null&&(h=""),u=h}h=Ci(u),s.defaultValue=h,y=s.textContent,y===h&&y!==""&&y!==null&&(s.value=y),ox(s)}function Mc(s,u){if(u){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=u;return}}s.textContent=u}var O9=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 xO(s,u,h){var y=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":y?s.setProperty(u,h):typeof h!="number"||h===0||O9.has(u)?u==="float"?s.cssFloat=h:s[u]=(""+h).trim():s[u]=h+"px"}function bO(s,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||u!=null&&u.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var S in u)y=u[S],u.hasOwnProperty(S)&&h[S]!==y&&xO(s,S,y)}else for(var k in u)u.hasOwnProperty(k)&&xO(s,k,u[k])}function ux(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 E9=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"]]),_9=/^[\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 Ip(s){return _9.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ss(){}var dx=null;function fx(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Lc=null,$c=null;function wO(s){var u=na(s);if(u&&(s=u.stateNode)){var h=s[kt]||null;e:switch(s=u.stateNode,u.type){case"input":if(lx(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ai(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var y=h[u];if(y!==s&&y.form===s.form){var S=y[kt]||null;if(!S)throw Error(r(90));lx(y,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(u=0;u<h.length;u++)y=h[u],y.form===s.form&&mO(y)}break e;case"textarea":yO(s,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Ic(s,!!h.multiple,u,!1)}}}var hx=!1;function SO(s,u,h){if(hx)return s(u,h);hx=!0;try{var y=s(u);return y}finally{if(hx=!1,(Lc!==null||$c!==null)&&(jm(),Lc&&(u=Lc,s=$c,$c=Lc=null,wO(u),s)))for(u=0;u<s.length;u++)wO(s[u])}}function Qd(s,u){var h=s.stateNode;if(h===null)return null;var y=h[kt]||null;if(y===null)return null;h=y[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),px=!1;if(os)try{var Wd={};Object.defineProperty(Wd,"passive",{get:function(){px=!0}}),window.addEventListener("test",Wd,Wd),window.removeEventListener("test",Wd,Wd)}catch{px=!1}var Zs=null,mx=null,Mp=null;function jO(){if(Mp)return Mp;var s,u=mx,h=u.length,y,S="value"in Zs?Zs.value:Zs.textContent,k=S.length;for(s=0;s<h&&u[s]===S[s];s++);var T=h-s;for(y=1;y<=T&&u[h-y]===S[k-y];y++);return Mp=S.slice(s,1<y?1-y:void 0)}function Lp(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function $p(){return!0}function NO(){return!1}function Gr(s){function u(h,y,S,k,T){this._reactName=h,this._targetInst=S,this.type=y,this.nativeEvent=k,this.target=T,this.currentTarget=null;for(var $ in s)s.hasOwnProperty($)&&(h=s[$],this[$]=h?h(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?$p:NO,this.isPropagationStopped=NO,this}return m(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=$p)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=$p)},persist:function(){},isPersistent:$p}),u}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bp=Gr(dl),Yd=m({},dl,{view:0,detail:0}),P9=Gr(Yd),gx,yx,Zd,Up=m({},Yd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xx,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!==Zd&&(Zd&&s.type==="mousemove"?(gx=s.screenX-Zd.screenX,yx=s.screenY-Zd.screenY):yx=gx=0,Zd=s),gx)},movementY:function(s){return"movementY"in s?s.movementY:yx}}),kO=Gr(Up),T9=m({},Up,{dataTransfer:0}),z9=Gr(T9),R9=m({},Yd,{relatedTarget:0}),vx=Gr(R9),D9=m({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),I9=Gr(D9),M9=m({},dl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),L9=Gr(M9),$9=m({},dl,{data:0}),CO=Gr($9),B9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U9={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"},q9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F9(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=q9[s])?!!u[s]:!1}function xx(){return F9}var K9=m({},Yd,{key:function(s){if(s.key){var u=B9[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Lp(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?U9[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xx,charCode:function(s){return s.type==="keypress"?Lp(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Lp(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),H9=Gr(K9),G9=m({},Up,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),AO=Gr(G9),V9=m({},Yd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xx}),Q9=Gr(V9),W9=m({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y9=Gr(W9),Z9=m({},Up,{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}),X9=Gr(Z9),J9=m({},dl,{newState:0,oldState:0}),eK=Gr(J9),tK=[9,13,27,32],bx=os&&"CompositionEvent"in window,Xd=null;os&&"documentMode"in document&&(Xd=document.documentMode);var nK=os&&"TextEvent"in window&&!Xd,OO=os&&(!bx||Xd&&8<Xd&&11>=Xd),EO=" ",_O=!1;function PO(s,u){switch(s){case"keyup":return tK.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TO(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bc=!1;function rK(s,u){switch(s){case"compositionend":return TO(u);case"keypress":return u.which!==32?null:(_O=!0,EO);case"textInput":return s=u.data,s===EO&&_O?null:s;default:return null}}function iK(s,u){if(Bc)return s==="compositionend"||!bx&&PO(s,u)?(s=jO(),Mp=mx=Zs=null,Bc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return OO&&u.locale!=="ko"?null:u.data;default:return null}}var aK={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 zO(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!aK[s.type]:u==="textarea"}function RO(s,u,h,y){Lc?$c?$c.push(y):$c=[y]:Lc=y,u=_m(u,"onChange"),0<u.length&&(h=new Bp("onChange","change",null,h,y),s.push({event:h,listeners:u}))}var Jd=null,ef=null;function sK(s){gP(s,0)}function qp(s){var u=Ws(s);if(mO(u))return s}function DO(s,u){if(s==="change")return u}var IO=!1;if(os){var wx;if(os){var Sx="oninput"in document;if(!Sx){var MO=document.createElement("div");MO.setAttribute("oninput","return;"),Sx=typeof MO.oninput=="function"}wx=Sx}else wx=!1;IO=wx&&(!document.documentMode||9<document.documentMode)}function LO(){Jd&&(Jd.detachEvent("onpropertychange",$O),ef=Jd=null)}function $O(s){if(s.propertyName==="value"&&qp(ef)){var u=[];RO(u,ef,s,fx(s)),SO(sK,u)}}function oK(s,u,h){s==="focusin"?(LO(),Jd=u,ef=h,Jd.attachEvent("onpropertychange",$O)):s==="focusout"&&LO()}function lK(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return qp(ef)}function cK(s,u){if(s==="click")return qp(u)}function uK(s,u){if(s==="input"||s==="change")return qp(u)}function dK(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var ci=typeof Object.is=="function"?Object.is:dK;function tf(s,u){if(ci(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var h=Object.keys(s),y=Object.keys(u);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var S=h[y];if(!dn.call(u,S)||!ci(s[S],u[S]))return!1}return!0}function BO(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function UO(s,u){var h=BO(s);s=0;for(var y;h;){if(h.nodeType===3){if(y=s+h.textContent.length,s<=u&&y>=u)return{node:h,offset:u-s};s=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=BO(h)}}function qO(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?qO(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function FO(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=Dp(s.document);u instanceof s.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)s=u.contentWindow;else break;u=Dp(s.document)}return u}function jx(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var fK=os&&"documentMode"in document&&11>=document.documentMode,Uc=null,Nx=null,nf=null,kx=!1;function KO(s,u,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;kx||Uc==null||Uc!==Dp(y)||(y=Uc,"selectionStart"in y&&jx(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),nf&&tf(nf,y)||(nf=y,y=_m(Nx,"onSelect"),0<y.length&&(u=new Bp("onSelect","select",null,u,h),s.push({event:u,listeners:y}),u.target=Uc)))}function fl(s,u){var h={};return h[s.toLowerCase()]=u.toLowerCase(),h["Webkit"+s]="webkit"+u,h["Moz"+s]="moz"+u,h}var qc={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},Cx={},HO={};os&&(HO=document.createElement("div").style,"AnimationEvent"in window||(delete qc.animationend.animation,delete qc.animationiteration.animation,delete qc.animationstart.animation),"TransitionEvent"in window||delete qc.transitionend.transition);function hl(s){if(Cx[s])return Cx[s];if(!qc[s])return s;var u=qc[s],h;for(h in u)if(u.hasOwnProperty(h)&&h in HO)return Cx[s]=u[h];return s}var GO=hl("animationend"),VO=hl("animationiteration"),QO=hl("animationstart"),hK=hl("transitionrun"),pK=hl("transitionstart"),mK=hl("transitioncancel"),WO=hl("transitionend"),YO=new Map,Ax="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(" ");Ax.push("scrollEnd");function ia(s,u){YO.set(s,u),is(u,[s])}var Fp=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=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(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Oi=[],Fc=0,Ox=0;function Kp(){for(var s=Fc,u=Ox=Fc=0;u<s;){var h=Oi[u];Oi[u++]=null;var y=Oi[u];Oi[u++]=null;var S=Oi[u];Oi[u++]=null;var k=Oi[u];if(Oi[u++]=null,y!==null&&S!==null){var T=y.pending;T===null?S.next=S:(S.next=T.next,T.next=S),y.pending=S}k!==0&&ZO(h,S,k)}}function Hp(s,u,h,y){Oi[Fc++]=s,Oi[Fc++]=u,Oi[Fc++]=h,Oi[Fc++]=y,Ox|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function Ex(s,u,h,y){return Hp(s,u,h,y),Gp(s)}function pl(s,u){return Hp(s,null,null,u),Gp(s)}function ZO(s,u,h){s.lanes|=h;var y=s.alternate;y!==null&&(y.lanes|=h);for(var S=!1,k=s.return;k!==null;)k.childLanes|=h,y=k.alternate,y!==null&&(y.childLanes|=h),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(S=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,S&&u!==null&&(S=31-de(h),s=k.hiddenUpdates,y=s[S],y===null?s[S]=[u]:y.push(u),u.lane=h|536870912),k):null}function Gp(s){if(50<kf)throw kf=0,Lb=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Kc={};function gK(s,u,h,y){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=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(s,u,h,y){return new gK(s,u,h,y)}function _x(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ls(s,u){var h=s.alternate;return h===null?(h=ui(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,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,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function XO(s,u){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=u,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,u=h.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function Vp(s,u,h,y,S,k){var T=0;if(y=s,typeof s=="function")_x(s)&&(T=1);else if(typeof s=="string")T=wH(s,h,V.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=ui(31,h,u,S),s.elementType=I,s.lanes=k,s;case b:return ml(h.children,S,k,u);case j:T=8,S|=24;break;case N:return s=ui(12,h,u,S|2),s.elementType=N,s.lanes=k,s;case P:return s=ui(13,h,u,S),s.elementType=P,s.lanes=k,s;case E:return s=ui(19,h,u,S),s.elementType=E,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:T=10;break e;case O:T=9;break e;case A:T=11;break e;case _:T=14;break e;case z:T=16,y=null;break e}T=29,h=Error(r(130,s===null?"null":typeof s,"")),y=null}return u=ui(T,h,u,S),u.elementType=s,u.type=y,u.lanes=k,u}function ml(s,u,h,y){return s=ui(7,s,y,u),s.lanes=h,s}function Px(s,u,h){return s=ui(6,s,null,u),s.lanes=h,s}function JO(s){var u=ui(18,null,null,0);return u.stateNode=s,u}function Tx(s,u,h){return u=ui(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var eE=new WeakMap;function Ei(s,u){if(typeof s=="object"&&s!==null){var h=eE.get(s);return h!==void 0?h:(u={value:s,source:u,stack:$t(u)},eE.set(s,u),u)}return{value:s,source:u,stack:$t(u)}}var Hc=[],Gc=0,Qp=null,rf=0,_i=[],Pi=0,Xs=null,ka=1,Ca="";function cs(s,u){Hc[Gc++]=rf,Hc[Gc++]=Qp,Qp=s,rf=u}function tE(s,u,h){_i[Pi++]=ka,_i[Pi++]=Ca,_i[Pi++]=Xs,Xs=s;var y=ka;s=Ca;var S=32-de(y)-1;y&=~(1<<S),h+=1;var k=32-de(u)+S;if(30<k){var T=S-S%5;k=(y&(1<<T)-1).toString(32),y>>=T,S-=T,ka=1<<32-de(u)+S|h<<S|y,Ca=k+s}else ka=1<<k|h<<S|y,Ca=s}function zx(s){s.return!==null&&(cs(s,1),tE(s,1,0))}function Rx(s){for(;s===Qp;)Qp=Hc[--Gc],Hc[Gc]=null,rf=Hc[--Gc],Hc[Gc]=null;for(;s===Xs;)Xs=_i[--Pi],_i[Pi]=null,Ca=_i[--Pi],_i[Pi]=null,ka=_i[--Pi],_i[Pi]=null}function nE(s,u){_i[Pi++]=ka,_i[Pi++]=Ca,_i[Pi++]=Xs,ka=u.id,Ca=u.overflow,Xs=s}var fr=null,an=null,wt=!1,Js=null,Ti=!1,Dx=Error(r(519));function eo(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw af(Ei(u,s)),Dx}function rE(s){var u=s.stateNode,h=s.type,y=s.memoizedProps;switch(u[et]=s,u[kt]=y,h){case"dialog":gt("cancel",u),gt("close",u);break;case"iframe":case"object":case"embed":gt("load",u);break;case"video":case"audio":for(h=0;h<Af.length;h++)gt(Af[h],u);break;case"source":gt("error",u);break;case"img":case"image":case"link":gt("error",u),gt("load",u);break;case"details":gt("toggle",u);break;case"input":gt("invalid",u),gO(u,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":gt("invalid",u);break;case"textarea":gt("invalid",u),vO(u,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||y.suppressHydrationWarning===!0||bP(u.textContent,h)?(y.popover!=null&&(gt("beforetoggle",u),gt("toggle",u)),y.onScroll!=null&>("scroll",u),y.onScrollEnd!=null&>("scrollend",u),y.onClick!=null&&(u.onclick=ss),u=!0):u=!1,u||eo(s,!0)}function iE(s){for(fr=s.return;fr;)switch(fr.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:fr=fr.return}}function Vc(s){if(s!==fr)return!1;if(!wt)return iE(s),wt=!0,!1;var u=s.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Jb(s.type,s.memoizedProps)),h=!h),h&&an&&eo(s),iE(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));an=EP(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));an=EP(s)}else u===27?(u=an,mo(s.type)?(s=iw,iw=null,an=s):an=u):an=fr?Ri(s.stateNode.nextSibling):null;return!0}function gl(){an=fr=null,wt=!1}function Ix(){var s=Js;return s!==null&&(Yr===null?Yr=s:Yr.push.apply(Yr,s),Js=null),s}function af(s){Js===null?Js=[s]:Js.push(s)}var Mx=M(null),yl=null,us=null;function to(s,u,h){D(Mx,u._currentValue),u._currentValue=h}function ds(s){s._currentValue=Mx.current,F(Mx)}function Lx(s,u,h){for(;s!==null;){var y=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,y!==null&&(y.childLanes|=u)):y!==null&&(y.childLanes&u)!==u&&(y.childLanes|=u),s===h)break;s=s.return}}function $x(s,u,h,y){var S=s.child;for(S!==null&&(S.return=s);S!==null;){var k=S.dependencies;if(k!==null){var T=S.child;k=k.firstContext;e:for(;k!==null;){var $=k;k=S;for(var G=0;G<u.length;G++)if($.context===u[G]){k.lanes|=h,$=k.alternate,$!==null&&($.lanes|=h),Lx(k.return,h,s),y||(T=null);break e}k=$.next}}else if(S.tag===18){if(T=S.return,T===null)throw Error(r(341));T.lanes|=h,k=T.alternate,k!==null&&(k.lanes|=h),Lx(T,h,s),T=null}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===s){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}}function Qc(s,u,h,y){s=null;for(var S=u,k=!1;S!==null;){if(!k){if((S.flags&524288)!==0)k=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var T=S.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var $=S.type;ci(S.pendingProps.value,T.value)||(s!==null?s.push($):s=[$])}}else if(S===Ce.current){if(T=S.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(s!==null?s.push(Tf):s=[Tf])}S=S.return}s!==null&&$x(u,s,h,y),u.flags|=262144}function Wp(s){for(s=s.firstContext;s!==null;){if(!ci(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function vl(s){yl=s,us=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function hr(s){return aE(yl,s)}function Yp(s,u){return yl===null&&vl(s),aE(s,u)}function aE(s,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},us===null){if(s===null)throw Error(r(308));us=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else us=us.next=u;return h}var yK=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(h,y){s.push(y)}};this.abort=function(){u.aborted=!0,s.forEach(function(h){return h()})}},vK=e.unstable_scheduleCallback,xK=e.unstable_NormalPriority,qn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bx(){return{controller:new yK,data:new Map,refCount:0}}function sf(s){s.refCount--,s.refCount===0&&vK(xK,function(){s.controller.abort()})}var of=null,Ux=0,Wc=0,Yc=null;function bK(s,u){if(of===null){var h=of=[];Ux=0,Wc=Kb(),Yc={status:"pending",value:void 0,then:function(y){h.push(y)}}}return Ux++,u.then(sE,sE),u}function sE(){if(--Ux===0&&of!==null){Yc!==null&&(Yc.status="fulfilled");var s=of;of=null,Wc=0,Yc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function wK(s,u){var h=[],y={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return s.then(function(){y.status="fulfilled",y.value=u;for(var S=0;S<h.length;S++)(0,h[S])(u)},function(S){for(y.status="rejected",y.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),y}var oE=K.S;K.S=function(s,u){K_=pt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&bK(s,u),oE!==null&&oE(s,u)};var xl=M(null);function qx(){var s=xl.current;return s!==null?s:Wt.pooledCache}function Zp(s,u){u===null?D(xl,xl.current):D(xl,u.pool)}function lE(){var s=qx();return s===null?null:{parent:qn._currentValue,pool:s}}var Zc=Error(r(460)),Fx=Error(r(474)),Xp=Error(r(542)),Jp={then:function(){}};function cE(s){return s=s.status,s==="fulfilled"||s==="rejected"}function uE(s,u,h){switch(h=s[h],h===void 0?s.push(u):h!==u&&(u.then(ss,ss),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,fE(s),s;default:if(typeof u.status=="string")u.then(ss,ss);else{if(s=Wt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(y){if(u.status==="pending"){var S=u;S.status="fulfilled",S.value=y}},function(y){if(u.status==="pending"){var S=u;S.status="rejected",S.reason=y}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,fE(s),s}throw wl=u,Zc}}function bl(s){try{var u=s._init;return u(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(wl=h,Zc):h}}var wl=null;function dE(){if(wl===null)throw Error(r(459));var s=wl;return wl=null,s}function fE(s){if(s===Zc||s===Xp)throw Error(r(483))}var Xc=null,lf=0;function em(s){var u=lf;return lf+=1,Xc===null&&(Xc=[]),uE(Xc,s,u)}function cf(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function tm(s,u){throw u.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function hE(s){function u(te,Z){if(s){var ie=te.deletions;ie===null?(te.deletions=[Z],te.flags|=16):ie.push(Z)}}function h(te,Z){if(!s)return null;for(;Z!==null;)u(te,Z),Z=Z.sibling;return null}function y(te){for(var Z=new Map;te!==null;)te.key!==null?Z.set(te.key,te):Z.set(te.index,te),te=te.sibling;return Z}function S(te,Z){return te=ls(te,Z),te.index=0,te.sibling=null,te}function k(te,Z,ie){return te.index=ie,s?(ie=te.alternate,ie!==null?(ie=ie.index,ie<Z?(te.flags|=67108866,Z):ie):(te.flags|=67108866,Z)):(te.flags|=1048576,Z)}function T(te){return s&&te.alternate===null&&(te.flags|=67108866),te}function $(te,Z,ie,xe){return Z===null||Z.tag!==6?(Z=Px(ie,te.mode,xe),Z.return=te,Z):(Z=S(Z,ie),Z.return=te,Z)}function G(te,Z,ie,xe){var He=ie.type;return He===b?ge(te,Z,ie.props.children,xe,ie.key):Z!==null&&(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&bl(He)===Z.type)?(Z=S(Z,ie.props),cf(Z,ie),Z.return=te,Z):(Z=Vp(ie.type,ie.key,ie.props,null,te.mode,xe),cf(Z,ie),Z.return=te,Z)}function ae(te,Z,ie,xe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ie.containerInfo||Z.stateNode.implementation!==ie.implementation?(Z=Tx(ie,te.mode,xe),Z.return=te,Z):(Z=S(Z,ie.children||[]),Z.return=te,Z)}function ge(te,Z,ie,xe,He){return Z===null||Z.tag!==7?(Z=ml(ie,te.mode,xe,He),Z.return=te,Z):(Z=S(Z,ie),Z.return=te,Z)}function we(te,Z,ie){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Px(""+Z,te.mode,ie),Z.return=te,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return ie=Vp(Z.type,Z.key,Z.props,null,te.mode,ie),cf(ie,Z),ie.return=te,ie;case w:return Z=Tx(Z,te.mode,ie),Z.return=te,Z;case z:return Z=bl(Z),we(te,Z,ie)}if(Y(Z)||B(Z))return Z=ml(Z,te.mode,ie,null),Z.return=te,Z;if(typeof Z.then=="function")return we(te,em(Z),ie);if(Z.$$typeof===C)return we(te,Yp(te,Z),ie);tm(te,Z)}return null}function le(te,Z,ie,xe){var He=Z!==null?Z.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return He!==null?null:$(te,Z,""+ie,xe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===He?G(te,Z,ie,xe):null;case w:return ie.key===He?ae(te,Z,ie,xe):null;case z:return ie=bl(ie),le(te,Z,ie,xe)}if(Y(ie)||B(ie))return He!==null?null:ge(te,Z,ie,xe,null);if(typeof ie.then=="function")return le(te,Z,em(ie),xe);if(ie.$$typeof===C)return le(te,Z,Yp(te,ie),xe);tm(te,ie)}return null}function ue(te,Z,ie,xe,He){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return te=te.get(ie)||null,$(Z,te,""+xe,He);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return te=te.get(xe.key===null?ie:xe.key)||null,G(Z,te,xe,He);case w:return te=te.get(xe.key===null?ie:xe.key)||null,ae(Z,te,xe,He);case z:return xe=bl(xe),ue(te,Z,ie,xe,He)}if(Y(xe)||B(xe))return te=te.get(ie)||null,ge(Z,te,xe,He,null);if(typeof xe.then=="function")return ue(te,Z,ie,em(xe),He);if(xe.$$typeof===C)return ue(te,Z,ie,Yp(Z,xe),He);tm(Z,xe)}return null}function Ie(te,Z,ie,xe){for(var He=null,Ot=null,Ue=Z,ot=Z=0,bt=null;Ue!==null&&ot<ie.length;ot++){Ue.index>ot?(bt=Ue,Ue=null):bt=Ue.sibling;var Et=le(te,Ue,ie[ot],xe);if(Et===null){Ue===null&&(Ue=bt);break}s&&Ue&&Et.alternate===null&&u(te,Ue),Z=k(Et,Z,ot),Ot===null?He=Et:Ot.sibling=Et,Ot=Et,Ue=bt}if(ot===ie.length)return h(te,Ue),wt&&cs(te,ot),He;if(Ue===null){for(;ot<ie.length;ot++)Ue=we(te,ie[ot],xe),Ue!==null&&(Z=k(Ue,Z,ot),Ot===null?He=Ue:Ot.sibling=Ue,Ot=Ue);return wt&&cs(te,ot),He}for(Ue=y(Ue);ot<ie.length;ot++)bt=ue(Ue,te,ot,ie[ot],xe),bt!==null&&(s&&bt.alternate!==null&&Ue.delete(bt.key===null?ot:bt.key),Z=k(bt,Z,ot),Ot===null?He=bt:Ot.sibling=bt,Ot=bt);return s&&Ue.forEach(function(bo){return u(te,bo)}),wt&&cs(te,ot),He}function Ye(te,Z,ie,xe){if(ie==null)throw Error(r(151));for(var He=null,Ot=null,Ue=Z,ot=Z=0,bt=null,Et=ie.next();Ue!==null&&!Et.done;ot++,Et=ie.next()){Ue.index>ot?(bt=Ue,Ue=null):bt=Ue.sibling;var bo=le(te,Ue,Et.value,xe);if(bo===null){Ue===null&&(Ue=bt);break}s&&Ue&&bo.alternate===null&&u(te,Ue),Z=k(bo,Z,ot),Ot===null?He=bo:Ot.sibling=bo,Ot=bo,Ue=bt}if(Et.done)return h(te,Ue),wt&&cs(te,ot),He;if(Ue===null){for(;!Et.done;ot++,Et=ie.next())Et=we(te,Et.value,xe),Et!==null&&(Z=k(Et,Z,ot),Ot===null?He=Et:Ot.sibling=Et,Ot=Et);return wt&&cs(te,ot),He}for(Ue=y(Ue);!Et.done;ot++,Et=ie.next())Et=ue(Ue,te,ot,Et.value,xe),Et!==null&&(s&&Et.alternate!==null&&Ue.delete(Et.key===null?ot:Et.key),Z=k(Et,Z,ot),Ot===null?He=Et:Ot.sibling=Et,Ot=Et);return s&&Ue.forEach(function(TH){return u(te,TH)}),wt&&cs(te,ot),He}function qt(te,Z,ie,xe){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:e:{for(var He=ie.key;Z!==null;){if(Z.key===He){if(He=ie.type,He===b){if(Z.tag===7){h(te,Z.sibling),xe=S(Z,ie.props.children),xe.return=te,te=xe;break e}}else if(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&bl(He)===Z.type){h(te,Z.sibling),xe=S(Z,ie.props),cf(xe,ie),xe.return=te,te=xe;break e}h(te,Z);break}else u(te,Z);Z=Z.sibling}ie.type===b?(xe=ml(ie.props.children,te.mode,xe,ie.key),xe.return=te,te=xe):(xe=Vp(ie.type,ie.key,ie.props,null,te.mode,xe),cf(xe,ie),xe.return=te,te=xe)}return T(te);case w:e:{for(He=ie.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===ie.containerInfo&&Z.stateNode.implementation===ie.implementation){h(te,Z.sibling),xe=S(Z,ie.children||[]),xe.return=te,te=xe;break e}else{h(te,Z);break}else u(te,Z);Z=Z.sibling}xe=Tx(ie,te.mode,xe),xe.return=te,te=xe}return T(te);case z:return ie=bl(ie),qt(te,Z,ie,xe)}if(Y(ie))return Ie(te,Z,ie,xe);if(B(ie)){if(He=B(ie),typeof He!="function")throw Error(r(150));return ie=He.call(ie),Ye(te,Z,ie,xe)}if(typeof ie.then=="function")return qt(te,Z,em(ie),xe);if(ie.$$typeof===C)return qt(te,Z,Yp(te,ie),xe);tm(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Z!==null&&Z.tag===6?(h(te,Z.sibling),xe=S(Z,ie),xe.return=te,te=xe):(h(te,Z),xe=Px(ie,te.mode,xe),xe.return=te,te=xe),T(te)):h(te,Z)}return function(te,Z,ie,xe){try{lf=0;var He=qt(te,Z,ie,xe);return Xc=null,He}catch(Ue){if(Ue===Zc||Ue===Xp)throw Ue;var Ot=ui(29,Ue,null,te.mode);return Ot.lanes=xe,Ot.return=te,Ot}}}var Sl=hE(!0),pE=hE(!1),no=!1;function Kx(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hx(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ro(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function io(s,u,h){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(Tt&2)!==0){var S=y.pending;return S===null?u.next=u:(u.next=S.next,S.next=u),y.pending=u,u=Gp(s),ZO(s,null,h),u}return Hp(s,y,u,h),Gp(s)}function uf(s,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var y=u.lanes;y&=s.pendingLanes,h|=y,u.lanes=h,Pp(s,h)}}function Gx(s,u){var h=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var S=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var T={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};k===null?S=k=T:k=k.next=T,h=h.next}while(h!==null);k===null?S=k=u:k=k.next=u}else S=k=u;h={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:k,shared:y.shared,callbacks:y.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=u}var Vx=!1;function df(){if(Vx){var s=Yc;if(s!==null)throw s}}function ff(s,u,h,y){Vx=!1;var S=s.updateQueue;no=!1;var k=S.firstBaseUpdate,T=S.lastBaseUpdate,$=S.shared.pending;if($!==null){S.shared.pending=null;var G=$,ae=G.next;G.next=null,T===null?k=ae:T.next=ae,T=G;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,$=ge.lastBaseUpdate,$!==T&&($===null?ge.firstBaseUpdate=ae:$.next=ae,ge.lastBaseUpdate=G))}if(k!==null){var we=S.baseState;T=0,ge=ae=G=null,$=k;do{var le=$.lane&-536870913,ue=le!==$.lane;if(ue?(xt&le)===le:(y&le)===le){le!==0&&le===Wc&&(Vx=!0),ge!==null&&(ge=ge.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Ie=s,Ye=$;le=u;var qt=h;switch(Ye.tag){case 1:if(Ie=Ye.payload,typeof Ie=="function"){we=Ie.call(qt,we,le);break e}we=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ye.payload,le=typeof Ie=="function"?Ie.call(qt,we,le):Ie,le==null)break e;we=m({},we,le);break e;case 2:no=!0}}le=$.callback,le!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=S.callbacks,ue===null?S.callbacks=[le]:ue.push(le))}else ue={lane:le,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ge===null?(ae=ge=ue,G=we):ge=ge.next=ue,T|=le;if($=$.next,$===null){if($=S.shared.pending,$===null)break;ue=$,$=ue.next,ue.next=null,S.lastBaseUpdate=ue,S.shared.pending=null}}while(!0);ge===null&&(G=we),S.baseState=G,S.firstBaseUpdate=ae,S.lastBaseUpdate=ge,k===null&&(S.shared.lanes=0),co|=T,s.lanes=T,s.memoizedState=we}}function mE(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function gE(s,u){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)mE(h[s],u)}var Jc=M(null),nm=M(0);function yE(s,u){s=bs,D(nm,s),D(Jc,u),bs=s|u.baseLanes}function Qx(){D(nm,bs),D(Jc,Jc.current)}function Wx(){bs=nm.current,F(Jc),F(nm)}var di=M(null),zi=null;function ao(s){var u=s.alternate;D(Dn,Dn.current&1),D(di,s),zi===null&&(u===null||Jc.current!==null||u.memoizedState!==null)&&(zi=s)}function Yx(s){D(Dn,Dn.current),D(di,s),zi===null&&(zi=s)}function vE(s){s.tag===22?(D(Dn,Dn.current),D(di,s),zi===null&&(zi=s)):so()}function so(){D(Dn,Dn.current),D(di,di.current)}function fi(s){F(di),zi===s&&(zi=null),F(Dn)}var Dn=M(0);function rm(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||nw(h)||rw(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var fs=0,st=null,Bt=null,Fn=null,im=!1,eu=!1,jl=!1,am=0,hf=0,tu=null,SK=0;function kn(){throw Error(r(321))}function Zx(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!ci(s[h],u[h]))return!1;return!0}function Xx(s,u,h,y,S,k){return fs=k,st=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,K.H=s===null||s.memoizedState===null?t_:hb,jl=!1,k=h(y,S),jl=!1,eu&&(k=bE(u,h,y,S)),xE(s),k}function xE(s){K.H=gf;var u=Bt!==null&&Bt.next!==null;if(fs=0,Fn=Bt=st=null,im=!1,hf=0,tu=null,u)throw Error(r(300));s===null||Kn||(s=s.dependencies,s!==null&&Wp(s)&&(Kn=!0))}function bE(s,u,h,y){st=s;var S=0;do{if(eu&&(tu=null),hf=0,eu=!1,25<=S)throw Error(r(301));if(S+=1,Fn=Bt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}K.H=n_,k=u(h,y)}while(eu);return k}function jK(){var s=K.H,u=s.useState()[0];return u=typeof u.then=="function"?pf(u):u,s=s.useState()[0],(Bt!==null?Bt.memoizedState:null)!==s&&(st.flags|=1024),u}function Jx(){var s=am!==0;return am=0,s}function eb(s,u,h){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~h}function tb(s){if(im){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}im=!1}fs=0,Fn=Bt=st=null,eu=!1,hf=am=0,tu=null}function Tr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fn===null?st.memoizedState=Fn=s:Fn=Fn.next=s,Fn}function In(){if(Bt===null){var s=st.alternate;s=s!==null?s.memoizedState:null}else s=Bt.next;var u=Fn===null?st.memoizedState:Fn.next;if(u!==null)Fn=u,Bt=s;else{if(s===null)throw st.alternate===null?Error(r(467)):Error(r(310));Bt=s,s={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Fn===null?st.memoizedState=Fn=s:Fn=Fn.next=s}return Fn}function sm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pf(s){var u=hf;return hf+=1,tu===null&&(tu=[]),s=uE(tu,s,u),u=st,(Fn===null?u.memoizedState:Fn.next)===null&&(u=u.alternate,K.H=u===null||u.memoizedState===null?t_:hb),s}function om(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return pf(s);if(s.$$typeof===C)return hr(s)}throw Error(r(438,String(s)))}function nb(s){var u=null,h=st.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var y=st.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(u={data:y.data.map(function(S){return S.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=sm(),st.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(s),y=0;y<s;y++)h[y]=q;return u.index++,h}function hs(s,u){return typeof u=="function"?u(s):u}function lm(s){var u=In();return rb(u,Bt,s)}function rb(s,u,h){var y=s.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=h;var S=s.baseQueue,k=y.pending;if(k!==null){if(S!==null){var T=S.next;S.next=k.next,k.next=T}u.baseQueue=S=k,y.pending=null}if(k=s.baseState,S===null)s.memoizedState=k;else{u=S.next;var $=T=null,G=null,ae=u,ge=!1;do{var we=ae.lane&-536870913;if(we!==ae.lane?(xt&we)===we:(fs&we)===we){var le=ae.revertLane;if(le===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),we===Wc&&(ge=!0);else if((fs&le)===le){ae=ae.next,le===Wc&&(ge=!0);continue}else we={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?($=G=we,T=k):G=G.next=we,st.lanes|=le,co|=le;we=ae.action,jl&&h(k,we),k=ae.hasEagerState?ae.eagerState:h(k,we)}else le={lane:we,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?($=G=le,T=k):G=G.next=le,st.lanes|=we,co|=we;ae=ae.next}while(ae!==null&&ae!==u);if(G===null?T=k:G.next=$,!ci(k,s.memoizedState)&&(Kn=!0,ge&&(h=Yc,h!==null)))throw h;s.memoizedState=k,s.baseState=T,s.baseQueue=G,y.lastRenderedState=k}return S===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function ib(s){var u=In(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var y=h.dispatch,S=h.pending,k=u.memoizedState;if(S!==null){h.pending=null;var T=S=S.next;do k=s(k,T.action),T=T.next;while(T!==S);ci(k,u.memoizedState)||(Kn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),h.lastRenderedState=k}return[k,y]}function wE(s,u,h){var y=st,S=In(),k=wt;if(k){if(h===void 0)throw Error(r(407));h=h()}else h=u();var T=!ci((Bt||S).memoizedState,h);if(T&&(S.memoizedState=h,Kn=!0),S=S.queue,ob(NE.bind(null,y,S,s),[s]),S.getSnapshot!==u||T||Fn!==null&&Fn.memoizedState.tag&1){if(y.flags|=2048,nu(9,{destroy:void 0},jE.bind(null,y,S,h,u),null),Wt===null)throw Error(r(349));k||(fs&127)!==0||SE(y,u,h)}return h}function SE(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=st.updateQueue,u===null?(u=sm(),st.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function jE(s,u,h,y){u.value=h,u.getSnapshot=y,kE(u)&&CE(s)}function NE(s,u,h){return h(function(){kE(u)&&CE(s)})}function kE(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!ci(s,h)}catch{return!0}}function CE(s){var u=pl(s,2);u!==null&&Zr(u,s,2)}function ab(s){var u=Tr();if(typeof s=="function"){var h=s;if(s=h(),jl){Vt(!0);try{h()}finally{Vt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:s},u}function AE(s,u,h,y){return s.baseState=h,rb(s,Bt,typeof y=="function"?y:hs)}function NK(s,u,h,y,S){if(dm(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:S,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){k.listeners.push(T)}};K.T!==null?h(!0):k.isTransition=!1,y(k),h=u.pending,h===null?(k.next=u.pending=k,OE(u,k)):(k.next=h.next,u.pending=h.next=k)}}function OE(s,u){var h=u.action,y=u.payload,S=s.state;if(u.isTransition){var k=K.T,T={};K.T=T;try{var $=h(S,y),G=K.S;G!==null&&G(T,$),EE(s,u,$)}catch(ae){sb(s,u,ae)}finally{k!==null&&T.types!==null&&(k.types=T.types),K.T=k}}else try{k=h(S,y),EE(s,u,k)}catch(ae){sb(s,u,ae)}}function EE(s,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){_E(s,u,y)},function(y){return sb(s,u,y)}):_E(s,u,h)}function _E(s,u,h){u.status="fulfilled",u.value=h,PE(u),s.state=h,u=s.pending,u!==null&&(h=u.next,h===u?s.pending=null:(h=h.next,u.next=h,OE(s,h)))}function sb(s,u,h){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do u.status="rejected",u.reason=h,PE(u),u=u.next;while(u!==y)}s.action=null}function PE(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function TE(s,u){return u}function zE(s,u){if(wt){var h=Wt.formState;if(h!==null){e:{var y=st;if(wt){if(an){t:{for(var S=an,k=Ti;S.nodeType!==8;){if(!k){S=null;break t}if(S=Ri(S.nextSibling),S===null){S=null;break t}}k=S.data,S=k==="F!"||k==="F"?S:null}if(S){an=Ri(S.nextSibling),y=S.data==="F!";break e}}eo(y)}y=!1}y&&(u=h[0])}}return h=Tr(),h.memoizedState=h.baseState=u,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:TE,lastRenderedState:u},h.queue=y,h=XE.bind(null,st,y),y.dispatch=h,y=ab(!1),k=fb.bind(null,st,!1,y.queue),y=Tr(),S={state:u,dispatch:null,action:s,pending:null},y.queue=S,h=NK.bind(null,st,S,k,h),S.dispatch=h,y.memoizedState=s,[u,h,!1]}function RE(s){var u=In();return DE(u,Bt,s)}function DE(s,u,h){if(u=rb(s,u,TE)[0],s=lm(hs)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var y=pf(u)}catch(T){throw T===Zc?Xp:T}else y=u;u=In();var S=u.queue,k=S.dispatch;return h!==u.memoizedState&&(st.flags|=2048,nu(9,{destroy:void 0},kK.bind(null,S,h),null)),[y,k,s]}function kK(s,u){s.action=u}function IE(s){var u=In(),h=Bt;if(h!==null)return DE(u,h,s);In(),u=u.memoizedState,h=In();var y=h.queue.dispatch;return h.memoizedState=s,[u,y,!1]}function nu(s,u,h,y){return s={tag:s,create:h,deps:y,inst:u,next:null},u=st.updateQueue,u===null&&(u=sm(),st.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=s.next=s:(y=h.next,h.next=s,s.next=y,u.lastEffect=s),s}function ME(){return In().memoizedState}function cm(s,u,h,y){var S=Tr();st.flags|=s,S.memoizedState=nu(1|u,{destroy:void 0},h,y===void 0?null:y)}function um(s,u,h,y){var S=In();y=y===void 0?null:y;var k=S.memoizedState.inst;Bt!==null&&y!==null&&Zx(y,Bt.memoizedState.deps)?S.memoizedState=nu(u,k,h,y):(st.flags|=s,S.memoizedState=nu(1|u,k,h,y))}function LE(s,u){cm(8390656,8,s,u)}function ob(s,u){um(2048,8,s,u)}function CK(s){st.flags|=4;var u=st.updateQueue;if(u===null)u=sm(),st.updateQueue=u,u.events=[s];else{var h=u.events;h===null?u.events=[s]:h.push(s)}}function $E(s){var u=In().memoizedState;return CK({ref:u,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function BE(s,u){return um(4,2,s,u)}function UE(s,u){return um(4,4,s,u)}function qE(s,u){if(typeof u=="function"){s=s();var h=u(s);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function FE(s,u,h){h=h!=null?h.concat([s]):null,um(4,4,qE.bind(null,u,s),h)}function lb(){}function KE(s,u){var h=In();u=u===void 0?null:u;var y=h.memoizedState;return u!==null&&Zx(u,y[1])?y[0]:(h.memoizedState=[s,u],s)}function HE(s,u){var h=In();u=u===void 0?null:u;var y=h.memoizedState;if(u!==null&&Zx(u,y[1]))return y[0];if(y=s(),jl){Vt(!0);try{s()}finally{Vt(!1)}}return h.memoizedState=[y,u],y}function cb(s,u,h){return h===void 0||(fs&1073741824)!==0&&(xt&261930)===0?s.memoizedState=u:(s.memoizedState=h,s=G_(),st.lanes|=s,co|=s,h)}function GE(s,u,h,y){return ci(h,u)?h:Jc.current!==null?(s=cb(s,h,y),ci(s,u)||(Kn=!0),s):(fs&42)===0||(fs&1073741824)!==0&&(xt&261930)===0?(Kn=!0,s.memoizedState=h):(s=G_(),st.lanes|=s,co|=s,u)}function VE(s,u,h,y,S){var k=J.p;J.p=k!==0&&8>k?k:8;var T=K.T,$={};K.T=$,fb(s,!1,u,h);try{var G=S(),ae=K.S;if(ae!==null&&ae($,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ge=wK(G,y);mf(s,u,ge,mi(s))}else mf(s,u,y,mi(s))}catch(we){mf(s,u,{then:function(){},status:"rejected",reason:we},mi())}finally{J.p=k,T!==null&&$.types!==null&&(T.types=$.types),K.T=T}}function AK(){}function ub(s,u,h,y){if(s.tag!==5)throw Error(r(476));var S=QE(s).queue;VE(s,S,u,se,h===null?AK:function(){return WE(s),h(y)})}function QE(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:se},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:h},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function WE(s){var u=QE(s);u.next===null&&(u=s.alternate.memoizedState),mf(s,u.next.queue,{},mi())}function db(){return hr(Tf)}function YE(){return In().memoizedState}function ZE(){return In().memoizedState}function OK(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var h=mi();s=ro(h);var y=io(u,s,h);y!==null&&(Zr(y,u,h),uf(y,u,h)),u={cache:Bx()},s.payload=u;return}u=u.return}}function EK(s,u,h){var y=mi();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},dm(s)?JE(u,h):(h=Ex(s,u,h,y),h!==null&&(Zr(h,s,y),e_(h,u,y)))}function XE(s,u,h){var y=mi();mf(s,u,h,y)}function mf(s,u,h,y){var S={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(dm(s))JE(u,S);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var T=u.lastRenderedState,$=k(T,h);if(S.hasEagerState=!0,S.eagerState=$,ci($,T))return Hp(s,u,S,0),Wt===null&&Kp(),!1}catch{}if(h=Ex(s,u,S,y),h!==null)return Zr(h,s,y),e_(h,u,y),!0}return!1}function fb(s,u,h,y){if(y={lane:2,revertLane:Kb(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},dm(s)){if(u)throw Error(r(479))}else u=Ex(s,h,y,2),u!==null&&Zr(u,s,2)}function dm(s){var u=s.alternate;return s===st||u!==null&&u===st}function JE(s,u){eu=im=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function e_(s,u,h){if((h&4194048)!==0){var y=u.lanes;y&=s.pendingLanes,h|=y,u.lanes=h,Pp(s,h)}}var gf={readContext:hr,use:om,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useLayoutEffect:kn,useInsertionEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useSyncExternalStore:kn,useId:kn,useHostTransitionStatus:kn,useFormState:kn,useActionState:kn,useOptimistic:kn,useMemoCache:kn,useCacheRefresh:kn};gf.useEffectEvent=kn;var t_={readContext:hr,use:om,useCallback:function(s,u){return Tr().memoizedState=[s,u===void 0?null:u],s},useContext:hr,useEffect:LE,useImperativeHandle:function(s,u,h){h=h!=null?h.concat([s]):null,cm(4194308,4,qE.bind(null,u,s),h)},useLayoutEffect:function(s,u){return cm(4194308,4,s,u)},useInsertionEffect:function(s,u){cm(4,2,s,u)},useMemo:function(s,u){var h=Tr();u=u===void 0?null:u;var y=s();if(jl){Vt(!0);try{s()}finally{Vt(!1)}}return h.memoizedState=[y,u],y},useReducer:function(s,u,h){var y=Tr();if(h!==void 0){var S=h(u);if(jl){Vt(!0);try{h(u)}finally{Vt(!1)}}}else S=u;return y.memoizedState=y.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},y.queue=s,s=s.dispatch=EK.bind(null,st,s),[y.memoizedState,s]},useRef:function(s){var u=Tr();return s={current:s},u.memoizedState=s},useState:function(s){s=ab(s);var u=s.queue,h=XE.bind(null,st,u);return u.dispatch=h,[s.memoizedState,h]},useDebugValue:lb,useDeferredValue:function(s,u){var h=Tr();return cb(h,s,u)},useTransition:function(){var s=ab(!1);return s=VE.bind(null,st,s.queue,!0,!1),Tr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,h){var y=st,S=Tr();if(wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Wt===null)throw Error(r(349));(xt&127)!==0||SE(y,u,h)}S.memoizedState=h;var k={value:h,getSnapshot:u};return S.queue=k,LE(NE.bind(null,y,k,s),[s]),y.flags|=2048,nu(9,{destroy:void 0},jE.bind(null,y,k,h,u),null),h},useId:function(){var s=Tr(),u=Wt.identifierPrefix;if(wt){var h=Ca,y=ka;h=(y&~(1<<32-de(y)-1)).toString(32)+h,u="_"+u+"R_"+h,h=am++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=SK++,u="_"+u+"r_"+h.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:db,useFormState:zE,useActionState:zE,useOptimistic:function(s){var u=Tr();u.memoizedState=u.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=fb.bind(null,st,!0,h),h.dispatch=u,[s,u]},useMemoCache:nb,useCacheRefresh:function(){return Tr().memoizedState=OK.bind(null,st)},useEffectEvent:function(s){var u=Tr(),h={impl:s};return u.memoizedState=h,function(){if((Tt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},hb={readContext:hr,use:om,useCallback:KE,useContext:hr,useEffect:ob,useImperativeHandle:FE,useInsertionEffect:BE,useLayoutEffect:UE,useMemo:HE,useReducer:lm,useRef:ME,useState:function(){return lm(hs)},useDebugValue:lb,useDeferredValue:function(s,u){var h=In();return GE(h,Bt.memoizedState,s,u)},useTransition:function(){var s=lm(hs)[0],u=In().memoizedState;return[typeof s=="boolean"?s:pf(s),u]},useSyncExternalStore:wE,useId:YE,useHostTransitionStatus:db,useFormState:RE,useActionState:RE,useOptimistic:function(s,u){var h=In();return AE(h,Bt,s,u)},useMemoCache:nb,useCacheRefresh:ZE};hb.useEffectEvent=$E;var n_={readContext:hr,use:om,useCallback:KE,useContext:hr,useEffect:ob,useImperativeHandle:FE,useInsertionEffect:BE,useLayoutEffect:UE,useMemo:HE,useReducer:ib,useRef:ME,useState:function(){return ib(hs)},useDebugValue:lb,useDeferredValue:function(s,u){var h=In();return Bt===null?cb(h,s,u):GE(h,Bt.memoizedState,s,u)},useTransition:function(){var s=ib(hs)[0],u=In().memoizedState;return[typeof s=="boolean"?s:pf(s),u]},useSyncExternalStore:wE,useId:YE,useHostTransitionStatus:db,useFormState:IE,useActionState:IE,useOptimistic:function(s,u){var h=In();return Bt!==null?AE(h,Bt,s,u):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:nb,useCacheRefresh:ZE};n_.useEffectEvent=$E;function pb(s,u,h,y){u=s.memoizedState,h=h(y,u),h=h==null?u:m({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var mb={enqueueSetState:function(s,u,h){s=s._reactInternals;var y=mi(),S=ro(y);S.payload=u,h!=null&&(S.callback=h),u=io(s,S,y),u!==null&&(Zr(u,s,y),uf(u,s,y))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var y=mi(),S=ro(y);S.tag=1,S.payload=u,h!=null&&(S.callback=h),u=io(s,S,y),u!==null&&(Zr(u,s,y),uf(u,s,y))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=mi(),y=ro(h);y.tag=2,u!=null&&(y.callback=u),u=io(s,y,h),u!==null&&(Zr(u,s,h),uf(u,s,h))}};function r_(s,u,h,y,S,k,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,k,T):u.prototype&&u.prototype.isPureReactComponent?!tf(h,y)||!tf(S,k):!0}function i_(s,u,h,y){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,y),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,y),u.state!==s&&mb.enqueueReplaceState(u,u.state,null)}function Nl(s,u){var h=u;if("ref"in u){h={};for(var y in u)y!=="ref"&&(h[y]=u[y])}if(s=s.defaultProps){h===u&&(h=m({},h));for(var S in s)h[S]===void 0&&(h[S]=s[S])}return h}function a_(s){Fp(s)}function s_(s){console.error(s)}function o_(s){Fp(s)}function fm(s,u){try{var h=s.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(y){setTimeout(function(){throw y})}}function l_(s,u,h){try{var y=s.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function gb(s,u,h){return h=ro(h),h.tag=3,h.payload={element:null},h.callback=function(){fm(s,u)},h}function c_(s){return s=ro(s),s.tag=3,s}function u_(s,u,h,y){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var k=y.value;s.payload=function(){return S(k)},s.callback=function(){l_(u,h,y)}}var T=h.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){l_(u,h,y),typeof S!="function"&&(uo===null?uo=new Set([this]):uo.add(this));var $=y.stack;this.componentDidCatch(y.value,{componentStack:$!==null?$:""})})}function _K(s,u,h,y,S){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(u=h.alternate,u!==null&&Qc(u,h,S,!0),h=di.current,h!==null){switch(h.tag){case 31:case 13:return zi===null?Nm():h.alternate===null&&Cn===0&&(Cn=3),h.flags&=-257,h.flags|=65536,h.lanes=S,y===Jp?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([y]):u.add(y),Ub(s,y,S)),!1;case 22:return h.flags|=65536,y===Jp?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([y]):h.add(y)),Ub(s,y,S)),!1}throw Error(r(435,h.tag))}return Ub(s,y,S),Nm(),!1}if(wt)return u=di.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=S,y!==Dx&&(s=Error(r(422),{cause:y}),af(Ei(s,h)))):(y!==Dx&&(u=Error(r(423),{cause:y}),af(Ei(u,h))),s=s.current.alternate,s.flags|=65536,S&=-S,s.lanes|=S,y=Ei(y,h),S=gb(s.stateNode,y,S),Gx(s,S),Cn!==4&&(Cn=2)),!1;var k=Error(r(520),{cause:y});if(k=Ei(k,h),Nf===null?Nf=[k]:Nf.push(k),Cn!==4&&(Cn=2),u===null)return!0;y=Ei(y,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,s=S&-S,h.lanes|=s,s=gb(h.stateNode,y,s),Gx(h,s),!1;case 1:if(u=h.type,k=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(uo===null||!uo.has(k))))return h.flags|=65536,S&=-S,h.lanes|=S,S=c_(S),u_(S,s,h,y),Gx(h,S),!1}h=h.return}while(h!==null);return!1}var yb=Error(r(461)),Kn=!1;function pr(s,u,h,y){u.child=s===null?pE(u,null,h,y):Sl(u,s.child,h,y)}function d_(s,u,h,y,S){h=h.render;var k=u.ref;if("ref"in y){var T={};for(var $ in y)$!=="ref"&&(T[$]=y[$])}else T=y;return vl(u),y=Xx(s,u,h,T,k,S),$=Jx(),s!==null&&!Kn?(eb(s,u,S),ps(s,u,S)):(wt&&$&&zx(u),u.flags|=1,pr(s,u,y,S),u.child)}function f_(s,u,h,y,S){if(s===null){var k=h.type;return typeof k=="function"&&!_x(k)&&k.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=k,h_(s,u,k,y,S)):(s=Vp(h.type,null,y,u,u.mode,S),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!kb(s,S)){var T=k.memoizedProps;if(h=h.compare,h=h!==null?h:tf,h(T,y)&&s.ref===u.ref)return ps(s,u,S)}return u.flags|=1,s=ls(k,y),s.ref=u.ref,s.return=u,u.child=s}function h_(s,u,h,y,S){if(s!==null){var k=s.memoizedProps;if(tf(k,y)&&s.ref===u.ref)if(Kn=!1,u.pendingProps=y=k,kb(s,S))(s.flags&131072)!==0&&(Kn=!0);else return u.lanes=s.lanes,ps(s,u,S)}return vb(s,u,h,y,S)}function p_(s,u,h,y){var S=y.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|h:h,s!==null){for(y=u.child=s.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;y=S&~k}else y=0,u.child=null;return m_(s,u,k,h,y)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Zp(u,k!==null?k.cachePool:null),k!==null?yE(u,k):Qx(),vE(u);else return y=u.lanes=536870912,m_(s,u,k!==null?k.baseLanes|h:h,h,y)}else k!==null?(Zp(u,k.cachePool),yE(u,k),so(),u.memoizedState=null):(s!==null&&Zp(u,null),Qx(),so());return pr(s,u,S,h),u.child}function yf(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function m_(s,u,h,y,S){var k=qx();return k=k===null?null:{parent:qn._currentValue,pool:k},u.memoizedState={baseLanes:h,cachePool:k},s!==null&&Zp(u,null),Qx(),vE(u),s!==null&&Qc(s,u,y,!0),u.childLanes=S,null}function hm(s,u){return u=mm({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function g_(s,u,h){return Sl(u,s.child,null,h),s=hm(u,u.pendingProps),s.flags|=2,fi(u),u.memoizedState=null,s}function PK(s,u,h){var y=u.pendingProps,S=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(wt){if(y.mode==="hidden")return s=hm(u,y),u.lanes=536870912,yf(null,s);if(Yx(u),(s=an)?(s=OP(s,Ti),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Xs!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},h=JO(s),h.return=u,u.child=h,fr=u,an=null)):s=null,s===null)throw eo(u);return u.lanes=536870912,null}return hm(u,y)}var k=s.memoizedState;if(k!==null){var T=k.dehydrated;if(Yx(u),S)if(u.flags&256)u.flags&=-257,u=g_(s,u,h);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Kn||Qc(s,u,h,!1),S=(h&s.childLanes)!==0,Kn||S){if(y=Wt,y!==null&&(T=Tp(y,h),T!==0&&T!==k.retryLane))throw k.retryLane=T,pl(s,T),Zr(y,s,T),yb;Nm(),u=g_(s,u,h)}else s=k.treeContext,an=Ri(T.nextSibling),fr=u,wt=!0,Js=null,Ti=!1,s!==null&&nE(u,s),u=hm(u,y),u.flags|=4096;return u}return s=ls(s.child,{mode:y.mode,children:y.children}),s.ref=u.ref,u.child=s,s.return=u,s}function pm(s,u){var h=u.ref;if(h===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(u.flags|=4194816)}}function vb(s,u,h,y,S){return vl(u),h=Xx(s,u,h,y,void 0,S),y=Jx(),s!==null&&!Kn?(eb(s,u,S),ps(s,u,S)):(wt&&y&&zx(u),u.flags|=1,pr(s,u,h,S),u.child)}function y_(s,u,h,y,S,k){return vl(u),u.updateQueue=null,h=bE(u,y,h,S),xE(s),y=Jx(),s!==null&&!Kn?(eb(s,u,k),ps(s,u,k)):(wt&&y&&zx(u),u.flags|=1,pr(s,u,h,k),u.child)}function v_(s,u,h,y,S){if(vl(u),u.stateNode===null){var k=Kc,T=h.contextType;typeof T=="object"&&T!==null&&(k=hr(T)),k=new h(y,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=mb,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=y,k.state=u.memoizedState,k.refs={},Kx(u),T=h.contextType,k.context=typeof T=="object"&&T!==null?hr(T):Kc,k.state=u.memoizedState,T=h.getDerivedStateFromProps,typeof T=="function"&&(pb(u,h,T,y),k.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(T=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),T!==k.state&&mb.enqueueReplaceState(k,k.state,null),ff(u,y,k,S),df(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),y=!0}else if(s===null){k=u.stateNode;var $=u.memoizedProps,G=Nl(h,$);k.props=G;var ae=k.context,ge=h.contextType;T=Kc,typeof ge=="object"&&ge!==null&&(T=hr(ge));var we=h.getDerivedStateFromProps;ge=typeof we=="function"||typeof k.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,ge||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||($||ae!==T)&&i_(u,k,y,T),no=!1;var le=u.memoizedState;k.state=le,ff(u,y,k,S),df(),ae=u.memoizedState,$||le!==ae||no?(typeof we=="function"&&(pb(u,h,we,y),ae=u.memoizedState),(G=no||r_(u,h,G,y,le,ae,T))?(ge||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"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=y,u.memoizedState=ae),k.props=y,k.state=ae,k.context=T,y=G):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),y=!1)}else{k=u.stateNode,Hx(s,u),T=u.memoizedProps,ge=Nl(h,T),k.props=ge,we=u.pendingProps,le=k.context,ae=h.contextType,G=Kc,typeof ae=="object"&&ae!==null&&(G=hr(ae)),$=h.getDerivedStateFromProps,(ae=typeof $=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(T!==we||le!==G)&&i_(u,k,y,G),no=!1,le=u.memoizedState,k.state=le,ff(u,y,k,S),df();var ue=u.memoizedState;T!==we||le!==ue||no||s!==null&&s.dependencies!==null&&Wp(s.dependencies)?(typeof $=="function"&&(pb(u,h,$,y),ue=u.memoizedState),(ge=no||r_(u,h,ge,y,le,ue,G)||s!==null&&s.dependencies!==null&&Wp(s.dependencies))?(ae||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(y,ue,G),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(y,ue,G)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=1024),u.memoizedProps=y,u.memoizedState=ue),k.props=y,k.state=ue,k.context=G,y=ge):(typeof k.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=1024),y=!1)}return k=y,pm(s,u),y=(u.flags&128)!==0,k||y?(k=u.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&y?(u.child=Sl(u,s.child,null,S),u.child=Sl(u,null,h,S)):pr(s,u,h,S),u.memoizedState=k.state,s=u.child):s=ps(s,u,S),s}function x_(s,u,h,y){return gl(),u.flags|=256,pr(s,u,h,y),u.child}var xb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bb(s){return{baseLanes:s,cachePool:lE()}}function wb(s,u,h){return s=s!==null?s.childLanes&~h:0,u&&(s|=pi),s}function b_(s,u,h){var y=u.pendingProps,S=!1,k=(u.flags&128)!==0,T;if((T=k)||(T=s!==null&&s.memoizedState===null?!1:(Dn.current&2)!==0),T&&(S=!0,u.flags&=-129),T=(u.flags&32)!==0,u.flags&=-33,s===null){if(wt){if(S?ao(u):so(),(s=an)?(s=OP(s,Ti),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Xs!==null?{id:ka,overflow:Ca}:null,retryLane:536870912,hydrationErrors:null},h=JO(s),h.return=u,u.child=h,fr=u,an=null)):s=null,s===null)throw eo(u);return rw(s)?u.lanes=32:u.lanes=536870912,null}var $=y.children;return y=y.fallback,S?(so(),S=u.mode,$=mm({mode:"hidden",children:$},S),y=ml(y,S,h,null),$.return=u,y.return=u,$.sibling=y,u.child=$,y=u.child,y.memoizedState=bb(h),y.childLanes=wb(s,T,h),u.memoizedState=xb,yf(null,y)):(ao(u),Sb(u,$))}var G=s.memoizedState;if(G!==null&&($=G.dehydrated,$!==null)){if(k)u.flags&256?(ao(u),u.flags&=-257,u=jb(s,u,h)):u.memoizedState!==null?(so(),u.child=s.child,u.flags|=128,u=null):(so(),$=y.fallback,S=u.mode,y=mm({mode:"visible",children:y.children},S),$=ml($,S,h,null),$.flags|=2,y.return=u,$.return=u,y.sibling=$,u.child=y,Sl(u,s.child,null,h),y=u.child,y.memoizedState=bb(h),y.childLanes=wb(s,T,h),u.memoizedState=xb,u=yf(null,y));else if(ao(u),rw($)){if(T=$.nextSibling&&$.nextSibling.dataset,T)var ae=T.dgst;T=ae,y=Error(r(419)),y.stack="",y.digest=T,af({value:y,source:null,stack:null}),u=jb(s,u,h)}else if(Kn||Qc(s,u,h,!1),T=(h&s.childLanes)!==0,Kn||T){if(T=Wt,T!==null&&(y=Tp(T,h),y!==0&&y!==G.retryLane))throw G.retryLane=y,pl(s,y),Zr(T,s,y),yb;nw($)||Nm(),u=jb(s,u,h)}else nw($)?(u.flags|=192,u.child=s.child,u=null):(s=G.treeContext,an=Ri($.nextSibling),fr=u,wt=!0,Js=null,Ti=!1,s!==null&&nE(u,s),u=Sb(u,y.children),u.flags|=4096);return u}return S?(so(),$=y.fallback,S=u.mode,G=s.child,ae=G.sibling,y=ls(G,{mode:"hidden",children:y.children}),y.subtreeFlags=G.subtreeFlags&65011712,ae!==null?$=ls(ae,$):($=ml($,S,h,null),$.flags|=2),$.return=u,y.return=u,y.sibling=$,u.child=y,yf(null,y),y=u.child,$=s.child.memoizedState,$===null?$=bb(h):(S=$.cachePool,S!==null?(G=qn._currentValue,S=S.parent!==G?{parent:G,pool:G}:S):S=lE(),$={baseLanes:$.baseLanes|h,cachePool:S}),y.memoizedState=$,y.childLanes=wb(s,T,h),u.memoizedState=xb,yf(s.child,y)):(ao(u),h=s.child,s=h.sibling,h=ls(h,{mode:"visible",children:y.children}),h.return=u,h.sibling=null,s!==null&&(T=u.deletions,T===null?(u.deletions=[s],u.flags|=16):T.push(s)),u.child=h,u.memoizedState=null,h)}function Sb(s,u){return u=mm({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function mm(s,u){return s=ui(22,s,null,u),s.lanes=0,s}function jb(s,u,h){return Sl(u,s.child,null,h),s=Sb(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function w_(s,u,h){s.lanes|=u;var y=s.alternate;y!==null&&(y.lanes|=u),Lx(s.return,u,h)}function Nb(s,u,h,y,S,k){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:S,treeForkCount:k}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=y,T.tail=h,T.tailMode=S,T.treeForkCount=k)}function S_(s,u,h){var y=u.pendingProps,S=y.revealOrder,k=y.tail;y=y.children;var T=Dn.current,$=(T&2)!==0;if($?(T=T&1|2,u.flags|=128):T&=1,D(Dn,T),pr(s,u,y,h),y=wt?rf:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&w_(s,h,u);else if(s.tag===19)w_(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(S){case"forwards":for(h=u.child,S=null;h!==null;)s=h.alternate,s!==null&&rm(s)===null&&(S=h),h=h.sibling;h=S,h===null?(S=u.child,u.child=null):(S=h.sibling,h.sibling=null),Nb(u,!1,S,h,k,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=u.child,u.child=null;S!==null;){if(s=S.alternate,s!==null&&rm(s)===null){u.child=S;break}s=S.sibling,S.sibling=h,h=S,S=s}Nb(u,!0,h,null,k,y);break;case"together":Nb(u,!1,null,null,void 0,y);break;default:u.memoizedState=null}return u.child}function ps(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),co|=u.lanes,(h&u.childLanes)===0)if(s!==null){if(Qc(s,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=ls(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=ls(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function kb(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Wp(s)))}function TK(s,u,h){switch(u.tag){case 3:je(u,u.stateNode.containerInfo),to(u,qn,s.memoizedState.cache),gl();break;case 27:case 5:pe(u);break;case 4:je(u,u.stateNode.containerInfo);break;case 10:to(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Yx(u),null;break;case 13:var y=u.memoizedState;if(y!==null)return y.dehydrated!==null?(ao(u),u.flags|=128,null):(h&u.child.childLanes)!==0?b_(s,u,h):(ao(u),s=ps(s,u,h),s!==null?s.sibling:null);ao(u);break;case 19:var S=(s.flags&128)!==0;if(y=(h&u.childLanes)!==0,y||(Qc(s,u,h,!1),y=(h&u.childLanes)!==0),S){if(y)return S_(s,u,h);u.flags|=128}if(S=u.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),D(Dn,Dn.current),y)break;return null;case 22:return u.lanes=0,p_(s,u,h,u.pendingProps);case 24:to(u,qn,s.memoizedState.cache)}return ps(s,u,h)}function j_(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps)Kn=!0;else{if(!kb(s,h)&&(u.flags&128)===0)return Kn=!1,TK(s,u,h);Kn=(s.flags&131072)!==0}else Kn=!1,wt&&(u.flags&1048576)!==0&&tE(u,rf,u.index);switch(u.lanes=0,u.tag){case 16:e:{var y=u.pendingProps;if(s=bl(u.elementType),u.type=s,typeof s=="function")_x(s)?(y=Nl(s,y),u.tag=1,u=v_(null,u,s,y,h)):(u.tag=0,u=vb(null,u,s,y,h));else{if(s!=null){var S=s.$$typeof;if(S===A){u.tag=11,u=d_(null,u,s,y,h);break e}else if(S===_){u.tag=14,u=f_(null,u,s,y,h);break e}}throw u=W(s)||s,Error(r(306,u,""))}}return u;case 0:return vb(s,u,u.type,u.pendingProps,h);case 1:return y=u.type,S=Nl(y,u.pendingProps),v_(s,u,y,S,h);case 3:e:{if(je(u,u.stateNode.containerInfo),s===null)throw Error(r(387));y=u.pendingProps;var k=u.memoizedState;S=k.element,Hx(s,u),ff(u,y,null,h);var T=u.memoizedState;if(y=T.cache,to(u,qn,y),y!==k.cache&&$x(u,[qn],h,!0),df(),y=T.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:T.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=x_(s,u,y,h);break e}else if(y!==S){S=Ei(Error(r(424)),u),af(S),u=x_(s,u,y,h);break e}else for(s=u.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,an=Ri(s.firstChild),fr=u,wt=!0,Js=null,Ti=!0,h=pE(u,null,y,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(gl(),y===S){u=ps(s,u,h);break e}pr(s,u,y,h)}u=u.child}return u;case 26:return pm(s,u),s===null?(h=RP(u.type,null,u.pendingProps,null))?u.memoizedState=h:wt||(h=u.type,s=u.pendingProps,y=Pm(re.current).createElement(h),y[et]=u,y[kt]=s,mr(y,h,s),xn(y),u.stateNode=y):u.memoizedState=RP(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return pe(u),s===null&&wt&&(y=u.stateNode=PP(u.type,u.pendingProps,re.current),fr=u,Ti=!0,S=an,mo(u.type)?(iw=S,an=Ri(y.firstChild)):an=S),pr(s,u,u.pendingProps.children,h),pm(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&wt&&((S=y=an)&&(y=lH(y,u.type,u.pendingProps,Ti),y!==null?(u.stateNode=y,fr=u,an=Ri(y.firstChild),Ti=!1,S=!0):S=!1),S||eo(u)),pe(u),S=u.type,k=u.pendingProps,T=s!==null?s.memoizedProps:null,y=k.children,Jb(S,k)?y=null:T!==null&&Jb(S,T)&&(u.flags|=32),u.memoizedState!==null&&(S=Xx(s,u,jK,null,null,h),Tf._currentValue=S),pm(s,u),pr(s,u,y,h),u.child;case 6:return s===null&&wt&&((s=h=an)&&(h=cH(h,u.pendingProps,Ti),h!==null?(u.stateNode=h,fr=u,an=null,s=!0):s=!1),s||eo(u)),null;case 13:return b_(s,u,h);case 4:return je(u,u.stateNode.containerInfo),y=u.pendingProps,s===null?u.child=Sl(u,null,y,h):pr(s,u,y,h),u.child;case 11:return d_(s,u,u.type,u.pendingProps,h);case 7:return pr(s,u,u.pendingProps,h),u.child;case 8:return pr(s,u,u.pendingProps.children,h),u.child;case 12:return pr(s,u,u.pendingProps.children,h),u.child;case 10:return y=u.pendingProps,to(u,u.type,y.value),pr(s,u,y.children,h),u.child;case 9:return S=u.type._context,y=u.pendingProps.children,vl(u),S=hr(S),y=y(S),u.flags|=1,pr(s,u,y,h),u.child;case 14:return f_(s,u,u.type,u.pendingProps,h);case 15:return h_(s,u,u.type,u.pendingProps,h);case 19:return S_(s,u,h);case 31:return PK(s,u,h);case 22:return p_(s,u,h,u.pendingProps);case 24:return vl(u),y=hr(qn),s===null?(S=qx(),S===null&&(S=Wt,k=Bx(),S.pooledCache=k,k.refCount++,k!==null&&(S.pooledCacheLanes|=h),S=k),u.memoizedState={parent:y,cache:S},Kx(u),to(u,qn,S)):((s.lanes&h)!==0&&(Hx(s,u),ff(u,null,null,h),df()),S=s.memoizedState,k=u.memoizedState,S.parent!==y?(S={parent:y,cache:y},u.memoizedState=S,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=S),to(u,qn,y)):(y=k.cache,to(u,qn,y),y!==S.cache&&$x(u,[qn],h,!0))),pr(s,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function ms(s){s.flags|=4}function Cb(s,u,h,y,S){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(S&335544128)===S)if(s.stateNode.complete)s.flags|=8192;else if(Y_())s.flags|=8192;else throw wl=Jp,Fx}else s.flags&=-16777217}function N_(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!$P(u))if(Y_())s.flags|=8192;else throw wl=Jp,Fx}function gm(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?_p():536870912,s.lanes|=u,su|=u)}function vf(s,u){if(!wt)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function sn(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,y=0;if(u)for(var S=s.child;S!==null;)h|=S.lanes|S.childLanes,y|=S.subtreeFlags&65011712,y|=S.flags&65011712,S.return=s,S=S.sibling;else for(S=s.child;S!==null;)h|=S.lanes|S.childLanes,y|=S.subtreeFlags,y|=S.flags,S.return=s,S=S.sibling;return s.subtreeFlags|=y,s.childLanes=h,u}function zK(s,u,h){var y=u.pendingProps;switch(Rx(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(u),null;case 1:return sn(u),null;case 3:return h=u.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),u.memoizedState.cache!==y&&(u.flags|=2048),ds(qn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Vc(u)?ms(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ix())),sn(u),null;case 26:var S=u.type,k=u.memoizedState;return s===null?(ms(u),k!==null?(sn(u),N_(u,k)):(sn(u),Cb(u,S,null,y,h))):k?k!==s.memoizedState?(ms(u),sn(u),N_(u,k)):(sn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==y&&ms(u),sn(u),Cb(u,S,s,y,h)),null;case 27:if(Ee(u),h=re.current,S=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&ms(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return sn(u),null}s=V.current,Vc(u)?rE(u):(s=PP(S,y,h),u.stateNode=s,ms(u))}return sn(u),null;case 5:if(Ee(u),S=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&ms(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return sn(u),null}if(k=V.current,Vc(u))rE(u);else{var T=Pm(re.current);switch(k){case 1:k=T.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:k=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":k=T.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":k=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":k=T.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof y.is=="string"?T.createElement("select",{is:y.is}):T.createElement("select"),y.multiple?k.multiple=!0:y.size&&(k.size=y.size);break;default:k=typeof y.is=="string"?T.createElement(S,{is:y.is}):T.createElement(S)}}k[et]=u,k[kt]=y;e:for(T=u.child;T!==null;){if(T.tag===5||T.tag===6)k.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===u)break e;for(;T.sibling===null;){if(T.return===null||T.return===u)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}u.stateNode=k;e:switch(mr(k,S,y),S){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ms(u)}}return sn(u),Cb(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,h),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==y&&ms(u);else{if(typeof y!="string"&&u.stateNode===null)throw Error(r(166));if(s=re.current,Vc(u)){if(s=u.stateNode,h=u.memoizedProps,y=null,S=fr,S!==null)switch(S.tag){case 27:case 5:y=S.memoizedProps}s[et]=u,s=!!(s.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||bP(s.nodeValue,h)),s||eo(u,!0)}else s=Pm(s).createTextNode(y),s[et]=u,u.stateNode=s}return sn(u),null;case 31:if(h=u.memoizedState,s===null||s.memoizedState!==null){if(y=Vc(u),h!==null){if(s===null){if(!y)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[et]=u}else gl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;sn(u),s=!1}else h=Ix(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return u.flags&256?(fi(u),u):(fi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return sn(u),null;case 13:if(y=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=Vc(u),y!==null&&y.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=u.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[et]=u}else gl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;sn(u),S=!1}else S=Ix(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return u.flags&256?(fi(u),u):(fi(u),null)}return fi(u),(u.flags&128)!==0?(u.lanes=h,u):(h=y!==null,s=s!==null&&s.memoizedState!==null,h&&(y=u.child,S=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(S=y.alternate.memoizedState.cachePool.pool),k=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(k=y.memoizedState.cachePool.pool),k!==S&&(y.flags|=2048)),h!==s&&h&&(u.child.flags|=8192),gm(u,u.updateQueue),sn(u),null);case 4:return ee(),s===null&&Qb(u.stateNode.containerInfo),sn(u),null;case 10:return ds(u.type),sn(u),null;case 19:if(F(Dn),y=u.memoizedState,y===null)return sn(u),null;if(S=(u.flags&128)!==0,k=y.rendering,k===null)if(S)vf(y,!1);else{if(Cn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=rm(s),k!==null){for(u.flags|=128,vf(y,!1),s=k.updateQueue,u.updateQueue=s,gm(u,s),u.subtreeFlags=0,s=h,h=u.child;h!==null;)XO(h,s),h=h.sibling;return D(Dn,Dn.current&1|2),wt&&cs(u,y.treeForkCount),u.child}s=s.sibling}y.tail!==null&&pt()>wm&&(u.flags|=128,S=!0,vf(y,!1),u.lanes=4194304)}else{if(!S)if(s=rm(k),s!==null){if(u.flags|=128,S=!0,s=s.updateQueue,u.updateQueue=s,gm(u,s),vf(y,!0),y.tail===null&&y.tailMode==="hidden"&&!k.alternate&&!wt)return sn(u),null}else 2*pt()-y.renderingStartTime>wm&&h!==536870912&&(u.flags|=128,S=!0,vf(y,!1),u.lanes=4194304);y.isBackwards?(k.sibling=u.child,u.child=k):(s=y.last,s!==null?s.sibling=k:u.child=k,y.last=k)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=pt(),s.sibling=null,h=Dn.current,D(Dn,S?h&1|2:h&1),wt&&cs(u,y.treeForkCount),s):(sn(u),null);case 22:case 23:return fi(u),Wx(),y=u.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(u.flags|=8192):y&&(u.flags|=8192),y?(h&536870912)!==0&&(u.flags&128)===0&&(sn(u),u.subtreeFlags&6&&(u.flags|=8192)):sn(u),h=u.updateQueue,h!==null&&gm(u,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==h&&(u.flags|=2048),s!==null&&F(xl),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),ds(qn),sn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function RK(s,u){switch(Rx(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return ds(qn),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(fi(u),u.alternate===null)throw Error(r(340));gl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(fi(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));gl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return F(Dn),null;case 4:return ee(),null;case 10:return ds(u.type),null;case 22:case 23:return fi(u),Wx(),s!==null&&F(xl),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return ds(qn),null;case 25:return null;default:return null}}function k_(s,u){switch(Rx(u),u.tag){case 3:ds(qn),ee();break;case 26:case 27:case 5:Ee(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&fi(u);break;case 13:fi(u);break;case 19:F(Dn);break;case 10:ds(u.type);break;case 22:case 23:fi(u),Wx(),s!==null&&F(xl);break;case 24:ds(qn)}}function xf(s,u){try{var h=u.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&s)===s){y=void 0;var k=h.create,T=h.inst;y=k(),T.destroy=y}h=h.next}while(h!==S)}}catch($){Lt(u,u.return,$)}}function oo(s,u,h){try{var y=u.updateQueue,S=y!==null?y.lastEffect:null;if(S!==null){var k=S.next;y=k;do{if((y.tag&s)===s){var T=y.inst,$=T.destroy;if($!==void 0){T.destroy=void 0,S=u;var G=h,ae=$;try{ae()}catch(ge){Lt(S,G,ge)}}}y=y.next}while(y!==k)}}catch(ge){Lt(u,u.return,ge)}}function C_(s){var u=s.updateQueue;if(u!==null){var h=s.stateNode;try{gE(u,h)}catch(y){Lt(s,s.return,y)}}}function A_(s,u,h){h.props=Nl(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(y){Lt(s,u,y)}}function bf(s,u){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof h=="function"?s.refCleanup=h(y):h.current=y}}catch(S){Lt(s,u,S)}}function Aa(s,u){var h=s.ref,y=s.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(S){Lt(s,u,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Lt(s,u,S)}else h.current=null}function O_(s){var u=s.type,h=s.memoizedProps,y=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(S){Lt(s,s.return,S)}}function Ab(s,u,h){try{var y=s.stateNode;nH(y,s.type,h,u),y[kt]=u}catch(S){Lt(s,s.return,S)}}function E_(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&mo(s.type)||s.tag===4}function Ob(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||E_(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&&mo(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 Eb(s,u,h){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(s),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=ss));else if(y!==4&&(y===27&&mo(s.type)&&(h=s.stateNode,u=null),s=s.child,s!==null))for(Eb(s,u,h),s=s.sibling;s!==null;)Eb(s,u,h),s=s.sibling}function ym(s,u,h){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?h.insertBefore(s,u):h.appendChild(s);else if(y!==4&&(y===27&&mo(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(ym(s,u,h),s=s.sibling;s!==null;)ym(s,u,h),s=s.sibling}function __(s){var u=s.stateNode,h=s.memoizedProps;try{for(var y=s.type,S=u.attributes;S.length;)u.removeAttributeNode(S[0]);mr(u,y,h),u[et]=s,u[kt]=h}catch(k){Lt(s,s.return,k)}}var gs=!1,Hn=!1,_b=!1,P_=typeof WeakSet=="function"?WeakSet:Set,ar=null;function DK(s,u){if(s=s.containerInfo,Zb=Lm,s=FO(s),jx(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var S=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var T=0,$=-1,G=-1,ae=0,ge=0,we=s,le=null;t:for(;;){for(var ue;we!==h||S!==0&&we.nodeType!==3||($=T+S),we!==k||y!==0&&we.nodeType!==3||(G=T+y),we.nodeType===3&&(T+=we.nodeValue.length),(ue=we.firstChild)!==null;)le=we,we=ue;for(;;){if(we===s)break t;if(le===h&&++ae===S&&($=T),le===k&&++ge===y&&(G=T),(ue=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=ue}h=$===-1||G===-1?null:{start:$,end:G}}else h=null}h=h||{start:0,end:0}}else h=null;for(Xb={focusedElem:s,selectionRange:h},Lm=!1,ar=u;ar!==null;)if(u=ar,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,ar=s;else for(;ar!==null;){switch(u=ar,k=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)S=s[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,h=u,S=k.memoizedProps,k=k.memoizedState,y=h.stateNode;try{var Ie=Nl(h.type,S);s=y.getSnapshotBeforeUpdate(Ie,k),y.__reactInternalSnapshotBeforeUpdate=s}catch(Ye){Lt(h,h.return,Ye)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,h=s.nodeType,h===9)tw(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":tw(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=u.sibling,s!==null){s.return=u.return,ar=s;break}ar=u.return}}function T_(s,u,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:vs(s,h),y&4&&xf(5,h);break;case 1:if(vs(s,h),y&4)if(s=h.stateNode,u===null)try{s.componentDidMount()}catch(T){Lt(h,h.return,T)}else{var S=Nl(h.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(S,u,s.__reactInternalSnapshotBeforeUpdate)}catch(T){Lt(h,h.return,T)}}y&64&&C_(h),y&512&&bf(h,h.return);break;case 3:if(vs(s,h),y&64&&(s=h.updateQueue,s!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{gE(s,u)}catch(T){Lt(h,h.return,T)}}break;case 27:u===null&&y&4&&__(h);case 26:case 5:vs(s,h),u===null&&y&4&&O_(h),y&512&&bf(h,h.return);break;case 12:vs(s,h);break;case 31:vs(s,h),y&4&&D_(s,h);break;case 13:vs(s,h),y&4&&I_(s,h),y&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=KK.bind(null,h),uH(s,h))));break;case 22:if(y=h.memoizedState!==null||gs,!y){u=u!==null&&u.memoizedState!==null||Hn,S=gs;var k=Hn;gs=y,(Hn=u)&&!k?xs(s,h,(h.subtreeFlags&8772)!==0):vs(s,h),gs=S,Hn=k}break;case 30:break;default:vs(s,h)}}function z_(s){var u=s.alternate;u!==null&&(s.alternate=null,z_(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Na(u)),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 fn=null,Vr=!1;function ys(s,u,h){for(h=h.child;h!==null;)R_(s,u,h),h=h.sibling}function R_(s,u,h){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(vn,h)}catch{}switch(h.tag){case 26:Hn||Aa(h,u),ys(s,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Hn||Aa(h,u);var y=fn,S=Vr;mo(h.type)&&(fn=h.stateNode,Vr=!1),ys(s,u,h),Ef(h.stateNode),fn=y,Vr=S;break;case 5:Hn||Aa(h,u);case 6:if(y=fn,S=Vr,fn=null,ys(s,u,h),fn=y,Vr=S,fn!==null)if(Vr)try{(fn.nodeType===9?fn.body:fn.nodeName==="HTML"?fn.ownerDocument.body:fn).removeChild(h.stateNode)}catch(k){Lt(h,u,k)}else try{fn.removeChild(h.stateNode)}catch(k){Lt(h,u,k)}break;case 18:fn!==null&&(Vr?(s=fn,CP(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),pu(s)):CP(fn,h.stateNode));break;case 4:y=fn,S=Vr,fn=h.stateNode.containerInfo,Vr=!0,ys(s,u,h),fn=y,Vr=S;break;case 0:case 11:case 14:case 15:oo(2,h,u),Hn||oo(4,h,u),ys(s,u,h);break;case 1:Hn||(Aa(h,u),y=h.stateNode,typeof y.componentWillUnmount=="function"&&A_(h,u,y)),ys(s,u,h);break;case 21:ys(s,u,h);break;case 22:Hn=(y=Hn)||h.memoizedState!==null,ys(s,u,h),Hn=y;break;default:ys(s,u,h)}}function D_(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{pu(s)}catch(h){Lt(u,u.return,h)}}}function I_(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{pu(s)}catch(h){Lt(u,u.return,h)}}function IK(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new P_),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new P_),u;default:throw Error(r(435,s.tag))}}function vm(s,u){var h=IK(s);u.forEach(function(y){if(!h.has(y)){h.add(y);var S=HK.bind(null,s,y);y.then(S,S)}})}function Qr(s,u){var h=u.deletions;if(h!==null)for(var y=0;y<h.length;y++){var S=h[y],k=s,T=u,$=T;e:for(;$!==null;){switch($.tag){case 27:if(mo($.type)){fn=$.stateNode,Vr=!1;break e}break;case 5:fn=$.stateNode,Vr=!1;break e;case 3:case 4:fn=$.stateNode.containerInfo,Vr=!0;break e}$=$.return}if(fn===null)throw Error(r(160));R_(k,T,S),fn=null,Vr=!1,k=S.alternate,k!==null&&(k.return=null),S.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)M_(u,s),u=u.sibling}var aa=null;function M_(s,u){var h=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Qr(u,s),Wr(s),y&4&&(oo(3,s,s.return),xf(3,s),oo(5,s,s.return));break;case 1:Qr(u,s),Wr(s),y&512&&(Hn||h===null||Aa(h,h.return)),y&64&&gs&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var S=aa;if(Qr(u,s),Wr(s),y&512&&(Hn||h===null||Aa(h,h.return)),y&4){var k=h!==null?h.memoizedState:null;if(y=s.memoizedState,h===null)if(y===null)if(s.stateNode===null){e:{y=s.type,h=s.memoizedProps,S=S.ownerDocument||S;t:switch(y){case"title":k=S.getElementsByTagName("title")[0],(!k||k[ll]||k[et]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=S.createElement(y),S.head.insertBefore(k,S.querySelector("head > title"))),mr(k,y,h),k[et]=s,xn(k),y=k;break e;case"link":var T=MP("link","href",S).get(y+(h.href||""));if(T){for(var $=0;$<T.length;$++)if(k=T[$],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)){T.splice($,1);break t}}k=S.createElement(y),mr(k,y,h),S.head.appendChild(k);break;case"meta":if(T=MP("meta","content",S).get(y+(h.content||""))){for($=0;$<T.length;$++)if(k=T[$],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)){T.splice($,1);break t}}k=S.createElement(y),mr(k,y,h),S.head.appendChild(k);break;default:throw Error(r(468,y))}k[et]=s,xn(k),y=k}s.stateNode=y}else LP(S,s.type,s.stateNode);else s.stateNode=IP(S,y,s.memoizedProps);else k!==y?(k===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):k.count--,y===null?LP(S,s.type,s.stateNode):IP(S,y,s.memoizedProps)):y===null&&s.stateNode!==null&&Ab(s,s.memoizedProps,h.memoizedProps)}break;case 27:Qr(u,s),Wr(s),y&512&&(Hn||h===null||Aa(h,h.return)),h!==null&&y&4&&Ab(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Qr(u,s),Wr(s),y&512&&(Hn||h===null||Aa(h,h.return)),s.flags&32){S=s.stateNode;try{Mc(S,"")}catch(Ie){Lt(s,s.return,Ie)}}y&4&&s.stateNode!=null&&(S=s.memoizedProps,Ab(s,S,h!==null?h.memoizedProps:S)),y&1024&&(_b=!0);break;case 6:if(Qr(u,s),Wr(s),y&4){if(s.stateNode===null)throw Error(r(162));y=s.memoizedProps,h=s.stateNode;try{h.nodeValue=y}catch(Ie){Lt(s,s.return,Ie)}}break;case 3:if(Rm=null,S=aa,aa=Tm(u.containerInfo),Qr(u,s),aa=S,Wr(s),y&4&&h!==null&&h.memoizedState.isDehydrated)try{pu(u.containerInfo)}catch(Ie){Lt(s,s.return,Ie)}_b&&(_b=!1,L_(s));break;case 4:y=aa,aa=Tm(s.stateNode.containerInfo),Qr(u,s),Wr(s),aa=y;break;case 12:Qr(u,s),Wr(s);break;case 31:Qr(u,s),Wr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,vm(s,y)));break;case 13:Qr(u,s),Wr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(bm=pt()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,vm(s,y)));break;case 22:S=s.memoizedState!==null;var G=h!==null&&h.memoizedState!==null,ae=gs,ge=Hn;if(gs=ae||S,Hn=ge||G,Qr(u,s),Hn=ge,gs=ae,Wr(s),y&8192)e:for(u=s.stateNode,u._visibility=S?u._visibility&-2:u._visibility|1,S&&(h===null||G||gs||Hn||kl(s)),h=null,u=s;;){if(u.tag===5||u.tag===26){if(h===null){G=h=u;try{if(k=G.stateNode,S)T=k.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{$=G.stateNode;var we=G.memoizedProps.style,le=we!=null&&we.hasOwnProperty("display")?we.display:null;$.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ie){Lt(G,G.return,Ie)}}}else if(u.tag===6){if(h===null){G=u;try{G.stateNode.nodeValue=S?"":G.memoizedProps}catch(Ie){Lt(G,G.return,Ie)}}}else if(u.tag===18){if(h===null){G=u;try{var ue=G.stateNode;S?AP(ue,!0):AP(G.stateNode,!1)}catch(Ie){Lt(G,G.return,Ie)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}y&4&&(y=s.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,vm(s,h))));break;case 19:Qr(u,s),Wr(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,vm(s,y)));break;case 30:break;case 21:break;default:Qr(u,s),Wr(s)}}function Wr(s){var u=s.flags;if(u&2){try{for(var h,y=s.return;y!==null;){if(E_(y)){h=y;break}y=y.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var S=h.stateNode,k=Ob(s);ym(s,k,S);break;case 5:var T=h.stateNode;h.flags&32&&(Mc(T,""),h.flags&=-33);var $=Ob(s);ym(s,$,T);break;case 3:case 4:var G=h.stateNode.containerInfo,ae=Ob(s);Eb(s,ae,G);break;default:throw Error(r(161))}}catch(ge){Lt(s,s.return,ge)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function L_(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;L_(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function vs(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)T_(s,u.alternate,u),u=u.sibling}function kl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:oo(4,u,u.return),kl(u);break;case 1:Aa(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&A_(u,u.return,h),kl(u);break;case 27:Ef(u.stateNode);case 26:case 5:Aa(u,u.return),kl(u);break;case 22:u.memoizedState===null&&kl(u);break;case 30:kl(u);break;default:kl(u)}s=s.sibling}}function xs(s,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var y=u.alternate,S=s,k=u,T=k.flags;switch(k.tag){case 0:case 11:case 15:xs(S,k,h),xf(4,k);break;case 1:if(xs(S,k,h),y=k,S=y.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ae){Lt(y,y.return,ae)}if(y=k,S=y.updateQueue,S!==null){var $=y.stateNode;try{var G=S.shared.hiddenCallbacks;if(G!==null)for(S.shared.hiddenCallbacks=null,S=0;S<G.length;S++)mE(G[S],$)}catch(ae){Lt(y,y.return,ae)}}h&&T&64&&C_(k),bf(k,k.return);break;case 27:__(k);case 26:case 5:xs(S,k,h),h&&y===null&&T&4&&O_(k),bf(k,k.return);break;case 12:xs(S,k,h);break;case 31:xs(S,k,h),h&&T&4&&D_(S,k);break;case 13:xs(S,k,h),h&&T&4&&I_(S,k);break;case 22:k.memoizedState===null&&xs(S,k,h),bf(k,k.return);break;case 30:break;default:xs(S,k,h)}u=u.sibling}}function Pb(s,u){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&sf(h))}function Tb(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&sf(s))}function sa(s,u,h,y){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)$_(s,u,h,y),u=u.sibling}function $_(s,u,h,y){var S=u.flags;switch(u.tag){case 0:case 11:case 15:sa(s,u,h,y),S&2048&&xf(9,u);break;case 1:sa(s,u,h,y);break;case 3:sa(s,u,h,y),S&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&sf(s)));break;case 12:if(S&2048){sa(s,u,h,y),s=u.stateNode;try{var k=u.memoizedProps,T=k.id,$=k.onPostCommit;typeof $=="function"&&$(T,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(G){Lt(u,u.return,G)}}else sa(s,u,h,y);break;case 31:sa(s,u,h,y);break;case 13:sa(s,u,h,y);break;case 23:break;case 22:k=u.stateNode,T=u.alternate,u.memoizedState!==null?k._visibility&2?sa(s,u,h,y):wf(s,u):k._visibility&2?sa(s,u,h,y):(k._visibility|=2,ru(s,u,h,y,(u.subtreeFlags&10256)!==0||!1)),S&2048&&Pb(T,u);break;case 24:sa(s,u,h,y),S&2048&&Tb(u.alternate,u);break;default:sa(s,u,h,y)}}function ru(s,u,h,y,S){for(S=S&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,T=u,$=h,G=y,ae=T.flags;switch(T.tag){case 0:case 11:case 15:ru(k,T,$,G,S),xf(8,T);break;case 23:break;case 22:var ge=T.stateNode;T.memoizedState!==null?ge._visibility&2?ru(k,T,$,G,S):wf(k,T):(ge._visibility|=2,ru(k,T,$,G,S)),S&&ae&2048&&Pb(T.alternate,T);break;case 24:ru(k,T,$,G,S),S&&ae&2048&&Tb(T.alternate,T);break;default:ru(k,T,$,G,S)}u=u.sibling}}function wf(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=s,y=u,S=y.flags;switch(y.tag){case 22:wf(h,y),S&2048&&Pb(y.alternate,y);break;case 24:wf(h,y),S&2048&&Tb(y.alternate,y);break;default:wf(h,y)}u=u.sibling}}var Sf=8192;function iu(s,u,h){if(s.subtreeFlags&Sf)for(s=s.child;s!==null;)B_(s,u,h),s=s.sibling}function B_(s,u,h){switch(s.tag){case 26:iu(s,u,h),s.flags&Sf&&s.memoizedState!==null&&SH(h,aa,s.memoizedState,s.memoizedProps);break;case 5:iu(s,u,h);break;case 3:case 4:var y=aa;aa=Tm(s.stateNode.containerInfo),iu(s,u,h),aa=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=Sf,Sf=16777216,iu(s,u,h),Sf=y):iu(s,u,h));break;default:iu(s,u,h)}}function U_(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function jf(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var y=u[h];ar=y,F_(y,s)}U_(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)q_(s),s=s.sibling}function q_(s){switch(s.tag){case 0:case 11:case 15:jf(s),s.flags&2048&&oo(9,s,s.return);break;case 3:jf(s);break;case 12:jf(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,xm(s)):jf(s);break;default:jf(s)}}function xm(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var y=u[h];ar=y,F_(y,s)}U_(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:oo(8,u,u.return),xm(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,xm(u));break;default:xm(u)}s=s.sibling}}function F_(s,u){for(;ar!==null;){var h=ar;switch(h.tag){case 0:case 11:case 15:oo(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:sf(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,ar=y;else e:for(h=s;ar!==null;){y=ar;var S=y.sibling,k=y.return;if(z_(y),y===h){ar=null;break e}if(S!==null){S.return=k,ar=S;break e}ar=k}}}var MK={getCacheForType:function(s){var u=hr(qn),h=u.data.get(s);return h===void 0&&(h=s(),u.data.set(s,h)),h},cacheSignal:function(){return hr(qn).controller.signal}},LK=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Wt=null,mt=null,xt=0,Mt=0,hi=null,lo=!1,au=!1,zb=!1,bs=0,Cn=0,co=0,Cl=0,Rb=0,pi=0,su=0,Nf=null,Yr=null,Db=!1,bm=0,K_=0,wm=1/0,Sm=null,uo=null,Zn=0,fo=null,ou=null,ws=0,Ib=0,Mb=null,H_=null,kf=0,Lb=null;function mi(){return(Tt&2)!==0&&xt!==0?xt&-xt:K.T!==null?Kb():Vd()}function G_(){if(pi===0)if((xt&536870912)===0||wt){var s=Ni;Ni<<=1,(Ni&3932160)===0&&(Ni=262144),pi=s}else pi=536870912;return s=di.current,s!==null&&(s.flags|=32),pi}function Zr(s,u,h){(s===Wt&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)&&(lu(s,0),ho(s,xt,pi,!1)),Vs(s,h),((Tt&2)===0||s!==Wt)&&(s===Wt&&((Tt&2)===0&&(Cl|=h),Cn===4&&ho(s,xt,pi,!1)),Oa(s))}function V_(s,u,h){if((Tt&6)!==0)throw Error(r(327));var y=!h&&(u&127)===0&&(u&s.expiredLanes)===0||ta(s,u),S=y?UK(s,u):Bb(s,u,!0),k=y;do{if(S===0){au&&!y&&ho(s,u,0,!1);break}else{if(h=s.current.alternate,k&&!$K(h)){S=Bb(s,u,!1),k=!1;continue}if(S===2){if(k=u,s.errorRecoveryDisabledLanes&k)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){u=T;e:{var $=s;S=Nf;var G=$.current.memoizedState.isDehydrated;if(G&&(lu($,T).flags|=256),T=Bb($,T,!1),T!==2){if(zb&&!G){$.errorRecoveryDisabledLanes|=k,Cl|=k,S=4;break e}k=Yr,Yr=S,k!==null&&(Yr===null?Yr=k:Yr.push.apply(Yr,k))}S=T}if(k=!1,S!==2)continue}}if(S===1){lu(s,0),ho(s,u,0,!0);break}e:{switch(y=s,k=S,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:ho(y,u,pi,!lo);break e;case 2:Yr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(S=bm+300-pt(),10<S)){if(ho(y,u,pi,!lo),Kr(y,0,!0)!==0)break e;ws=u,y.timeoutHandle=NP(Q_.bind(null,y,h,Yr,Sm,Db,u,pi,Cl,su,lo,k,"Throttled",-0,0),S);break e}Q_(y,h,Yr,Sm,Db,u,pi,Cl,su,lo,k,null,-0,0)}}break}while(!0);Oa(s)}function Q_(s,u,h,y,S,k,T,$,G,ae,ge,we,le,ue){if(s.timeoutHandle=-1,we=u.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ss},B_(u,k,we);var Ie=(k&62914560)===k?bm-pt():(k&4194048)===k?K_-pt():0;if(Ie=jH(we,Ie),Ie!==null){ws=k,s.cancelPendingCommit=Ie(nP.bind(null,s,u,k,h,y,S,T,$,G,ge,we,null,le,ue)),ho(s,k,T,!ae);return}}nP(s,u,k,h,y,S,T,$,G)}function $K(s){for(var u=s;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var S=h[y],k=S.getSnapshot;S=S.value;try{if(!ci(k(),S))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function ho(s,u,h,y){u&=~Rb,u&=~Cl,s.suspendedLanes|=u,s.pingedLanes&=~u,y&&(s.warmLanes|=u),y=s.expirationTimes;for(var S=u;0<S;){var k=31-de(S),T=1<<k;y[k]=-1,S&=~T}h!==0&&Kd(s,h,u)}function jm(){return(Tt&6)===0?(Cf(0),!1):!0}function $b(){if(mt!==null){if(Mt===0)var s=mt.return;else s=mt,us=yl=null,tb(s),Xc=null,lf=0,s=mt;for(;s!==null;)k_(s.alternate,s),s=s.return;mt=null}}function lu(s,u){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,aH(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),ws=0,$b(),Wt=s,mt=h=ls(s.current,null),xt=u,Mt=0,hi=null,lo=!1,au=ta(s,u),zb=!1,su=pi=Rb=Cl=co=Cn=0,Yr=Nf=null,Db=!1,(u&8)!==0&&(u|=u&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=u;0<y;){var S=31-de(y),k=1<<S;u|=s[S],y&=~k}return bs=u,Kp(),h}function W_(s,u){st=null,K.H=gf,u===Zc||u===Xp?(u=dE(),Mt=3):u===Fx?(u=dE(),Mt=4):Mt=u===yb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,hi=u,mt===null&&(Cn=1,fm(s,Ei(u,s.current)))}function Y_(){var s=di.current;return s===null?!0:(xt&4194048)===xt?zi===null:(xt&62914560)===xt||(xt&536870912)!==0?s===zi:!1}function Z_(){var s=K.H;return K.H=gf,s===null?gf:s}function X_(){var s=K.A;return K.A=MK,s}function Nm(){Cn=4,lo||(xt&4194048)!==xt&&di.current!==null||(au=!0),(co&134217727)===0&&(Cl&134217727)===0||Wt===null||ho(Wt,xt,pi,!1)}function Bb(s,u,h){var y=Tt;Tt|=2;var S=Z_(),k=X_();(Wt!==s||xt!==u)&&(Sm=null,lu(s,u)),u=!1;var T=Cn;e:do try{if(Mt!==0&&mt!==null){var $=mt,G=hi;switch(Mt){case 8:$b(),T=6;break e;case 3:case 2:case 9:case 6:di.current===null&&(u=!0);var ae=Mt;if(Mt=0,hi=null,cu(s,$,G,ae),h&&au){T=0;break e}break;default:ae=Mt,Mt=0,hi=null,cu(s,$,G,ae)}}BK(),T=Cn;break}catch(ge){W_(s,ge)}while(!0);return u&&s.shellSuspendCounter++,us=yl=null,Tt=y,K.H=S,K.A=k,mt===null&&(Wt=null,xt=0,Kp()),T}function BK(){for(;mt!==null;)J_(mt)}function UK(s,u){var h=Tt;Tt|=2;var y=Z_(),S=X_();Wt!==s||xt!==u?(Sm=null,wm=pt()+500,lu(s,u)):au=ta(s,u);e:do try{if(Mt!==0&&mt!==null){u=mt;var k=hi;t:switch(Mt){case 1:Mt=0,hi=null,cu(s,u,k,1);break;case 2:case 9:if(cE(k)){Mt=0,hi=null,eP(u);break}u=function(){Mt!==2&&Mt!==9||Wt!==s||(Mt=7),Oa(s)},k.then(u,u);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:cE(k)?(Mt=0,hi=null,eP(u)):(Mt=0,hi=null,cu(s,u,k,7));break;case 5:var T=null;switch(mt.tag){case 26:T=mt.memoizedState;case 5:case 27:var $=mt;if(T?$P(T):$.stateNode.complete){Mt=0,hi=null;var G=$.sibling;if(G!==null)mt=G;else{var ae=$.return;ae!==null?(mt=ae,km(ae)):mt=null}break t}}Mt=0,hi=null,cu(s,u,k,5);break;case 6:Mt=0,hi=null,cu(s,u,k,6);break;case 8:$b(),Cn=6;break e;default:throw Error(r(462))}}qK();break}catch(ge){W_(s,ge)}while(!0);return us=yl=null,K.H=y,K.A=S,Tt=h,mt!==null?0:(Wt=null,xt=0,Kp(),Cn)}function qK(){for(;mt!==null&&!Ze();)J_(mt)}function J_(s){var u=j_(s.alternate,s,bs);s.memoizedProps=s.pendingProps,u===null?km(s):mt=u}function eP(s){var u=s,h=u.alternate;switch(u.tag){case 15:case 0:u=y_(h,u,u.pendingProps,u.type,void 0,xt);break;case 11:u=y_(h,u,u.pendingProps,u.type.render,u.ref,xt);break;case 5:tb(u);default:k_(h,u),u=mt=XO(u,bs),u=j_(h,u,bs)}s.memoizedProps=s.pendingProps,u===null?km(s):mt=u}function cu(s,u,h,y){us=yl=null,tb(u),Xc=null,lf=0;var S=u.return;try{if(_K(s,S,u,h,xt)){Cn=1,fm(s,Ei(h,s.current)),mt=null;return}}catch(k){if(S!==null)throw mt=S,k;Cn=1,fm(s,Ei(h,s.current)),mt=null;return}u.flags&32768?(wt||y===1?s=!0:au||(xt&536870912)!==0?s=!1:(lo=s=!0,(y===2||y===9||y===3||y===6)&&(y=di.current,y!==null&&y.tag===13&&(y.flags|=16384))),tP(u,s)):km(u)}function km(s){var u=s;do{if((u.flags&32768)!==0){tP(u,lo);return}s=u.return;var h=zK(u.alternate,u,bs);if(h!==null){mt=h;return}if(u=u.sibling,u!==null){mt=u;return}mt=u=s}while(u!==null);Cn===0&&(Cn=5)}function tP(s,u){do{var h=RK(s.alternate,s);if(h!==null){h.flags&=32767,mt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(s=s.sibling,s!==null)){mt=s;return}mt=s=h}while(s!==null);Cn=6,mt=null}function nP(s,u,h,y,S,k,T,$,G){s.cancelPendingCommit=null;do Cm();while(Zn!==0);if((Tt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Ox,sx(s,h,k,T,$,G),s===Wt&&(mt=Wt=null,xt=0),ou=u,fo=s,ws=h,Ib=k,Mb=S,H_=y,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,GK(Me,function(){return oP(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||y){y=K.T,K.T=null,S=J.p,J.p=2,T=Tt,Tt|=4;try{DK(s,u,h)}finally{Tt=T,J.p=S,K.T=y}}Zn=1,rP(),iP(),aP()}}function rP(){if(Zn===1){Zn=0;var s=fo,u=ou,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=K.T,K.T=null;var y=J.p;J.p=2;var S=Tt;Tt|=4;try{M_(u,s);var k=Xb,T=FO(s.containerInfo),$=k.focusedElem,G=k.selectionRange;if(T!==$&&$&&$.ownerDocument&&qO($.ownerDocument.documentElement,$)){if(G!==null&&jx($)){var ae=G.start,ge=G.end;if(ge===void 0&&(ge=ae),"selectionStart"in $)$.selectionStart=ae,$.selectionEnd=Math.min(ge,$.value.length);else{var we=$.ownerDocument||document,le=we&&we.defaultView||window;if(le.getSelection){var ue=le.getSelection(),Ie=$.textContent.length,Ye=Math.min(G.start,Ie),qt=G.end===void 0?Ye:Math.min(G.end,Ie);!ue.extend&&Ye>qt&&(T=qt,qt=Ye,Ye=T);var te=UO($,Ye),Z=UO($,qt);if(te&&Z&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==Z.node||ue.focusOffset!==Z.offset)){var ie=we.createRange();ie.setStart(te.node,te.offset),ue.removeAllRanges(),Ye>qt?(ue.addRange(ie),ue.extend(Z.node,Z.offset)):(ie.setEnd(Z.node,Z.offset),ue.addRange(ie))}}}}for(we=[],ue=$;ue=ue.parentNode;)ue.nodeType===1&&we.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<we.length;$++){var xe=we[$];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Lm=!!Zb,Xb=Zb=null}finally{Tt=S,J.p=y,K.T=h}}s.current=u,Zn=2}}function iP(){if(Zn===2){Zn=0;var s=fo,u=ou,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=K.T,K.T=null;var y=J.p;J.p=2;var S=Tt;Tt|=4;try{T_(s,u.alternate,u)}finally{Tt=S,J.p=y,K.T=h}}Zn=3}}function aP(){if(Zn===4||Zn===3){Zn=0,Rt();var s=fo,u=ou,h=ws,y=H_;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Zn=5:(Zn=0,ou=fo=null,sP(s,s.pendingLanes));var S=s.pendingLanes;if(S===0&&(uo=null),Gd(h),u=u.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(vn,u,void 0,(u.current.flags&128)===128)}catch{}if(y!==null){u=K.T,S=J.p,J.p=2,K.T=null;try{for(var k=s.onRecoverableError,T=0;T<y.length;T++){var $=y[T];k($.value,{componentStack:$.stack})}}finally{K.T=u,J.p=S}}(ws&3)!==0&&Cm(),Oa(s),S=s.pendingLanes,(h&261930)!==0&&(S&42)!==0?s===Lb?kf++:(kf=0,Lb=s):kf=0,Cf(0)}}function sP(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,sf(u)))}function Cm(){return rP(),iP(),aP(),oP()}function oP(){if(Zn!==5)return!1;var s=fo,u=Ib;Ib=0;var h=Gd(ws),y=K.T,S=J.p;try{J.p=32>h?32:h,K.T=null,h=Mb,Mb=null;var k=fo,T=ws;if(Zn=0,ou=fo=null,ws=0,(Tt&6)!==0)throw Error(r(331));var $=Tt;if(Tt|=4,q_(k.current),$_(k,k.current,T,h),Tt=$,Cf(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(vn,k)}catch{}return!0}finally{J.p=S,K.T=y,sP(s,u)}}function lP(s,u,h){u=Ei(h,u),u=gb(s.stateNode,u,2),s=io(s,u,2),s!==null&&(Vs(s,2),Oa(s))}function Lt(s,u,h){if(s.tag===3)lP(s,s,h);else for(;u!==null;){if(u.tag===3){lP(u,s,h);break}else if(u.tag===1){var y=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(uo===null||!uo.has(y))){s=Ei(h,s),h=c_(2),y=io(u,h,2),y!==null&&(u_(h,y,u,s),Vs(y,2),Oa(y));break}}u=u.return}}function Ub(s,u,h){var y=s.pingCache;if(y===null){y=s.pingCache=new LK;var S=new Set;y.set(u,S)}else S=y.get(u),S===void 0&&(S=new Set,y.set(u,S));S.has(h)||(zb=!0,S.add(h),s=FK.bind(null,s,u,h),u.then(s,s))}function FK(s,u,h){var y=s.pingCache;y!==null&&y.delete(u),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Wt===s&&(xt&h)===h&&(Cn===4||Cn===3&&(xt&62914560)===xt&&300>pt()-bm?(Tt&2)===0&&lu(s,0):Rb|=h,su===xt&&(su=0)),Oa(s)}function cP(s,u){u===0&&(u=_p()),s=pl(s,u),s!==null&&(Vs(s,u),Oa(s))}function KK(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),cP(s,h)}function HK(s,u){var h=0;switch(s.tag){case 31:case 13:var y=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(u),cP(s,h)}function GK(s,u){return nn(s,u)}var Am=null,uu=null,qb=!1,Om=!1,Fb=!1,po=0;function Oa(s){s!==uu&&s.next===null&&(uu===null?Am=uu=s:uu=uu.next=s),Om=!0,qb||(qb=!0,QK())}function Cf(s,u){if(!Fb&&Om){Fb=!0;do for(var h=!1,y=Am;y!==null;){if(s!==0){var S=y.pendingLanes;if(S===0)var k=0;else{var T=y.suspendedLanes,$=y.pingedLanes;k=(1<<31-de(42|s)+1)-1,k&=S&~(T&~$),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(h=!0,hP(y,k))}else k=xt,k=Kr(y,y===Wt?k:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(k&3)===0||ta(y,k)||(h=!0,hP(y,k));y=y.next}while(h);Fb=!1}}function VK(){uP()}function uP(){Om=qb=!1;var s=0;po!==0&&iH()&&(s=po);for(var u=pt(),h=null,y=Am;y!==null;){var S=y.next,k=dP(y,u);k===0?(y.next=null,h===null?Am=S:h.next=S,S===null&&(uu=h)):(h=y,(s!==0||(k&3)!==0)&&(Om=!0)),y=S}Zn!==0&&Zn!==5||Cf(s),po!==0&&(po=0)}function dP(s,u){for(var h=s.suspendedLanes,y=s.pingedLanes,S=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var T=31-de(k),$=1<<T,G=S[T];G===-1?(($&h)===0||($&y)!==0)&&(S[T]=Sa($,u)):G<=u&&(s.expiredLanes|=$),k&=~$}if(u=Wt,h=xt,h=Kr(s,s===u?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,h===0||s===u&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&Se(y),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||ta(s,h)){if(u=h&-h,u===s.callbackPriority)return u;switch(y!==null&&Se(y),Gd(h)){case 2:case 8:h=Ne;break;case 32:h=Me;break;case 268435456:h=ht;break;default:h=Me}return y=fP.bind(null,s),h=nn(h,y),s.callbackPriority=u,s.callbackNode=h,u}return y!==null&&y!==null&&Se(y),s.callbackPriority=2,s.callbackNode=null,2}function fP(s,u){if(Zn!==0&&Zn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Cm()&&s.callbackNode!==h)return null;var y=xt;return y=Kr(s,s===Wt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:(V_(s,y,u),dP(s,pt()),s.callbackNode!=null&&s.callbackNode===h?fP.bind(null,s):null)}function hP(s,u){if(Cm())return null;V_(s,u,!0)}function QK(){sH(function(){(Tt&6)!==0?nn(ce,VK):uP()})}function Kb(){if(po===0){var s=Wc;s===0&&(s=Yn,Yn<<=1,(Yn&261888)===0&&(Yn=256)),po=s}return po}function pP(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ip(""+s)}function mP(s,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,s.id&&h.setAttribute("form",s.id),u.parentNode.insertBefore(h,u),s=new FormData(s),h.parentNode.removeChild(h),s}function WK(s,u,h,y,S){if(u==="submit"&&h&&h.stateNode===S){var k=pP((S[kt]||null).action),T=y.submitter;T&&(u=(u=T[kt]||null)?pP(u.formAction):T.getAttribute("formAction"),u!==null&&(k=u,T=null));var $=new Bp("action","action",null,y,S);s.push({event:$,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(po!==0){var G=T?mP(S,T):new FormData(S);ub(h,{pending:!0,data:G,method:S.method,action:k},null,G)}}else typeof k=="function"&&($.preventDefault(),G=T?mP(S,T):new FormData(S),ub(h,{pending:!0,data:G,method:S.method,action:k},k,G))},currentTarget:S}]})}}for(var Hb=0;Hb<Ax.length;Hb++){var Gb=Ax[Hb],YK=Gb.toLowerCase(),ZK=Gb[0].toUpperCase()+Gb.slice(1);ia(YK,"on"+ZK)}ia(GO,"onAnimationEnd"),ia(VO,"onAnimationIteration"),ia(QO,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(hK,"onTransitionRun"),ia(pK,"onTransitionStart"),ia(mK,"onTransitionCancel"),ia(WO,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("onPointerLeave",["pointerout","pointerover"]),is("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),is("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),is("onBeforeInput",["compositionend","keypress","textInput","paste"]),is("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),is("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),is("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Af="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(" "),XK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Af));function gP(s,u){u=(u&4)!==0;for(var h=0;h<s.length;h++){var y=s[h],S=y.event;y=y.listeners;e:{var k=void 0;if(u)for(var T=y.length-1;0<=T;T--){var $=y[T],G=$.instance,ae=$.currentTarget;if($=$.listener,G!==k&&S.isPropagationStopped())break e;k=$,S.currentTarget=ae;try{k(S)}catch(ge){Fp(ge)}S.currentTarget=null,k=G}else for(T=0;T<y.length;T++){if($=y[T],G=$.instance,ae=$.currentTarget,$=$.listener,G!==k&&S.isPropagationStopped())break e;k=$,S.currentTarget=ae;try{k(S)}catch(ge){Fp(ge)}S.currentTarget=null,k=G}}}}function gt(s,u){var h=u[ja];h===void 0&&(h=u[ja]=new Set);var y=s+"__bubble";h.has(y)||(yP(u,s,2,!1),h.add(y))}function Vb(s,u,h){var y=0;u&&(y|=4),yP(h,s,y,u)}var Em="_reactListening"+Math.random().toString(36).slice(2);function Qb(s){if(!s[Em]){s[Em]=!0,cl.forEach(function(h){h!=="selectionchange"&&(XK.has(h)||Vb(h,!1,s),Vb(h,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Em]||(u[Em]=!0,Vb("selectionchange",!1,u))}}function yP(s,u,h,y){switch(GP(u)){case 2:var S=CH;break;case 8:S=AH;break;default:S=cw}h=S.bind(null,u,h,s),S=void 0,!px||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(S=!0),y?S!==void 0?s.addEventListener(u,h,{capture:!0,passive:S}):s.addEventListener(u,h,!0):S!==void 0?s.addEventListener(u,h,{passive:S}):s.addEventListener(u,h,!1)}function Wb(s,u,h,y,S){var k=y;if((u&1)===0&&(u&2)===0&&y!==null)e:for(;;){if(y===null)return;var T=y.tag;if(T===3||T===4){var $=y.stateNode.containerInfo;if($===S)break;if(T===4)for(T=y.return;T!==null;){var G=T.tag;if((G===3||G===4)&&T.stateNode.containerInfo===S)return;T=T.return}for(;$!==null;){if(T=ki($),T===null)return;if(G=T.tag,G===5||G===6||G===26||G===27){y=k=T;continue e}$=$.parentNode}}y=y.return}SO(function(){var ae=k,ge=fx(h),we=[];e:{var le=YO.get(s);if(le!==void 0){var ue=Bp,Ie=s;switch(s){case"keypress":if(Lp(h)===0)break e;case"keydown":case"keyup":ue=H9;break;case"focusin":Ie="focus",ue=vx;break;case"focusout":Ie="blur",ue=vx;break;case"beforeblur":case"afterblur":ue=vx;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=kO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=z9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Q9;break;case GO:case VO:case QO:ue=I9;break;case WO:ue=Y9;break;case"scroll":case"scrollend":ue=P9;break;case"wheel":ue=X9;break;case"copy":case"cut":case"paste":ue=L9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=AO;break;case"toggle":case"beforetoggle":ue=eK}var Ye=(u&4)!==0,qt=!Ye&&(s==="scroll"||s==="scrollend"),te=Ye?le!==null?le+"Capture":null:le;Ye=[];for(var Z=ae,ie;Z!==null;){var xe=Z;if(ie=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ie===null||te===null||(xe=Qd(Z,te),xe!=null&&Ye.push(Of(Z,xe,ie))),qt)break;Z=Z.return}0<Ye.length&&(le=new ue(le,Ie,null,h,ge),we.push({event:le,listeners:Ye}))}}if((u&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",ue=s==="mouseout"||s==="pointerout",le&&h!==dx&&(Ie=h.relatedTarget||h.fromElement)&&(ki(Ie)||Ie[Rn]))break e;if((ue||le)&&(le=ge.window===ge?ge:(le=ge.ownerDocument)?le.defaultView||le.parentWindow:window,ue?(Ie=h.relatedTarget||h.toElement,ue=ae,Ie=Ie?ki(Ie):null,Ie!==null&&(qt=a(Ie),Ye=Ie.tag,Ie!==qt||Ye!==5&&Ye!==27&&Ye!==6)&&(Ie=null)):(ue=null,Ie=ae),ue!==Ie)){if(Ye=kO,xe="onMouseLeave",te="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=AO,xe="onPointerLeave",te="onPointerEnter",Z="pointer"),qt=ue==null?le:Ws(ue),ie=Ie==null?le:Ws(Ie),le=new Ye(xe,Z+"leave",ue,h,ge),le.target=qt,le.relatedTarget=ie,xe=null,ki(ge)===ae&&(Ye=new Ye(te,Z+"enter",Ie,h,ge),Ye.target=ie,Ye.relatedTarget=qt,xe=Ye),qt=xe,ue&&Ie)t:{for(Ye=JK,te=ue,Z=Ie,ie=0,xe=te;xe;xe=Ye(xe))ie++;xe=0;for(var He=Z;He;He=Ye(He))xe++;for(;0<ie-xe;)te=Ye(te),ie--;for(;0<xe-ie;)Z=Ye(Z),xe--;for(;ie--;){if(te===Z||Z!==null&&te===Z.alternate){Ye=te;break t}te=Ye(te),Z=Ye(Z)}Ye=null}else Ye=null;ue!==null&&vP(we,le,ue,Ye,!1),Ie!==null&&qt!==null&&vP(we,qt,Ie,Ye,!0)}}e:{if(le=ae?Ws(ae):window,ue=le.nodeName&&le.nodeName.toLowerCase(),ue==="select"||ue==="input"&&le.type==="file")var Ot=DO;else if(zO(le))if(IO)Ot=uK;else{Ot=lK;var Ue=oK}else ue=le.nodeName,!ue||ue.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&ux(ae.elementType)&&(Ot=DO):Ot=cK;if(Ot&&(Ot=Ot(s,ae))){RO(we,Ot,h,ge);break e}Ue&&Ue(s,le,ae),s==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&cx(le,"number",le.value)}switch(Ue=ae?Ws(ae):window,s){case"focusin":(zO(Ue)||Ue.contentEditable==="true")&&(Uc=Ue,Nx=ae,nf=null);break;case"focusout":nf=Nx=Uc=null;break;case"mousedown":kx=!0;break;case"contextmenu":case"mouseup":case"dragend":kx=!1,KO(we,h,ge);break;case"selectionchange":if(fK)break;case"keydown":case"keyup":KO(we,h,ge)}var ot;if(bx)e:{switch(s){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Bc?PO(s,h)&&(bt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(bt="onCompositionStart");bt&&(OO&&h.locale!=="ko"&&(Bc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Bc&&(ot=jO()):(Zs=ge,mx="value"in Zs?Zs.value:Zs.textContent,Bc=!0)),Ue=_m(ae,bt),0<Ue.length&&(bt=new CO(bt,s,null,h,ge),we.push({event:bt,listeners:Ue}),ot?bt.data=ot:(ot=TO(h),ot!==null&&(bt.data=ot)))),(ot=nK?rK(s,h):iK(s,h))&&(bt=_m(ae,"onBeforeInput"),0<bt.length&&(Ue=new CO("onBeforeInput","beforeinput",null,h,ge),we.push({event:Ue,listeners:bt}),Ue.data=ot)),WK(we,s,ae,h,ge)}gP(we,u)})}function Of(s,u,h){return{instance:s,listener:u,currentTarget:h}}function _m(s,u){for(var h=u+"Capture",y=[];s!==null;){var S=s,k=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||k===null||(S=Qd(s,h),S!=null&&y.unshift(Of(s,S,k)),S=Qd(s,u),S!=null&&y.push(Of(s,S,k))),s.tag===3)return y;s=s.return}return[]}function JK(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function vP(s,u,h,y,S){for(var k=u._reactName,T=[];h!==null&&h!==y;){var $=h,G=$.alternate,ae=$.stateNode;if($=$.tag,G!==null&&G===y)break;$!==5&&$!==26&&$!==27||ae===null||(G=ae,S?(ae=Qd(h,k),ae!=null&&T.unshift(Of(h,ae,G))):S||(ae=Qd(h,k),ae!=null&&T.push(Of(h,ae,G)))),h=h.return}T.length!==0&&s.push({event:u,listeners:T})}var eH=/\r\n?/g,tH=/\u0000|\uFFFD/g;function xP(s){return(typeof s=="string"?s:""+s).replace(eH,`
|
|
9
|
-
`).replace(tH,"")}function bP(s,u){return u=xP(u),xP(s)===u}function Ut(s,u,h,y,S,k){switch(h){case"children":typeof y=="string"?u==="body"||u==="textarea"&&y===""||Mc(s,y):(typeof y=="number"||typeof y=="bigint")&&u!=="body"&&Mc(s,""+y);break;case"className":Rp(s,"class",y);break;case"tabIndex":Rp(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Rp(s,h,y);break;case"style":bO(s,y,k);break;case"data":if(u!=="object"){Rp(s,"data",y);break}case"src":case"href":if(y===""&&(u!=="a"||h!=="href")){s.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(h);break}y=Ip(""+y),s.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="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"?(u!=="input"&&Ut(s,u,"name",S.name,S,null),Ut(s,u,"formEncType",S.formEncType,S,null),Ut(s,u,"formMethod",S.formMethod,S,null),Ut(s,u,"formTarget",S.formTarget,S,null)):(Ut(s,u,"encType",S.encType,S,null),Ut(s,u,"method",S.method,S,null),Ut(s,u,"target",S.target,S,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(h);break}y=Ip(""+y),s.setAttribute(h,y);break;case"onClick":y!=null&&(s.onclick=ss);break;case"onScroll":y!=null&>("scroll",s);break;case"onScrollEnd":y!=null&>("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(S.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}h=Ip(""+y),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":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,""+y):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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":y===!0?s.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(h,y):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(h,y):s.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(h):s.setAttribute(h,y);break;case"popover":gt("beforetoggle",s),gt("toggle",s),ul(s,"popover",y);break;case"xlinkActuate":as(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":as(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":as(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":as(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":as(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":as(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":as(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":as(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":as(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":ul(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=E9.get(h)||h,ul(s,h,y))}}function Yb(s,u,h,y,S,k){switch(h){case"style":bO(s,y,k);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(S.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof y=="string"?Mc(s,y):(typeof y=="number"||typeof y=="bigint")&&Mc(s,""+y);break;case"onScroll":y!=null&>("scroll",s);break;case"onScrollEnd":y!=null&>("scrollend",s);break;case"onClick":y!=null&&(s.onclick=ss);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),u=h.slice(2,S?h.length-7:void 0),k=s[kt]||null,k=k!=null?k[h]:null,typeof k=="function"&&s.removeEventListener(u,k,S),typeof y=="function")){typeof k!="function"&&k!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(u,y,S);break e}h in s?s[h]=y:y===!0?s.setAttribute(h,""):ul(s,h,y)}}}function mr(s,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",s),gt("load",s);var y=!1,S=!1,k;for(k in h)if(h.hasOwnProperty(k)){var T=h[k];if(T!=null)switch(k){case"src":y=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ut(s,u,k,T,h,null)}}S&&Ut(s,u,"srcSet",h.srcSet,h,null),y&&Ut(s,u,"src",h.src,h,null);return;case"input":gt("invalid",s);var $=k=T=S=null,G=null,ae=null;for(y in h)if(h.hasOwnProperty(y)){var ge=h[y];if(ge!=null)switch(y){case"name":S=ge;break;case"type":T=ge;break;case"checked":G=ge;break;case"defaultChecked":ae=ge;break;case"value":k=ge;break;case"defaultValue":$=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,u));break;default:Ut(s,u,y,ge,h,null)}}gO(s,k,$,G,ae,T,S,!1);return;case"select":gt("invalid",s),y=T=k=null;for(S in h)if(h.hasOwnProperty(S)&&($=h[S],$!=null))switch(S){case"value":k=$;break;case"defaultValue":T=$;break;case"multiple":y=$;default:Ut(s,u,S,$,h,null)}u=k,h=T,s.multiple=!!y,u!=null?Ic(s,!!y,u,!1):h!=null&&Ic(s,!!y,h,!0);return;case"textarea":gt("invalid",s),k=S=y=null;for(T in h)if(h.hasOwnProperty(T)&&($=h[T],$!=null))switch(T){case"value":y=$;break;case"defaultValue":S=$;break;case"children":k=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:Ut(s,u,T,$,h,null)}vO(s,y,S,k);return;case"option":for(G in h)h.hasOwnProperty(G)&&(y=h[G],y!=null)&&(G==="selected"?s.selected=y&&typeof y!="function"&&typeof y!="symbol":Ut(s,u,G,y,h,null));return;case"dialog":gt("beforetoggle",s),gt("toggle",s),gt("cancel",s),gt("close",s);break;case"iframe":case"object":gt("load",s);break;case"video":case"audio":for(y=0;y<Af.length;y++)gt(Af[y],s);break;case"image":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"embed":case"source":case"link":gt("error",s),gt("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(ae in h)if(h.hasOwnProperty(ae)&&(y=h[ae],y!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ut(s,u,ae,y,h,null)}return;default:if(ux(u)){for(ge in h)h.hasOwnProperty(ge)&&(y=h[ge],y!==void 0&&Yb(s,u,ge,y,h,void 0));return}}for($ in h)h.hasOwnProperty($)&&(y=h[$],y!=null&&Ut(s,u,$,y,h,null))}function nH(s,u,h,y){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,k=null,T=null,$=null,G=null,ae=null,ge=null;for(ue in h){var we=h[ue];if(h.hasOwnProperty(ue)&&we!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":G=we;default:y.hasOwnProperty(ue)||Ut(s,u,ue,null,y,we)}}for(var le in y){var ue=y[le];if(we=h[le],y.hasOwnProperty(le)&&(ue!=null||we!=null))switch(le){case"type":k=ue;break;case"name":S=ue;break;case"checked":ae=ue;break;case"defaultChecked":ge=ue;break;case"value":T=ue;break;case"defaultValue":$=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,u));break;default:ue!==we&&Ut(s,u,le,ue,y,we)}}lx(s,T,$,G,ae,ge,k,S);return;case"select":ue=T=$=le=null;for(k in h)if(G=h[k],h.hasOwnProperty(k)&&G!=null)switch(k){case"value":break;case"multiple":ue=G;default:y.hasOwnProperty(k)||Ut(s,u,k,null,y,G)}for(S in y)if(k=y[S],G=h[S],y.hasOwnProperty(S)&&(k!=null||G!=null))switch(S){case"value":le=k;break;case"defaultValue":$=k;break;case"multiple":T=k;default:k!==G&&Ut(s,u,S,k,y,G)}u=$,h=T,y=ue,le!=null?Ic(s,!!h,le,!1):!!y!=!!h&&(u!=null?Ic(s,!!h,u,!0):Ic(s,!!h,h?[]:"",!1));return;case"textarea":ue=le=null;for($ in h)if(S=h[$],h.hasOwnProperty($)&&S!=null&&!y.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Ut(s,u,$,null,y,S)}for(T in y)if(S=y[T],k=h[T],y.hasOwnProperty(T)&&(S!=null||k!=null))switch(T){case"value":le=S;break;case"defaultValue":ue=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:S!==k&&Ut(s,u,T,S,y,k)}yO(s,le,ue);return;case"option":for(var Ie in h)le=h[Ie],h.hasOwnProperty(Ie)&&le!=null&&!y.hasOwnProperty(Ie)&&(Ie==="selected"?s.selected=!1:Ut(s,u,Ie,null,y,le));for(G in y)le=y[G],ue=h[G],y.hasOwnProperty(G)&&le!==ue&&(le!=null||ue!=null)&&(G==="selected"?s.selected=le&&typeof le!="function"&&typeof le!="symbol":Ut(s,u,G,le,y,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 Ye in h)le=h[Ye],h.hasOwnProperty(Ye)&&le!=null&&!y.hasOwnProperty(Ye)&&Ut(s,u,Ye,null,y,le);for(ae in y)if(le=y[ae],ue=h[ae],y.hasOwnProperty(ae)&&le!==ue&&(le!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,u));break;default:Ut(s,u,ae,le,y,ue)}return;default:if(ux(u)){for(var qt in h)le=h[qt],h.hasOwnProperty(qt)&&le!==void 0&&!y.hasOwnProperty(qt)&&Yb(s,u,qt,void 0,y,le);for(ge in y)le=y[ge],ue=h[ge],!y.hasOwnProperty(ge)||le===ue||le===void 0&&ue===void 0||Yb(s,u,ge,le,y,ue);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!y.hasOwnProperty(te)&&Ut(s,u,te,null,y,le);for(we in y)le=y[we],ue=h[we],!y.hasOwnProperty(we)||le===ue||le==null&&ue==null||Ut(s,u,we,le,y,ue)}function wP(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rH(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var S=h[y],k=S.transferSize,T=S.initiatorType,$=S.duration;if(k&&$&&wP(T)){for(T=0,$=S.responseEnd,y+=1;y<h.length;y++){var G=h[y],ae=G.startTime;if(ae>$)break;var ge=G.transferSize,we=G.initiatorType;ge&&wP(we)&&(G=G.responseEnd,T+=ge*(G<$?1:($-ae)/(G-ae)))}if(--y,u+=8*(k+T)/(S.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Zb=null,Xb=null;function Pm(s){return s.nodeType===9?s:s.ownerDocument}function SP(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 jP(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function Jb(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var ew=null;function iH(){var s=window.event;return s&&s.type==="popstate"?s===ew?!1:(ew=s,!0):(ew=null,!1)}var NP=typeof setTimeout=="function"?setTimeout:void 0,aH=typeof clearTimeout=="function"?clearTimeout:void 0,kP=typeof Promise=="function"?Promise:void 0,sH=typeof queueMicrotask=="function"?queueMicrotask:typeof kP<"u"?function(s){return kP.resolve(null).then(s).catch(oH)}:NP;function oH(s){setTimeout(function(){throw s})}function mo(s){return s==="head"}function CP(s,u){var h=u,y=0;do{var S=h.nextSibling;if(s.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(y===0){s.removeChild(S),pu(u);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")Ef(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Ef(h);for(var k=h.firstChild;k;){var T=k.nextSibling,$=k.nodeName;k[ll]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&k.rel.toLowerCase()==="stylesheet"||h.removeChild(k),k=T}}else h==="body"&&Ef(s.ownerDocument.body);h=S}while(h);pu(u)}function AP(s,u){var h=s;s=0;do{var y=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=y}while(h)}function tw(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":tw(h),Na(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function lH(s,u,h,y){for(;s.nodeType===1;){var S=h;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[ll])switch(u){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!==S.rel||s.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||s.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||s.getAttribute("title")!==(S.title==null?null:S.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(S.src==null?null:S.src)||s.getAttribute("type")!==(S.type==null?null:S.type)||s.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=S.name==null?null:""+S.name;if(S.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Ri(s.nextSibling),s===null)break}return null}function cH(s,u,h){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=Ri(s.nextSibling),s===null))return null;return s}function OP(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ri(s.nextSibling),s===null))return null;return s}function nw(s){return s.data==="$?"||s.data==="$~"}function rw(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function uH(s,u){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||h.readyState!=="loading")u();else{var y=function(){u(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function Ri(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var iw=null;function EP(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(u===0)return Ri(s.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}s=s.nextSibling}return null}function _P(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return s;u--}else h!=="/$"&&h!=="/&"||u++}s=s.previousSibling}return null}function PP(s,u,h){switch(u=Pm(h),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ef(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Na(s)}var Di=new Map,TP=new Set;function Tm(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ss=J.d;J.d={f:dH,r:fH,D:hH,C:pH,L:mH,m:gH,X:vH,S:yH,M:xH};function dH(){var s=Ss.f(),u=jm();return s||u}function fH(s){var u=na(s);u!==null&&u.tag===5&&u.type==="form"?WE(u):Ss.r(s)}var du=typeof document>"u"?null:document;function zP(s,u,h){var y=du;if(y&&typeof u=="string"&&u){var S=Ai(u);S='link[rel="'+s+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),TP.has(S)||(TP.add(S),s={rel:s,crossOrigin:h,href:u},y.querySelector(S)===null&&(u=y.createElement("link"),mr(u,"link",s),xn(u),y.head.appendChild(u)))}}function hH(s){Ss.D(s),zP("dns-prefetch",s,null)}function pH(s,u){Ss.C(s,u),zP("preconnect",s,u)}function mH(s,u,h){Ss.L(s,u,h);var y=du;if(y&&s&&u){var S='link[rel="preload"][as="'+Ai(u)+'"]';u==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+Ai(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+Ai(h.imageSizes)+'"]')):S+='[href="'+Ai(s)+'"]';var k=S;switch(u){case"style":k=fu(s);break;case"script":k=hu(s)}Di.has(k)||(s=m({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:s,as:u},h),Di.set(k,s),y.querySelector(S)!==null||u==="style"&&y.querySelector(_f(k))||u==="script"&&y.querySelector(Pf(k))||(u=y.createElement("link"),mr(u,"link",s),xn(u),y.head.appendChild(u)))}}function gH(s,u){Ss.m(s,u);var h=du;if(h&&s){var y=u&&typeof u.as=="string"?u.as:"script",S='link[rel="modulepreload"][as="'+Ai(y)+'"][href="'+Ai(s)+'"]',k=S;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=hu(s)}if(!Di.has(k)&&(s=m({rel:"modulepreload",href:s},u),Di.set(k,s),h.querySelector(S)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Pf(k)))return}y=h.createElement("link"),mr(y,"link",s),xn(y),h.head.appendChild(y)}}}function yH(s,u,h){Ss.S(s,u,h);var y=du;if(y&&s){var S=Ys(y).hoistableStyles,k=fu(s);u=u||"default";var T=S.get(k);if(!T){var $={loading:0,preload:null};if(T=y.querySelector(_f(k)))$.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":u},h),(h=Di.get(k))&&aw(s,h);var G=T=y.createElement("link");xn(G),mr(G,"link",s),G._p=new Promise(function(ae,ge){G.onload=ae,G.onerror=ge}),G.addEventListener("load",function(){$.loading|=1}),G.addEventListener("error",function(){$.loading|=2}),$.loading|=4,zm(T,u,y)}T={type:"stylesheet",instance:T,count:1,state:$},S.set(k,T)}}}function vH(s,u){Ss.X(s,u);var h=du;if(h&&s){var y=Ys(h).hoistableScripts,S=hu(s),k=y.get(S);k||(k=h.querySelector(Pf(S)),k||(s=m({src:s,async:!0},u),(u=Di.get(S))&&sw(s,u),k=h.createElement("script"),xn(k),mr(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(S,k))}}function xH(s,u){Ss.M(s,u);var h=du;if(h&&s){var y=Ys(h).hoistableScripts,S=hu(s),k=y.get(S);k||(k=h.querySelector(Pf(S)),k||(s=m({src:s,async:!0,type:"module"},u),(u=Di.get(S))&&sw(s,u),k=h.createElement("script"),xn(k),mr(k,"link",s),h.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(S,k))}}function RP(s,u,h,y){var S=(S=re.current)?Tm(S):null;if(!S)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=fu(h.href),h=Ys(S).hoistableStyles,y=h.get(u),y||(y={type:"style",instance:null,count:0,state:null},h.set(u,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=fu(h.href);var k=Ys(S).hoistableStyles,T=k.get(s);if(T||(S=S.ownerDocument||S,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,T),(k=S.querySelector(_f(s)))&&!k._p&&(T.instance=k,T.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||bH(S,s,h,T.state))),u&&y===null)throw Error(r(528,""));return T}if(u&&y!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=hu(h),h=Ys(S).hoistableScripts,y=h.get(u),y||(y={type:"script",instance:null,count:0,state:null},h.set(u,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function fu(s){return'href="'+Ai(s)+'"'}function _f(s){return'link[rel="stylesheet"]['+s+"]"}function DP(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function bH(s,u,h,y){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?y.loading=1:(u=s.createElement("link"),y.preload=u,u.addEventListener("load",function(){return y.loading|=1}),u.addEventListener("error",function(){return y.loading|=2}),mr(u,"link",h),xn(u),s.head.appendChild(u))}function hu(s){return'[src="'+Ai(s)+'"]'}function Pf(s){return"script[async]"+s}function IP(s,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var y=s.querySelector('style[data-href~="'+Ai(h.href)+'"]');if(y)return u.instance=y,xn(y),y;var S=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),xn(y),mr(y,"style",S),zm(y,h.precedence,s),u.instance=y;case"stylesheet":S=fu(h.href);var k=s.querySelector(_f(S));if(k)return u.state.loading|=4,u.instance=k,xn(k),k;y=DP(h),(S=Di.get(S))&&aw(y,S),k=(s.ownerDocument||s).createElement("link"),xn(k);var T=k;return T._p=new Promise(function($,G){T.onload=$,T.onerror=G}),mr(k,"link",y),u.state.loading|=4,zm(k,h.precedence,s),u.instance=k;case"script":return k=hu(h.src),(S=s.querySelector(Pf(k)))?(u.instance=S,xn(S),S):(y=h,(S=Di.get(k))&&(y=m({},h),sw(y,S)),s=s.ownerDocument||s,S=s.createElement("script"),xn(S),mr(S,"link",y),s.head.appendChild(S),u.instance=S);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(y=u.instance,u.state.loading|=4,zm(y,h.precedence,s));return u.instance}function zm(s,u,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=y.length?y[y.length-1]:null,k=S,T=0;T<y.length;T++){var $=y[T];if($.dataset.precedence===u)k=$;else if(k!==S)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(s,u.firstChild))}function aw(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function sw(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Rm=null;function MP(s,u,h){if(Rm===null){var y=new Map,S=Rm=new Map;S.set(h,y)}else S=Rm,y=S.get(h),y||(y=new Map,S.set(h,y));if(y.has(s))return y;for(y.set(s,null),h=h.getElementsByTagName(s),S=0;S<h.length;S++){var k=h[S];if(!(k[ll]||k[et]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var T=k.getAttribute(u)||"";T=s+T;var $=y.get(T);$?$.push(k):y.set(T,[k])}}return y}function LP(s,u,h){s=s.ownerDocument||s,s.head.insertBefore(h,u==="title"?s.querySelector("head > title"):null)}function wH(s,u,h){if(h===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(s=u.disabled,typeof u.precedence=="string"&&s==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function $P(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function SH(s,u,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=fu(y.href),k=u.querySelector(_f(S));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Dm.bind(s),u.then(s,s)),h.state.loading|=4,h.instance=k,xn(k);return}k=u.ownerDocument||u,y=DP(y),(S=Di.get(S))&&aw(y,S),k=k.createElement("link"),xn(k);var T=k;T._p=new Promise(function($,G){T.onload=$,T.onerror=G}),mr(k,"link",y),h.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Dm.bind(s),u.addEventListener("load",h),u.addEventListener("error",h))}}var ow=0;function jH(s,u){return s.stylesheets&&s.count===0&&Mm(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var y=setTimeout(function(){if(s.stylesheets&&Mm(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&ow===0&&(ow=62500*rH());var S=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Mm(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>ow?50:800)+u);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(S)}}:null}function Dm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mm(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Im=null;function Mm(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Im=new Map,u.forEach(NH,s),Im=null,Dm.call(s))}function NH(s,u){if(!(u.state.loading&4)){var h=Im.get(s);if(h)var y=h.get(null);else{h=new Map,Im.set(s,h);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<S.length;k++){var T=S[k];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(h.set(T.dataset.precedence,T),y=T)}y&&h.set(null,y)}S=u.instance,T=S.getAttribute("data-precedence"),k=h.get(T)||y,k===y&&h.set(null,S),h.set(T,S),this.count++,y=Dm.bind(this),S.addEventListener("load",y),S.addEventListener("error",y),k?k.parentNode.insertBefore(S,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(S,s.firstChild)),u.state.loading|=4}}var Tf={$$typeof:C,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function kH(s,u,h,y,S,k,T,$,G){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=Gs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gs(0),this.hiddenUpdates=Gs(null),this.identifierPrefix=y,this.onUncaughtError=S,this.onCaughtError=k,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function BP(s,u,h,y,S,k,T,$,G,ae,ge,we){return s=new kH(s,u,h,T,G,ae,ge,we,$),u=1,k===!0&&(u|=24),k=ui(3,null,null,u),s.current=k,k.stateNode=s,u=Bx(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:y,isDehydrated:h,cache:u},Kx(k),s}function UP(s){return s?(s=Kc,s):Kc}function qP(s,u,h,y,S,k){S=UP(S),y.context===null?y.context=S:y.pendingContext=S,y=ro(u),y.payload={element:h},k=k===void 0?null:k,k!==null&&(y.callback=k),h=io(s,y,u),h!==null&&(Zr(h,s,u),uf(h,s,u))}function FP(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function lw(s,u){FP(s,u),(s=s.alternate)&&FP(s,u)}function KP(s){if(s.tag===13||s.tag===31){var u=pl(s,67108864);u!==null&&Zr(u,s,67108864),lw(s,67108864)}}function HP(s){if(s.tag===13||s.tag===31){var u=mi();u=Hd(u);var h=pl(s,u);h!==null&&Zr(h,s,u),lw(s,u)}}var Lm=!0;function CH(s,u,h,y){var S=K.T;K.T=null;var k=J.p;try{J.p=2,cw(s,u,h,y)}finally{J.p=k,K.T=S}}function AH(s,u,h,y){var S=K.T;K.T=null;var k=J.p;try{J.p=8,cw(s,u,h,y)}finally{J.p=k,K.T=S}}function cw(s,u,h,y){if(Lm){var S=uw(y);if(S===null)Wb(s,u,y,$m,h),VP(s,y);else if(EH(S,s,u,h,y))y.stopPropagation();else if(VP(s,y),u&4&&-1<OH.indexOf(s)){for(;S!==null;){var k=na(S);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var T=zn(k.pendingLanes);if(T!==0){var $=k;for($.pendingLanes|=2,$.entangledLanes|=2;T;){var G=1<<31-de(T);$.entanglements[1]|=G,T&=~G}Oa(k),(Tt&6)===0&&(wm=pt()+500,Cf(0))}}break;case 31:case 13:$=pl(k,2),$!==null&&Zr($,k,2),jm(),lw(k,2)}if(k=uw(y),k===null&&Wb(s,u,y,$m,h),k===S)break;S=k}S!==null&&y.stopPropagation()}else Wb(s,u,y,null,h)}}function uw(s){return s=fx(s),dw(s)}var $m=null;function dw(s){if($m=null,s=ki(s),s!==null){var u=a(s);if(u===null)s=null;else{var h=u.tag;if(h===13){if(s=o(u),s!==null)return s;s=null}else if(h===31){if(s=c(u),s!==null)return s;s=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return $m=s,null}function GP(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(Xe()){case ce:return 2;case Ne:return 8;case Me:case Ge:return 32;case ht:return 268435456;default:return 32}default:return 32}}var fw=!1,go=null,yo=null,vo=null,zf=new Map,Rf=new Map,xo=[],OH="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 VP(s,u){switch(s){case"focusin":case"focusout":go=null;break;case"dragenter":case"dragleave":yo=null;break;case"mouseover":case"mouseout":vo=null;break;case"pointerover":case"pointerout":zf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rf.delete(u.pointerId)}}function Df(s,u,h,y,S,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:h,eventSystemFlags:y,nativeEvent:k,targetContainers:[S]},u!==null&&(u=na(u),u!==null&&KP(u)),s):(s.eventSystemFlags|=y,u=s.targetContainers,S!==null&&u.indexOf(S)===-1&&u.push(S),s)}function EH(s,u,h,y,S){switch(u){case"focusin":return go=Df(go,s,u,h,y,S),!0;case"dragenter":return yo=Df(yo,s,u,h,y,S),!0;case"mouseover":return vo=Df(vo,s,u,h,y,S),!0;case"pointerover":var k=S.pointerId;return zf.set(k,Df(zf.get(k)||null,s,u,h,y,S)),!0;case"gotpointercapture":return k=S.pointerId,Rf.set(k,Df(Rf.get(k)||null,s,u,h,y,S)),!0}return!1}function QP(s){var u=ki(s.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=o(h),u!==null){s.blockedOn=u,Q(s.priority,function(){HP(h)});return}}else if(u===31){if(u=c(h),u!==null){s.blockedOn=u,Q(s.priority,function(){HP(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Bm(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var h=uw(s.nativeEvent);if(h===null){h=s.nativeEvent;var y=new h.constructor(h.type,h);dx=y,h.target.dispatchEvent(y),dx=null}else return u=na(h),u!==null&&KP(u),s.blockedOn=h,!1;u.shift()}return!0}function WP(s,u,h){Bm(s)&&h.delete(u)}function _H(){fw=!1,go!==null&&Bm(go)&&(go=null),yo!==null&&Bm(yo)&&(yo=null),vo!==null&&Bm(vo)&&(vo=null),zf.forEach(WP),Rf.forEach(WP)}function Um(s,u){s.blockedOn===u&&(s.blockedOn=null,fw||(fw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_H)))}var qm=null;function YP(s){qm!==s&&(qm=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qm===s&&(qm=null);for(var u=0;u<s.length;u+=3){var h=s[u],y=s[u+1],S=s[u+2];if(typeof y!="function"){if(dw(y||h)===null)continue;break}var k=na(h);k!==null&&(s.splice(u,3),u-=3,ub(k,{pending:!0,data:S,method:h.method,action:y},y,S))}}))}function pu(s){function u(G){return Um(G,s)}go!==null&&Um(go,s),yo!==null&&Um(yo,s),vo!==null&&Um(vo,s),zf.forEach(u),Rf.forEach(u);for(var h=0;h<xo.length;h++){var y=xo[h];y.blockedOn===s&&(y.blockedOn=null)}for(;0<xo.length&&(h=xo[0],h.blockedOn===null);)QP(h),h.blockedOn===null&&xo.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var S=h[y],k=h[y+1],T=S[kt]||null;if(typeof k=="function")T||YP(h);else if(T){var $=null;if(k&&k.hasAttribute("formAction")){if(S=k,T=k[kt]||null)$=T.formAction;else if(dw(S)!==null)continue}else $=T.action;typeof $=="function"?h[y+1]=$:(h.splice(y,3),y-=3),YP(h)}}}function ZP(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(T){return S=T})},focusReset:"manual",scroll:"manual"})}function u(){S!==null&&(S(),S=null),y||setTimeout(h,20)}function h(){if(!y&&!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 y=!1,S=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),S!==null&&(S(),S=null)}}}function hw(s){this._internalRoot=s}Fm.prototype.render=hw.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,y=mi();qP(h,y,s,u,null,null)},Fm.prototype.unmount=hw.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;qP(s.current,2,null,s,null,null),jm(),u[Rn]=null}};function Fm(s){this._internalRoot=s}Fm.prototype.unstable_scheduleHydration=function(s){if(s){var u=Vd();s={blockedOn:null,target:s,priority:u};for(var h=0;h<xo.length&&u!==0&&u<xo[h].priority;h++);xo.splice(h,0,s),h===0&&QP(s)}};var XP=t.version;if(XP!=="19.2.4")throw Error(r(527,XP,"19.2.4"));J.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(u),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var PH={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Km=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Km.isDisabled&&Km.supportsFiber)try{vn=Km.inject(PH),We=Km}catch{}}return Mf.createRoot=function(s,u){if(!i(s))throw Error(r(299));var h=!1,y="",S=a_,k=s_,T=o_;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),u=BP(s,1,!1,null,null,h,y,null,S,k,T,ZP),s[Rn]=u.current,Qb(s),new hw(u)},Mf.hydrateRoot=function(s,u,h){if(!i(s))throw Error(r(299));var y=!1,S="",k=a_,T=s_,$=o_,G=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(k=h.onUncaughtError),h.onCaughtError!==void 0&&(T=h.onCaughtError),h.onRecoverableError!==void 0&&($=h.onRecoverableError),h.formState!==void 0&&(G=h.formState)),u=BP(s,1,!0,u,h??null,y,S,G,k,T,$,ZP),u.context=UP(null),h=u.current,y=mi(),y=Hd(y),S=ro(y),S.callback=null,io(h,S,y),h=y,u.current.lanes=h,Vs(u,h),Oa(u),s[Rn]=u.current,Qb(s),new Fm(u)},Mf.version="19.2.4",Mf}var l2;function UH(){if(l2)return gw.exports;l2=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(),gw.exports=BH(),gw.exports}var qH=UH(),Sc=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(){}},FH={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},KH=class{#t=FH;#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)}},$l=new KH;function HH(e){setTimeout(e,0)}var rc=typeof window>"u"||"Deno"in globalThis;function Sr(){}function GH(e,t){return typeof e=="function"?e(t):e}function Kj(e){return typeof e=="number"&&e>=0&&e!==1/0}function p$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Io(e,t){return typeof e=="function"?e(t):e}function Bi(e,t){return typeof e=="function"?e(t):e}function c2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==BN(o,t.options))return!1}else if(!jh(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function u2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ic(t.options.mutationKey)!==ic(a))return!1}else if(!jh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function BN(e,t){return(t?.queryKeyHashFn||ic)(e)}function ic(e){return JSON.stringify(e,(t,n)=>Hj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function jh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>jh(e[n],t[n])):!1}var VH=Object.prototype.hasOwnProperty;function UN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=d2(e)&&d2(t);if(!r&&!(Hj(e)&&Hj(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:o[p],g=e[m],v=t[m];if(g===v){d[m]=g,(r?p<a:VH.call(e,m))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[m]=v;continue}const w=UN(g,v,n+1);d[m]=w,w===g&&f++}return a===c&&f===a?e:d}function Nh(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 d2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hj(e){if(!f2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!f2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function f2(e){return Object.prototype.toString.call(e)==="[object Object]"}function QH(e){return new Promise(t=>{$l.setTimeout(t,e)})}function Gj(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?UN(e,t):t}function WH(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function YH(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qN=Symbol();function m$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===qN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function FN(e,t){return typeof e=="function"?e(...t):!!e}function ZH(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 XH=class extends Sc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!rc&&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"}},KN=new XH;function Vj(){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 JH=HH;function e7(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=JH;const a=c=>{t?e.push(c):i(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var En=e7(),t7=class extends Sc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!rc&&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}},ey=new t7;function n7(e){return Math.min(1e3*2**e,3e4)}function g$(e){return(e??"online")==="online"?ey.isOnline():!0}var Qj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function y$(e){let t=!1,n=0,r;const i=Vj(),a=()=>i.status!=="pending",o=b=>{if(!a()){const j=new Qj(b);g(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>KN.isFocused()&&(e.networkMode==="always"||ey.isOnline())&&e.canRun(),p=()=>g$(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},g=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=j=>{(a()||f())&&b(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),w=()=>{if(a())return;let b;const j=n===0?e.initialPromise:void 0;try{b=j??e.fn()}catch(N){b=Promise.reject(N)}Promise.resolve(b).then(m).catch(N=>{if(a())return;const O=e.retry??(rc?0:3),C=e.retryDelay??n7,A=typeof C=="function"?C(n,N):C,P=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,N);if(t||!P){g(N);return}n++,e.onFail?.(n,N),QH(A).then(()=>f()?void 0:v()).then(()=>{t?g(N):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var v$=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kj(this.gcTime)&&(this.#t=$l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:300*1e3))}clearGcTimeout(){this.#t&&($l.clearTimeout(this.#t),this.#t=void 0)}},r7=class extends v${#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=p2(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=p2(this.options);t.data!==void 0&&(this.setState(h2(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Gj(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(Sr).catch(Sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Bi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Io(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:!p$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=m$(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=y$({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof Qj&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Qj){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...x$(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...h2(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),En.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function x$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:g$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function h2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function p2(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 HN=class extends Sc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Vj(),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),m2(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wj(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wj(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),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 Bi(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&&!Nh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&g2(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Bi(this.options.enabled,this.#e)!==Bi(t.enabled,this.#e)||Io(this.options.staleTime,this.#e)!==Io(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Bi(this.options.enabled,this.#e)!==Bi(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 a7(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(Sr)),t}#g(){this.#b();const e=Io(this.options.staleTime,this.#e);if(rc||this.#i.isStale||!Kj(e))return;const n=p$(this.#i.dataUpdatedAt,e)+1;this.#c=$l.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,!(rc||Bi(this.options.enabled,this.#e)===!1||!Kj(this.#l)||this.#l===0)&&(this.#u=$l.setInterval(()=>{(this.options.refetchIntervalInBackground||KN.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&($l.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&($l.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,g;if(t._optimisticResults){const z=this.hasListeners(),I=!z&&m2(e,t),q=z&&g2(e,n,t,r);(I||q)&&(p={...p,...x$(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:b}=p;g=p.data;let j=!1;if(t.placeholderData!==void 0&&g===void 0&&b==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(z=i.data,j=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,z!==void 0&&(b="success",g=Gj(i?.data,z,t),m=!0)}if(t.select&&g!==void 0&&!j)if(i&&g===a?.data&&t.select===this.#p)g=this.#d;else try{this.#p=t.select,g=t.select(g),g=Gj(i?.data,g,t),this.#d=g,this.#s=null}catch(z){this.#s=z}this.#s&&(v=this.#s,g=this.#d,w=Date.now(),b="error");const N=p.fetchStatus==="fetching",O=b==="pending",C=b==="error",A=O&&N,P=g!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:O,isSuccess:b==="success",isError:C,isInitialLoading:A,isLoading:A,data:g,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:C&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&P,isStale:GN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Bi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=_.data!==void 0,I=_.status==="error"&&!z,q=H=>{I?H.reject(_.error):z&&H.resolve(_.data)},U=()=>{const H=this.#o=_.promise=Vj();q(H)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&q(B);break;case"fulfilled":(I||_.data!==B.value)&&U();break;case"rejected":(!I||_.error!==B.reason)&&U();break}}return _}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),Nh(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const c=o;return this.#i[c]!==e[c]&&a.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#j(e){En.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function i7(e,t){return Bi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m2(e,t){return i7(e,t)||e.state.data!==void 0&&Wj(e,t,t.refetchOnMount)}function Wj(e,t,n){if(Bi(t.enabled,e)!==!1&&Io(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&GN(e,t)}return!1}function g2(e,t,n,r){return(e!==t||Bi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&GN(e,n)}function GN(e,t){return Bi(t.enabled,e)!==!1&&e.isStaleByTime(Io(t.staleTime,e))}function a7(e,t){return!Nh(e.getCurrentResult(),t)}function y2(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{ZH(w,()=>t.signal,()=>p=!0)},g=m$(t.options,t.fetchOptions),v=async(w,b,j)=>{if(p)return Promise.reject();if(b==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:b,direction:j?"backward":"forward",meta:t.options.meta};return m(E),E})(),C=await g(O),{maxPages:A}=t.options,P=j?YH:WH;return{pages:P(w.pages,C,A),pageParams:P(w.pageParams,b,A)}};if(i&&a.length){const w=i==="backward",b=w?s7:v2,j={pages:a,pageParams:o},N=b(r,j);c=await v(j,N,w)}else{const w=e??a.length;do{const b=d===0?o[0]??r.initialPageParam:v2(r,c);if(d>0&&b==null)break;c=await v(c,b),d++}while(d<w)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function v2(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 s7(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var o7=class extends v${#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||b$(),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=y$({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),En.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function b$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var w$=class extends Sc{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 o7({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=Hm(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=Hm(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=Hm(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=Hm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){En.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=>u2(t,n))}findAll(e={}){return this.getAll().filter(t=>u2(e,t))}notify(e){En.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return En.batch(()=>Promise.all(e.map(t=>t.continue().catch(Sr))))}};function Hm(e){return e.options.scope?.id}var l7=class extends Sc{#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),Nh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ic(n.mutationKey)!==ic(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??b$();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){En.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 x2(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function c7(e,t,n){const r=e.slice(0);return r[t]=n,r}var u7=class extends Sc{#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,En.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,c=i.some((p,m)=>p!==n[m]),d=o||c,f=d?!0:a.some((p,m)=>{const g=this.#e[m];return!g||!Nh(p,g)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(x2(n,i).forEach(p=>{p.destroy()}),x2(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=UN(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 HN(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=c7(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&&En.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},d7=class extends Sc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??BN(r,t);let a=this.get(i);return a||(a=new r7({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(){En.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=>c2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>c2(e,n)):t}notify(e){En.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){En.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){En.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},f7=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new d7,this.#e=e.mutationCache||new w$,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=KN.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=ey.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(Io(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=GH(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return En.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;En.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return En.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=En.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Sr).catch(Sr)}invalidateQueries(e,t={}){return En.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=En.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(Sr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Io(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sr).catch(Sr)}fetchInfiniteQuery(e){return e.behavior=y2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sr).catch(Sr)}ensureInfiniteQueryData(e){return e.behavior=y2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ey.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(ic(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{jh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ic(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{jh(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=BN(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===qN&&(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()}},S$=x.createContext(void 0),ji=e=>{const t=x.useContext(S$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},h7=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(S$.Provider,{value:e,children:t})),j$=x.createContext(!1),N$=()=>x.useContext(j$);j$.Provider;function p7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var m7=x.createContext(p7()),k$=()=>x.useContext(m7),C$=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?FN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},A$=e=>{x.useEffect(()=>{e.clearReset()},[e])},O$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||FN(n,[e.error,r])),E$=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))}},g7=(e,t)=>e.isLoading&&e.isFetching&&!t,Yj=(e,t)=>e?.suspense&&t.isPending,Zj=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function y7({queries:e,...t},n){const r=ji(),i=N$(),a=k$(),o=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(b=>{E$(b);const j=r.getQueryCache().get(b.queryHash);C$(b,a,j)}),A$(a);const[c]=x.useState(()=>new u7(r,o,t)),[d,f,p]=c.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?c.subscribe(En.batchCalls(b)):Sr,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const v=d.some((b,j)=>Yj(o[j],b))?d.flatMap((b,j)=>{const N=o[j];if(N&&Yj(N,b)){const O=new HN(r,N);return Zj(N,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((b,j)=>{const N=o[j];return N&&O$({result:b,errorResetBoundary:a,throwOnError:N.throwOnError,query:r.getQueryCache().get(N.queryHash),suspense:N.suspense})});if(w?.error)throw w.error;return f(p())}function v7(e,t,n){const r=N$(),i=k$(),a=ji(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",E$(o),C$(o,i,c),A$(i);const d=!a.getQueryCache().get(o.queryHash),[f]=x.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(g=>{const v=m?f.subscribe(En.batchCalls(g)):Sr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),Yj(o,p))throw Zj(o,f,i);if(O$({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!rc&&g7(p,r)&&(d?Zj(o,f,i):c?.promise)?.catch(Sr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function ha(e,t){return v7(e,HN)}function Zh(e,t){const n=ji(),[r]=x.useState(()=>new l7(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(En.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,c)=>{r.mutate(o,c).catch(Sr)},[r]);if(i.error&&FN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Gm=typeof window<"u"?x.useLayoutEffect:x.useEffect;function bw(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function x7(e,t,n={},r={}){x.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 b7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var w7=!1;function kh(e){return e[e.length-1]}function S7(e){return typeof e=="function"}function To(e,t){return S7(e)?e(t):e}var j7=Object.prototype.hasOwnProperty,b2=Object.prototype.propertyIsEnumerable,N7=()=>Object.create(null),Al=(e,t)=>Bl(e,t,N7);function Bl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=j2(e)&&j2(i);if(!a&&!(ty(e)&&ty(i)))return i;const o=a?e:w2(e);if(!o)return i;const c=a?i:w2(i);if(!c)return i;const d=o.length,f=c.length,p=a?new Array(f):n();let m=0;for(let g=0;g<f;g++){const v=a?g:c[g],w=e[v],b=i[v];if(w===b){p[v]=w,(a?g<d:j7.call(e,v))&&m++;continue}if(w===null||b===null||typeof w!="object"||typeof b!="object"){p[v]=b;continue}const j=Bl(w,b,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function w2(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!b2.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(!b2.call(e,i))return!1;r.push(i)}return r}function ty(e){if(!S2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!S2(n)||!n.hasOwnProperty("isPrototypeOf"))}function S2(e){return Object.prototype.toString.call(e)==="[object Object]"}function j2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wl(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(!Wl(e[r],t[r],n))return!1;return!0}if(ty(e)&&ty(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!Wl(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||!Wl(e[o],t[o],n)))return!1;return i===a}return!1}function nd(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 Ch(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function k7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function N2(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 k7(t)}var C7=["http:","https:","mailto:","tel:"];function ny(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Lf(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+=N2(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+N2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function A7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ry(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=o,i(c);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var O7="Invariant failed";function zs(e,t){if(!e)throw new Error(O7)}var Ul=4,_$=5;function E7(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 VN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const o=E7(a);if(o){const[c,d]=o,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Cv(e,t,n,r,i,a,o){o?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<f;){const v=VN(d,c,t);let w;const b=c,j=v[5];switch(c=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 C=ql(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.static.set(N,C)}}else{const O=N.toLowerCase(),C=i.staticInsensitive?.get(O);if(C)w=C;else{i.staticInsensitive??=new Map;const A=ql(n.fullPath??n.from);A.parent=i,A.depth=a,w=A,i.staticInsensitive.set(O,A)}}break}case 1:{const N=d.substring(b,v[1]),O=d.substring(v[4],j),C=p&&!!(N||O),A=N?C?N:N.toLowerCase():void 0,P=O?C?O:O.toLowerCase():void 0,E=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(E)w=E;else{const _=Sw(1,n.fullPath??n.from,C,A,P);w=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const N=d.substring(b,v[1]),O=d.substring(v[4],j),C=p&&!!(N||O),A=N?C?N:N.toLowerCase():void 0,P=O?C?O:O.toLowerCase():void 0,E=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(E)w=E;else{const _=Sw(3,n.fullPath??n.from,C,A,P);w=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const N=d.substring(b,v[1]),O=d.substring(v[4],j),C=p&&!!(N||O),A=N?C?N:N.toLowerCase():void 0,P=O?C?O:O.toLowerCase():void 0,E=Sw(2,n.fullPath??n.from,C,A,P);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=ql(n.fullPath??n.from);v.kind=_$,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const v=ql(n.fullPath??n.from);v.kind=Ul,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,g&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Cv(e,t,d,c,i,a,o)}function ww(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 Co(e){if(e.pathless)for(const t of e.pathless)Co(t);if(e.static)for(const t of e.static.values())Co(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Co(t);if(e.dynamic?.length){e.dynamic.sort(ww);for(const t of e.dynamic)Co(t)}if(e.optional?.length){e.optional.sort(ww);for(const t of e.optional)Co(t)}if(e.wildcard?.length){e.wildcard.sort(ww);for(const t of e.wildcard)Co(t)}}function ql(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 Sw(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 _7(e,t){const n=ql("/"),r=new Uint16Array(6);for(const i of e)Cv(!1,r,i,1,n,0);Co(n),t.masksTree=n,t.flatCache=ry(1e3)}function P7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=QN(e,t.masksTree);return t.flatCache.set(e,r),r}function T7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=ql("/"),Cv(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),QN(r,o,n)}function z7(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=QN(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=I7(a.route)),t.matchCache.set(r,a),a}function R7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function D7(e,t=!1,n){const r=ql(e.fullPath),i=new Uint16Array(6),a={},o={};let c=0;return Cv(t,i,e,1,r,0,d=>{if(n?.(d,c),zs(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=R7(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}c++}),Co(r),{processedTree:{segmentTree:r,singleCache:ry(1e3),matchCache:ry(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function QN(e,t,n=!1){const r=e.split("/"),i=L7(e,r,t,n);if(!i)return null;const[a]=P$(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function P$(e,t,n){const r=M7(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;o++,c++,d++,f++){const p=r[c];if(p.kind===Ul)break;if(p.kind===_$){f--,o--,d--;continue}const m=t[o],g=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 b=p.suffix?.length??0,j=v.substring(w+2,v.length-b-1),N=m.substring(w,m.length-b);a[j]=decodeURIComponent(N)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){o--,d=g-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,b=p.suffix?.length??0,j=v.substring(w+3,v.length-b-1),N=p.suffix||p.prefix?m.substring(w,m.length-b):m;N&&(a[j]=decodeURIComponent(N))}else if(p.kind===2){const v=p,w=e.substring(g+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(w);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:c,path:d,segment:f}]}function I7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function M7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function L7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!kh(t),a=i&&e!=="/",o=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;c.length;){const m=c.pop(),{node:g,index:v,skipped:w,depth:b,statics:j,dynamics:N,optionals:O}=m;let{extract:C,rawParams:A,parsedParams:P}=m;if(g.skipOnParamError){if(!jw(e,t,m))continue;A=m.rawParams,C=m.extract,P=m.parsedParams}r&&g.route&&g.kind!==Ul&&$f(f,m)&&(f=m);const E=v===o;if(E&&(g.route&&!a&&$f(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const _=E?void 0:t[v];let z;if(E&&g.index){const I={node:g.index,index:v,skipped:w,depth:b+1,statics:j,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P};let q=!0;if(g.index.skipOnParamError&&(jw(e,t,I)||(q=!1)),q){if(j===o&&!N&&!O&&!w)return I;$f(p,I)&&(p=I)}}if(g.wildcard&&$f(d,m))for(const I of g.wildcard){const{prefix:q,suffix:U}=I;if(q&&(E||!(I.caseSensitive?_:z??=_.toLowerCase()).startsWith(q)))continue;if(U){if(E)continue;const H=t.slice(v).join("/").slice(-U.length);if((I.caseSensitive?H:H.toLowerCase())!==U)continue}const B={node:I,index:o,skipped:w,depth:b,statics:j,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P};if(!(I.skipOnParamError&&!jw(e,t,B))){d=B;break}}if(g.optional){const I=w|1<<b,q=b+1;for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U];c.push({node:B,index:v,skipped:I,depth:q,statics:j,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P})}if(!E)for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U],{prefix:H,suffix:W}=B;if(H||W){const Y=B.caseSensitive?_:z??=_.toLowerCase();if(H&&!Y.startsWith(H)||W&&!Y.endsWith(W))continue}c.push({node:B,index:v+1,skipped:w,depth:q,statics:j,dynamics:N,optionals:O+1,extract:C,rawParams:A,parsedParams:P})}}if(!E&&g.dynamic&&_)for(let I=g.dynamic.length-1;I>=0;I--){const q=g.dynamic[I],{prefix:U,suffix:B}=q;if(U||B){const H=q.caseSensitive?_:z??=_.toLowerCase();if(U&&!H.startsWith(U)||B&&!H.endsWith(B))continue}c.push({node:q,index:v+1,skipped:w,depth:b+1,statics:j,dynamics:N+1,optionals:O,extract:C,rawParams:A,parsedParams:P})}if(!E&&g.staticInsensitive){const I=g.staticInsensitive.get(z??=_.toLowerCase());I&&c.push({node:I,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P})}if(!E&&g.static){const I=g.static.get(_);I&&c.push({node:I,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P})}if(g.pathless){const I=b+1;for(let q=g.pathless.length-1;q>=0;q--){const U=g.pathless[q];c.push({node:U,index:v,skipped:w,depth:I,statics:j,dynamics:N,optionals:O,extract:C,rawParams:A,parsedParams:P})}}}if(p&&d)return $f(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 g=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(g),f}return null}function jw(e,t,n){try{const[r,i]=P$(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 $f(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===Ul)>(e.node.kind===Ul)||t.node.kind===Ul==(e.node.kind===Ul)&&t.depth>e.depth))):!0}function Lg(e){return WN(e.filter(t=>t!==void 0).join("/"))}function WN(e){return e.replace(/\/{2,}/g,"/")}function T$(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Mo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function z$(e){return Mo(T$(e))}function iy(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function $7(e,t,n){return iy(e,n)===iy(t,n)}function B7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&kh(c)==="";)c.pop();const m=t.split("/");for(let g=0,v=m.length;g<v;g++){const w=m[g];w===""?g?g===v-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(kh(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let d,f="";for(let m=0;m<c.length;m++){m>0&&(f+="/");const g=c[m];if(!g)continue;d=VN(g,0,d);const v=d[0];if(v===0){f+=g;continue}const w=d[5],b=g.substring(0,d[1]),j=g.substring(d[4],w),N=g.substring(d[2],d[3]);v===1?f+=b||j?`${b}{$${N}}${j}`:`$${N}`:v===2?f+=b||j?`${b}{$}${j}`:"$":f+=`${b}{-$${N}}${j}`}f=WN(f);const p=f||"/";return o&&r&&r.set(o,p),p}function U7(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 Nw(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=>C2(i,n)).join("/"):C2(r,n)}function k2({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let c=0,d,f="";for(;c<o;){const p=c;d=VN(e,p,d);const m=d[5];if(c=m+1,p===m)continue;const g=d[0];if(g===0){f+="/"+e.substring(p,m);continue}if(g===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(w||b)&&(f+="/"+w+b);continue}const j=Nw("_splat",t,n);f+="/"+w+j+b;continue}if(g===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]),b=e.substring(d[4],m),j=Nw(v,t,n)??"undefined";f+="/"+w+j+b;continue}if(g===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const b=e.substring(p,d[1]),j=e.substring(d[4],m),N=Nw(v,t,n)??"";f+="/"+b+N+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function C2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Mr(e){return!!e?.isNotFound}function q7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Xj="tsr-scroll-restoration-v1_3",F7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function K7(){const e=q7();if(!e)return null;const t=e.getItem(Xj);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=To(r,n)||n;try{e.setItem(Xj,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Vm=K7(),H7=e=>e.state.__TSR_key||e.href;function G7(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 ay=!1;function V7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=o[c];ay=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const g=d[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=g.scrollX,v.scrollTop=g.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(f);g&&g.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 g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}ay=!1}function Q7(e,t){if(!Vm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Vm))return;e.isScrollRestorationSetup=!0,ay=!1;const n=e.options.getScrollRestorationKey||H7;window.history.scrollRestoration="manual";const r=i=>{if(ay||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=G7(i.target)}const o=n(e.state.location);Vm.set(c=>{const d=c[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",F7(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})||(V7({storageKey:Xj,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Vm.set(o=>(o[a]||={},o)))})}function W7(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 Y7(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 kw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Z7(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]=kw(i):Array.isArray(a)?a.push(kw(i)):n[r]=[a,kw(i)]}return n}var X7=eG(JSON.parse),J7=tG(JSON.stringify,JSON.parse);function eG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Z7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function tG(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=Y7(i,r);return a?`?${a}`:""}}var Yl="__root__";function YN(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 Jr(e){return e instanceof Response&&!!e.options}function nG(e){return{input:({url:t})=>{for(const n of e)t=Jj(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=R$(e[n],t);return t}}}function rG(e){const t=z$(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const c=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return c===i?o.pathname="/":c.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Lg(["/",t,o.pathname]),o)}}function Jj(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 R$(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 hn=(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))(hn||{});function D$({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:c};function r(f,p,m){const g=p.depsTail;if(g!==void 0&&g.dep===f)return;const v=g!==void 0?g.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 b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:g,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=b),g!==void 0?g.nextDep=b:p.deps=b,w!==void 0?w.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,g=f.prevDep,v=f.nextDep,w=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=g:p.depsTail=g,g!==void 0?g.nextDep=v:p.deps=v,w!==void 0?w.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const g=f.sub;let v=g.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,g)?(g.flags=v|40,v&=1):v=0:g.flags=v&-9|32:v=0:g.flags=v|32,v&2&&t(g),v&1){const w=g.subs;if(w!==void 0){const b=(f=w).nextSub;b!==void 0&&(m={value:p,prev:m},p=b);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,g=0,v=!1;e:do{const w=f.dep,b=w.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(w)){const j=w.subs;j.nextSub!==void 0&&c(j),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=w.deps,p=w,++g;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;g--;){const j=p.subs,N=j.nextSub!==void 0;if(N?(f=m.value,m=m.prev):f=j,v){if(e(p)){N&&c(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 c(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let ZN=0,Ol=0,hh=0;const ks=[],{link:u2e,unlink:I$,propagate:d2e,checkDirty:iG,shallowPropagate:f2e}=D$({update(e){return e.depsTail!==void 0?lG(e):cG(e)},notify(e){let t=hh,n=t;do if(ks[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(hh=t;n<--t;){const r=ks[n];ks[n++]=ks[t],ks[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Av(e)):fG.call(e)}});function aG(){return ZN}function sG(){++ZN}function oG(){--ZN||dG()}function lG(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Av(e)}}function cG(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function uG(e){const t=e.flags;if(t&16||t&32&&iG(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Av(e)}}else e.flags=2}function dG(){try{for(;Ol<hh;){const e=ks[Ol];ks[Ol++]=void 0,uG(e)}}finally{for(;Ol<hh;){const e=ks[Ol];ks[Ol++]=void 0,e.flags|=10}Ol=0,hh=0}}function fG(){this.depsTail=void 0,this.flags=0,Av(this);const e=this.subs;e!==void 0&&I$(e)}function Av(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=I$(n,e)}function XN(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 e1=[];let $g=0;const{link:A2,unlink:hG,propagate:pG,checkDirty:M$,shallowPropagate:O2}=D$({update(e){return e._update()},notify(e){e1[t1++]=e,e.flags&=~hn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=hn.Mutable|hn.Dirty,sy(e))}});let Qm=0,t1=0,Ra;function sy(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=hG(n,e)}function L$(){if(!(aG()>0)){for(;Qm<t1;){const e=e1[Qm];e1[Qm++]=void 0,e.notify()}Qm=0,t1=0}}function $$(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?hn.None:hn.Mutable,get(){return Ra!==void 0&&A2(i,Ra,$g),i._snapshot},subscribe(a){const o=XN(a),c={current:!1},d=mG(()=>{i.get(),c.current?o.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=Ra,c=Object.is;if(n)Ra=i,++$g,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=hn.Mutable|hn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{Ra=o,n&&(i.flags&=~hn.RecursedCheck),sy(i)}}};return n?(i.flags=hn.Mutable|hn.Dirty,i.get=function(){const a=i.flags;if(a&hn.Dirty||a&hn.Pending&&M$(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&O2(o)}}else a&hn.Pending&&(i.flags=a&~hn.Pending);return Ra!==void 0&&A2(i,Ra,$g),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(pG(o),O2(o),L$())}},i}function mG(e){const t=()=>{const r=Ra;Ra=n,++$g,n.depsTail=void 0,n.flags=hn.Watching|hn.RecursedCheck;try{return e()}finally{Ra=r,n.flags&=~hn.RecursedCheck,sy(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:hn.Watching|hn.RecursedCheck,notify(){const r=this.flags;r&hn.Dirty||r&hn.Pending&&M$(this.deps,this)?t():this.flags=hn.Watching},stop(){this.flags=hn.None,this.depsTail=void 0,sy(this)}};return t(),n}class gG{constructor(t){this.atom=$$(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(XN(t))}}class yG{constructor(t){this.atom=$$(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(XN(t))}}function vG(e){return typeof e=="function"?new yG(e):new gG(e)}function xG(e){try{sG(),e()}finally{oG(),L$()}}function ph(e){let t;return xG(()=>{t=e()}),t}var n1=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ov=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Zl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const c=e.router.getMatch(o.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},E2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const c=e.matches[o];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return o}return n?a:i},zo=(e,t,n)=>{if(!(!Jr(n)&&!Mr(n)))throw Jr(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:Jr(n)?"redirected":r.status==="pending"?"success":r.status,context:Zl(e,t.index),isFetching:!1,error:n})),Mr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Jr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},B$=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},_2=(e,t,n)=>{const r=Zl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Bf=(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,zo(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(c){n=c,zo(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Jr(n)&&!Mr(n)&&(e.serialError??=n)},U$=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ov(e,t)&&(n.options.loader||n.options.beforeLoad||F$(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{n1(e)},i);r._nonReactive.pendingTimeout=a}},bG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;U$(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&zo(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},wG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=nd(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:c}=i;o&&Bf(e,n,o,"PARSE_PARAMS"),c&&Bf(e,n,c,"VALIDATE_SEARCH"),U$(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){ph(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=nd();const g={...Zl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:b}=i,j=Ov(e,t),N={search:v,abortController:d,params:w,preload:j,context:g,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=A=>{if(A===void 0){ph(()=>{p(),m()});return}(Jr(A)||Mr(A))&&(p(),Bf(e,n,A,"BEFORE_LOAD")),ph(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:A})),m()})};let C;try{if(C=r.options.beforeLoad(N),Ch(C))return p(),C.catch(A=>{Bf(e,n,A,"BEFORE_LOAD")}).then(O)}catch(A){p(),Bf(e,n,A,"BEFORE_LOAD")}O(C)},SG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),o=()=>wG(e,n,t,i),c=()=>{if(B$(e,n))return;const d=bG(e,n,i);return Ch(d)?d.then(o):o()};return a()},jG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:o,styles:a?.styles}))},q$=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=Zl(e,r),m=Ov(e,n);return{params:o,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},P2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(w7??e.router.isServer)||a.ssr===!0)&&Ah(i);const o=i.options.loader,c=typeof o=="function"?o:o?.handler,d=c?.(q$(e,t,n,r,i)),f=!!c&&Ch(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;zo(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,g=>({...g,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:Zl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let c=o;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Zl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Mr(o)&&await i.options.notFoundComponent?.preload?.(),zo(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){c=f,zo(e,e.router.getMatch(n),f)}!Jr(c)&&!Mr(c)&&await Ah(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:Zl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),zo(e,o,a)}},NG=async(e,t,n)=>{async function r(v,w,b,j,N){const O=Date.now()-w.updatedAt,C=v?N.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:N.options.staleTime??e.router.options.defaultStaleTime??0,A=N.options.shouldReload,P=typeof A=="function"?A(q$(e,t,i,n,N)):A,{status:E,invalid:_}=j,z=O>C&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);o=E==="success"&&(_||(P??z)),v&&N.options.preload===!1||(o&&!e.sync&&p?(c=!0,(async()=>{try{await P2(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){Jr(I)&&await e.router.navigate(I.options)}})()):E!=="success"||o?await P2(e,t,i,n,N):_2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(B$(e,i)){if(!e.router.getMatch(i))return e.matches[n];_2(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,b=Ov(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&&zo(e,j,N),j.status==="pending"&&await r(b,v,w,j,d)}else{const j=b&&!e.router.state.matches.some(O=>O.id===i),N=e.router.getMatch(i);N._nonReactive.loaderPromise=nd(),j!==N.preload&&e.updateMatch(i,O=>({...O,preload:j})),await r(b,v,w,N,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const g=c?m.isFetching:!1;return g!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:g,invalid:!1})),e.router.getMatch(i)):m};async function T2(e){const t=e,n=[];t.router.state.matches.some(g=>g._forcePending)&&n1(t);let r;for(let g=0;g<t.matches.length;g++){try{const v=SG(t,g);Ch(v)&&await v}catch(v){if(Jr(v))throw v;if(Mr(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?E2(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let g=0;g<o;g++)n.push(NG(t,n,g));try{await Promise.all(n)}catch{const g=await Promise.allSettled(n);for(const v of g){if(v.status!=="rejected")continue;const w=v.reason;if(Jr(w))throw w;Mr(w)?c??=w:d??=w}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const g=E2(t,f);zs(g!==void 0);const v=t.matches[g],w=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&b&&(w.options.notFoundComponent=b),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=g,await Ah(w,["notFoundComponent"])}else if(!t.preload){const g=t.matches[0];g.globalNotFound||t.router.getMatch(g.id)?.globalNotFound&&t.updateMatch(g.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const g=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ah(g,["errorComponent"])}for(let g=0;g<=p;g++){const{id:v,routeId:w}=t.matches[g],b=t.router.looseRoutesById[w];try{const j=jG(t,v,b);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=n1(t);if(Ch(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function z2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ah(e,t=Bg){!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===Bg?(()=>{if(e._componentsPromise===void 0){const r=z2(e,Bg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():z2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function F$(e){for(const t of Bg)if(e.options[t]?.preload)return!0;return!1}var Bg=["component","errorComponent","pendingComponent","notFoundComponent"],Lo="__TSR_index",R2="popstate",D2="beforeunload";function kG(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const g=oy(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:g,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,c,d)=>{const f=t.state[Lo];c=I2(f+1,c),a({task:()=>{e.pushState(o,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:c})},replace:(o,c,d)=>{const f=t.state[Lo];c=I2(f,c),a({task:()=>{e.replaceState(o,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:c})},go:(o,c)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:c,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[Lo]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function I2(e,t){t||(t={});const n=JN();return{...t,key:n,__TSR_key:n,[Lo]:e}}function CG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=z=>i=z,c=(z=>z),d=(()=>oy(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=JN();t.history.replaceState({[Lo]:0,key:z,__TSR_key:z},"")}let f=d(),p,m=!1,g=!1,v=!1,w=!1;const b=()=>f;let j,N;const O=()=>{j&&(_._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),_._ignoreSubscribers=!1,j=void 0,N=void 0,p=void 0)},C=(z,I,q)=>{const U=c(I);N||(p=f),f=oy(I,q),j={href:U,state:q,isPush:j?.isPush||z==="push"},N||(N=Promise.resolve().then(()=>O()))},A=z=>{f=d(),_.notify({type:z})},P=async()=>{if(g){g=!1;return}const z=d(),I=z.state[Lo]-f.state[Lo],q=I===1,U=I===-1,B=!q&&!U||m;m=!1;const H=B?"GO":U?"BACK":"FORWARD",W=B?{type:"GO",index:I}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const Y=a();if(typeof document<"u"&&Y.length){for(const K of Y)if(await K.blockerFn({currentLocation:f,nextLocation:z,action:H})){g=!0,t.history.go(1),_.notify(W);return}}}f=d(),_.notify(W)},E=z=>{if(w){w=!1;return}let I=!1;const q=a();if(typeof document<"u"&&q.length)for(const U of q){const B=U.enableBeforeUnload??!0;if(B===!0){I=!0;break}if(typeof B=="function"&&B()===!0){I=!0;break}}if(I)return z.preventDefault(),z.returnValue=""},_=kG({getLocation:b,getLength:()=>t.history.length,pushState:(z,I)=>C("push",z,I),replaceState:(z,I)=>C("replace",z,I),back:z=>(z&&(v=!0),w=!0,t.history.back()),forward:z=>{z&&(v=!0),w=!0,t.history.forward()},go:z=>{m=!0,t.history.go(z)},createHref:z=>c(z),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(D2,E,{capture:!0}),t.removeEventListener(R2,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(D2,E,{capture:!0}),t.addEventListener(R2,P),t.history.pushState=function(...z){const I=n.apply(t.history,z);return _._ignoreSubscribers||A("PUSH"),I},t.history.replaceState=function(...z){const I=r.apply(t.history,z);return _._ignoreSubscribers||A("REPLACE"),I},_}function AG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function oy(e,t){const n=AG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=JN();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||{[Lo]:0,key:a,__TSR_key:a}}}function JN(){return(Math.random()+1).toString(36).substring(7)}function Xl(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 OG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var EG=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=U7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=CG()),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=ry(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=vG(PG(this.latestLocation)),Q7(this));let o=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=z$(c);p&&p!=="/"&&f.push(rG({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:nG(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=D7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&_7(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const j=this.options.parseSearch(d),N=this.options.stringifySearch(j);return{href:c+N+f,publicHref:p,pathname:Lf(c).path,external:!1,searchStr:N,search:Al(n?.search,j),hash:Lf(f.slice(1)).path,state:Bl(n?.state,m)}}const g=new URL(p,this.origin),v=Jj(this.rewrite,g),w=this.options.parseSearch(v.search),b=this.options.stringifySearch(w);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Lf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:Al(n?.search,w),hash:Lf(v.hash.slice(1)).path,state:Bl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=r(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>B7({base:t,to:WN(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=>TG({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(c,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,To(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(g).length>0)for(const I of w){const q=I.options.params?.stringify??I.options.stringifyParams;if(q)try{Object.assign(g,q(g))}catch{}}const b=t.leaveParams?m:Lf(k2({path:m,params:g,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,Ug(q.options.validateSearch,{...I,...j}))}catch{}}),j=I}j=zG({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=Al(f,j);const N=this.options.stringifySearch(j),O=i.hash===!0?a.hash:i.hash?To(i.hash,a.hash):void 0,C=O?`#${O}`:"";let A=i.state===!0?a.state:i.state?To(i.state,a.state):{};A=Bl(a.state,A);const P=`${b}${N}${C}`;let E,_,z=!1;if(this.rewrite){const I=new URL(P,this.origin),q=R$(this.rewrite,I);E=I.href.replace(I.origin,""),q.origin!==this.origin?(_=q.href,z=!0):_=q.pathname+q.search+q.hash}else E=A7(P),_=E;return{publicHref:_,href:E,pathname:b,search:j,searchStr:N,state:A,hash:O??"",external:z,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=P7(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...g}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,To(m,d));a={from:t.from,...g,params:v},c=n(a)}}}return c&&(o.maskedLocation=c),o};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Wl(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=Mo(this.latestLocation.href)===Mo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=nd(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:o,...c}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=oy(o,{__TSR_index:t?p:p+1}),g=new URL(m.pathname,this.origin);c.to=Jj(this.rewrite,g).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const c=!o&&i?i:r;if(ny(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Xl({resolvedLocation:f,location:d})}),await T2({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=[],g=[],v=[];ph(()=>{this.__store.setState(w=>{const b=w.matches,j=w.pendingMatches||w.matches;return p=b.filter(N=>!j.some(O=>O.id===N.id)),m=b.filter(N=>!j.some(O=>O.routeId===N.routeId)),g=j.filter(N=>!b.some(O=>O.routeId===N.routeId)),v=j.filter(N=>b.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"],[g,"onEnter"],[v,"onStay"]].forEach(([w,b])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[b]?.(j)})})})})}})}catch(d){Jr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Mr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(c=>c.status==="error")&&(o=500),o!==void 0&&this.__store.setState(c=>({...c,statusCode:o}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(Xl({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:OG(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&&ny(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=Ah,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)]);ph(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,o]}))})});try{return r=await T2({router:this,matches:r,location:n,preload:!0,updateMatch:(o,c)=>{i.has(o)?r=r.map(d=>d.id===o?c(d):d):this.updateMatch(o,c)}}),r}catch(o){if(Jr(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});Mr(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=T7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!Wl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Wl(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??J7,parseSearch:e.parseSearch??X7,protocolAllowlist:e.protocolAllowlist??C7}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,c=!1;(r?r.path!=="/"&&i["**"]:Mo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:c=!0);const d=c?DG(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 g=o[m],v=f[m-1];let w,b,j;{const H=v?.search??e.search,W=v?._strictSearch??void 0;try{const Y=Ug(g.options.validateSearch,{...H})??void 0;w={...H,...Y},b={...W,...Y},j=void 0}catch(Y){let K=Y;if(Y instanceof ly||(K=new ly(Y.message,{cause:Y})),t?.throwOnError)throw K;w=H,b={},j=K}}const N=g.options.loaderDeps?.({search:w})??"",O=N?JSON.stringify(N):"",{interpolatedPath:C,usedParams:A}=k2({path:g.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=g.id+C+O,E=this.getMatch(P),_=p.get(g.id),z=E?._strictParams??A;let I;if(!E)try{M2(g,A,a,z)}catch(H){if(Mr(H)||Jr(H)?I=H:I=new _G(H.message,{cause:H}),t?.throwOnError)throw I}Object.assign(i,z);const q=_?"stay":"enter";let U;if(E)U={...E,cause:q,params:_?.params??i,_strictParams:z,search:Al(_?_.search:E.search,w),_strictSearch:b};else{const H=g.options.loader||g.options.beforeLoad||g.lazyFn||F$(g)?"pending":"success";U={id:P,ssr:g.options.ssr,index:m,routeId:g.id,params:_?.params??i,_strictParams:z,pathname:C,updatedAt:Date.now(),search:_?Al(_.search,w):w,_strictSearch:b,searchError:void 0,status:H,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:nd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:_?Bl(_.loaderDeps,N):N,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(U.globalNotFound=d===g.id),U.searchError=j;const B=this.getParentContext(v);U.context={...B,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const g=f[m],v=this.looseRoutesById[g.routeId],w=this.getMatch(g.id),b=p.get(g.routeId);if(g.params=b?Al(b.params,i):i,!w){const j=f[m-1],N=this.getParentContext(j);if(v.options.context){const O={deps:g.loaderDeps,params:g.params,context:N??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:f,routeId:v.id};g.__routeContext=v.options.context(O)??void 0}g.context={...N,...g.__routeContext,...g.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=kh(t),a={...e.search};for(const f of t)try{Object.assign(a,Ug(f.options.validateSearch,a))}catch{}const o=kh(this.state.matches),c=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{M2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ly=class extends Error{},_G=class extends Error{};function PG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ug(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ly("Async validation not supported");if(n.issues)throw new ly(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 TG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Mo(e);let a,o;const c=z7(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),o=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function zG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return RG(n)(e,t,r??!1)}function RG(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:c})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));const f=c(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:o,next:c})=>{const d=c(o);if(!t._includeValidateSearch)return d;try{return{...d,...Ug(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:To(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const c=o[i];return c({search:a,next:f=>r(i+1,f,o)})};return function(a,o,c){return t.dest=o,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function DG(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 Yl}function M2(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 IG="Error preloading route! ☝️",K$=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=Yl:this.parentRoute||zs(!1);let i=r?Yl:n?.path;i&&i!=="/"&&(i=T$(i));const a=n?.id||i;let o=r?Yl:Lg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=Lg(["/",o]));const c=o==="__root__"?"/":Lg([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=c,this._to=Mo(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>YN({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.")}},MG=class extends K${constructor(e){super(e)}};function ek(e){const t=e.errorComponent??tk;return l.jsx(LG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var LG=class extends x.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function tk({error:e}){const[t,n]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.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"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function $G({children:e,fallback:t=null}){return H$()?l.jsx(Ui.Fragment,{children:e}):l.jsx(Ui.Fragment,{children:t})}function H$(){return Ui.useSyncExternalStore(BG,()=>!0,()=>!1)}function BG(){return()=>{}}var G$=x.createContext(null);function Zi(e){const t=x.useContext(G$);return e?.warn,t}var Cw={exports:{}},Aw={},Ow={exports:{}},Ew={};var L2;function UG(){if(L2)return Ew;L2=1;var e=Sd();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function c(m,g){var v=g(),w=r({inst:{value:v,getSnapshot:g}}),b=w[0].inst,j=w[1];return a(function(){b.value=v,b.getSnapshot=g,d(b)&&j({inst:b})},[m,v,g]),i(function(){return d(b)&&j({inst:b}),m(function(){d(b)&&j({inst:b})})},[m]),o(v),v}function d(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function f(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Ew.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ew}var $2;function qG(){return $2||($2=1,Ow.exports=UG()),Ow.exports}var B2;function FG(){if(B2)return Aw;B2=1;var e=Sd(),t=qG();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Aw.useSyncExternalStoreWithSelector=function(f,p,m,g,v){var w=a(null);if(w.current===null){var b={hasValue:!1,value:null};w.current=b}else b=w.current;w=c(function(){function N(E){if(!O){if(O=!0,C=E,E=g(E),v!==void 0&&b.hasValue){var _=b.value;if(v(_,E))return A=_}return A=E}if(_=A,r(C,E))return _;var z=g(E);return v!==void 0&&v(_,z)?(C=E,_):(C=E,A=z)}var O=!1,C,A,P=m===void 0?null:m;return[function(){return N(p())},P===null?void 0:function(){return N(P())}]},[p,m,g,v]);var j=i(f,w[0],w[1]);return o(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},Aw}var U2;function KG(){return U2||(U2=1,Cw.exports=FG()),Cw.exports}var V$=KG();function HG(e,t){return e===t}function GG(e,t,n=HG){const r=x.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(o);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return V$.useSyncExternalStoreWithSelector(r,i,i,t,n)}function ri(e){const t=Zi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return GG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Bl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Ev=x.createContext(void 0),VG=x.createContext(void 0);function Yo(e){const t=x.useContext(e.from?VG:Ev);return ri({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(zs(!((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 nk(e){return Yo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rk(e){const{select:t,...n}=e;return Yo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function _v(e){return Yo({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 Pv(e){return Yo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Zo(e){const t=Zi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ik(e){return Yo({...e,select:t=>e.select?e.select(t.context):t.context})}var jc=h$();const QG=ga(jc);function WG(e,t){const n=Zi(),r=b7(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:g,resetScroll:v,viewTransition:w,children:b,target:j,disabled:N,style:O,className:C,onClick:A,onBlur:P,onFocus:E,onMouseEnter:_,onMouseLeave:z,onTouchStart:I,ignoreBlocker:q,params:U,search:B,hash:H,state:W,mask:Y,reloadDocument:K,unsafeRelative:J,from:se,_fromLocation:me,...L}=e,M=H$(),F=ri({select:Xe=>{const ce=Xe.matches[Xe.matches.length-1];return{search:ce?.search,hash:Xe.location.hash,path:ce?.pathname}},structuralSharing:!0}),D=e.from,V=x.useMemo(()=>({...e,from:D}),[n,F,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=x.useMemo(()=>n.buildLocation({...V}),[n,V]),re=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,Ce=oe.maskedLocation?oe.maskedLocation.external:oe.external,je=x.useMemo(()=>tV(re,Ce,n.history,N),[N,Ce,re,n.history]),ee=x.useMemo(()=>{if(je?.external)return ny(je.href,n.protocolAllowlist)?void 0:je.href;if(!nV(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),ny(c,n.protocolAllowlist)?void 0:c}catch{}},[c,je,n.protocolAllowlist]),pe=ri({select:Xe=>{if(ee)return!1;if(o?.exact){if(!$7(Xe.location.pathname,oe.pathname,n.basepath))return!1}else{const ce=iy(Xe.location.pathname,n.basepath),Ne=iy(oe.pathname,n.basepath);if(!(ce.startsWith(Ne)&&(ce.length===Ne.length||ce[Ne.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Wl(Xe.location.search,oe.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?M&&Xe.location.hash===oe.hash:!0}}),Ee=pe?To(i,{})??YG:_w,X=pe?_w:To(a,{})??_w,Ke=[C,Ee.className,X.className].filter(Boolean).join(" "),ze=(O||Ee.style||X.style)&&{...O,...Ee.style,...X.style},[at,Ve]=x.useState(!1),Gt=x.useRef(!1),$t=e.reloadDocument||ee?!1:d??n.options.defaultPreload,dn=f??n.options.defaultPreloadDelay??0,nn=x.useCallback(()=>{n.preloadRoute({...V,_builtLocation:oe}).catch(Xe=>{console.warn(Xe),console.warn(IG)})},[n,V,oe]);x7(r,x.useCallback(Xe=>{Xe?.isIntersecting&&nn()},[nn]),eV,{disabled:!!N||$t!=="viewport"}),x.useEffect(()=>{Gt.current||!N&&$t==="render"&&(nn(),Gt.current=!0)},[N,nn,$t]);const Se=Xe=>{const ce=Xe.currentTarget.getAttribute("target"),Ne=j!==void 0?j:ce;if(!N&&!rV(Xe)&&!Xe.defaultPrevented&&(!Ne||Ne==="_self")&&Xe.button===0){Xe.preventDefault(),jc.flushSync(()=>{Ve(!0)});const Me=n.subscribe("onResolved",()=>{Me(),Ve(!1)});n.navigate({...V,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:g,viewTransition:w,ignoreBlocker:q})}};if(ee)return{...L,ref:r,href:ee,...b&&{children:b},...j&&{target:j},...N&&{disabled:N},...O&&{style:O},...C&&{className:C},...A&&{onClick:A},...P&&{onBlur:P},...E&&{onFocus:E},..._&&{onMouseEnter:_},...z&&{onMouseLeave:z},...I&&{onTouchStart:I}};const Ze=Xe=>{if(N||$t!=="intent")return;if(!dn){nn();return}const ce=Xe.currentTarget;if(Uf.has(ce))return;const Ne=setTimeout(()=>{Uf.delete(ce),nn()},dn);Uf.set(ce,Ne)},Rt=Xe=>{N||$t!=="intent"||nn()},pt=Xe=>{if(N||!$t||!dn)return;const ce=Xe.currentTarget,Ne=Uf.get(ce);Ne&&(clearTimeout(Ne),Uf.delete(ce))};return{...L,...Ee,...X,href:je?.href,ref:r,onClick:mu([A,Se]),onBlur:mu([P,pt]),onFocus:mu([E,Ze]),onMouseEnter:mu([_,Ze]),onMouseLeave:mu([z,pt]),onTouchStart:mu([I,Rt]),disabled:!!N,target:j,...ze&&{style:ze},...Ke&&{className:Ke},...N&&ZG,...pe&&XG,...M&&at&&JG}}var _w={},YG={className:"active"},ZG={role:"link","aria-disabled":!0},XG={"data-status":"active","aria-current":"page"},JG={"data-transitioning":"transitioning"},Uf=new WeakMap,eV={rootMargin:"100px"},mu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function tV(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function nV(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Xt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=WG(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return x.createElement("a",d,o)}return x.createElement(n,a,o)});function rV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var iV=class extends K${constructor(e){super(e),this.useMatch=t=>Yo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ik({...t,from:this.id}),this.useSearch=t=>Pv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>_v({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>rk({...t,from:this.id}),this.useLoaderData=t=>nk({...t,from:this.id}),this.useNavigate=()=>Zo({from:this.fullPath}),this.Link=Ui.forwardRef((t,n)=>l.jsx(Xt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function si(e){return new iV(e)}function aV(){return e=>oV(e)}var sV=class extends MG{constructor(e){super(e),this.useMatch=t=>Yo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ik({...t,from:this.id}),this.useSearch=t=>Pv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>_v({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>rk({...t,from:this.id}),this.useLoaderData=t=>nk({...t,from:this.id}),this.useNavigate=()=>Zo({from:this.fullPath}),this.Link=Ui.forwardRef((t,n)=>l.jsx(Xt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function oV(e){return new sV(e)}function q2(e){return typeof e=="object"?new F2(e,{silent:!0}).createRoute(e):new F2(e,{silent:!0}).createRoute}var F2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=si(n);return r.isRoot=!1,r},this.silent=t?.silent}},K2=class{constructor(e){this.useMatch=t=>Yo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ik({...t,from:this.options.id}),this.useSearch=t=>Pv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>_v({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>rk({...t,from:this.options.id}),this.useLoaderData=t=>nk({...t,from:this.options.id}),this.useNavigate=()=>Zo({from:Zi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function H2(e){return typeof e=="object"?new K2(e):t=>new K2({id:e,...t})}function lV(e){const t=ri({select:n=>`not-found-${n.location.pathname}-${n.status}`});return l.jsx(ek,{getResetKey:()=>t,onCatch:(n,r)=>{if(Mr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Mr(n))return e.fallback?.(n);throw n},children:e.children})}function cV(){return l.jsx("p",{children:"Not Found"})}function Tu(e){return l.jsx(l.Fragment,{children:e.children})}function Q$(e,t,n){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...n}):l.jsx(cV,{})}function uV(){return Zi().isScrollRestoring,null}var W$=x.memo(function({matchId:t}){const n=Zi(),r=ri({select:w=>{const b=w.matches.findIndex(N=>N.id===t),j=w.matches[b];return zs(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?l.jsx(a,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:Tu,g=c?ek:Tu,v=f?lV:Tu;return l.jsxs(i.isRoot?i.options.shellComponent??Tu:Tu,{children:[l.jsx(Ev.Provider,{value:t,children:l.jsx(m,{fallback:o,children:l.jsx(g,{getResetKey:()=>r.resetKey,errorComponent:c||tk,onCatch:(w,b)=>{if(Mr(w))throw w;d?.(w,b)},children:l.jsx(v,{fallback:w=>{if(!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(f,w)},children:p||r._displayPending?l.jsx($G,{fallback:o,children:l.jsx(G2,{matchId:t})}):l.jsx(G2,{matchId:t})})})})}),r.parentRouteId===Yl&&n.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(dV,{}),l.jsx(uV,{})]}):null]})});function dV(){const e=Zi(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Xl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var G2=x.memo(function({matchId:t}){const n=Zi(),{match:r,key:i,routeId:a}=ri({select:d=>{const f=d.matches.find(g=>g.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],c=x.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?l.jsx(d,{},i):l.jsx(ak,{})},[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=nd();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 zs(Mr(r.error)),Q$(n,o,r.error);if(r.status==="redirected")throw zs(Jr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),ak=x.memo(function(){const t=Zi(),n=x.useContext(Ev),r=ri({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=ri({select:f=>{const p=f.matches.find(m=>m.id===n);return zs(p),p.globalNotFound}}),o=ri({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(a)return Q$(t,i,void 0);if(!o)return null;const d=l.jsx(W$,{matchId:o});return r===Yl?l.jsx(x.Suspense,{fallback:c,children:d}):d});function fV(){const e=Zi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=ri({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),o=bw(a),c=a||n||i,d=bw(c),f=a||i,p=bw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mo(e.latestLocation.publicHref)!==Mo(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{m()}},[e,e.history]),Gm(()=>{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(g){console.error(g)}})()},[e]),Gm(()=>{o&&!a&&e.emit({type:"onLoad",...Xl(e.state)})},[o,e,a]),Gm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Xl(e.state)})},[f,p,e]),Gm(()=>{if(d&&!c){const m=Xl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),m.hrefChanged&&W7(e)}},[c,d,e]),null}function hV(){const e=Zi(),t=e.routesById[Yl].options.pendingComponent??e.options.defaultPendingComponent,n=t?l.jsx(t,{}):null,r=l.jsxs(typeof document<"u"&&e.ssr?Tu:x.Suspense,{fallback:n,children:[l.jsx(fV,{}),l.jsx(pV,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:r}):r}function pV(){const e=Zi(),t=ri({select:i=>i.matches[0]?.id}),n=ri({select:i=>i.loadedAt}),r=t?l.jsx(W$,{matchId:t}):null;return l.jsx(Ev.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:l.jsx(ek,{getResetKey:()=>n,errorComponent:tk,onCatch:void 0,children:r})})}var mV=e=>new gV(e),gV=class extends EG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=q2,globalThis.createLazyFileRoute=H2):typeof window<"u"&&(window.createFileRoute=q2,window.createLazyFileRoute=H2);function yV({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=l.jsx(G$.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:r}):r}function vV({router:e,...t}){return l.jsx(yV,{router:e,...t,children:l.jsx(hV,{})})}function Y$(e){return ri({select:t=>t.location})}class ai extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function xV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Z$=xV();function bV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function wV(e){return`${bV()}${e}`}function SV(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 jV(){return""}function V2(){return!!jV()}async function _e(e,t){const n=t?.body!=null,r=await fetch(`${Z$}${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 c=JSON.parse(i);typeof c.error=="string"?a=c.error:c.error?.message?(a=c.error.message,o=c.error.code):c.message&&(a=c.message)}catch{a=i}throw new ai(a,r.status,o)}if(r.status!==204)return r.json()}function sk(){return _e("/projects")}function X$(e){return _e(`/projects/${encodeURIComponent(e)}`)}function J$(){return _e("/runs")}function NV(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function ac(e){return _e(`/runs/${encodeURIComponent(e)}`)}function kV(e){return _e(`/projects/${encodeURIComponent(e)}/queries`)}function e5(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function t5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function Tv(e,t){return _e(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function CV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function AV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function n5(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Q2(e,t){const n=await X$(e);return Tv(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 OV(e,t){const n=await X$(e);return Tv(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 EV(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),_e(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function _V(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function PV(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function TV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function zV(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function RV(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function ok(){return _e("/settings")}function DV(){return _e("/session")}function IV(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function MV(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function LV(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function $V(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function BV(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof ai&&t.statusCode===404)return null;throw t}}function W2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function UV(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function qV(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function FV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function KV(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function HV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function GV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function VV(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function QV(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function r5(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function WV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function YV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function ZV(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function XV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function JV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function i5(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function eQ(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 _e(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function tQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function nQ(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 _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function rQ(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function lk(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function iQ(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function aQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function sQ(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function oQ(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Y2(){return _e("/cdp/status")}function lQ(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Z2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function a5(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function cQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function uQ(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function dQ(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function fQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function ck(e){return _e(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function s5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function o5(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function X2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function hQ(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function pQ(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function mQ(e){return _e(`/projects/${encodeURIComponent(e)}/report`)}function gQ(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function yQ(e){const t=await fetch(`${Z$}/projects/${encodeURIComponent(e)}/report.html`,{credentials:"same-origin",headers:{}});if(!t.ok)throw new ai(`Failed to download report: ${t.status}`,t.status);const n=await t.blob(),r=URL.createObjectURL(n),i=gQ(t.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,a=document.createElement("a");a.href=r,a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function vQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function xQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function l5(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function bQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function wQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function SQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function jQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function NQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function kQ(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}function CQ(e){return _e(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function AQ(e,t){const n=wV(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:SV(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,lastHeartbeatAt:c}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function OQ(){return _e("/backlinks/status")}function EQ(){return _e("/backlinks/install",{method:"POST"})}function c5(){return _e("/backlinks/syncs/latest")}function _Q(){return _e("/backlinks/syncs")}function PQ(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function TQ(){return _e("/backlinks/releases")}function zQ(){return _e("/backlinks/latest-release")}function RQ(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function DQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function IQ(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),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function MQ(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function LQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const $Q=6e3,BQ=5,UQ=180;let jr=[],qQ=0;const r1=new Set,i1=new Map,a1=new Map;function cy(){const e=[...jr];for(const t of r1)t(e)}function uk(e){const t=i1.get(e);t&&(clearTimeout(t),i1.delete(e));const n=a1.get(e);n&&(clearTimeout(n),a1.delete(e))}function u5(e){uk(e);const t=jr.length;jr=jr.filter(n=>n.id!==e),jr.length!==t&&cy()}function J2(e){uk(e.id),i1.set(e.id,setTimeout(()=>{s1(e.id)},e.durationMs))}function FQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function vt(e,t="negative",n=$Q){const r=FQ(e,t,n),i={id:String(++qQ),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=jr.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 jr=jr.map(c=>c.id===a.id?o:c),cy(),J2(o),a.id}}return jr.length>=BQ&&u5(jr[0].id),jr=[...jr,i],cy(),J2(i),i.id}function s1(e){const t=jr.find(n=>n.id===e);!t||t.state==="closing"||(uk(e),jr=jr.map(n=>n.id===e?{...n,state:"closing"}:n),cy(),a1.set(e,setTimeout(()=>{u5(e)},UQ)))}function KQ(e){return r1.add(e),()=>{r1.delete(e)}}function eT(){return jr}const HQ=5*6e4,d5=30*6e4,qf=3e4,Nr=6e4,o1=3e4;function GQ(){return new f7({defaultOptions:{queries:{staleTime:HQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new w$({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||vt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const VQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),tT=e=>{const t=QQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},f5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),WQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var YQ={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 ZQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...c},d)=>x.createElement("svg",{ref:d,...YQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:f5("lucide",i),...!a&&!WQ(c)&&{"aria-hidden":"true"},...c},[...o.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const At=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(ZQ,{ref:a,iconNode:t,className:f5(`lucide-${VQ(tT(e))}`,`lucide-${e}`,r),...i}));return n.displayName=tT(e),n};const XQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],JQ=At("arrow-up",XQ);const eW=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],tW=At("book-open",eW);const nW=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],h5=At("check",nW);const rW=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iW=At("chevron-down",rW);const aW=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xh=At("chevron-right",aW);const sW=[["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"}]],oW=At("circle-alert",sW);const lW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],p5=At("circle-check",lW);const cW=[["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"}]],m5=At("circle-question-mark",cW);const uW=[["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"}]],dW=At("copy",uW);const fW=[["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"}]],zv=At("download",fW);const hW=[["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"}]],pW=At("external-link",hW);const mW=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],gW=At("file-text",mW);const yW=[["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"}]],vW=At("github",yW);const xW=[["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"}]],bW=At("globe",xW);const wW=[["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"}]],SW=At("layout-dashboard",wW);const jW=[["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"}]],g5=At("link-2",jW);const NW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],y5=At("loader-circle",NW);const kW=[["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"}]],CW=At("maximize-2",kW);const AW=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],OW=At("menu",AW);const EW=[["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"}]],_W=At("minimize-2",EW);const PW=[["path",{d:"M5 12h14",key:"1ays0h"}]],TW=At("minus",PW);const zW=[["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"}]],uy=At("play",zW);const RW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],nT=At("plus",RW);const DW=[["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"}]],rT=At("refresh-cw",DW);const IW=[["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"}]],MW=At("rocket",IW);const LW=[["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"}]],v5=At("rotate-ccw",LW);const $W=[["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"}]],BW=At("settings",$W);const UW=[["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"}]],iT=At("sparkles",UW);const qW=[["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"}]],x5=At("trash-2",qW);const FW=[["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"}]],dy=At("triangle-alert",FW);const KW=[["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"}]],HW=At("unplug",KW);const GW=[["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"}]],VW=At("upload",GW);const QW=[["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"}]],WW=At("wrench",QW);const YW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jh=At("x",YW);function ve(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const g=p[m];g in c||(c[g]=f[g].bind(c))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(c){var d;const f=n?.Parent?new a:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Ku extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const w5={};function Fo(e){return w5}function S5(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 l1(e,t){return typeof t=="bigint"?t.toString():t}function Rv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function dk(e){return e==null}function fk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ZW(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}const aT=Symbol("evaluating");function It(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==aT)return r===void 0&&(r=aT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Nc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function sT(e){return JSON.stringify(e)}function XW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const j5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Oh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const JW=Rv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function rd(e){if(Oh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Oh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function N5(e){return rd(e)?{...e}:Array.isArray(e)?[...e]:e}const eY=new Set(["string","number","symbol"]);function id(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fe(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 tY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const nY={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 rY(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=Xo(e._zod.def,{get shape(){const o={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=n.shape[c])}return Nc(this,"shape",o),o},checks:[]});return Jo(e,a)}function iY(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=Xo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return Nc(this,"shape",o),o},checks:[]});return Jo(e,a)}function aY(e,t){if(!rd(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=Xo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Nc(this,"shape",a),a}});return Jo(e,i)}function sY(e,t){if(!rd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Xo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Nc(this,"shape",r),r}});return Jo(e,n)}function oY(e,t){const n=Xo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Nc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Jo(e,n)}function lY(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=Xo(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(n)for(const f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(const f in c)d[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return Nc(this,"shape",d),d},checks:[]});return Jo(t,o)}function cY(e,t,n){const r=Xo(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 Nc(this,"shape",a),a}});return Jo(t,r)}function Ru(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 Du(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Wm(e){return typeof e=="string"?e:e?.message}function Ko(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Wm(e.inst?._zod.def?.error?.(e))??Wm(t?.error?.(e))??Wm(n.customError?.(e))??Wm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function hk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Eh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const k5=(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,l1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},C5=ve("$ZodError",k5),A5=ve("$ZodError",k5,{Parent:Error});function uY(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 dY(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(e),n}const pk=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 Ku;if(o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>Ko(d,a,Fo())));throw j5(c,i?.callee),c}return o.value},mk=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>Ko(d,a,Fo())));throw j5(c,i?.callee),c}return o.value},Dv=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 Ku;return a.issues.length?{success:!1,error:new(e??C5)(a.issues.map(o=>Ko(o,i,Fo())))}:{success:!0,data:a.value}},fY=Dv(A5),Iv=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=>Ko(o,i,Fo())))}:{success:!0,data:a.value}},hY=Iv(A5),pY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pk(e)(t,n,i)},mY=e=>(t,n,r)=>pk(e)(t,n,r),gY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mk(e)(t,n,i)},yY=e=>async(t,n,r)=>mk(e)(t,n,r),vY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dv(e)(t,n,i)},xY=e=>(t,n,r)=>Dv(e)(t,n,r),bY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Iv(e)(t,n,i)},wY=e=>async(t,n,r)=>Iv(e)(t,n,r),SY=/^[cC][^\s-]{8,}$/,jY=/^[0-9a-z]+$/,NY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kY=/^[0-9a-vA-V]{20}$/,CY=/^[A-Za-z0-9]{27}$/,AY=/^[a-zA-Z0-9_-]{21}$/,OY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,EY=/^([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})$/,oT=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)$/,_Y=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,PY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function TY(){return new RegExp(PY,"u")}const zY=/^(?:(?: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])$/,RY=/^(([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}|:))$/,DY=/^((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])$/,IY=/^(([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])$/,MY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O5=/^[A-Za-z0-9_-]*$/,LY=/^\+[1-9]\d{6,14}$/,E5="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$Y=new RegExp(`^${E5}$`);function _5(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 BY(e){return new RegExp(`^${_5(e)}$`)}function UY(e){const t=_5({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${E5}T(?:${r})$`)}const qY=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},FY=/^-?\d+$/,P5=/^-?\d+(?:\.\d+)?$/,KY=/^(?:true|false)$/i,HY=/^[^A-Z]*$/,GY=/^[^a-z]*$/,oi=ve("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),T5={number:"number",bigint:"bigint",object:"date"},z5=ve("$ZodCheckLessThan",(e,t)=>{oi.init(e,t);const n=T5[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})}}),R5=ve("$ZodCheckGreaterThan",(e,t)=>{oi.init(e,t);const n=T5[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})}}),VY=ve("$ZodCheckMultipleOf",(e,t)=>{oi.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):ZW(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})}}),QY=ve("$ZodCheckNumberFormat",(e,t)=>{oi.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=nY[t.format];e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=FY)}),e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),WY=ve("$ZodCheckMaxLength",(e,t)=>{var n;oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!dk(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=hk(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),YY=ve("$ZodCheckMinLength",(e,t)=>{var n;oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!dk(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=hk(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ZY=ve("$ZodCheckLengthEquals",(e,t)=>{var n;oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!dk(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=hk(i),c=a>t.length;r.issues.push({origin:o,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Mv=ve("$ZodCheckStringFormat",(e,t)=>{var n,r;oi.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=()=>{})}),XY=ve("$ZodCheckRegex",(e,t)=>{Mv.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})}}),JY=ve("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=HY),Mv.init(e,t)}),eZ=ve("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=GY),Mv.init(e,t)}),tZ=ve("$ZodCheckIncludes",(e,t)=>{oi.init(e,t);const n=id(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})}}),nZ=ve("$ZodCheckStartsWith",(e,t)=>{oi.init(e,t);const n=new RegExp(`^${id(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})}}),rZ=ve("$ZodCheckEndsWith",(e,t)=>{oi.init(e,t);const n=new RegExp(`.*${id(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})}}),iZ=ve("$ZodCheckOverwrite",(e,t)=>{oi.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class aZ{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 sZ={major:4,minor:3,patch:6},wn=ve("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sZ;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,c,d)=>{let f=Ru(o),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const g=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new Ku;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==g&&(f||(f=Ru(o,g)))});else{if(o.issues.length===g)continue;f||(f=Ru(o,g))}}return p?p.then(()=>o):o},a=(o,c,d)=>{if(Ru(o))return o.aborted=!0,o;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ku;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,c)):a(f,o,c)}const d=e._zod.parse(o,c);if(d instanceof Promise){if(c.async===!1)throw new Ku;return d.then(f=>i(f,r,c))}return i(d,r,c)}}It(e,"~standard",()=>({validate:i=>{try{const a=fY(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return hY(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),gk=ve("$ZodString",(e,t)=>{wn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??qY(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}}),gn=ve("$ZodStringFormat",(e,t)=>{Mv.init(e,t),gk.init(e,t)}),oZ=ve("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=EY),gn.init(e,t)}),lZ=ve("$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=oT(r))}else t.pattern??(t.pattern=oT());gn.init(e,t)}),cZ=ve("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_Y),gn.init(e,t)}),uZ=ve("$ZodURL",(e,t)=>{gn.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})}}}),dZ=ve("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=TY()),gn.init(e,t)}),fZ=ve("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=AY),gn.init(e,t)}),hZ=ve("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=SY),gn.init(e,t)}),pZ=ve("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jY),gn.init(e,t)}),mZ=ve("$ZodULID",(e,t)=>{t.pattern??(t.pattern=NY),gn.init(e,t)}),gZ=ve("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kY),gn.init(e,t)}),yZ=ve("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=CY),gn.init(e,t)}),vZ=ve("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=UY(t)),gn.init(e,t)}),xZ=ve("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$Y),gn.init(e,t)}),bZ=ve("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=BY(t)),gn.init(e,t)}),wZ=ve("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=OY),gn.init(e,t)}),SZ=ve("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=zY),gn.init(e,t),e._zod.bag.format="ipv4"}),jZ=ve("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=RY),gn.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})}}}),NZ=ve("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=DY),gn.init(e,t)}),kZ=ve("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=IY),gn.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 D5(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const CZ=ve("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=MY),gn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{D5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function AZ(e){if(!O5.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return D5(n)}const OZ=ve("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=O5),gn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{AZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),EZ=ve("$ZodE164",(e,t)=>{t.pattern??(t.pattern=LY),gn.init(e,t)});function _Z(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 PZ=ve("$ZodJWT",(e,t)=>{gn.init(e,t),e._zod.check=n=>{_Z(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),I5=ve("$ZodNumber",(e,t)=>{wn.init(e,t),e._zod.pattern=e._zod.bag.pattern??P5,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}}),TZ=ve("$ZodNumberFormat",(e,t)=>{QY.init(e,t),I5.init(e,t)}),zZ=ve("$ZodBoolean",(e,t)=>{wn.init(e,t),e._zod.pattern=KY,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}}),RZ=ve("$ZodUnknown",(e,t)=>{wn.init(e,t),e._zod.parse=n=>n}),DZ=ve("$ZodNever",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function lT(e,t,n){e.issues.length&&t.issues.push(...Du(n,e.issues)),t.value[n]=e.value}const IZ=ve("$ZodArray",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const c=i[o],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>lT(f,n,o))):lT(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function fy(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Du(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function M5(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=tY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function L5(e,t,n,r,i,a){const o=[],c=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(c.has(m))continue;if(f==="never"){o.push(m);continue}const g=d.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>fy(v,n,m,t,p))):fy(g,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 MZ=ve("$ZodObject",(e,t)=>{if(wn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Rv(()=>M5(t));It(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=Oh,a=t.catchall;let o;e._zod.parse=(c,d)=>{o??(o=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],m=o.shape;for(const g of o.keys){const v=m[g],w=v._zod.optout==="optional",b=v._zod.run({value:f[g],issues:[]},d);b instanceof Promise?p.push(b.then(j=>fy(j,c,g,f,w))):fy(b,c,g,f,w)}return a?L5(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),LZ=ve("$ZodObjectJIT",(e,t)=>{MZ.init(e,t);const n=e._zod.parse,r=Rv(()=>M5(t)),i=g=>{const v=new aZ(["shape","payload","ctx"]),w=r.value,b=C=>{const A=sT(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let N=0;for(const C of w.keys)j[C]=`key_${N++}`;v.write("const newResult = {};");for(const C of w.keys){const A=j[C],P=sT(C),_=g[C]?._zod?.optout==="optional";v.write(`const ${A} = ${b(C)};`),_?v.write(`
|
|
12
|
-
if (${A}.issues.length) {
|
|
13
|
-
if (${P} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${A}.value === undefined) {
|
|
22
|
-
if (${P} in input) {
|
|
23
|
-
newResult[${P}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${P}] = ${A}.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`):v.write(`
|
|
30
|
-
if (${A}.issues.length) {
|
|
31
|
-
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
32
|
-
...iss,
|
|
33
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${A}.value === undefined) {
|
|
38
|
-
if (${P} in input) {
|
|
39
|
-
newResult[${P}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${P}] = ${A}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(C,A)=>O(g,C,A)};let a;const o=Oh,c=!w5.jitless,f=c&&JW.value,p=t.catchall;let m;e._zod.parse=(g,v)=>{m??(m=r.value);const w=g.value;return o(w)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),g=a(g,v),p?L5([],w,g,v,m,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),g)}});function cT(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=>!Ru(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=>Ko(o,r,Fo())))}),t)}const $5=ve("$ZodUnion",(e,t)=>{wn.init(e,t),It(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),It(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=>fk(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),o=!0;else{if(f.issues.length===0)return f;c.push(f)}}return o?Promise.all(c).then(d=>cT(d,i,e,a)):cT(c,i,e,a)}}),$Z=ve("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$5.init(e,t);const n=e._zod.parse;It(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[c,d]of Object.entries(o)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=Rv(()=>{const i=t.options,a=new Map;for(const o of i){const c=o._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of c){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(!Oh(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const c=r.value.get(o?.[t.discriminator]);return c?c._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)}}),BZ=ve("$ZodIntersection",(e,t)=>{wn.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])=>uT(n,d,f)):uT(n,a,o)}});function c1(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(rd(e)&&rd(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=c1(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=c1(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 uT(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&i&&e.issues.push({...i,keys:a}),Ru(e))return e;const o=c1(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 UZ=ve("$ZodRecord",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!rd(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const c=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Du(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Du(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&P5.test(c)&&d.issues.length){const m=t.keyType._zod.run({value:Number(c),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Ko(m,r,Fo())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Du(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Du(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),qZ=ve("$ZodEnum",(e,t)=>{wn.init(e,t);const n=S5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>eY.has(typeof i)).map(i=>typeof i=="string"?id(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}}),FZ=ve("$ZodLiteral",(e,t)=>{if(wn.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"?id(r):r?id(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}}),KZ=ve("$ZodTransform",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new b5(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 Ku;return n.value=i,n}});function dT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const B5=ve("$ZodOptional",(e,t)=>{wn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fk(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=>dT(a,n.value)):dT(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),HZ=ve("$ZodExactOptional",(e,t)=>{B5.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),GZ=ve("$ZodNullable",(e,t)=>{wn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fk(n.source)}|null)$`):void 0}),It(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)}),VZ=ve("$ZodDefault",(e,t)=>{wn.init(e,t),e._zod.optin="optional",It(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=>fT(a,t)):fT(i,t)}});function fT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const QZ=ve("$ZodPrefault",(e,t)=>{wn.init(e,t),e._zod.optin="optional",It(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))}),WZ=ve("$ZodNonOptional",(e,t)=>{wn.init(e,t),It(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=>hT(a,e)):hT(i,e)}});function hT(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 YZ=ve("$ZodCatch",(e,t)=>{wn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(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=>Ko(o,r,Fo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Ko(a,r,Fo()))},input:n.value}),n.issues=[]),n)}}),ZZ=ve("$ZodPipe",(e,t)=>{wn.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(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=>Ym(o,t.in,r)):Ym(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Ym(a,t.out,r)):Ym(i,t.out,r)}});function Ym(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const XZ=ve("$ZodReadonly",(e,t)=>{wn.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(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(pT):pT(i)}});function pT(e){return e.value=Object.freeze(e.value),e}const JZ=ve("$ZodCustom",(e,t)=>{oi.init(e,t),wn.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=>mT(a,n,r,e));mT(i,n,r,e)}});function mT(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(Eh(i))}}var gT;class eX{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 tX(){return new eX}(gT=globalThis).__zod_globalRegistry??(gT.__zod_globalRegistry=tX());const lh=globalThis.__zod_globalRegistry;function nX(e,t){return new e({type:"string",...Fe(t)})}function rX(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function yT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function iX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function aX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function sX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function oX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function lX(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function cX(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function uX(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function dX(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function fX(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function hX(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function pX(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function mX(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function gX(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function yX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function vX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function xX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function bX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function wX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function SX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function jX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function NX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function kX(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function CX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function AX(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function OX(e,t){return new e({type:"number",checks:[],...Fe(t)})}function EX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function _X(e,t){return new e({type:"boolean",...Fe(t)})}function PX(e){return new e({type:"unknown"})}function TX(e,t){return new e({type:"never",...Fe(t)})}function vT(e,t){return new z5({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Pw(e,t){return new z5({check:"less_than",...Fe(t),value:e,inclusive:!0})}function xT(e,t){return new R5({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Tw(e,t){return new R5({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function bT(e,t){return new VY({check:"multiple_of",...Fe(t),value:e})}function U5(e,t){return new WY({check:"max_length",...Fe(t),maximum:e})}function hy(e,t){return new YY({check:"min_length",...Fe(t),minimum:e})}function q5(e,t){return new ZY({check:"length_equals",...Fe(t),length:e})}function zX(e,t){return new XY({check:"string_format",format:"regex",...Fe(t),pattern:e})}function RX(e){return new JY({check:"string_format",format:"lowercase",...Fe(e)})}function DX(e){return new eZ({check:"string_format",format:"uppercase",...Fe(e)})}function IX(e,t){return new tZ({check:"string_format",format:"includes",...Fe(t),includes:e})}function MX(e,t){return new nZ({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function LX(e,t){return new rZ({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function jd(e){return new iZ({check:"overwrite",tx:e})}function $X(e){return jd(t=>t.normalize(e))}function BX(){return jd(e=>e.trim())}function UX(){return jd(e=>e.toLowerCase())}function qX(){return jd(e=>e.toUpperCase())}function FX(){return jd(e=>XW(e))}function KX(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function HX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function GX(e){const t=VX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Eh(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(Eh(i))}},e(n.value,n)));return t}function VX(e,t){const n=new oi({check:"custom",...Fe(t)});return n._zod.check=e,n}function F5(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??lh,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 Qn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const g=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,g,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),Qn(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"&&zr(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 K5(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const d=r.get(c);if(d&&d!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,g=e.external.uri??(w=>w);if(m)return{ref:g(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${c}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:d,defId:f}=i(o);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
-
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function H5(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const c=e.seen.get(o);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const g=e.seen.get(p),v=g.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 b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const m=o._zod.parent;if(m&&m!==p){r(m);const g=e.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:c.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const c=o[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:py(t,"input",e.processors),output:py(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function zr(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 zr(r.element,n);if(r.type==="set")return zr(r.valueType,n);if(r.type==="lazy")return zr(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 zr(r.innerType,n);if(r.type==="intersection")return zr(r.left,n)||zr(r.right,n);if(r.type==="record"||r.type==="map")return zr(r.keyType,n)||zr(r.valueType,n);if(r.type==="pipe")return zr(r.in,n)||zr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(zr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(zr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(zr(i,n))return!0;return!!(r.rest&&zr(r.rest,n))}return!1}const QX=(e,t={})=>n=>{const r=F5({...n,processors:t});return Qn(e,r),K5(r,e),H5(r,e)},py=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=F5({...i??{},target:a,io:t,processors:n});return Qn(e,o),K5(o,e),H5(o,e)},WX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},YX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),c&&(i.format=WX[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},ZX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},XX=(e,t,n,r)=>{n.type="boolean"},JX=(e,t,n,r)=>{n.not={}},eJ=(e,t,n,r)=>{},tJ=(e,t,n,r)=>{const i=e._zod.def,a=S5(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},nJ=(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},rJ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},iJ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},aJ=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=Qn(a.element,t,{...r,path:[...r.path,"items"]})},sJ=(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]=Qn(o[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(o)),d=new Set([...c].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Qn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},oJ=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((c,d)=>Qn(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},lJ=(e,t,n,r)=>{const i=e._zod.def,a=Qn(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Qn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(a)?a.allOf:[a],...c(o)?o.allOf:[o]];n.allOf=d},cJ=(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=Qn(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=Qn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Qn(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)}},uJ=(e,t,n,r)=>{const i=e._zod.def,a=Qn(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"}]},dJ=(e,t,n,r)=>{const i=e._zod.def;Qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},fJ=(e,t,n,r)=>{const i=e._zod.def;Qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},hJ=(e,t,n,r)=>{const i=e._zod.def;Qn(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)))},pJ=(e,t,n,r)=>{const i=e._zod.def;Qn(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},mJ=(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;Qn(a,t,r);const o=t.seen.get(e);o.ref=a},gJ=(e,t,n,r)=>{const i=e._zod.def;Qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},G5=(e,t,n,r)=>{const i=e._zod.def;Qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},yJ=ve("ZodISODateTime",(e,t)=>{vZ.init(e,t),jn.init(e,t)});function vJ(e){return NX(yJ,e)}const xJ=ve("ZodISODate",(e,t)=>{xZ.init(e,t),jn.init(e,t)});function bJ(e){return kX(xJ,e)}const wJ=ve("ZodISOTime",(e,t)=>{bZ.init(e,t),jn.init(e,t)});function SJ(e){return CX(wJ,e)}const jJ=ve("ZodISODuration",(e,t)=>{wZ.init(e,t),jn.init(e,t)});function NJ(e){return AX(jJ,e)}const kJ=(e,t)=>{C5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>dY(e,n)},flatten:{value:n=>uY(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,l1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,l1,2)}},isEmpty:{get(){return e.issues.length===0}}})},Xi=ve("ZodError",kJ,{Parent:Error}),CJ=pk(Xi),AJ=mk(Xi),OJ=Dv(Xi),EJ=Iv(Xi),_J=pY(Xi),PJ=mY(Xi),TJ=gY(Xi),zJ=yY(Xi),RJ=vY(Xi),DJ=xY(Xi),IJ=bY(Xi),MJ=wY(Xi),Sn=ve("ZodType",(e,t)=>(wn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:py(e,"input"),output:py(e,"output")}}),e.toJSONSchema=QX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Xo(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)=>Jo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>CJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>OJ(e,n,r),e.parseAsync=async(n,r)=>AJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>EJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>_J(e,n,r),e.decode=(n,r)=>PJ(e,n,r),e.encodeAsync=async(n,r)=>TJ(e,n,r),e.decodeAsync=async(n,r)=>zJ(e,n,r),e.safeEncode=(n,r)=>RJ(e,n,r),e.safeDecode=(n,r)=>DJ(e,n,r),e.safeEncodeAsync=async(n,r)=>IJ(e,n,r),e.safeDecodeAsync=async(n,r)=>MJ(e,n,r),e.refine=(n,r)=>e.check(Tee(n,r)),e.superRefine=n=>e.check(zee(n)),e.overwrite=n=>e.check(jd(n)),e.optional=()=>jT(e),e.exactOptional=()=>xee(e),e.nullable=()=>NT(e),e.nullish=()=>jT(NT(e)),e.nonoptional=n=>kee(e,n),e.array=()=>Ae(e),e.or=n=>cee([e,n]),e.and=n=>hee(e,n),e.transform=n=>kT(e,yee(n)),e.default=n=>See(e,n),e.prefault=n=>Nee(e,n),e.catch=n=>Aee(e,n),e.pipe=n=>kT(e,n),e.readonly=()=>_ee(e),e.describe=n=>{const r=e.clone();return lh.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return lh.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return lh.get(e);const r=e.clone();return lh.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),V5=ve("_ZodString",(e,t)=>{gk.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>YX(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(zX(...r)),e.includes=(...r)=>e.check(IX(...r)),e.startsWith=(...r)=>e.check(MX(...r)),e.endsWith=(...r)=>e.check(LX(...r)),e.min=(...r)=>e.check(hy(...r)),e.max=(...r)=>e.check(U5(...r)),e.length=(...r)=>e.check(q5(...r)),e.nonempty=(...r)=>e.check(hy(1,...r)),e.lowercase=r=>e.check(RX(r)),e.uppercase=r=>e.check(DX(r)),e.trim=()=>e.check(BX()),e.normalize=(...r)=>e.check($X(...r)),e.toLowerCase=()=>e.check(UX()),e.toUpperCase=()=>e.check(qX()),e.slugify=()=>e.check(FX())}),LJ=ve("ZodString",(e,t)=>{gk.init(e,t),V5.init(e,t),e.email=n=>e.check(rX($J,n)),e.url=n=>e.check(lX(BJ,n)),e.jwt=n=>e.check(jX(tee,n)),e.emoji=n=>e.check(cX(UJ,n)),e.guid=n=>e.check(yT(wT,n)),e.uuid=n=>e.check(iX(Zm,n)),e.uuidv4=n=>e.check(aX(Zm,n)),e.uuidv6=n=>e.check(sX(Zm,n)),e.uuidv7=n=>e.check(oX(Zm,n)),e.nanoid=n=>e.check(uX(qJ,n)),e.guid=n=>e.check(yT(wT,n)),e.cuid=n=>e.check(dX(FJ,n)),e.cuid2=n=>e.check(fX(KJ,n)),e.ulid=n=>e.check(hX(HJ,n)),e.base64=n=>e.check(bX(XJ,n)),e.base64url=n=>e.check(wX(JJ,n)),e.xid=n=>e.check(pX(GJ,n)),e.ksuid=n=>e.check(mX(VJ,n)),e.ipv4=n=>e.check(gX(QJ,n)),e.ipv6=n=>e.check(yX(WJ,n)),e.cidrv4=n=>e.check(vX(YJ,n)),e.cidrv6=n=>e.check(xX(ZJ,n)),e.e164=n=>e.check(SX(eee,n)),e.datetime=n=>e.check(vJ(n)),e.date=n=>e.check(bJ(n)),e.time=n=>e.check(SJ(n)),e.duration=n=>e.check(NJ(n))});function R(e){return nX(LJ,e)}const jn=ve("ZodStringFormat",(e,t)=>{gn.init(e,t),V5.init(e,t)}),$J=ve("ZodEmail",(e,t)=>{cZ.init(e,t),jn.init(e,t)}),wT=ve("ZodGUID",(e,t)=>{oZ.init(e,t),jn.init(e,t)}),Zm=ve("ZodUUID",(e,t)=>{lZ.init(e,t),jn.init(e,t)}),BJ=ve("ZodURL",(e,t)=>{uZ.init(e,t),jn.init(e,t)}),UJ=ve("ZodEmoji",(e,t)=>{dZ.init(e,t),jn.init(e,t)}),qJ=ve("ZodNanoID",(e,t)=>{fZ.init(e,t),jn.init(e,t)}),FJ=ve("ZodCUID",(e,t)=>{hZ.init(e,t),jn.init(e,t)}),KJ=ve("ZodCUID2",(e,t)=>{pZ.init(e,t),jn.init(e,t)}),HJ=ve("ZodULID",(e,t)=>{mZ.init(e,t),jn.init(e,t)}),GJ=ve("ZodXID",(e,t)=>{gZ.init(e,t),jn.init(e,t)}),VJ=ve("ZodKSUID",(e,t)=>{yZ.init(e,t),jn.init(e,t)}),QJ=ve("ZodIPv4",(e,t)=>{SZ.init(e,t),jn.init(e,t)}),WJ=ve("ZodIPv6",(e,t)=>{jZ.init(e,t),jn.init(e,t)}),YJ=ve("ZodCIDRv4",(e,t)=>{NZ.init(e,t),jn.init(e,t)}),ZJ=ve("ZodCIDRv6",(e,t)=>{kZ.init(e,t),jn.init(e,t)}),XJ=ve("ZodBase64",(e,t)=>{CZ.init(e,t),jn.init(e,t)}),JJ=ve("ZodBase64URL",(e,t)=>{OZ.init(e,t),jn.init(e,t)}),eee=ve("ZodE164",(e,t)=>{EZ.init(e,t),jn.init(e,t)}),tee=ve("ZodJWT",(e,t)=>{PZ.init(e,t),jn.init(e,t)}),Q5=ve("ZodNumber",(e,t)=>{I5.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>ZX(e,r,i),e.gt=(r,i)=>e.check(xT(r,i)),e.gte=(r,i)=>e.check(Tw(r,i)),e.min=(r,i)=>e.check(Tw(r,i)),e.lt=(r,i)=>e.check(vT(r,i)),e.lte=(r,i)=>e.check(Pw(r,i)),e.max=(r,i)=>e.check(Pw(r,i)),e.int=r=>e.check(ST(r)),e.safe=r=>e.check(ST(r)),e.positive=r=>e.check(xT(0,r)),e.nonnegative=r=>e.check(Tw(0,r)),e.negative=r=>e.check(vT(0,r)),e.nonpositive=r=>e.check(Pw(0,r)),e.multipleOf=(r,i)=>e.check(bT(r,i)),e.step=(r,i)=>e.check(bT(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 he(e){return OX(Q5,e)}const nee=ve("ZodNumberFormat",(e,t)=>{TZ.init(e,t),Q5.init(e,t)});function ST(e){return EX(nee,e)}const ree=ve("ZodBoolean",(e,t)=>{zZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XX(e,n,r)});function ct(e){return _X(ree,e)}const iee=ve("ZodUnknown",(e,t)=>{RZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eJ()});function ad(){return PX(iee)}const aee=ve("ZodNever",(e,t)=>{DZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JX(e,n,r)});function see(e){return TX(aee,e)}const oee=ve("ZodArray",(e,t)=>{IZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aJ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(hy(n,r)),e.nonempty=n=>e.check(hy(1,n)),e.max=(n,r)=>e.check(U5(n,r)),e.length=(n,r)=>e.check(q5(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return KX(oee,e,t)}const lee=ve("ZodObject",(e,t)=>{LZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sJ(e,n,r,i),It(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ad()}),e.loose=()=>e.clone({...e._zod.def,catchall:ad()}),e.strict=()=>e.clone({...e._zod.def,catchall:see()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>aY(e,n),e.safeExtend=n=>sY(e,n),e.merge=n=>oY(e,n),e.pick=n=>rY(e,n),e.omit=n=>iY(e,n),e.partial=(...n)=>lY(Y5,e,n[0]),e.required=(...n)=>cY(Z5,e,n[0])});function ye(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new lee(n)}const W5=ve("ZodUnion",(e,t)=>{$5.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oJ(e,n,r,i),e.options=t.options});function cee(e,t){return new W5({type:"union",options:e,...Fe(t)})}const uee=ve("ZodDiscriminatedUnion",(e,t)=>{W5.init(e,t),$Z.init(e,t)});function dee(e,t,n){return new uee({type:"union",options:t,discriminator:e,...Fe(n)})}const fee=ve("ZodIntersection",(e,t)=>{BZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lJ(e,n,r,i)});function hee(e,t){return new fee({type:"intersection",left:e,right:t})}const pee=ve("ZodRecord",(e,t)=>{UZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cJ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function kc(e,t,n){return new pee({type:"record",keyType:e,valueType:t,...Fe(n)})}const u1=ve("ZodEnum",(e,t)=>{qZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>tJ(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 u1({...t,checks:[],...Fe(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 u1({...t,checks:[],...Fe(i),entries:a})}});function tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new u1({type:"enum",entries:n,...Fe(t)})}const mee=ve("ZodLiteral",(e,t)=>{FZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nJ(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 qa(e,t){return new mee({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const gee=ve("ZodTransform",(e,t)=>{KZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iJ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new b5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Eh(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(Eh(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function yee(e){return new gee({type:"transform",transform:e})}const Y5=ve("ZodOptional",(e,t)=>{B5.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>G5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jT(e){return new Y5({type:"optional",innerType:e})}const vee=ve("ZodExactOptional",(e,t)=>{HZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>G5(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function xee(e){return new vee({type:"optional",innerType:e})}const bee=ve("ZodNullable",(e,t)=>{GZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function NT(e){return new bee({type:"nullable",innerType:e})}const wee=ve("ZodDefault",(e,t)=>{VZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function See(e,t){return new wee({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():N5(t)}})}const jee=ve("ZodPrefault",(e,t)=>{QZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Nee(e,t){return new jee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():N5(t)}})}const Z5=ve("ZodNonOptional",(e,t)=>{WZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kee(e,t){return new Z5({type:"nonoptional",innerType:e,...Fe(t)})}const Cee=ve("ZodCatch",(e,t)=>{YZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Aee(e,t){return new Cee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Oee=ve("ZodPipe",(e,t)=>{ZZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mJ(e,n,r,i),e.in=t.in,e.out=t.out});function kT(e,t){return new Oee({type:"pipe",in:e,out:t})}const Eee=ve("ZodReadonly",(e,t)=>{XZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _ee(e){return new Eee({type:"readonly",innerType:e})}const Pee=ve("ZodCustom",(e,t)=>{JZ.init(e,t),Sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rJ(e,n)});function Tee(e,t={}){return HX(Pee,e,t)}function zee(e){return GX(e)}ye({maxConcurrency:he().int().positive(),maxRequestsPerMinute:he().int().positive(),maxRequestsPerDay:he().int().positive()});const Ls=R().min(1);R().min(1);const yk=ye({label:R().min(1),city:R().min(1),region:R().min(1),country:R().length(2),timezone:R().optional()}),vk=tt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ye({id:R(),projectId:R(),channel:qa("webhook"),url:R().url(),urlDisplay:R(),urlHost:R(),events:Ae(vk),enabled:ct().default(!0),source:R().optional(),webhookSecret:R().optional(),createdAt:R(),updatedAt:R()});ye({channel:qa("webhook"),url:R().url(),events:Ae(vk).min(1),source:R().optional()});const X5=tt(["cli","api","config-file"]);function Ree(e){const t=new Set,n=new Set;for(const r of e){if(t.has(r.label)){n.add(r.label);continue}t.add(r.label)}return[...n]}function Dee(e,t){return t?e.some(n=>n.label===t):!0}ye({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional(),country:R().length(2),language:R().min(2),tags:Ae(R()).optional(),labels:kc(R(),R()).optional(),providers:Ae(Ls).optional(),locations:Ae(yk).optional(),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().optional(),configSource:X5.optional()});ye({id:R(),name:R(),displayName:R().optional(),canonicalDomain:R(),ownedDomains:Ae(R()).default([]),country:R().length(2),language:R().min(2),tags:Ae(R()).default([]),labels:kc(R(),R()).default({}),locations:Ae(yk).default([]),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().default(!1),configSource:X5.default("cli"),configRevision:he().int().positive().default(1),createdAt:R().optional(),updatedAt:R().optional()});ye({id:R(),query:R(),createdAt:R()});ye({id:R(),keyword:R(),createdAt:R()});ye({queries:Ae(R().trim().min(1)).min(1)});ye({keywords:Ae(R().trim().min(1)).min(1)});ye({provider:Ls,count:he().int().min(1).max(20).optional()});ye({id:R(),domain:R(),createdAt:R()});ye({competitors:Ae(R().trim().min(1)).min(1)});function my(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const Iee=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function Mee(e){const t=my(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return Iee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function Lee(e){const t=Mee(e);return t?t.split(".")[0]??"":""}function $ee(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=my(a);n.has(o)||(n.add(o),r.push(a))}return r}const Bee=ye({name:R().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:kc(R(),R()).optional().default({})}),Uee=ye({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),providers:Ae(Ls).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),qee=ye({channel:qa("webhook"),url:R().url(),events:Ae(vk).min(1)}),Fee=ye({gsc:ye({propertyUrl:R()}).optional(),syncSchedule:ye({preset:R().optional(),cron:R().optional()}).optional()}).optional(),CT=Ae(R().min(1)),Kee=ye({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional().default([]),country:R().length(2),language:R().min(2),queries:CT.optional(),keywords:CT.optional(),competitors:Ae(R().min(1)).optional().default([]),providers:Ae(Ls).optional().default([]),locations:Ae(yk).optional().default([]),defaultLocation:R().optional(),schedule:Uee,notifications:Ae(qee).optional().default([]),google:Fee,autoExtractBacklinks:ct().optional().default(!1)}).superRefine((e,t)=>{e.queries!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const n=Ree(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),Dee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ye({apiVersion:qa("canonry/v1"),kind:qa("Project"),metadata:Bee,spec:Kee});const Hee=tt(["gsc","ga4"]);ye({id:R(),domain:R(),connectionType:Hee,propertyId:R().nullable().optional(),sitemapUrl:R().nullable().optional(),scopes:Ae(R()).default([]),createdAt:R(),updatedAt:R()});ye({date:R(),query:R(),page:R(),country:R().nullable().optional(),device:R().nullable().optional(),clicks:he(),impressions:he(),ctr:he(),position:he()});const d1=ye({id:R(),url:R(),indexingState:R().nullable().optional(),verdict:R().nullable().optional(),coverageState:R().nullable().optional(),pageFetchState:R().nullable().optional(),robotsTxtState:R().nullable().optional(),crawlTime:R().nullable().optional(),lastCrawlResult:R().nullable().optional(),isMobileFriendly:ct().nullable().optional(),richResults:Ae(R()).default([]),inspectedAt:R()});tt(["stable","reindexed","deindexed","still-missing","new"]);const Gee=ye({url:R(),previousState:R().nullable(),currentState:R().nullable(),transitionDate:R()}),Vee=ye({reason:R(),count:he(),urls:Ae(d1).default([])});ye({summary:ye({total:he(),indexed:he(),notIndexed:he(),deindexed:he(),percentage:he()}),lastInspectedAt:R().nullable(),lastSyncedAt:R().nullable(),indexed:Ae(d1).default([]),notIndexed:Ae(d1).default([]),deindexed:Ae(Gee).default([]),reasonGroups:Ae(Vee).default([])});ye({url:R(),type:tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R()});ye({url:R(),type:tt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R(),status:tt(["success","error"]),error:R().optional()});ye({date:R(),indexed:he(),notIndexed:he(),reasonBreakdown:kc(R(),he()).default({})});ye({id:R(),domain:R(),siteUrl:R().nullable().optional(),createdAt:R(),updatedAt:R()});const zw=ye({id:R(),url:R(),httpCode:he().nullable().optional(),inIndex:ct().nullable().optional(),lastCrawledDate:R().nullable().optional(),inIndexDate:R().nullable().optional(),inspectedAt:R(),documentSize:he().nullable().optional(),anchorCount:he().nullable().optional(),discoveryDate:R().nullable().optional()});ye({summary:ye({total:he(),indexed:he(),notIndexed:he(),unknown:he().optional(),percentage:he()}),lastInspectedAt:R().nullable(),indexed:Ae(zw).default([]),notIndexed:Ae(zw).default([]),unknown:Ae(zw).default([]).optional()});ye({query:R(),impressions:he(),clicks:he(),ctr:he(),averagePosition:he()});ye({date:R(),indexed:he(),notIndexed:he(),unknown:he()});ye({url:R(),status:tt(["success","error"]),submittedAt:R(),error:R().optional()});const Nd=tt(["live","staging"]);ye({projectName:R(),url:R(),stagingUrl:R().optional(),username:R(),defaultEnv:Nd,createdAt:R(),updatedAt:R()});const AT=ye({url:R(),reachable:ct(),pageCount:he().nullable().optional(),version:R().nullable().optional(),error:R().nullable().optional(),plugins:Ae(R()).optional(),authenticatedUser:ye({id:he(),slug:R()}).nullable().optional()});ye({connected:ct(),projectName:R(),defaultEnv:Nd,live:AT.nullable(),staging:AT.nullable(),adminUrl:R().nullable().optional()});const Qee=ye({id:he(),slug:R(),title:R(),status:R(),modifiedAt:R().nullable().optional(),link:R().nullable().optional()}),J5=ye({title:R().nullable(),description:R().nullable(),noindex:ct().nullable(),writable:ct().default(!1),writeTargets:Ae(R()).default([])}),Wee=ye({type:R(),json:kc(R(),ad())}),Yee=Qee.extend({env:Nd,content:R(),seo:J5,schemaBlocks:Ae(Wee).default([])}),OT=Yee.extend({contentHash:R(),contentSnippet:R()}),e4=ye({manualRequired:qa(!0),targetUrl:R(),adminUrl:R().nullable().optional(),content:R(),nextSteps:Ae(R()).default([])}),Zee=ye({slug:R(),severity:tt(["high","medium","low"]),code:tt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:R()});ye({slug:R(),title:R(),status:R(),wordCount:he(),seo:J5,schemaPresent:ct(),issues:Ae(Zee).default([])});const Xee=ye({slug:R(),status:tt(["applied","skipped","manual"]),error:R().optional(),manualAssist:e4.optional()});ye({env:Nd,strategy:tt(["plugin","manual"]),results:Ae(Xee)});const Jee=ye({slug:R(),status:tt(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(R()).optional(),manualAssist:e4.optional(),error:R().optional()});ye({env:Nd,results:Ae(Jee)});const ete=ye({slug:R(),title:R(),canonrySchemas:Ae(R()),thirdPartySchemas:Ae(R()),hasCanonrySchema:ct()});ye({env:Nd,pages:Ae(ete)});const tte=ye({name:R(),status:tt(["completed","skipped","failed"]),summary:R().optional(),error:R().optional()});ye({projectName:R(),steps:Ae(tte)});ye({slug:R(),live:OT,staging:OT,hasDifferences:ct(),differences:ye({title:ct(),slug:ct(),content:ct(),seoTitle:ct(),seoDescription:ct(),noindex:ct(),schema:ct()})});const t4=tt(["queued","running","completed","partial","failed","cancelled"]),Kt=t4.enum,n4=tt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),yt=n4.enum,r4=tt(["manual","scheduled","config-apply"]),mh=r4.enum,sd=tt(["cited","not-cited"]),Lr=sd.enum,gy=tt(["visible","not-visible"]);gy.enum;const i4=tt(["new","cited","lost","emerging","not-cited"]);i4.enum;ye({kind:qa(yt["answer-visibility"]).optional(),trigger:qa(mh.manual).optional(),providers:Ae(Ls).optional(),location:R().min(1).optional(),allLocations:ct().optional(),noLocation:ct().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const nte=ye({message:R(),raw:ad().optional()}),rte=ye({message:R().optional(),providers:kc(R(),nte).optional()}),ite=ye({id:R(),projectId:R(),kind:n4,status:t4,trigger:r4.default("manual"),location:R().nullable().optional(),startedAt:R().nullable().optional(),finishedAt:R().nullable().optional(),error:rte.nullable().optional(),createdAt:R()});function xk(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 a4=ye({uri:R(),title:R()}),s4=ye({id:R(),runId:R(),queryId:R(),query:R().optional(),provider:Ls,citationState:sd,answerMentioned:ct().optional(),visibilityState:gy.optional(),transition:i4.optional(),answerText:R().nullable().optional(),citedDomains:Ae(R()).default([]),competitorOverlap:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),matchedTerms:Ae(R()).default([]),groundingSources:Ae(a4).default([]),searchQueries:Ae(R()).default([]),model:R().nullable().optional(),location:R().nullable().optional(),createdAt:R()});ye({snapshots:Ae(s4),total:he().int().nonnegative()});const ate=ye({queryId:R().nullable(),query:R().nullable(),run1State:sd.nullable(),run2State:sd.nullable(),run1AnswerMentioned:ct().nullable(),run2AnswerMentioned:ct().nullable(),run1VisibilityState:gy.nullable(),run2VisibilityState:gy.nullable(),changed:ct(),visibilityChanged:ct()});ye({run1:R(),run2:R(),diff:Ae(ate)});const ste=ite.extend({snapshots:Ae(s4).optional()});ye({totalRuns:he().int().nonnegative(),run:ste.nullable()});ye({id:R(),projectId:R().nullable().optional(),actor:R(),action:R(),entityType:R(),entityId:R().nullable().optional(),diff:ad().optional(),createdAt:R()});const ote=tt(["yes","no","unknown","not-mentioned"]),ET=Ae(R().min(1));ye({companyName:R().min(1),domain:R().min(1),queries:ET.optional(),phrases:ET.optional(),competitors:Ae(R().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const lte=ye({name:R(),count:he().int().nonnegative()}),cte=ye({id:R(),name:R(),weight:he(),score:he(),grade:R(),status:tt(["pass","partial","fail"]),findings:Ae(ye({type:R(),message:R()})).default([]),recommendations:Ae(R()).default([])}),ute=ye({url:R(),finalUrl:R(),auditedAt:R(),overallScore:he(),overallGrade:R(),summary:R(),factors:Ae(cte).default([])}),dte=ye({industry:R(),summary:R(),services:Ae(R()).default([]),categoryTerms:Ae(R()).default([])}),fte=ye({provider:R(),displayName:R(),model:R().nullable().optional(),mentioned:ct(),cited:ct(),describedAccurately:ote,accuracyNotes:R().nullable().optional(),incorrectClaims:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),citedDomains:Ae(R()).default([]),groundingSources:Ae(a4).default([]),searchQueries:Ae(R()).default([]),answerText:R(),error:R().nullable().optional()}),hte=ye({query:R(),providerResults:Ae(fte).default([])}),pte=ye({totalQueries:he().int().nonnegative(),totalProviders:he().int().nonnegative(),totalComparisons:he().int().nonnegative(),mentionCount:he().int().nonnegative(),citationCount:he().int().nonnegative(),topCompetitors:Ae(lte).default([]),visibilityGap:R(),whatThisMeans:Ae(R()).default([]),recommendedActions:Ae(R()).default([])});ye({companyName:R(),domain:R(),homepageUrl:R(),generatedAt:R(),queries:Ae(R()).default([]),competitors:Ae(R()).default([]),profile:dte,audit:ute,queryResults:Ae(hte).default([]),summary:pte});ye({id:R(),projectId:R(),cronExpr:R(),preset:R().nullable().optional(),timezone:R().default("UTC"),enabled:ct().default(!0),providers:Ae(Ls).default([]),lastRunAt:R().nullable().optional(),nextRunAt:R().nullable().optional(),createdAt:R(),updatedAt:R()});ye({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),enabled:ct().optional().default(!0),providers:Ae(Ls).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const mte=tt(["mentioned","cited"]);mte.enum;ye({id:R(),projectId:R(),propertyId:R(),clientEmail:R(),connected:ct(),createdAt:R(),updatedAt:R()});ye({date:R(),landingPage:R(),sessions:he(),organicSessions:he(),users:he()});const bk=tt(["session","first_user","manual_utm"]),gte=ye({source:R(),medium:R(),sessions:he(),users:he(),sourceDimension:bk}),yte=ye({source:R(),medium:R(),sourceDimension:bk,landingPage:R(),sessions:he(),users:he()}),vte=ye({source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ye({totalSessions:he(),totalOrganicSessions:he(),totalDirectSessions:he(),totalUsers:he(),topPages:Ae(ye({landingPage:R(),sessions:he(),organicSessions:he(),directSessions:he(),users:he()})),aiReferrals:Ae(gte),aiReferralLandingPages:Ae(yte),aiSessionsDeduped:he(),aiUsersDeduped:he(),aiSessionsBySession:he(),aiUsersBySession:he(),socialReferrals:Ae(vte),socialSessions:he(),socialUsers:he(),organicSharePct:he(),aiSharePct:he(),aiSharePctBySession:he(),directSharePct:he(),socialSharePct:he(),organicSharePctDisplay:R(),aiSharePctDisplay:R(),aiSharePctBySessionDisplay:R(),directSharePctDisplay:R(),socialSharePctDisplay:R(),lastSyncedAt:R().nullable()});ye({date:R(),source:R(),medium:R(),landingPage:R(),sessions:he(),users:he(),sourceDimension:bk});ye({date:R(),source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ye({date:R(),sessions:he(),organicSessions:he(),users:he()});function yy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const xte=tt(["aero","user","compaction"]);xte.enum;const o4=128;ye({key:R().min(1).max(o4),value:R().min(1)});ye({key:R().min(1).max(o4)});const wk=tt(["queued","downloading","querying","ready","failed"]);wk.enum;ye({id:R(),release:R(),status:wk,phaseDetail:R().nullable().optional(),vertexPath:R().nullable().optional(),edgesPath:R().nullable().optional(),vertexSha256:R().nullable().optional(),edgesSha256:R().nullable().optional(),vertexBytes:he().int().nullable().optional(),edgesBytes:he().int().nullable().optional(),projectsProcessed:he().int().nullable().optional(),domainsDiscovered:he().int().nullable().optional(),downloadStartedAt:R().nullable().optional(),downloadFinishedAt:R().nullable().optional(),queryStartedAt:R().nullable().optional(),queryFinishedAt:R().nullable().optional(),error:R().nullable().optional(),createdAt:R(),updatedAt:R()});const bte=ye({linkingDomain:R(),numHosts:he().int()}),wte=ye({projectId:R(),release:R(),targetDomain:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R(),excludedLinkingDomains:he().int().optional(),excludedHosts:he().int().optional()});ye({summary:wte.nullable(),total:he().int(),rows:Ae(bte)});ye({release:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R()});ye({duckdbInstalled:ct(),duckdbVersion:R().nullable().optional(),duckdbSpec:R(),pluginDir:R()});ye({installed:ct(),version:R(),path:R(),alreadyPresent:ct()});ye({release:R(),vertexUrl:R(),edgesUrl:R(),vertexBytes:he().int().nullable(),edgesBytes:he().int().nullable(),lastModified:R().nullable()});ye({release:R(),syncStatus:wk.nullable(),bytes:he().int(),lastUsedAt:R().nullable()});tt(["snapshot","insight"]);const Ste=ye({kind:qa("snapshot"),id:R(),runId:R(),query:R(),provider:R(),model:R().nullable(),citationState:sd,matchedField:tt(["answerText","citedDomains","searchQueries","query"]),snippet:R(),createdAt:R()}),jte=ye({kind:qa("insight"),id:R(),runId:R().nullable(),type:tt(["regression","gain","opportunity"]),severity:tt(["critical","high","medium","low"]),title:R(),query:R(),provider:R(),matchedField:tt(["title","query","recommendation","cause"]),snippet:R(),dismissed:ct(),createdAt:R()}),Nte=dee("kind",[Ste,jte]);ye({query:R(),totalHits:he().int().nonnegative(),truncated:ct(),hits:Ae(Nte)});const l4=tt(["create","expand","refresh","add-schema"]);l4.enum;const c4=tt(["gsc","competitor-evidence","both"]);c4.enum;const u4=tt(["high","medium","low"]);u4.enum;const kte=tt(["blog-post","comparison","listicle","how-to","guide","glossary"]);kte.enum;const d4=tt(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);d4.enum;const Cte=ye({url:R(),gscImpressions:he().nonnegative(),gscClicks:he().nonnegative(),gscAvgPosition:he().nonnegative().nullable(),organicSessions:he().nonnegative()}),Ate=ye({domain:R(),url:R(),title:R(),citationCount:he().int().nonnegative()}),Ote=ye({demand:he(),competitor:he(),absence:he(),gapSeverity:he()}),Ete=ye({actionId:R(),state:d4,lastUpdated:R()}),_te=ye({targetRef:R(),query:R(),action:l4,ourBestPage:Cte.nullable(),winningCompetitor:Ate.nullable(),score:he(),scoreBreakdown:Ote,drivers:Ae(R()),demandSource:c4,actionConfidence:u4,existingAction:Ete.nullable()});ye({targets:Ae(_te),contextMetrics:ye({totalAiReferralSessions:he().int().nonnegative(),latestRunId:R(),runTimestamp:R()})});const Pte=ye({uri:R(),title:R(),domain:R(),isOurDomain:ct(),isCompetitor:ct(),citationCount:he().int().nonnegative(),providers:Ae(Ls)}),Tte=ye({query:R(),groundingSources:Ae(Pte)});ye({sources:Ae(Tte),latestRunId:R()});const zte=ye({query:R(),competitorDomains:Ae(R()),competitorCount:he().int().nonnegative(),missRate:he().min(0).max(1),lastSeenInRunId:R()});ye({gaps:Ae(zte),latestRunId:R()});const f4=tt(["ok","warn","fail","skipped"]);f4.enum;const Sk=tt(["global","project"]);Sk.enum;const h4=tt(["auth","config","providers","integrations","database","schedules"]);h4.enum;const Rte=ye({id:R(),category:h4,scope:Sk,title:R(),status:f4,code:R().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:R(),remediation:R().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:kc(R(),ad()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:he().int().nonnegative().describe("How long the check took to execute.")});ye({scope:Sk,project:R().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:R().describe("ISO-8601 timestamp when this doctor run started."),durationMs:he().int().nonnegative(),summary:ye({total:he().int().nonnegative(),ok:he().int().nonnegative(),warn:he().int().nonnegative(),fail:he().int().nonnegative(),skipped:he().int().nonnegative()}),checks:Ae(Rte)});function Dte(e,t){if(!e)return"";const n=e.trim();if(!n)return"";if(/^https?:\/\//i.test(n))return n;if(n.startsWith("//"))return`https:${n}`;const r=t.trim().replace(/^https?:\/\//i,"").replace(/\/+$/,"");return r?n.startsWith("/")?`https://${r}${n}`:`https://${r}/${n}`:n}const Ite=ye({provider:R(),citationState:sd,cited:ct(),mentioned:ct(),runId:R(),runCreatedAt:R()}),Mte=ye({queryId:R(),query:R(),providers:Ae(Ite),citedCount:he().int().nonnegative(),mentionedCount:he().int().nonnegative(),totalProviders:he().int().nonnegative()}),Lte=ye({queryId:R(),query:R(),provider:R(),citingCompetitors:Ae(R()),runId:R(),runCreatedAt:R()}),$te=ye({providersConfigured:he().int().nonnegative(),providersCiting:he().int().nonnegative(),providersMentioning:he().int().nonnegative(),totalQueries:he().int().nonnegative(),queriesCitedAndMentioned:he().int().nonnegative(),queriesCitedOnly:he().int().nonnegative(),queriesMentionedOnly:he().int().nonnegative(),queriesInvisible:he().int().nonnegative(),latestRunId:R().nullable(),latestRunAt:R().nullable()});ye({summary:$te,byQuery:Ae(Mte),competitorGaps:Ae(Lte),status:tt(["ready","no-data"]),reason:tt(["no-runs-yet","no-queries"]).optional()});const Bte=tt(["claude","codex"]);Bte.enum;const Ute=tt(["claude","codex","all"]);Ute.enum;var Ro=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Ro||{});const qte={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Xm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},Fte=xk;function Kte(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 Lv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ca(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function _T(e){return e===null?"Unknown":e?"Pass":"Fail"}function f1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Hte(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function Gte(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 Rw(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 ${f1(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${f1(c)} · ${r}`}return`${e} · ${r}`}function vy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function p4(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 Vte(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 Qte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Wte(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Ho(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
-
`):void 0}function Yte(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:vy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:vy(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Wte(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function Zte(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 Xte(e,t,n){const r=Zte(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(c=>c.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const m4="canonry.run-tracker",h1=new Set;let PT=!1,Jte=0,$v={runs:{},batches:{}};function ene(){const e=sc();for(const t of h1)t(e)}function tne(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function nne(){typeof window>"u"||window.sessionStorage.setItem(m4,JSON.stringify($v))}function g4(){PT||(PT=!0,!(typeof window>"u")&&($v=tne(window.sessionStorage.getItem(m4))))}function Bv(e){$v=e,nne(),ene()}function sc(){return g4(),$v}function rne(e){return g4(),h1.add(e),()=>{h1.delete(e)}}function y4(e){const t=sc();Bv({...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 TT(e){const t=sc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Bv({...t,runs:r})}function ine(e){const t=sc(),n=`batch_${Date.now()}_${++Jte}`;return Bv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function ane(e){const t=sc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Bv({...t,batches:r})}function jk(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function sne(e,t){let n=0,r=0,i=0,a=0,o=0;for(const c of e){const d=t[c]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function zT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=zT(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():zT(e[i],null)}}}}function Cc(...e){return x.useCallback(Nk(...e),e)}var one=Symbol.for("react.lazy"),xy=kv[" use ".trim().toString()];function lne(e){return typeof e=="object"&&e!==null&&"then"in e}function v4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===one&&"_payload"in e&&lne(e._payload)}function cne(e){const t=dne(e),n=x.forwardRef((r,i)=>{let{children:a,...o}=r;v4(a)&&typeof xy=="function"&&(a=xy(a._payload));const c=x.Children.toArray(a),d=c.find(hne);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var une=cne("Slot");function dne(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(v4(i)&&typeof xy=="function"&&(i=xy(i._payload)),x.isValidElement(i)){const o=mne(i),c=pne(a,i.props);return i.type!==x.Fragment&&(c.ref=r?Nk(r,o):o),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fne=Symbol("radix.slottable");function hne(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fne}function pne(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function mne(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 x4(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=x4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=x4(e))&&(r&&(r+=" "),r+=t);return r}const RT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DT=jt,b4=(e,t)=>n=>{var r;if(t?.variants==null)return DT(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 g=RT(p)||RT(m);return i[f][g]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,g]=p;return g===void 0||(f[m]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:g,...v}=p;return Object.entries(v).every(w=>{let[b,j]=w;return Array.isArray(j)?j.includes({...a,...c}[b]):{...a,...c}[b]===j})?[...f,m,g]:f},[]);return DT(e,o,d,n?.class,n?.className)},gne=(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},yne=(e,t)=>({classGroupId:e,validator:t}),w4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),by="-",IT=[],vne="arbitrary..",xne=e=>{const t=wne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return bne(o);const c=o.split(by),d=c[0]===""&&c.length>1?1:0;return S4(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],f=n[o];return d?f?gne(f,d):d:f||IT}return n[o]||IT}}},S4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=S4(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const c=t===0?e.join(by):e.slice(t).join(by),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(c))return p.classGroupId}},bne=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?vne+r:void 0})(),wne=e=>{const{theme:t,classGroups:n}=e;return Sne(n,t)},Sne=(e,t)=>{const n=w4();for(const r in e){const i=e[r];kk(i,n,r,t)}return n},kk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];jne(o,t,n,r)}},jne=(e,t,n,r)=>{if(typeof e=="string"){Nne(e,t,n);return}if(typeof e=="function"){kne(e,t,n,r);return}Cne(e,t,n,r)},Nne=(e,t,n)=>{const r=e===""?t:j4(t,e);r.classGroupId=n},kne=(e,t,n,r)=>{if(Ane(e)){kk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(yne(n,e))},Cne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[c,d]=i[o];kk(d,j4(t,c),n,r)}},j4=(e,t)=>{let n=e;const r=t.split(by),i=r.length;for(let a=0;a<i;a++){const o=r[a];let c=n.nextPart.get(o);c||(c=w4(),n.nextPart.set(o,c)),n=c}return n},Ane=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,One=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)}}},p1="!",MT=":",Ene=[],LT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_ne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,c=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(o===0&&c===0){if(j===MT){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?o++:j==="]"?o--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let g=m,v=!1;m.endsWith(p1)?(g=m.slice(0,-1),v=!0):m.startsWith(p1)&&(g=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return LT(a,v,g,w)};if(t){const i=t+MT,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):LT(Ene,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Pne=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Tne=e=>({cache:One(e.cacheSize),parseClassName:_ne(e),sortModifiers:Pne(e),...xne(e)}),zne=/\s+/,Rne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],c=e.trim().split(zne);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!b,N=r(j?w.substring(0,b):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=g.length===0?"":g.length===1?g[0]:a(g).join(":"),C=v?O+p1:O,A=C+N;if(o.indexOf(A)>-1)continue;o.push(A);const P=i(N,j);for(let E=0;E<P.length;++E){const _=P[E];o.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},Dne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=N4(n))&&(i&&(i+=" "),i+=r);return i},N4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=N4(e[r]))&&(n&&(n+=" "),n+=t);return n},Ine=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=Tne(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=Rne(d,n);return i(d,p),p};return a=o,(...d)=>a(Dne(...d))},Mne=[],Xn=e=>{const t=n=>n[e]||Mne;return t.isThemeGetter=!0,t},k4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,C4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$ne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bne=/\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$/,Une=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=e=>Lne.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),So=e=>!!e&&Number.isInteger(Number(e)),Dw=e=>e.endsWith("%")&&dt(e.slice(0,-1)),js=e=>$ne.test(e),A4=()=>!0,Kne=e=>Bne.test(e)&&!Une.test(e),Ck=()=>!1,Hne=e=>qne.test(e),Gne=e=>Fne.test(e),Vne=e=>!Le(e)&&!$e(e),Qne=e=>el(e,_4,Ck),Le=e=>k4.test(e),El=e=>el(e,P4,Kne),$T=e=>el(e,nre,dt),Wne=e=>el(e,z4,A4),Yne=e=>el(e,T4,Ck),BT=e=>el(e,O4,Ck),Zne=e=>el(e,E4,Gne),Jm=e=>el(e,R4,Hne),$e=e=>C4.test(e),Ff=e=>Ac(e,P4),Xne=e=>Ac(e,T4),UT=e=>Ac(e,O4),Jne=e=>Ac(e,_4),ere=e=>Ac(e,E4),eg=e=>Ac(e,R4,!0),tre=e=>Ac(e,z4,!0),el=(e,t,n)=>{const r=k4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ac=(e,t,n=!1)=>{const r=C4.exec(e);return r?r[1]?t(r[1]):n:!1},O4=e=>e==="position"||e==="percentage",E4=e=>e==="image"||e==="url",_4=e=>e==="length"||e==="size"||e==="bg-size",P4=e=>e==="length",nre=e=>e==="number",T4=e=>e==="family-name",z4=e=>e==="number"||e==="weight",R4=e=>e==="shadow",rre=()=>{const e=Xn("color"),t=Xn("font"),n=Xn("text"),r=Xn("font-weight"),i=Xn("tracking"),a=Xn("leading"),o=Xn("breakpoint"),c=Xn("container"),d=Xn("spacing"),f=Xn("radius"),p=Xn("shadow"),m=Xn("inset-shadow"),g=Xn("text-shadow"),v=Xn("drop-shadow"),w=Xn("blur"),b=Xn("perspective"),j=Xn("aspect"),N=Xn("ease"),O=Xn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...A(),$e,Le],E=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],z=()=>[$e,Le,d],I=()=>[wo,"full","auto",...z()],q=()=>[So,"none","subgrid",$e,Le],U=()=>["auto",{span:["full",So,$e,Le]},So,$e,Le],B=()=>[So,"auto",$e,Le],H=()=>["auto","min","max","fr",$e,Le],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...z()],J=()=>[wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],se=()=>[wo,"screen","full","dvw","lvw","svw","min","max","fit",...z()],me=()=>[wo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],L=()=>[e,$e,Le],M=()=>[...A(),UT,BT,{position:[$e,Le]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Jne,Qne,{size:[$e,Le]}],V=()=>[Dw,Ff,El],oe=()=>["","none","full",f,$e,Le],re=()=>["",dt,Ff,El],Ce=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[dt,Dw,UT,BT],pe=()=>["","none",w,$e,Le],Ee=()=>["none",dt,$e,Le],X=()=>["none",dt,$e,Le],Ke=()=>[dt,$e,Le],ze=()=>[wo,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[js],breakpoint:[js],color:[A4],container:[js],"drop-shadow":[js],ease:["in","out","in-out"],font:[Vne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[js],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[js],shadow:[js],spacing:["px",dt],text:[js],"text-shadow":[js],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wo,Le,$e,j]}],container:["container"],columns:[{columns:[dt,Le,$e,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],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:[So,"auto",$e,Le]}],basis:[{basis:[wo,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,wo,"auto","initial","none",Le]}],grow:[{grow:["",dt,$e,Le]}],shrink:[{shrink:["",dt,$e,Le]}],order:[{order:[So,"first","last","none",$e,Le]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...se()]}],"min-inline-size":[{"min-inline":["auto",...se()]}],"max-inline-size":[{"max-inline":["none",...se()]}],"block-size":[{block:["auto",...me()]}],"min-block-size":[{"min-block":["auto",...me()]}],"max-block-size":[{"max-block":["none",...me()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"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,Ff,El]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tre,Wne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dw,Le]}],"font-family":[{font:[Xne,Yne,t]}],"font-features":[{"font-features":[Le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,$e,Le]}],"line-clamp":[{"line-clamp":[dt,"none",$e,$T]}],leading:[{leading:[a,...z()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",$e,El]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dt,"auto",$e,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},So,$e,Le],radial:["",$e,Le],conic:[So,$e,Le]},ere,Zne]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,$e,Le]}],"outline-w":[{outline:["",dt,Ff,El]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,eg,Jm]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,eg,Jm]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dt,El]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",g,eg,Jm]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dt,$e,Le]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:pe()}],brightness:[{brightness:[dt,$e,Le]}],contrast:[{contrast:[dt,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,eg,Jm]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dt,$e,Le]}],"hue-rotate":[{"hue-rotate":[dt,$e,Le]}],invert:[{invert:["",dt,$e,Le]}],saturate:[{saturate:[dt,$e,Le]}],sepia:[{sepia:["",dt,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[dt,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[dt,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",dt,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[dt,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[dt,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,$e,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",$e,Le]}],ease:[{ease:["linear","initial",N,$e,Le]}],delay:[{delay:[dt,$e,Le]}],animate:[{animate:["none",O,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,$e,Le]}],"perspective-origin":[{"perspective-origin":P()}],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:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,Le]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dt,Ff,El,$T]}],stroke:[{stroke:["none",...L()]}],"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"]}},ire=Ine(rre);function Ji(...e){return ire(jt(e))}const are=b4("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=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?une:"button";return l.jsx(o,{ref:a,className:Ji(are({variant:t,size:n,className:e})),...i})});be.displayName="Button";const sre=b4("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 D4({className:e,variant:t,...n}){return l.jsx("div",{className:Ji(sre({variant:t}),e),...n})}function qT({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return l.jsxs(Xt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[l.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"brand-copy",children:[l.jsx("span",{className:"brand-mark",children:"Canonry"}),n?l.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function oc({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 l.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 it({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(D4,{variant:r,...n,children:t})}function Uv({status:e}){return l.jsx(it,{tone:p4(e),children:Lv(e)})}function $o(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function ore(e,t){const n=x.createContext(t),r=a=>{const{children:o,...c}=a,d=x.useMemo(()=>c,Object.values(c));return l.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=x.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 lre(e,t=[]){let n=[];function r(a,o){const c=x.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:g,children:v,...w}=m,b=g?.[e]?.[d]||c,j=x.useMemo(()=>w,Object.values(w));return l.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,g){const v=g?.[e]?.[d]||c,w=x.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=>x.createContext(o));return function(c){const d=c?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,cre(i,...t)]}function cre(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var _h=globalThis?.document?x.useLayoutEffect:()=>{},ure=kv[" useId ".trim().toString()]||(()=>{}),dre=0;function Iw(e){const[t,n]=x.useState(ure());return _h(()=>{n(r=>r??String(dre++))},[e]),e||(t?`radix-${t}`:"")}var fre=kv[" useInsertionEffect ".trim().toString()]||_h;function hre({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=pre({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const m=mre(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[c,e,a,o]);return[d,f]}function pre({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return fre(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function mre(e){return typeof e=="function"}function I4(e){const t=gre(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,c=x.Children.toArray(a),d=c.find(vre);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function gre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=bre(i),c=xre(a,i.props);return i.type!==x.Fragment&&(c.ref=r?Nk(r,o):o),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yre=Symbol("radix.slottable");function vre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yre}function xre(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function bre(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 wre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$s=wre.reduce((e,t)=>{const n=I4(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...c}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Sre(e,t){e&&jc.flushSync(()=>e.dispatchEvent(t))}function Ph(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function jre(e,t=globalThis?.document){const n=Ph(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Nre="DismissableLayer",m1="dismissableLayer.update",kre="dismissableLayer.pointerDownOutside",Cre="dismissableLayer.focusOutside",FT,M4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),L4=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...d}=e,f=x.useContext(M4),[p,m]=x.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=Cc(t,_=>m(_)),b=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(j),O=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=N,P=Ere(_=>{const z=_.target,I=[...f.branches].some(q=>q.contains(z));!A||I||(i?.(_),o?.(_),_.defaultPrevented||c?.())},g),E=_re(_=>{const z=_.target;[...f.branches].some(q=>q.contains(z))||(a?.(_),o?.(_),_.defaultPrevented||c?.())},g);return jre(_=>{O===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},g),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(FT=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),KT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=FT)}},[p,g,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),KT())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(m1,_),()=>document.removeEventListener(m1,_)},[]),l.jsx($s.div,{...d,ref:w,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:$o(e.onFocusCapture,E.onFocusCapture),onBlurCapture:$o(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:$o(e.onPointerDownCapture,P.onPointerDownCapture)})});L4.displayName=Nre;var Are="DismissableLayerBranch",Ore=x.forwardRef((e,t)=>{const n=x.useContext(M4),r=x.useRef(null),i=Cc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx($s.div,{...e,ref:i})});Ore.displayName=Are;function Ere(e,t=globalThis?.document){const n=Ph(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){$4(kre,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _re(e,t=globalThis?.document){const n=Ph(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&$4(Cre,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 KT(){const e=new CustomEvent(m1);document.dispatchEvent(e)}function $4(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?Sre(i,a):i.dispatchEvent(a)}var Mw="focusScope.autoFocusOnMount",Lw="focusScope.autoFocusOnUnmount",HT={bubbles:!1,cancelable:!0},Pre="FocusScope",B4=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,d]=x.useState(null),f=Ph(i),p=Ph(a),m=x.useRef(null),g=Cc(t,b=>d(b)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let b=function(C){if(v.paused||!c)return;const A=C.target;c.contains(A)?m.current=A:ko(m.current,{select:!0})},j=function(C){if(v.paused||!c)return;const A=C.relatedTarget;A!==null&&(c.contains(A)||ko(m.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&ko(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const O=new MutationObserver(N);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),O.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){VT.add(v);const b=document.activeElement;if(!c.contains(b)){const N=new CustomEvent(Mw,HT);c.addEventListener(Mw,f),c.dispatchEvent(N),N.defaultPrevented||(Tre(Mre(U4(c)),{select:!0}),document.activeElement===b&&ko(c))}return()=>{c.removeEventListener(Mw,f),setTimeout(()=>{const N=new CustomEvent(Lw,HT);c.addEventListener(Lw,p),c.dispatchEvent(N),N.defaultPrevented||ko(b??document.body,{select:!0}),c.removeEventListener(Lw,p),VT.remove(v)},0)}}},[c,f,p,v]);const w=x.useCallback(b=>{if(!n&&!r||v.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(j&&N){const O=b.currentTarget,[C,A]=zre(O);C&&A?!b.shiftKey&&N===A?(b.preventDefault(),n&&ko(C,{select:!0})):b.shiftKey&&N===C&&(b.preventDefault(),n&&ko(A,{select:!0})):N===O&&b.preventDefault()}},[n,r,v.paused]);return l.jsx($s.div,{tabIndex:-1,...o,ref:g,onKeyDown:w})});B4.displayName=Pre;function Tre(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ko(r,{select:t}),document.activeElement!==n)return}function zre(e){const t=U4(e),n=GT(t,e),r=GT(t.reverse(),e);return[n,r]}function U4(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 GT(e,t){for(const n of e)if(!Rre(n,{upTo:t}))return n}function Rre(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 Dre(e){return e instanceof HTMLInputElement&&"select"in e}function ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dre(e)&&t&&e.select()}}var VT=Ire();function Ire(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=QT(e,t),e.unshift(t)},remove(t){e=QT(e,t),e[0]?.resume()}}}function QT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mre(e){return e.filter(t=>t.tagName!=="A")}var Lre="Portal",q4=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);_h(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?QG.createPortal(l.jsx($s.div,{...r,ref:t}),o):null});q4.displayName=Lre;function $re(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var qv=e=>{const{present:t,children:n}=e,r=Bre(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Cc(r.ref,Ure(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};qv.displayName="Presence";function Bre(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[c,d]=$re(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=tg(r.current);a.current=c==="mounted"?f:"none"},[c]),_h(()=>{const f=r.current,p=i.current;if(p!==e){const g=a.current,v=tg(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),_h(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=tg(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(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)})}},g=v=>{v.target===t&&(a.current=tg(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function tg(e){return e?.animationName||"none"}function Ure(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 $w=0;function qre(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??WT()),document.body.insertAdjacentElement("beforeend",e[1]??WT()),$w++,()=>{$w===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$w--}},[])}function WT(){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 Ia=function(){return Ia=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},Ia.apply(this,arguments)};function F4(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 Fre(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 qg="right-scroll-bar-position",Fg="width-before-scroll-bar",Kre="with-scroll-bars-hidden",Hre="--removed-body-scroll-bar-size";function Bw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gre(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Vre=typeof window<"u"?x.useLayoutEffect:x.useEffect,YT=new WeakMap;function Qre(e,t){var n=Gre(null,function(r){return e.forEach(function(i){return Bw(i,r)})});return Vre(function(){var r=YT.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(c){a.has(c)||Bw(c,null)}),a.forEach(function(c){i.has(c)||Bw(c,o)})}YT.set(n,e)},[e]),n}function Wre(e){return e}function Yre(e,t){t===void 0&&(t=Wre);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function Zre(e){e===void 0&&(e={});var t=Yre(null);return t.options=Ia({async:!0,ssr:!1},e),t}var K4=function(e){var t=e.sideCar,n=F4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ia({},n))};K4.isSideCarExport=!0;function Xre(e,t){return e.useMedium(t),K4}var H4=Zre(),Uw=function(){},Fv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Uw,onWheelCapture:Uw,onTouchMoveCapture:Uw}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,w=e.noIsolation,b=e.inert,j=e.allowPinchZoom,N=e.as,O=N===void 0?"div":N,C=e.gapMode,A=F4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=g,E=Qre([n,t]),_=Ia(Ia({},A),i);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:H4,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:C}),o?x.cloneElement(x.Children.only(c),Ia(Ia({},_),{ref:E})):x.createElement(O,Ia({},_,{className:d,ref:E}),c))});Fv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fv.classNames={fullWidth:Fg,zeroRight:qg};var Jre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eie(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jre();return t&&e.setAttribute("nonce",t),e}function tie(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nie(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eie())&&(tie(t,n),nie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iie=function(){var e=rie();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},G4=function(){var e=iie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},aie={left:0,top:0,right:0,gap:0},qw=function(e){return parseInt(e||"",10)||0},sie=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[qw(n),qw(r),qw(i)]},oie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aie;var t=sie(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])}},lie=G4(),Hu="data-scroll-locked",cie=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
-
.`.concat(Kre,` {
|
|
54
|
-
overflow: hidden `).concat(r,`;
|
|
55
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
56
|
-
}
|
|
57
|
-
body[`).concat(Hu,`] {
|
|
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(c,"px ").concat(r,`;
|
|
67
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat(qg,` {
|
|
71
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(Fg,` {
|
|
75
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(qg," .").concat(qg,` {
|
|
79
|
-
right: 0 `).concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Fg," .").concat(Fg,` {
|
|
83
|
-
margin-right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
body[`).concat(Hu,`] {
|
|
87
|
-
`).concat(Hre,": ").concat(c,`px;
|
|
88
|
-
}
|
|
89
|
-
`)},ZT=function(){var e=parseInt(document.body.getAttribute(Hu)||"0",10);return isFinite(e)?e:0},uie=function(){x.useEffect(function(){return document.body.setAttribute(Hu,(ZT()+1).toString()),function(){var e=ZT()-1;e<=0?document.body.removeAttribute(Hu):document.body.setAttribute(Hu,e.toString())}},[])},die=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;uie();var a=x.useMemo(function(){return oie(i)},[i]);return x.createElement(lie,{styles:cie(a,!t,i,n?"":"!important")})},g1=!1;if(typeof window<"u")try{var ng=Object.defineProperty({},"passive",{get:function(){return g1=!0,!0}});window.addEventListener("test",ng,ng),window.removeEventListener("test",ng,ng)}catch{g1=!1}var gu=g1?{passive:!1}:!1,fie=function(e){return e.tagName==="TEXTAREA"},V4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fie(e)&&n[t]==="visible")},hie=function(e){return V4(e,"overflowY")},pie=function(e){return V4(e,"overflowX")},XT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Q4(e,r);if(i){var a=W4(e,r),o=a[1],c=a[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Q4=function(e,t){return e==="v"?hie(t):pie(t)},W4=function(e,t){return e==="v"?mie(t):gie(t)},yie=function(e,t){return e==="h"&&t==="rtl"?-1:1},vie=function(e,t,n,r,i){var a=yie(e,window.getComputedStyle(t).direction),o=a*r,c=n.target,d=t.contains(c),f=!1,p=o>0,m=0,g=0;do{if(!c)break;var v=W4(e,c),w=v[0],b=v[1],j=v[2],N=b-j-a*w;(w||N)&&Q4(e,c)&&(m+=N,g+=w);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(f=!0),f},rg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},JT=function(e){return[e.deltaX,e.deltaY]},ez=function(e){return e&&"current"in e?e.current:e},xie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bie=function(e){return`
|
|
90
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
-
`)},wie=0,yu=[];function Sie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(wie++)[0],a=x.useState(G4)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=Fre([e.lockRef.current],(e.shards||[]).map(ez),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var N=rg(b),O=n.current,C="deltaX"in b?b.deltaX:O[0]-N[0],A="deltaY"in b?b.deltaY:O[1]-N[1],P,E=b.target,_=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&_==="h"&&E.type==="range")return!1;var z=window.getSelection(),I=z&&z.anchorNode,q=I?I===E||I.contains(E):!1;if(q)return!1;var U=XT(_,E);if(!U)return!0;if(U?P=_:(P=_==="v"?"h":"v",U=XT(_,E)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=P),!P)return!0;var B=r.current||P;return vie(B,j,b,B==="h"?C:A)},[]),d=x.useCallback(function(b){var j=b;if(!(!yu.length||yu[yu.length-1]!==a)){var N="deltaY"in j?JT(j):rg(j),O=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&xie(P.delta,N)})[0];if(O&&O.should){j.cancelable&&j.preventDefault();return}if(!O){var C=(o.current.shards||[]).map(ez).filter(Boolean).filter(function(P){return P.contains(j.target)}),A=C.length>0?c(j,C[0]):!o.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,N,O){var C={name:b,delta:j,target:N,should:O,shadowParent:jie(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),p=x.useCallback(function(b){n.current=rg(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,JT(b),b.target,c(b,e.lockRef.current))},[]),g=x.useCallback(function(b){f(b.type,rg(b),b.target,c(b,e.lockRef.current))},[]);x.useEffect(function(){return yu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,gu),document.addEventListener("touchmove",d,gu),document.addEventListener("touchstart",p,gu),function(){yu=yu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,gu),document.removeEventListener("touchmove",d,gu),document.removeEventListener("touchstart",p,gu)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:bie(i)}):null,v?x.createElement(die,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nie=Xre(H4,Sie);var Y4=x.forwardRef(function(e,t){return x.createElement(Fv,Ia({},e,{ref:t,sideCar:Nie}))});Y4.classNames=Fv.classNames;var kie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vu=new WeakMap,ig=new WeakMap,ag={},Fw=0,Z4=function(e){return e&&(e.host||Z4(e.parentNode))},Cie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Z4(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})},Aie=function(e,t,n,r){var i=Cie(t,Array.isArray(e)?e:[e]);ag[n]||(ag[n]=new WeakMap);var a=ag[n],o=[],c=new Set,d=new Set(i),f=function(m){!m||c.has(m)||(c.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))p(g);else try{var v=g.getAttribute(r),w=v!==null&&v!=="false",b=(vu.get(g)||0)+1,j=(a.get(g)||0)+1;vu.set(g,b),a.set(g,j),o.push(g),b===1&&w&&ig.set(g,!0),j===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return p(t),c.clear(),Fw++,function(){o.forEach(function(m){var g=vu.get(m)-1,v=a.get(m)-1;vu.set(m,g),a.set(m,v),g||(ig.has(m)||m.removeAttribute(r),ig.delete(m)),v||m.removeAttribute(n)}),Fw--,Fw||(vu=new WeakMap,vu=new WeakMap,ig=new WeakMap,ag={})}},Oie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=kie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Aie(r,i,n,"aria-hidden")):function(){return null}},Kv="Dialog",[X4]=lre(Kv),[Eie,ya]=X4(Kv),J4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=x.useRef(null),d=x.useRef(null),[f,p]=hre({prop:r,defaultProp:i??!1,onChange:a,caller:Kv});return l.jsx(Eie,{scope:t,triggerRef:c,contentRef:d,contentId:Iw(),titleId:Iw(),descriptionId:Iw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};J4.displayName=Kv;var e3="DialogTrigger",_ie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ya(e3,n),a=Cc(t,i.triggerRef);return l.jsx($s.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ek(i.open),...r,ref:a,onClick:$o(e.onClick,i.onOpenToggle)})});_ie.displayName=e3;var Ak="DialogPortal",[Pie,t3]=X4(Ak,{forceMount:void 0}),n3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ya(Ak,t);return l.jsx(Pie,{scope:t,forceMount:n,children:x.Children.map(r,o=>l.jsx(qv,{present:n||a.open,children:l.jsx(q4,{asChild:!0,container:i,children:o})}))})};n3.displayName=Ak;var wy="DialogOverlay",r3=x.forwardRef((e,t)=>{const n=t3(wy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ya(wy,e.__scopeDialog);return a.modal?l.jsx(qv,{present:r||a.open,children:l.jsx(zie,{...i,ref:t})}):null});r3.displayName=wy;var Tie=I4("DialogOverlay.RemoveScroll"),zie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ya(wy,n);return l.jsx(Y4,{as:Tie,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx($s.div,{"data-state":Ek(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),lc="DialogContent",i3=x.forwardRef((e,t)=>{const n=t3(lc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ya(lc,e.__scopeDialog);return l.jsx(qv,{present:r||a.open,children:a.modal?l.jsx(Rie,{...i,ref:t}):l.jsx(Die,{...i,ref:t})})});i3.displayName=lc;var Rie=x.forwardRef((e,t)=>{const n=ya(lc,e.__scopeDialog),r=x.useRef(null),i=Cc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Oie(a)},[]),l.jsx(a3,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$o(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:$o(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&a.preventDefault()}),onFocusOutside:$o(e.onFocusOutside,a=>a.preventDefault())})}),Die=x.forwardRef((e,t)=>{const n=ya(lc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return l.jsx(a3,{...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()}})}),a3=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=ya(lc,n),d=x.useRef(null),f=Cc(t,d);return qre(),l.jsxs(l.Fragment,{children:[l.jsx(B4,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(L4,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ek(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Iie,{titleId:c.titleId}),l.jsx(Lie,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Ok="DialogTitle",s3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ya(Ok,n);return l.jsx($s.h2,{id:i.titleId,...r,ref:t})});s3.displayName=Ok;var o3="DialogDescription",l3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ya(o3,n);return l.jsx($s.p,{id:i.descriptionId,...r,ref:t})});l3.displayName=o3;var c3="DialogClose",u3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ya(c3,n);return l.jsx($s.button,{type:"button",...r,ref:t,onClick:$o(e.onClick,()=>i.onOpenChange(!1))})});u3.displayName=c3;function Ek(e){return e?"open":"closed"}var d3="DialogTitleWarning",[h2e,f3]=ore(d3,{contentName:lc,titleName:Ok,docsSlug:"dialog"}),Iie=({titleId:e})=>{const t=f3(d3),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 x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Mie="DialogDescriptionWarning",Lie=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${f3(Mie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},h3=J4,p3=n3,_k=r3,Pk=i3,Tk=s3,m3=l3,g3=u3;const $ie=h3,Bie=p3,y3=x.forwardRef(({className:e,...t},n)=>l.jsx(_k,{ref:n,className:Ji("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));y3.displayName=_k.displayName;const Uie=400,qie=1200,Fie=720,v3=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(Fie),o=x.useRef(!1),c=x.useRef(0),d=x.useRef(0),f=x.useCallback(g=>{o.current=!0,c.current=g.clientX,d.current=i,g.target.setPointerCapture(g.pointerId),g.preventDefault()},[i]),p=x.useCallback(g=>{if(!o.current)return;const v=c.current-g.clientX,w=Math.min(qie,Math.max(Uie,d.current+v));a(w)},[]),m=x.useCallback(()=>{o.current=!1},[]);return l.jsxs(Bie,{children:[l.jsx(y3,{}),l.jsxs(Pk,{ref:r,className:Ji("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:[l.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,l.jsxs(g3,{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:[l.jsx(Jh,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});v3.displayName=Pk.displayName;const Kie=({className:e,...t})=>l.jsx("div",{className:Ji("flex flex-col gap-1.5 pr-10",e),...t}),x3=x.forwardRef(({className:e,...t},n)=>l.jsx(Tk,{ref:n,className:Ji("text-lg font-medium text-zinc-50",e),...t}));x3.displayName=Tk.displayName;const b3=x.forwardRef(({className:e,...t},n)=>l.jsx(m3,{ref:n,className:Ji("text-sm text-zinc-500",e),...t}));b3.displayName=m3.displayName;function Hie({title:e,subtitle:t,children:n,open:r,onClose:i}){return l.jsx($ie,{open:r,onOpenChange:a=>a?void 0:i(),children:l.jsxs(v3,{children:[l.jsxs(Kie,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(x3,{id:"drawer-title",children:e}),l.jsx(b3,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:n})]})})}function vr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=x.useCallback(()=>n(null),[]);return l.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[l.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&jc.createPortal(l.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)]})}const Gie=/[\s\-_]+/;function Vie(e){const t=e.split(Gie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function tz(e,t){const n=Qie(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"?Ui.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(Vie).filter(f=>!!f);if(o.length===0)return r.map((f,p)=>f.type==="bold"?Ui.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const c=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=yy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(c).map((g,v)=>{if(!g)return null;if(v%2===1){const b=d.get(yy(g))??"answer-highlight";return f.type==="bold"?Ui.createElement("mark",{key:`hl-${p}-${v}`,className:b},Ui.createElement("strong",{className:"text-zinc-200 font-semibold"},g)):Ui.createElement("mark",{key:`hl-${p}-${v}`,className:b},g)}return f.type==="bold"?Ui.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},g):g})).filter(Boolean)}function Qie(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Kw(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 Wie({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,o]=x.useState("mentions"),[c,d]=x.useState(-1),[f,p]=x.useState(null),[m,g]=x.useState(!1),[v,w]=x.useState({}),b=$ee(t.project),j=new Set(b.map(my)),N=e.runHistory,O=N.length>1,[C,A]=x.useState(null),P=x.useRef(!1);x.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const V=N.at(-1);V&&(P.current=!0,ac(V.runId).then(oe=>{const re=oe.snapshots.find(Ce=>Ce.query===e.query&&Ce.provider===e.provider);re&&A({citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:V.visibilityTransition,provider:re.provider,model:re.model??e.model,answerSnippet:re.answerText??e.answerSnippet,citedDomains:re.citedDomains??e.citedDomains,competitorDomains:re.competitorOverlap??e.competitorDomains,recommendedCompetitors:re.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:re.matchedTerms??e.matchedTerms??[],groundingSources:re.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,N]);const E=c>=0&&f!==null,_=E?f:C||{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},z=_.visibilityState==="pending"||_.citationState==="pending",I=z?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===Lr.cited||_.citationState==="emerging",q=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,U=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,H=[...b.map(my),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(V=>V.trim().length>2),W=[..._.competitorDomains.flatMap(V=>{const oe=Lee(V);return oe.length>=4?[oe]:[]}),..._.recommendedCompetitors].filter(V=>V.trim().length>2),Y=[{terms:H,className:"answer-highlight-brand"},...W.length>0?[{terms:W,className:"answer-highlight-competitor"}]:[]],K=z?"pending":_.visibilityTransition==="lost"?"lost":I?"cited":"not-cited",J=x.useRef(0),se=x.useCallback(async V=>{const oe=++J.current;if(V===-1||V===N.length-1){d(-1),p(null),i(!1);return}d(V),i(!1);const re=N[V],Ce=`${re.runId}::${e.query}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}g(!0);try{const je=await ac(re.runId);if(oe!==J.current)return;const ee=je.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??je.snapshots.find(Ee=>Ee.query===e.query),pe=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:re.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:Kw(re.visibilityTransition,re.visibilityState),summary:""}:{citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:re.visibilityTransition,provider:e.provider,model:re.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Kw(re.visibilityTransition,re.visibilityState),summary:"Snapshot data not available for this run."};w(Ee=>({...Ee,[Ce]:pe})),p(pe)}catch{if(oe!==J.current)return;p({citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:re.visibilityTransition,provider:e.provider,model:re.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Kw(re.visibilityTransition,re.visibilityState),summary:"Failed to load historical run data."})}finally{oe===J.current&&g(!1)}},[N,e.query,e.provider,v]),L=(E||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,M=!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:L}:_.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:L}:z?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:L},D=()=>{if(!_.answerSnippet)return null;const V=_.answerSnippet.split(`
|
|
97
|
-
`),oe=[];let re=[],Ce=0;const je=()=>{if(re.length===0)return;const ee=re.join(" ").trim();ee&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:tz(ee,Y)},Ce++)),re=[]};for(const ee of V){const pe=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(pe)){je(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Ee=pe.match(/^(#{1,3})\s+(.+)$/);if(Ee){je();const X=Ee[1].length,Ke=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],ze=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";oe.push(l.jsx("p",{className:ze,children:tz(Ke,Y)},Ce++));continue}if(pe===""){je();continue}re.push(pe)}return je(),oe};return l.jsx(h3,{open:!0,onOpenChange:V=>{V||n()},children:l.jsxs(p3,{children:[l.jsx(_k,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(Pk,{className:"evidence-modal","aria-describedby":void 0,children:[l.jsxs("div",{className:"evidence-modal-header",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),l.jsx(Tk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),l.jsxs(g3,{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:[l.jsx(Jh,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),O&&l.jsxs("div",{className:"evidence-modal-timeline",children:[l.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),l.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:N.map((V,oe)=>{const re=c===-1&&oe===N.length-1||c===oe,Ce=V.visibilityState??(V.answerMentioned?"visible":"not-visible"),je=V.visibilityTransition??Ce,ee=Ce==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(V.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),X=!!(V.model&&oe>0&&N[oe-1]?.model&&N[oe-1].model!==V.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${re?"evidence-run-dot--selected":""}`,onClick:()=>se(oe===N.length-1?-1:oe),"aria-label":[`Run ${Ee}: ${Ce}`,V.model?`model ${V.model}`:null,X?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":re,children:[l.jsx("span",{className:`size-2 rounded-full ${ee} ${X?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},oe)})}),c>=0&&c<N.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(N[c].createdAt).toLocaleString()," ","—"," ",l.jsx("span",{className:"capitalize",children:N[c].visibilityState??(N[c].answerMentioned?"visible":"not-visible")}),l.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>se(-1),children:["←"," Back to latest"]})]}),!E&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(V=>l.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${V.fromModel??"unknown"} -> ${V.toModel??"unknown"} on ${new Date(V.createdAt).toLocaleDateString()}`},`${V.runId}:${V.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.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&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${K}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${K}`,children:F.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${K}`,children:F.title}),l.jsx("p",{className:"evidence-position-meta",children:F.meta}),M&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:M})]}),_.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),_.answerSnippet.length>280&&l.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"})]}),!_.answerSnippet&&!m&&l.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&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:I?"Why you're visible":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((V,oe)=>l.jsxs("div",{className:"action-item",children:[l.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?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:V})]},oe))})]}),_.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[(q||U)&&l.jsxs("div",{className:"sidebar-tabs",children:[l.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"}),l.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"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Answer visibility"}),l.jsx(vr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),l.jsxs("div",{className:`mention-status mention-status--${I?"visible":"not-visible"}`,children:[l.jsx("span",{className:"mention-status-icon",children:z?"…":I?"✓":"—"}),l.jsx("span",{className:"mention-status-label",children:z?"Pending":I?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(V=>l.jsx("span",{className:"mention-chip mention-chip--brand",children:V},V))})]}),!z&&!I&&_.matchedTerms.length===0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:H.map(V=>l.jsx("span",{className:"mention-chip mention-chip--muted",children:V},V))}),l.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Competitors in answer"}),l.jsx(vr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const V=_.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),oe=new Set(V.map(Ce=>yy(Ce.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(Ce=>!oe.has(yy(Ce))),...V].map(Ce=>l.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&l.jsxs(l.Fragment,{children:[_.citedDomains.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Domains from source links"}),l.jsx(vr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),l.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((V,oe)=>{const re=V.toLowerCase().replace(/^www\./,""),Ce=j.has(re),je=!Ce&&_.competitorDomains.some(pe=>pe.toLowerCase().replace(/^www\./,"")===re),ee=Ce?"you":je?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:V}),Ce&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},V)})})]}),_.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),l.jsx(vr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),l.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((V,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:V.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V.title||V.uri})},oe))})]}),_.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(V=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V})},V))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&l.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&&!U&&l.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 la(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 Hw=[{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 Hv(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 Yie=Hv({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"}),Zie=Hv({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"}),Xie=Hv({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"}),Jie=Hv({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"}),eae=[{id:"evidence_citypoint_emergency_gemini",query:"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:la(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:la(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:la(["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",query:"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:la(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"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:la(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:la(["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",query:"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:la(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"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:la(["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",query:"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:la(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Hw[0],Hw[1],la(["cited","cited","cited","cited","cited"]),Hw[2],2/7,la(["not-cited","not-cited","not-cited","cited"]);function tae(e,t){return e.projects.find(n=>n.project.id===t)}function nae(e,t){return e.runs.find(n=>n.id===t)}function rae(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 iae={regression:"negative",gain:"positive",opportunity:"caution"},aae={regression:"lost",gain:"emerging",opportunity:"not-cited"},sae={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function oae(e){return{id:e.id,tone:iae[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??sae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:aae[e.type]}]}}function lae(e){return e.filter(t=>!t.dismissed).map(oae)}function w3(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 y1(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function cae(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 zk(e){switch(e){case yt["answer-visibility"]:return"Answer visibility sweep";case yt["gsc-sync"]:return"GSC sync";case yt["inspect-sitemap"]:return"Sitemap inspection";case yt["ga-sync"]:return"GA sync";case yt["bing-inspect"]:return"Bing URL inspection";case yt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case yt["site-audit"]:return"Site audit";case yt["backlink-extract"]:return"Backlink extract"}}function uae(e){return e===mh.manual?"Manual":e===mh.scheduled?"Scheduled":e===mh["config-apply"]?"Config apply":e}function Rk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:zk(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?y1(e.startedAt):y1(e.createdAt),duration:cae(e.startedAt,e.finishedAt),statusDetail:e.error?S3(e.error):dae(e),summary:fae(e),triggerLabel:uae(e.trigger)}}function S3(e){const t=xk(e);return t.length>200?t.slice(0,200)+"…":t}function dae(e){switch(e.status){case Kt.queued:return"Waiting for execution slot.";case Kt.running:return"Provider queries in progress.";case Kt.completed:return"All queries checked.";case Kt.partial:return"Run completed with some queries skipped.";case Kt.failed:return e.error?S3(e.error):"Run failed.";case Kt.cancelled:return"Run was cancelled.";default:return""}}function fae(e){const t=zk(e.kind);switch(e.status){case Kt.queued:return`${t} queued`;case Kt.running:return`${t} in progress`;case Kt.completed:return`${t} completed`;case Kt.partial:return`${t} partially completed`;case Kt.failed:return`${t} failed`;case Kt.cancelled:return`${t} cancelled`;default:return e.status}}function j3(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.query??a.id;t.has(o)||t.set(o,!1),a.citationState===Lr.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 N3(e){return e>=70?"positive":e>=40?"caution":"negative"}function hae(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function pae(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function mae(e){if(e.length===0)return{label:"Gap Queries",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify queries where competitors are cited and your domain is not.",tooltip:"Tracked queries 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.queryId,c=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState===Lr.cited&&(c.cited=!0);for(const d of a.competitorOverlap)c.competitorOverlap.add(d);t.set(o,c)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.competitorOverlap.size>0).length,i=r===1?"query":"queries";return{label:"Gap Queries",value:`${r}`,delta:`${r} of ${n} queries at risk`,tone:pae(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive query gaps detected in the latest visibility run.",tooltip:"Tracked queries where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function gae(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 yae(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function vae(e,t){const n=gae(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:yae(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 k3(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 xae(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const c=new Map;for(const g of n.snapshots)if(g.query){const v=`${g.query}::${g.provider}`;c.set(v,g)}const d=new Set(n.snapshots.map(g=>g.provider)),f=new Set(t.flatMap(g=>Object.keys(g.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const g of t){if(g.runs.length===0)continue;o.add(g.query);const v=g.runs.at(-1),w=v?.transition??"not-cited";for(const b of m){const j=c.get(`${g.query}::${b}`),N=(g.providerRuns?.[b]?.length??0)>0;if(!j&&!N)continue;const O=j?.model??null,C=O?`${b}:${O}`:null,A=C?g.modelRuns?.[C]:void 0,P=g.providerRuns?.[b],E=(P?.length?P:null)??(A?.length?A:null),_=P?.length?"provider":A?.length?"model":"query",z=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,U=E?.at(-1)?.visibilityState,B=j?z==="lost"?"lost":z==="emerging"?"emerging":j.citationState===Lr.cited?"cited":"not-cited":q===Lr.cited?"cited":"not-cited",H=j?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),W=v1(E||g.runs),Y=nz(E||g.runs),K=bae(g,b),J=(E??g.runs).map(M=>({runId:M.runId,citationState:M.citationState,createdAt:M.createdAt,model:K.get(M.runId)??null,answerMentioned:M.answerMentioned,visibilityState:M.visibilityState,visibilityTransition:M.visibilityTransition})),se=wae(J),me=_==="provider"&&se.length<=1?"model":_,L=Sae(J);i.push({id:`evidence_${e}_${a++}`,query:g.query,provider:j?.provider??b,model:j?.model??null,location:j?.location??null,citationState:B,answerMentioned:j?.answerMentioned,visibilityState:H,visibilityChangeLabel:rz(I,Y,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:rz(z,W),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:jae(H,I,g.query),runHistory:J,historyScope:me,modelsSeen:se,modelTransitions:L})}}}for(const c of r)o.has(c.query)||i.push({id:`evidence_${e}_${a++}`,query:c.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function bae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),c=o==="unknown"?null:o;for(const d of a)n.set(d.runId,c)}return n}function wae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function Sae(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 v1(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 nz(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 rz(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?`${Kf(r.positive)} in latest run`:`${Kf(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Kf(r.first);case"not-cited":case"not-visible":return t<=1?`${Kf(r.negative)} in latest run`:`${Kf(r.negative)} across ${t} runs`;default:return e}}function Kf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jae(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 iz(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.query)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.query),r.set(a,o)}return r}const Gw=3;function Nae(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],c=[],d=new Set;for(const N of t)N.citationState==="lost"&&(d.has(N.query)||(d.add(N.query),c.push({query:N.query,evidenceId:N.id,provider:N.provider,citationState:"lost"})));c.length>0&&o.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} quer${c.length>1?"ies":"y"}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const f=iz(r,a),p=iz(i,a);for(const N of a){const O=f.get(N)??new Set,C=p.get(N)??new Set,A=[...O].filter(P=>!C.has(P));A.length>0&&o.push({id:`insight_comp_gained_${N}`,tone:"negative",title:`${N} appeared on ${A.length} quer${A.length>1?"ies":"y"}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:A.map(P=>{const E=t.find(_=>_.query===P);return{query:P,evidenceId:E?.id??"",citationState:"cited"}})})}const m=new Map;for(const N of n){const O=N.runs.at(-1);O&&m.set(N.query,{transition:O.transition,citationState:O.citationState})}const g=[],v=[],w=new Set;for(const[N,{transition:O,citationState:C}]of m){if(!(O==="emerging"||O==="new"&&C===Lr.cited))continue;w.add(N);const P=t.find(E=>E.query===N&&(E.citationState==="emerging"||E.citationState===Lr.cited));g.push({query:N,evidenceId:P?.id??"",provider:P?.provider,citationState:"emerging"})}for(const N of t)N.citationState==="emerging"&&(w.has(N.query)||v.push({query:N.query,evidenceId:N.id,provider:N.provider,citationState:"emerging"}));if(v.length>0){const N=new Set(v.map(O=>O.query)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${N} quer${N>1?"ies":"y"}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}g.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} quer${w.size>1?"ies":"y"}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:g});const b=new Set(t.map(N=>N.query)),j=[];for(const N of n){if(!b.has(N.query)||N.runs.length<Gw||N.runs.at(-1)?.citationState!==Lr["not-cited"])continue;if(v1(N.runs)>=Gw){const A=t.find(P=>P.query===N.query);j.push({query:N.query,evidenceId:A?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} quer${j.length>1?"ies":"y"} uncited for ${Gw}+ runs`,detail:"These queries 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,A=[...p.get(N)??new Set].filter(P=>!O.has(P));A.length>0&&o.push({id:`insight_comp_lost_${N}`,tone:"neutral",title:`${N} dropped from ${A.length} quer${A.length>1?"ies":"y"}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:A.map(P=>{const E=t.find(_=>_.query===P);return{query:P,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 queries.",actionLabel:"Stable",affectedPhrases:[]}),o}function kae(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 queries.",actionLabel:"Stable",affectedPhrases:[]}]:r}function Cae(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState===Lr.cited).map(f=>f.query)).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===Lr.cited&&p.query&&f.add(p.query);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const c=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:c,hasPreviousRun:!0}}function Aae(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===yt["answer-visibility"])??e[0],r=n.status===Kt.completed?"Healthy":n.status===Kt.running?"Running":n.status===Kt.queued?"Queued":n.status===Kt.partial?"Partial":"Failed",i=n.status===Kt.completed?"positive":n.status===Kt.failed?"negative":n.status===Kt.partial?"caution":"neutral",a=e.filter(d=>d.kind===yt["answer-visibility"]).length,o=e.length-a,c=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${zk(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 Oae(e){const t=w3(e.project),n=xae(t.name,e.timeline,e.latestRunDetail,e.queries),r=e.runs.filter(_=>_.kind===yt["answer-visibility"]&&(_.status===Kt.completed||_.status===Kt.partial)).sort((_,z)=>z.createdAt.localeCompare(_.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=j3(i),o=mae(i),c=vae(e.gscCoverage,e.bingCoverage),d=k3(i,e.competitors.map(_=>_.domain)),f=Nae({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(_=>_.domain)}),p=e.dbInsights!=null?lae(e.dbInsights):null,m=p!=null?kae(f,p):f,g=[...e.runs].sort((_,z)=>z.createdAt.localeCompare(_.createdAt)),v=g.find(_=>_.kind===yt["answer-visibility"]),w=g.find(_=>_.kind!==yt["answer-visibility"]);if(v&&w){const _=new Date(w.createdAt).getTime()-new Date(v.createdAt).getTime(),z=1440*60*1e3;_>z&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${y1(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const b=g.map(_=>Rk(_,e.project.displayName||e.project.name)),j=new Map;for(const _ of i){const z=_.provider||"gemini",I=_.model??null,q=`${z}::${I??"unknown"}`,U=j.get(q)??{provider:z,model:I,cited:0,total:0};U.total++,_.citationState===Lr.cited&&U.cited++,j.set(q,U)}const N=[...j.values()].sort((_,z)=>_.provider.localeCompare(z.provider)||(_.model??"").localeCompare(z.model??"")).map(({provider:_,model:z,cited:I,total:q})=>({provider:_,model:z,score:q>0?Math.round(I/q*100):0,cited:I,total:q})),O=e.project.providers.filter(_=>!_.startsWith("cdp:")),C=new Set(i.map(_=>_.provider)),A=O.filter(_=>C.has(_)).length,P=i.length>0&&O.length>1&&A<O.length,E=P?`${A} 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} queries visible`:"Run a sweep first",tone:i.length>0?P?"caution":N3(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.totalCount} tracked queries found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked queries where your domain is cited by at least one AI answer engine. A query is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:E},queryCounts:{cited:a.citedCount,total:a.totalCount},gapQueries:o,indexCoverage:c,providerScores:N,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:hae(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 queries.",trend:[]},runStatus:Aae(g),movementSummary:Cae(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((_,z)=>{const I=new Set;for(const W of i)(W.competitorOverlap.includes(_.domain)||W.citedDomains.includes(_.domain))&&W.query&&I.add(W.query);const q=[...I],U=new Set(i.map(W=>W.query).filter(Boolean)),B=U.size>0?q.length/U.size:0,H=B>=.5?"High":B>=.2?"Moderate":q.length>0?"Low":"None";return{id:_.id||`comp_${z}`,domain:_.domain,citationCount:q.length,totalQueries:U.size,pressureLabel:H,citedQueries:q,movement:"",notes:""}}),recentRuns:b.slice(0,5)}}function Eae(e){const t=w3(e.project),n=e.runs.filter(w=>w.kind===yt["answer-visibility"]&&(w.status===Kt.completed||w.status===Kt.partial)).sort((w,b)=>b.createdAt.localeCompare(w.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=j3(r),a=k3(r,e.competitors.map(w=>w.domain)),o=[...e.runs].sort((w,b)=>b.createdAt.localeCompare(w.createdAt)),c=o.find(w=>w.kind===yt["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=c?Rk(c,d):{id:"none",projectId:e.project.id,projectName:d,kind:yt["answer-visibility"],kindLabel:"No runs yet",status:Kt.queued,trigger:mh.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)),g=p.filter(w=>m.has(w)).length,v=r.length>0&&p.length>1&&g<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} queries`:"No data",visibilityTone:r.length>0?v?"caution":N3(i.score):"neutral",providerCoverage:v?`${g} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} queries 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 _ae(e,t){const n=[],r=[],i=[];for(const o of e){r.push(Oae(o)),i.push(Eae(o));const c=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(Rk(d,o.project.displayName||o.project.name))}n.sort((o,c)=>c.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Pae(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 query 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"},queryImportState:{mode:"paste",queryCount: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 Pae(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} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===Kt.running||a.status===Kt.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 qe={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],queries:e=>["projects",e,"queries"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],gsc:{project:e=>["gsc",e],connections:e=>["gsc",e,"connections"],properties:e=>["gsc",e,"properties"],performance:(e,t)=>["gsc",e,"performance",t],inspections:(e,t)=>["gsc",e,"inspections",t],deindexed:e=>["gsc",e,"deindexed"],coverage:e=>["gsc",e,"coverage"],coverageHistory:e=>["gsc",e,"coverage-history"],sitemaps:e=>["gsc",e,"sitemaps"]},bing:{project:e=>["bing",e],status:e=>["bing",e,"status"],coverage:e=>["bing",e,"coverage"],inspections:e=>["bing",e,"inspections"],performance:e=>["bing",e,"performance"],sites:e=>["bing",e,"sites"]},schedule:e=>["schedule",e],notifications:e=>["notifications",e],agent:{providers:e=>["agent",e,"providers"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]}},C3=x.createContext(null);C3.Provider;function ep(){return x.useContext(C3)}function Oc(e){const n=ep()?.dashboard??null,r=ha({queryKey:qe.projects.all,queryFn:sk,enabled:!n}),i=ha({queryKey:qe.runs.all,queryFn:J$,enabled:!n,staleTime:o1,refetchInterval:w=>w.state.data?.some(N=>N.status==="running"||N.status==="queued")?3e3:o1}),a=ha({queryKey:qe.settings,queryFn:()=>ok().catch(()=>null),enabled:!n}),o=r.data??[],c=i.data??[],d=y7({queries:o.map(w=>{const b=c.filter(N=>N.projectId===w.id),j=b.filter(N=>(N.status==="completed"||N.status==="partial")&&N.kind==="answer-visibility").sort((N,O)=>O.createdAt.localeCompare(N.createdAt));return{queryKey:qe.projects.detail(w.id,j[0]?.id),queryFn:async()=>{const N=j[0]?.id,[O,C,A,P,E,_,z,I]=await Promise.all([kV(w.name).catch(()=>[]),e5(w.name).catch(()=>[]),t5(w.name).catch(()=>[]),N?ac(N).catch(()=>null):Promise.resolve(null),j[1]?ac(j[1].id).catch(()=>null):Promise.resolve(null),lk(w.name).catch(()=>null),ck(w.name).catch(()=>null),N?kQ(w.name,N).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:b,queries:O,competitors:C,timeline:A,latestRunDetail:P,previousRunDetail:E,gscCoverage:_,bingCoverage:z,dbInsights:I}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:d5}})}),f=d.every(w=>w.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const w=d.map(b=>b.data?{...b.data,runs:c.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return _ae(w,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length,c]),m=!n&&(r.isError||i.isError),g=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:g,isError:m,refetch:v}}async function Tae(){const e=await AQ("/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 Gv(e,t){return ha({queryKey:qe.health,queryFn:Tae,enabled:e,refetchInterval:15e3,initialData:t})}function zae(e){return ha({queryKey:qe.runs.detail(e??""),queryFn:()=>ac(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function kd(){const e=Zo(),t=Pv({strict:!1}),n=ri({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Qi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Qi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Qi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const Rae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Dae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Iae(){const e=x.useSyncExternalStore(KQ,eT,eT),t=Zo(),{openRun:n}=kd(),r=x.useCallback(a=>{s1(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),s1(a.id))},[t,n]);return e.length===0?null:l.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>l.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${Rae[a.tone]}`,children:[l.jsxs("div",{className:"toast-copy",children:[l.jsx("p",{className:"toast-title",children:a.title}),a.detail?l.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?l.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Dae(a),children:a.cta.label}):null]}),l.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:l.jsx(Jh,{className:"size-3.5"})})]},a.id))})}function Mae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$ae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bae={};function az(e,t){return(Bae.jsx?$ae:Lae).test(e)}const Uae=/[ \t\n\f\r]/g;function qae(e){return typeof e=="object"?e.type==="text"?sz(e.value):!1:sz(e)}function sz(e){return e.replace(Uae,"")===""}let tp=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};tp.prototype.normal={};tp.prototype.property={};tp.prototype.space=void 0;function A3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new tp(n,r,t)}function x1(e){return e.toLowerCase()}class li{constructor(t,n){this.attribute=n,this.property=t}}li.prototype.attribute="";li.prototype.booleanish=!1;li.prototype.boolean=!1;li.prototype.commaOrSpaceSeparated=!1;li.prototype.commaSeparated=!1;li.prototype.defined=!1;li.prototype.mustUseProperty=!1;li.prototype.number=!1;li.prototype.overloadedBoolean=!1;li.prototype.property="";li.prototype.spaceSeparated=!1;li.prototype.space=void 0;let Fae=0;const lt=Ec(),Gn=Ec(),b1=Ec(),Oe=Ec(),Zt=Ec(),Gu=Ec(),gi=Ec();function Ec(){return 2**++Fae}const w1=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Gn,commaOrSpaceSeparated:gi,commaSeparated:Gu,number:Oe,overloadedBoolean:b1,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Vw=Object.keys(w1);class Dk extends li{constructor(t,n,r,i){let a=-1;if(super(t,n),oz(this,"space",i),typeof r=="number")for(;++a<Vw.length;){const o=Vw[a];oz(this,Vw[a],(r&w1[o])===w1[o])}}}Dk.prototype.defined=!0;function oz(e,t,n){n&&(e[t]=n)}function Cd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Dk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[x1(r)]=r,n[x1(a.attribute)]=r}return new tp(t,n,e.space)}const O3=Cd({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Zt,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:Oe,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Zt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Gn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E3(e,t){return t in e?e[t]:t}function _3(e,t){return E3(e,t.toLowerCase())}const Kae=Cd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gu,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Zt,autoFocus:lt,autoPlay:lt,blocking:Zt,capture:null,charSet:null,checked:lt,cite:null,className:Zt,cols:Oe,colSpan:null,content:null,contentEditable:Gn,controls:lt,controlsList:Zt,coords:Oe|Gu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:b1,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Zt,height:Oe,hidden:b1,high:Oe,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:lt,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,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:lt,optimum:Oe,pattern:null,ping:Zt,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Zt,required:lt,reversed:lt,rows:Oe,rowSpan:Oe,sandbox:Zt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:Gn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:_3}),Hae=Cd({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:gi,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Zt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:Gu,g2:Gu,glyphName:Gu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:gi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gi,rev:gi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gi,requiredFeatures:gi,requiredFonts:gi,requiredFormats:gi,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:gi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gi,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E3}),P3=Cd({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()}}),T3=Cd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_3}),z3=Cd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Gae={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"},Vae=/[A-Z]/g,lz=/-[a-z]/g,Qae=/^data[-\w.:]+$/i;function Wae(e,t){const n=x1(t);let r=t,i=li;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Qae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(lz,Zae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!lz.test(a)){let o=a.replace(Vae,Yae);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Dk}return new i(r,t)}function Yae(e){return"-"+e.toLowerCase()}function Zae(e){return e.charAt(1).toUpperCase()}const Xae=A3([O3,Kae,P3,T3,z3],"html"),Ik=A3([O3,Hae,P3,T3,z3],"svg");function Jae(e){return e.join(" ").trim()}var xu={},Qw,cz;function ese(){if(cz)return Qw;cz=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
98
|
-
`,f="/",p="*",m="",g="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,C=1;function A(W){var Y=W.match(t);Y&&(O+=Y.length);var K=W.lastIndexOf(d);C=~K?W.length-K:C+W.length}function P(){var W={line:O,column:C};return function(Y){return Y.position=new E(W),I(),Y}}function E(W){this.start=W,this.end={line:O,column:C},this.source=N.source}E.prototype.content=j;function _(W){var Y=new Error(N.source+":"+O+":"+C+": "+W);if(Y.reason=W,Y.filename=N.source,Y.line=O,Y.column=C,Y.source=j,!N.silent)throw Y}function z(W){var Y=W.exec(j);if(Y){var K=Y[0];return A(K),j=j.slice(K.length),Y}}function I(){z(n)}function q(W){var Y;for(W=W||[];Y=U();)Y!==!1&&W.push(Y);return W}function U(){var W=P();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 _("End of comment missing");var K=j.slice(2,Y-2);return C+=2,A(K),j=j.slice(Y),C+=2,W({type:g,comment:K})}}function B(){var W=P(),Y=z(r);if(Y){if(U(),!z(i))return _("property missing ':'");var K=z(a),J=W({type:v,property:b(Y[0].replace(e,m)),value:K?b(K[0].replace(e,m)):m});return z(o),J}}function H(){var W=[];q(W);for(var Y;Y=B();)Y!==!1&&(W.push(Y),q(W));return W}return I(),H()}function b(j){return j?j.replace(c,m):m}return Qw=w,Qw}var uz;function tse(){if(uz)return xu;uz=1;var e=xu&&xu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xu,"__esModule",{value:!0}),xu.default=n;const t=e(ese());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return xu}var Hf={},dz;function nse(){if(dz)return Hf;dz=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,o))};return Hf.camelCase=d,Hf}var Gf,fz;function rse(){if(fz)return Gf;fz=1;var e=Gf&&Gf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(tse()),n=nse();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,a)]=d)}),o}return r.default=r,Gf=r,Gf}var ise=rse();const ase=ga(ise),R3=D3("end"),Mk=D3("start");function D3(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 sse(e){const t=Mk(e),n=R3(e);if(t&&n)return{start:t,end:n}}function gh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hz(e.position):"start"in e||"end"in e?hz(e):"line"in e||"column"in e?S1(e):""}function S1(e){return pz(e&&e.line)+":"+pz(e&&e.column)}function hz(e){return S1(e&&e.start)+"-"+S1(e&&e.end)}function pz(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=gh(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}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const Lk={}.hasOwnProperty,ose=new Map,lse=/[A-Z]/g,cse=new Set(["table","tbody","thead","tfoot","tr"]),use=new Set(["td","th"]),I3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dse(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=xse(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=vse(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"?Ik:Xae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=M3(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function M3(e,t,n){if(t.type==="element")return fse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mse(e,t,n);if(t.type==="mdxjsEsm")return pse(e,t);if(t.type==="root")return gse(e,t,n);if(t.type==="text")return yse(e,t)}function fse(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ik,e.schema=i),e.ancestors.push(t);const a=$3(e,t.tagName,!1),o=bse(e,t);let c=Bk(e,t);return cse.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!qae(d):!0})),L3(e,o,a,t),$k(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function hse(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)}Th(e,t.position)}function pse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Th(e,t.position)}function mse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ik,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:$3(e,t.name,!0),o=wse(e,t),c=Bk(e,t);return L3(e,o,a,t),$k(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gse(e,t,n){const r={};return $k(r,Bk(e,t)),e.create(t,e.Fragment,r,n)}function yse(e,t){return t.value}function L3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $k(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vse(e,t,n){return r;function r(i,a,o,c){const f=Array.isArray(o.children)?n:t;return c?f(a,o,c):f(a,o)}}function xse(e,t){return n;function n(r,i,a,o){const c=Array.isArray(a.children),d=Mk(r);return t(i,a,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function bse(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Lk.call(t.properties,i)){const a=Sse(e,i,t.properties[i]);if(a){const[o,c]=a;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&use.has(t.tagName)?r=c:n[o]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function wse(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Th(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Th(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Bk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ose;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const c=M3(e,a,o);c!==void 0&&n.push(c)}return n}function Sse(e,t,n){const r=Wae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Mae(n):Jae(n)),r.property==="style"){let i=typeof n=="object"?n:jse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Nse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Gae[r.property]||r.property:r.attribute,n]}}function jse(e,t){try{return ase(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Er("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=I3+"#cannot-parse-style-attribute",i}}function $3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const c=az(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=o}else r=az(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Lk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Th(e)}function Th(e,t){const n=new Er("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=I3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nse(e){const t={};let n;for(n in e)Lk.call(e,n)&&(t[kse(n)]=e[n]);return t}function kse(e){let t=e.replace(lse,Cse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Cse(e){return"-"+e.toLowerCase()}const Ww={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"]},Ase={};function Ose(e,t){const n=Ase,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return B3(e,r,i)}function B3(e,t,n){if(Ese(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 mz(e.children,t,n)}return Array.isArray(e)?mz(e,t,n):""}function mz(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=B3(e[i],t,n);return r.join("")}function Ese(e){return!!(e&&typeof e=="object")}const gz=document.createElement("i");function Uk(e){const t="&"+e+";";gz.innerHTML=t;const n=gz.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Fa(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 qi(e,t){return e.length>0?(Fa(e,e.length,0,t),e):t}const yz={}.hasOwnProperty;function _se(e){const t={};let n=-1;for(;++n<e.length;)Pse(t,e[n]);return t}function Pse(e,t){let n;for(n in t){const i=(yz.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){yz.call(i,o)||(i[o]=[]);const c=a[o];Tse(i[o],Array.isArray(c)?c:c?[c]:[])}}}function Tse(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Fa(e,0,0,r)}function U3(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 Vu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ma=tl(/[A-Za-z]/),vi=tl(/[\dA-Za-z]/),zse=tl(/[#-'*+\--9=?A-Z^-~]/);function j1(e){return e!==null&&(e<32||e===127)}const N1=tl(/\d/),Rse=tl(/[\dA-Fa-f]/),Dse=tl(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function ii(e){return e!==null&&(e<0||e===32)}function zt(e){return e===-2||e===-1||e===32}const Ise=tl(new RegExp("\\p{P}|\\p{S}","u")),Mse=tl(/\s/);function tl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ad(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&vi(e.charCodeAt(n+1))&&vi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(o=String.fromCharCode(a,c),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function en(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return zt(d)?(e.enter(n),c(d)):t(d)}function c(d){return zt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const Lse={tokenize:$se};function $se(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),en(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Je(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),o)}}const Bse={tokenize:Use},vz={tokenize:qse};function Use(e){const t=this,n=[];let r=0,i,a,o;return c;function c(C){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const A=t.events.length;let P=A,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){E=t.events[P][1].end;break}N(r);let _=A;for(;_<t.events.length;)t.events[_][1].end={...E},_++;return Fa(t.events,P+1,0,t.events.slice(A)),t.events.length=_,f(C)}return c(C)}function f(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return w(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(vz,p,m)(C)}function p(C){return i&&O(),N(r),g(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(C)}function g(C){return t.containerState={},e.attempt(vz,v,w)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function w(C){if(C===null){i&&O(),N(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(C)}function b(C){if(C===null){j(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Je(C)?(e.consume(C),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(C),b)}function j(C,A){const P=t.sliceStream(C);if(A&&P.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.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 _=t.events.length;let z=_,I,q;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(I){q=t.events[z][1].end;break}I=!0}for(N(r),E=_;E<t.events.length;)t.events[E][1].end={...q},E++;Fa(t.events,z+1,0,t.events.slice(_)),t.events.length=E}}function N(C){let A=n.length;for(;A-- >C;){const P=n[A];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function O(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qse(e,t,n){return en(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xz(e){if(e===null||ii(e)||Mse(e))return 1;if(Ise(e))return 2}function qk(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 k1={name:"attention",resolveAll:Fse,tokenize:Kse};function Fse(e,t){let n=-1,r,i,a,o,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},g={...e[n][1].start};bz(m,-d),bz(g,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=qi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=qi(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=qi(f,qk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=qi(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=qi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Fa(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 Kse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=xz(r);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=xz(d),m=!p||p===2&&i||n.includes(d),g=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!g)),f._close=!!(a===42?g:g&&(p||!m)),t(d)}}function bz(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Hse={name:"autolink",tokenize:Gse};function Gse(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 Ma(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||vi(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||vi(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||j1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):zse(v)?(e.consume(v),f):n(v)}function p(v){return vi(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):g(v)}function g(v){if((v===45||vi(v))&&r++<63){const w=v===45?g:m;return e.consume(v),w}return n(v)}}const Vv={partial:!0,tokenize:Vse};function Vse(e,t,n){return r;function r(a){return zt(a)?en(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Je(a)?t(a):n(a)}}const q3={continuation:{tokenize:Wse},exit:Yse,name:"blockQuote",tokenize:Qse};function Qse(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return zt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Wse(e,t,n){const r=this;return i;function i(o){return zt(o)?en(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(q3,t,n)(o)}}function Yse(e){e.exit("blockQuote")}const F3={name:"characterEscape",tokenize:Zse};function Zse(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 Dse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const K3={name:"characterReference",tokenize:Xse};function Xse(e,t,n){const r=this;let i=0,a,o;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=vi,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=Rse,p):(e.enter("characterReferenceValue"),a=7,o=N1,p(m))}function p(m){if(m===59&&i){const g=e.exit("characterReferenceValue");return o===vi&&!Uk(r.sliceSerialize(g))?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 wz={partial:!0,tokenize:eoe},Sz={concrete:!0,name:"codeFenced",tokenize:Jse};function Jse(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,o=0,c;return d;function d(E){return f(E)}function f(E){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,c=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===c?(o++,e.consume(E),p):o<3?n(E):(e.exit("codeFencedFenceSequence"),zt(E)?en(e,m,"whitespace")(E):m(E))}function m(E){return E===null||Je(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(wz,b,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||Je(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):zt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),en(e,v,"whitespace")(E)):E===96&&E===c?n(E):(e.consume(E),g)}function v(E){return E===null||Je(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===null||Je(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===c?n(E):(e.consume(E),w)}function b(E){return e.attempt(i,A,j)(E)}function j(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),N}function N(E){return a>0&&zt(E)?en(e,O,"linePrefix",a+1)(E):O(E)}function O(E){return E===null||Je(E)?e.check(wz,b,A)(E):(e.enter("codeFlowValue"),C(E))}function C(E){return E===null||Je(E)?(e.exit("codeFlowValue"),O(E)):(e.consume(E),C)}function A(E){return e.exit("codeFenced"),t(E)}function P(E,_,z){let I=0;return q;function q(Y){return E.enter("lineEnding"),E.consume(Y),E.exit("lineEnding"),U}function U(Y){return E.enter("codeFencedFence"),zt(Y)?en(E,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):B(Y)}function B(Y){return Y===c?(E.enter("codeFencedFenceSequence"),H(Y)):z(Y)}function H(Y){return Y===c?(I++,E.consume(Y),H):I>=o?(E.exit("codeFencedFenceSequence"),zt(Y)?en(E,W,"whitespace")(Y):W(Y)):z(Y)}function W(Y){return Y===null||Je(Y)?(E.exit("codeFencedFence"),_(Y)):z(Y)}}}function eoe(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 Yw={name:"codeIndented",tokenize:noe},toe={partial:!0,tokenize:roe};function noe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),en(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):Je(f)?e.attempt(toe,o,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Je(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function roe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):en(e,a,"linePrefix",5)(o)}function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Je(o)?i(o):n(o)}}const ioe={name:"codeText",previous:soe,resolve:aoe,tokenize:ooe};function aoe(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 soe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ooe(e,t,n){let r=0,i,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):Je(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||Je(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 loe{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&&Vf(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),Vf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vf(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);Vf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vf(this.left,n.reverse())}}}function Vf(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 H3(e){const t={};let n=-1,r,i,a,o,c,d,f;const p=new loe(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,coe(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return Fa(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function coe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],f={};let p,m,g=-1,v=n,w=0,b=0;const j=[b];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;++g<c.length;)c[g][0]==="exit"&&c[g-1][0]==="enter"&&c[g][1].type===c[g-1][1].type&&c[g][1].start.line!==c[g][1].end.line&&(b=g+1,j.push(b),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(),g=j.length;g--;){const N=c.slice(j[g],j[g+1]),O=a.pop();d.push([O,O+N.length-1]),e.splice(O,2,N)}for(d.reverse(),g=-1;++g<d.length;)f[w+d[g][0]]=w+d[g][1],w+=d[g][1]-d[g][0]-1;return f}const uoe={resolve:foe,tokenize:hoe},doe={partial:!0,tokenize:poe};function foe(e){return H3(e),e}function hoe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):Je(c)?e.check(doe,o,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function poe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),en(e,a,"linePrefix")}function a(o){if(o===null||Je(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function G3(e,t,n,r,i,a,o,c,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),g):N===null||N===32||N===41||j1(N)?n(N):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),b(N))}function g(N){return N===62?(e.enter(a),e.consume(N),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(c),g(N)):N===null||N===60||Je(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 b(N){return!p&&(N===null||N===41||ii(N))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(N)):p<f&&N===40?(e.consume(N),p++,b):N===41?(e.consume(N),p--,b):N===null||N===32||N===40||j1(N)?n(N):(e.consume(N),N===92?j:b)}function j(N){return N===40||N===41||N===92?(e.consume(N),b):b(N)}}function V3(e,t,n,r,i,a){const o=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Je(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||Je(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!zt(v)),v===92?g:m)}function g(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function Q3(e,t,n,r,i,a){let o;return c;function c(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,d):n(g)}function d(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),f(g))}function f(g){return g===o?(e.exit(a),d(o)):g===null?n(g):Je(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),en(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===o||g===null||Je(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?m:p)}function m(g){return g===o||g===92?(e.consume(g),p):p(g)}}function yh(e,t){let n;return r;function r(i){return Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):zt(i)?en(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const moe={name:"definition",tokenize:yoe},goe={partial:!0,tokenize:voe};function yoe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return V3.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=Vu(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 ii(v)?yh(e,f)(v):f(v)}function f(v){return G3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(goe,m,m)(v)}function m(v){return zt(v)?en(e,g,"whitespace")(v):g(v)}function g(v){return v===null||Je(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function voe(e,t,n){return r;function r(c){return ii(c)?yh(e,i)(c):n(c)}function i(c){return Q3(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return zt(c)?en(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Je(c)?t(c):n(c)}}const xoe={name:"hardBreakEscape",tokenize:boe};function boe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Je(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const woe={name:"headingAtx",resolve:Soe,tokenize:joe};function Soe(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"},Fa(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function joe(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||ii(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Je(p)?(e.exit("atxHeading"),t(p)):zt(p)?en(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||ii(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const Noe=["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"],jz=["pre","script","style","textarea"],koe={concrete:!0,name:"htmlFlow",resolveTo:Ooe,tokenize:Eoe},Coe={partial:!0,tokenize:Poe},Aoe={partial:!0,tokenize:_oe};function Ooe(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 Eoe(e,t,n){const r=this;let i,a,o,c,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),g):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:L):Ma(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function g(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,c=0,w):Ma(D)?(e.consume(D),i=4,r.interrupt?t:L):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:L):n(D)}function w(D){const V="CDATA[";return D===V.charCodeAt(c++)?(e.consume(D),c===V.length?r.interrupt?t:B:w):n(D)}function b(D){return Ma(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||ii(D)){const V=D===47,oe=o.toLowerCase();return!V&&!a&&jz.includes(oe)?(i=1,r.interrupt?t(D):B(D)):Noe.includes(o.toLowerCase())?(i=6,V?(e.consume(D),N):r.interrupt?t(D):B(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?O(D):C(D))}return D===45||vi(D)?(e.consume(D),o+=String.fromCharCode(D),j):n(D)}function N(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function O(D){return zt(D)?(e.consume(D),O):q(D)}function C(D){return D===47?(e.consume(D),q):D===58||D===95||Ma(D)?(e.consume(D),A):zt(D)?(e.consume(D),C):q(D)}function A(D){return D===45||D===46||D===58||D===95||vi(D)?(e.consume(D),A):P(D)}function P(D){return D===61?(e.consume(D),E):zt(D)?(e.consume(D),P):C(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,_):zt(D)?(e.consume(D),E):z(D)}function _(D){return D===d?(e.consume(D),d=null,I):D===null||Je(D)?n(D):(e.consume(D),_)}function z(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||ii(D)?P(D):(e.consume(D),z)}function I(D){return D===47||D===62||zt(D)?C(D):n(D)}function q(D){return D===62?(e.consume(D),U):n(D)}function U(D){return D===null||Je(D)?B(D):zt(D)?(e.consume(D),U):n(D)}function B(D){return D===45&&i===2?(e.consume(D),K):D===60&&i===1?(e.consume(D),J):D===62&&i===4?(e.consume(D),M):D===63&&i===3?(e.consume(D),L):D===93&&i===5?(e.consume(D),me):Je(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Coe,F,H)(D)):D===null||Je(D)?(e.exit("htmlFlowData"),H(D)):(e.consume(D),B)}function H(D){return e.check(Aoe,W,F)(D)}function W(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Y}function Y(D){return D===null||Je(D)?H(D):(e.enter("htmlFlowData"),B(D))}function K(D){return D===45?(e.consume(D),L):B(D)}function J(D){return D===47?(e.consume(D),o="",se):B(D)}function se(D){if(D===62){const V=o.toLowerCase();return jz.includes(V)?(e.consume(D),M):B(D)}return Ma(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),se):B(D)}function me(D){return D===93?(e.consume(D),L):B(D)}function L(D){return D===62?(e.consume(D),M):D===45&&i===2?(e.consume(D),L):B(D)}function M(D){return D===null||Je(D)?(e.exit("htmlFlowData"),F(D)):(e.consume(D),M)}function F(D){return e.exit("htmlFlow"),t(D)}}function _oe(e,t,n){const r=this;return i;function i(o){return Je(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 Poe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Vv,t,n)}}const Toe={name:"htmlText",tokenize:zoe};function zoe(e,t,n){const r=this;let i,a,o;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),P):L===63?(e.consume(L),C):Ma(L)?(e.consume(L),z):n(L)}function f(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),a=0,w):Ma(L)?(e.consume(L),O):n(L)}function p(L){return L===45?(e.consume(L),v):n(L)}function m(L){return L===null?n(L):L===45?(e.consume(L),g):Je(L)?(o=m,J(L)):(e.consume(L),m)}function g(L){return L===45?(e.consume(L),v):m(L)}function v(L){return L===62?K(L):L===45?g(L):m(L)}function w(L){const M="CDATA[";return L===M.charCodeAt(a++)?(e.consume(L),a===M.length?b:w):n(L)}function b(L){return L===null?n(L):L===93?(e.consume(L),j):Je(L)?(o=b,J(L)):(e.consume(L),b)}function j(L){return L===93?(e.consume(L),N):b(L)}function N(L){return L===62?K(L):L===93?(e.consume(L),N):b(L)}function O(L){return L===null||L===62?K(L):Je(L)?(o=O,J(L)):(e.consume(L),O)}function C(L){return L===null?n(L):L===63?(e.consume(L),A):Je(L)?(o=C,J(L)):(e.consume(L),C)}function A(L){return L===62?K(L):C(L)}function P(L){return Ma(L)?(e.consume(L),E):n(L)}function E(L){return L===45||vi(L)?(e.consume(L),E):_(L)}function _(L){return Je(L)?(o=_,J(L)):zt(L)?(e.consume(L),_):K(L)}function z(L){return L===45||vi(L)?(e.consume(L),z):L===47||L===62||ii(L)?I(L):n(L)}function I(L){return L===47?(e.consume(L),K):L===58||L===95||Ma(L)?(e.consume(L),q):Je(L)?(o=I,J(L)):zt(L)?(e.consume(L),I):K(L)}function q(L){return L===45||L===46||L===58||L===95||vi(L)?(e.consume(L),q):U(L)}function U(L){return L===61?(e.consume(L),B):Je(L)?(o=U,J(L)):zt(L)?(e.consume(L),U):I(L)}function B(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,H):Je(L)?(o=B,J(L)):zt(L)?(e.consume(L),B):(e.consume(L),W)}function H(L){return L===i?(e.consume(L),i=void 0,Y):L===null?n(L):Je(L)?(o=H,J(L)):(e.consume(L),H)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||ii(L)?I(L):(e.consume(L),W)}function Y(L){return L===47||L===62||ii(L)?I(L):n(L)}function K(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function J(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),se}function se(L){return zt(L)?en(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):me(L)}function me(L){return e.enter("htmlTextData"),o(L)}}const Fk={name:"labelEnd",resolveAll:Moe,resolveTo:Loe,tokenize:$oe},Roe={tokenize:Boe},Doe={tokenize:Uoe},Ioe={tokenize:qoe};function Moe(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&&Fa(e,0,e.length,n),e}function Loe(e,t){let n=e.length,r=0,i,a,o,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=qi(c,e.slice(a+1,a+r+3)),c=qi(c,[["enter",p,t]]),c=qi(c,qk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),c=qi(c,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),c=qi(c,e.slice(o+1)),c=qi(c,[["exit",d,t]]),Fa(e,a,e.length,c),e}function $oe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(g){return a?a._inactive?m(g):(o=r.parser.defined.includes(Vu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(Roe,p,o?p:m)(g):g===91?e.attempt(Doe,p,o?f:m)(g):o?p(g):m(g)}function f(g){return e.attempt(Ioe,p,m)(g)}function p(g){return t(g)}function m(g){return a._balanced=!0,n(g)}}function Boe(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 ii(m)?yh(e,a)(m):a(m)}function a(m){return m===41?p(m):G3(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return ii(m)?yh(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?Q3(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return ii(m)?yh(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 Uoe(e,t,n){const r=this;return i;function i(c){return V3.call(r,e,a,o,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Vu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function qoe(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 Foe={name:"labelStartImage",resolveAll:Fk.resolveAll,tokenize:Koe};function Koe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Hoe={name:"labelStartLink",resolveAll:Fk.resolveAll,tokenize:Goe};function Goe(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 Zw={name:"lineEnding",tokenize:Voe};function Voe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),en(e,t,"linePrefix")}}const Kg={name:"thematicBreak",tokenize:Qoe};function Qoe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Je(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),zt(f)?en(e,c,"whitespace")(f):c(f))}}const Xr={continuation:{tokenize:Xoe},exit:ele,name:"list",tokenize:Zoe},Woe={partial:!0,tokenize:tle},Yoe={partial:!0,tokenize:Joe};function Zoe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:N1(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(Kg,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 N1(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(Vv,r.interrupt?n:p,e.attempt(Woe,g,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function m(v){return zt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Xoe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vv,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,en(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!zt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Yoe,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,en(e,e.attempt(Xr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Joe(e,t,n){const r=this;return en(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 ele(e){e.exit(this.containerState.type)}function tle(e,t,n){const r=this;return en(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!zt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Nz={name:"setextUnderline",resolveTo:nle,tokenize:rle};function nle(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 rle(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),zt(f)?en(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Je(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const ile={tokenize:ale};function ale(e){const t=this,n=e.attempt(Vv,r,e.attempt(this.parser.constructs.flowInitial,i,en(e,e.attempt(this.parser.constructs.flow,i,e.attempt(uoe,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 sle={resolveAll:Y3()},ole=W3("string"),lle=W3("text");function W3(e){return{resolveAll:Y3(e==="text"?cle:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,c);return o;function o(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let g=-1;if(m)for(;++g<m.length;){const v=m[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Y3(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 cle(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const ule={42:Xr,43:Xr,45:Xr,48:Xr,49:Xr,50:Xr,51:Xr,52:Xr,53:Xr,54:Xr,55:Xr,56:Xr,57:Xr,62:q3},dle={91:moe},fle={[-2]:Yw,[-1]:Yw,32:Yw},hle={35:woe,42:Kg,45:[Nz,Kg],60:koe,61:Nz,95:Kg,96:Sz,126:Sz},ple={38:K3,92:F3},mle={[-5]:Zw,[-4]:Zw,[-3]:Zw,33:Foe,38:K3,42:k1,60:[Hse,Toe],91:Hoe,92:[xoe,F3],93:Fk,95:k1,96:ioe},gle={null:[k1,sle]},yle={null:[42,95]},vle={null:[]},xle=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yle,contentInitial:dle,disable:vle,document:ule,flow:hle,flowInitial:fle,insideSpan:gle,string:ple,text:mle},Symbol.toStringTag,{value:"Module"}));function ble(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],c=[];const d={attempt:_(P),check:_(E),consume:O,enter:C,exit:A,interrupt:_(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return o=qi(o,U),j(),o[o.length-1]!==null?[]:(z(t,0),f.events=qk(a,f.events,f),f.events)}function g(U,B){return Sle(v(U),B)}function v(U){return wle(o,U)}function w(){const{_bufferIndex:U,_index:B,line:H,column:W,offset:Y}=r;return{_bufferIndex:U,_index:B,line:H,column:W,offset:Y}}function b(U){i[U.line]=U.column,q()}function j(){let U;for(;r._index<o.length;){const B=o[r._index];if(typeof B=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<B.length;)N(B.charCodeAt(r._bufferIndex));else N(B)}}function N(U){p=p(U)}function O(U){Je(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,q()):U!==-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=U}function C(U,B){const H=B||{};return H.type=U,H.start=w(),f.events.push(["enter",H,f]),c.push(H),H}function A(U){const B=c.pop();return B.end=w(),f.events.push(["exit",B,f]),B}function P(U,B){z(U,B.from)}function E(U,B){B.restore()}function _(U,B){return H;function H(W,Y,K){let J,se,me,L;return Array.isArray(W)?F(W):"tokenize"in W?F([W]):M(W);function M(re){return Ce;function Ce(je){const ee=je!==null&&re[je],pe=je!==null&&re.null,Ee=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return F(Ee)(je)}}function F(re){return J=re,se=0,re.length===0?K:D(re[se])}function D(re){return Ce;function Ce(je){return L=I(),me=re,re.partial||(f.currentConstruct=re),re.name&&f.parser.constructs.disable.null.includes(re.name)?oe():re.tokenize.call(B?Object.assign(Object.create(f),B):f,d,V,oe)(je)}}function V(re){return U(me,L),Y}function oe(re){return L.restore(),++se<J.length?D(J[se]):K}}}function z(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Fa(f.events,B,f.events.length-B,U.resolve(f.events.slice(B),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function I(){const U=w(),B=f.previous,H=f.currentConstruct,W=f.events.length,Y=Array.from(c);return{from:W,restore:K};function K(){r=U,f.previous=B,f.currentConstruct=H,f.events.length=W,c=Y,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function wle(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Sle(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 jle(e){const r={constructs:_se([xle,...(e||{}).extensions||[]]),content:i(Lse),defined:[],document:i(Bse),flow:i(ile),lazy:{},string:i(ole),text:i(lle)};return r;function i(a){return o;function o(c){return ble(r,a,c)}}}function Nle(e){for(;!H3(e););return e}const kz=/[\0\t\n\r]/g;function kle(){let e=1,t="",n=!0,r;return i;function i(a,o,c){const d=[];let f,p,m,g,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(kz.lastIndex=m,f=kz.exec(a),g=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(g),!f){t=a.slice(m);break}if(v===10&&m===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<g&&(d.push(a.slice(m,g)),e+=g-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=g+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Cle=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ale(e){return e.replace(Cle,Ole)}function Ole(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return U3(n.slice(a?2:1),a?16:10)}return Uk(n)||e}const Z3={}.hasOwnProperty;function Ele(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_le(n)(Nle(jle(n).document().write(kle()(e,t,!0))))}function _le(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(dn),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(at),blockQuote:a(pe),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(Ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ze),hardBreakEscape:a(Ve),hardBreakTrailing:a(Ve),htmlFlow:a(Gt,o),htmlFlowData:I,htmlText:a(Gt,o),htmlTextData:I,image:a($t),label:o,link:a(dn),listItem:a(Se),listItemValue:g,listOrdered:a(nn,m),listUnordered:a(nn),paragraph:a(Ze),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(at),strong:a(Rt),thematicBreak:a(Xe)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:re,characterReference:Ce,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:d(N),codeText:d(Y),codeTextData:q,data:q,definition:d(),definitionDestinationString:A,definitionLabelString:O,definitionTitleString:C,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(H),htmlFlowData:q,htmlText:d(W),htmlTextData:q,image:d(J),label:me,labelText:se,lineEnding:U,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:V,resourceDestinationString:L,resourceTitleString:M,resource:F,setextHeading:d(z),setextHeadingLineSequence:_,setextHeadingText:E,strong:d(),thematicBreak:d()}};X3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ne={type:"root",children:[]};const Me={stack:[Ne],tokenStack:[],config:t,enter:c,exit:f,buffer:o,resume:p,data:n},Ge=[];let ht=-1;for(;++ht<ce.length;)if(ce[ht][1].type==="listOrdered"||ce[ht][1].type==="listUnordered")if(ce[ht][0]==="enter")Ge.push(ht);else{const yn=Ge.pop();ht=i(ce,yn,ht)}for(ht=-1;++ht<ce.length;){const yn=t[ce[ht][0]];Z3.call(yn,ce[ht][1].type)&&yn[ce[ht][1].type].call(Object.assign({sliceSerialize:ce[ht][2].sliceSerialize},Me),ce[ht][1])}if(Me.tokenStack.length>0){const yn=Me.tokenStack[Me.tokenStack.length-1];(yn[1]||Cz).call(Me,void 0,yn[0])}for(Ne.position={start:jo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:jo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<t.transforms.length;)Ne=t.transforms[ht](Ne)||Ne;return Ne}function i(ce,Ne,Me){let Ge=Ne-1,ht=-1,yn=!1,Tn,vn,We,Vt;for(;++Ge<=Me;){const de=ce[Ge];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?ht++:ht--,Vt=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(Tn&&!Vt&&!ht&&!We&&(We=Ge),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!ht&&de[0]==="enter"&&de[1].type==="listItemPrefix"||ht===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(Tn){let Pe=Ge;for(vn=void 0;Pe--;){const fe=ce[Pe];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;vn&&(ce[vn][1].type="lineEndingBlank",yn=!0),fe[1].type="lineEnding",vn=Pe}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}We&&(!vn||We<vn)&&(Tn._spread=!0),Tn.end=Object.assign({},vn?ce[vn][1].start:de[1].end),ce.splice(vn||Ge,0,["exit",Tn,de[2]]),Ge++,Me++}if(de[1].type==="listItemPrefix"){const Pe={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};Tn=Pe,ce.splice(Ge,0,["enter",Pe,de[2]]),Ge++,Me++,We=void 0,Vt=!0}}}return ce[Ne][1]._spread=yn,Me}function a(ce,Ne){return Me;function Me(Ge){c.call(this,ce(Ge),Ge),Ne&&Ne.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(ce,Ne,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ne,Me||void 0]),ce.position={start:jo(Ne.start),end:void 0}}function d(ce){return Ne;function Ne(Me){ce&&ce.call(this,Me),f.call(this,Me)}}function f(ce,Ne){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ce.type&&(Ne?Ne.call(this,ce,Ge[0]):(Ge[1]||Cz).call(this,ce,Ge[0]));else throw new Error("Cannot close `"+ce.type+"` ("+gh({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=jo(ce.end)}function p(){return Ose(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ce}function w(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ce}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/(\r?\n|\r)$/g,"")}function O(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Vu(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function A(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function P(ce){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Me=this.sliceSerialize(ce).length;Ne.depth=Me}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function _(ce){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function I(ce){const Me=this.stack[this.stack.length-1].children;let Ge=Me[Me.length-1];(!Ge||Ge.type!=="text")&&(Ge=pt(),Ge.position={start:jo(ce.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function q(ce){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ce),Ne.position.end=jo(ce.end)}function U(ce){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ne.children[Ne.children.length-1];Me.position.end=jo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&(I.call(this,ce),q.call(this,ce))}function B(){this.data.atHardBreak=!0}function H(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function W(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function Y(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function K(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function J(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function se(ce){const Ne=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=Ale(Ne),Me.identifier=Vu(Ne).toLowerCase()}function me(){const ce=this.stack[this.stack.length-1],Ne=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ge=ce.children;Me.children=Ge}else Me.alt=Ne}function L(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function M(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function F(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function V(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Vu(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function oe(ce){this.data.characterReferenceType=ce.type}function re(ce){const Ne=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let Ge;Me?(Ge=U3(Ne,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Uk(Ne);const ht=this.stack[this.stack.length-1];ht.value+=Ge}function Ce(ce){const Ne=this.stack.pop();Ne.position.end=jo(ce.end)}function je(ce){q.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ce)}function ee(ce){q.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ce)}function pe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function at(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function $t(){return{type:"image",title:null,url:"",alt:null}}function dn(){return{type:"link",title:null,url:"",children:[]}}function nn(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Se(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Rt(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function Xe(){return{type:"thematicBreak"}}}function jo(e){return{line:e.line,column:e.column,offset:e.offset}}function X3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?X3(e,r):Ple(e,r)}}function Ple(e,t){let n;for(n in t)if(Z3.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 Cz(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+gh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+gh({start:t.start,end:t.end})+") is still open")}function Tle(e){const t=this;t.parser=n;function n(r){return Ele(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zle(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 Rle(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
-
`}]}function Dle(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 Ile(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mle(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ad(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function $le(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 Ble(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function J3(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 Ule(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J3(e,t);const i={src:Ad(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 qle(e,t){const n={src:Ad(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 Fle(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 Kle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return J3(e,t);const i={href:Ad(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 Hle(e,t){const n={href:Ad(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 Gle(e,t,n){const r=e.all(t),i=n?Vle(n):eB(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
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 Vle(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=eB(n[r])}return t}function eB(e){const t=e.spread;return t??e.children.length>1}function Qle(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 Wle(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yle(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Zle(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xle(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Mk(t.children[1]),d=R3(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Jle(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],g={},v=o?o[d]:void 0;v&&(g.align=v);let w={type:"element",tagName:a,properties:g,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 ece(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Az=9,Oz=32;function tce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Ez(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ez(t.slice(i),i>0,!1)),a.join("")}function Ez(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Az||a===Oz;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Az||a===Oz;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function nce(e,t){const n={type:"text",value:tce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function rce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ice={blockquote:zle,break:Rle,code:Dle,delete:Ile,emphasis:Mle,footnoteReference:Lle,heading:$le,html:Ble,imageReference:Ule,image:qle,inlineCode:Fle,linkReference:Kle,link:Hle,listItem:Gle,list:Qle,paragraph:Wle,root:Yle,strong:Zle,table:Xle,tableCell:ece,tableRow:Jle,text:nce,thematicBreak:rce,toml:sg,yaml:sg,definition:sg,footnoteDefinition:sg};function sg(){}const tB=-1,Qv=0,vh=1,Sy=2,Kk=3,Hk=4,Gk=5,Vk=6,nB=7,rB=8,_z=typeof self=="object"?self:globalThis,ace=(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 Qv:case tB:return n(o,i);case vh:{const c=n([],i);for(const d of o)c.push(r(d));return c}case Sy:{const c=n({},i);for(const[d,f]of o)c[r(d)]=r(f);return c}case Kk:return n(new Date(o),i);case Hk:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case Gk:{const c=n(new Map,i);for(const[d,f]of o)c.set(r(d),r(f));return c}case Vk:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case nB:{const{name:c,message:d}=o;return n(new _z[c](d),i)}case rB:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new _z[a](o),i)};return r},Pz=e=>ace(new Map,e)(0),bu="",{toString:sce}={},{keys:oce}=Object,Qf=e=>{const t=typeof e;if(t!=="object"||!e)return[Qv,t];const n=sce.call(e).slice(8,-1);switch(n){case"Array":return[vh,bu];case"Object":return[Sy,bu];case"Date":return[Kk,bu];case"RegExp":return[Hk,bu];case"Map":return[Gk,bu];case"Set":return[Vk,bu];case"DataView":return[vh,n]}return n.includes("Array")?[vh,n]:n.includes("Error")?[nB,n]:[Sy,n]},og=([e,t])=>e===Qv&&(t==="function"||t==="symbol"),lce=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},a=o=>{if(n.has(o))return n.get(o);let[c,d]=Qf(o);switch(c){case Qv:{let p=o;switch(d){case"bigint":c=rB,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([tB],o)}return i([c,p],o)}case vh:{if(d){let g=o;return d==="DataView"?g=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(o)),i([d,[...g]],o)}const p=[],m=i([c,p],o);for(const g of o)p.push(a(g));return m}case Sy:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([c,p],o);for(const g of oce(o))(e||!og(Qf(o[g])))&&p.push([a(g),a(o[g])]);return m}case Kk:return i([c,o.toISOString()],o);case Hk:{const{source:p,flags:m}=o;return i([c,{source:p,flags:m}],o)}case Gk:{const p=[],m=i([c,p],o);for(const[g,v]of o)(e||!(og(Qf(g))||og(Qf(v))))&&p.push([a(g),a(v)]);return m}case Vk:{const p=[],m=i([c,p],o);for(const g of o)(e||!og(Qf(g)))&&p.push(a(g));return m}}const{message:f}=o;return i([c,{name:d,message:f}],o)};return a},Tz=(e,{json:t,lossy:n}={})=>{const r=[];return lce(!(t||n),!!t,new Map,r)(e),r},jy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Pz(Tz(e,t)):structuredClone(e):(e,t)=>Pz(Tz(e,t));function cce(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 uce(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dce(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||cce,r=e.options.footnoteBackLabel||uce,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),g=Ad(m.toLowerCase());let v=0;const w=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){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-"+g+(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-"+g},children:e.wrap(p,!0)};e.patch(f,N),c.push(N)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...jy(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
106
|
-
`}]}}const iB=(function(e){if(e==null)return mce;if(typeof e=="function")return Wv(e);if(typeof e=="object")return Array.isArray(e)?fce(e):hce(e);if(typeof e=="string")return pce(e);throw new Error("Expected function, string, or object as test")});function fce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=iB(e[n]);return Wv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function hce(e){const t=e;return Wv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function pce(e){return Wv(t);function t(n){return n&&n.type===e}}function Wv(e){return t;function t(n,r,i){return!!(gce(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function mce(){return!0}function gce(e){return e!==null&&typeof e=="object"&&"type"in e}const aB=[],yce=!0,zz=!1,vce="skip";function xce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=iB(i),o=r?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=aB,w,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=bce(n(d,p)),v[0]===zz))return v;if("children"in d&&d.children){const N=d;if(N.children&&v[0]!==vce)for(b=(r?N.children.length:-1)+o,j=p.concat(N);b>-1&&b<N.children.length;){const O=N.children[b];if(w=c(O,b,j)(),w[0]===zz)return w;b=typeof w[1]=="number"?w[1]:b+o}}return v}}}function bce(e){return Array.isArray(e)?e:typeof e=="number"?[yce,e]:e==null?aB:[e]}function sB(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),xce(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const C1={}.hasOwnProperty,wce={};function Sce(e,t){const n=t||wce,r=new Map,i=new Map,a=new Map,o={...ice,...n.handlers},c={all:f,applyData:Nce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:jce,wrap:Cce};return sB(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,g=String(p.identifier).toUpperCase();m.has(g)||m.set(g,p)}}),c;function d(p,m){const g=p.type,v=c.handlers[g];if(C1.call(c.handlers,g)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(g)){if("children"in p){const{children:b,...j}=p,N=jy(j);return N.children=c.all(p),N}return jy(p)}return(c.options.unknownHandler||kce)(c,p,m)}function f(p){const m=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const w=c.one(g[v],p);if(w){if(v&&g[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Rz(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=Rz(b.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function jce(e,t){e.position&&(t.position=sse(e))}function Nce(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,jy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function kce(e,t){const n=t.data||{},r="value"in t&&!(C1.call(n,"hProperties")||C1.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 Cce(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 Rz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Dz(e,t){const n=Sce(e,t),r=n.one(e,void 0),i=dce(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 Ace(e,t){return e&&"run"in e?async function(n,r){const i=Dz(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Dz(n,{file:r,...e||t})}}function Iz(e){if(e)throw e}var Xw,Mz;function Oce(){if(Mz)return Xw;Mz=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 g;for(g in f);return typeof g>"u"||e.call(f,g)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Xw=function d(){var f,p,m,g,v,w,b=arguments[0],j=1,N=arguments.length,O=!1;for(typeof b=="boolean"&&(O=b,b=arguments[1]||{},j=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});j<N;++j)if(f=arguments[j],f!=null)for(p in f)m=c(b,p),g=c(f,p),b!==g&&(O&&g&&(a(g)||(v=i(g)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},o(b,{name:p,newValue:d(O,w,g)})):typeof g<"u"&&o(b,{name:p,newValue:g}));return b},Xw}var Ece=Oce();const Jw=ga(Ece);function A1(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 _ce(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?Pce(p,c)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Pce(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(o,...c){n||(n=!0,t(o,...c))}function a(o){i(null,o)}}const za={basename:Tce,dirname:zce,extname:Rce,join:Dce,sep:"/"};function Tce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');np(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function zce(e){if(np(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 Rce(e){np(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Dce(...e){let t=-1,n;for(;++t<e.length;)np(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ice(n)}function Ice(e){np(e);const t=e.codePointAt(0)===47;let n=Mce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Mce(e,t){let n="",r=0,i=-1,a=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else c===46&&a>-1?a++:a=-1}return n}function np(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lce={cwd:$ce};function $ce(){return"/"}function O1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bce(e){if(typeof e=="string")e=new URL(e);else if(!O1(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 Uce(e)}function Uce(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 eS=["history","path","basename","stem","extname","dirname"];class oB{constructor(t){let n;t?O1(t)?n={path:t}:typeof t=="string"||qce(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Lce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<eS.length;){const a=eS[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)eS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?za.basename(this.path):void 0}set basename(t){nS(t,"basename"),tS(t,"basename"),this.path=za.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?za.dirname(this.path):void 0}set dirname(t){Lz(this.basename,"dirname"),this.path=za.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?za.extname(this.path):void 0}set extname(t){if(tS(t,"extname"),Lz(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=za.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){O1(t)&&(t=Bce(t)),nS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?za.basename(this.path,this.extname):void 0}set stem(t){nS(t,"stem"),tS(t,"stem"),this.path=za.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 Er(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 tS(e,t){if(e&&e.includes(za.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+za.sep+"`")}function nS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Lz(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function qce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Fce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Kce={}.hasOwnProperty;class Qk extends Fce{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=_ce()}copy(){const t=new Qk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Jw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(aS("data",this.frozen),this.namespace[t]=n,this):Kce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(aS("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=lg(t),r=this.parser||this.Parser;return rS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rS("process",this.parser||this.Parser),iS("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const c=lg(t),d=r.parse(c);r.run(d,c,function(p,m,g){if(p||!m||!g)return f(p);const v=m,w=r.stringify(v,g);Vce(w)?g.value=w:g.result=w,f(p,g)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),rS("processSync",this.parser||this.Parser),iS("processSync",this.compiler||this.Compiler),this.process(t,i),Bz("processSync","process",n),r;function i(a,o){n=!0,Iz(a),r=o}}run(t,n,r){$z(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,c){const d=lg(n);i.run(t,d,f);function f(p,m,g){const v=m||t;p?c(p):o?o(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Bz("runSync","run",r),i;function a(o,c){Iz(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=lg(n),i=this.compiler||this.Compiler;return iS("stringify",i),$z(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(aS("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=Jw(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,g=-1;for(;++m<r.length;)if(r[m][0]===f){g=m;break}if(g===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const b=r[g][1];A1(b)&&A1(v)&&(v=Jw(!0,b,v)),r[g]=[f,v,...w]}}}}const Hce=new Qk().freeze();function rS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function aS(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 $z(e){if(!A1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Bz(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lg(e){return Gce(e)?e:new oB(e)}function Gce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Vce(e){return typeof e=="string"||Qce(e)}function Qce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wce="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Uz=[],qz={allowDangerousHtml:!0},Yce=/^(https?|ircs?|mailto|xmpp)$/i,Zce=[{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 Xce(e){const t=Jce(e),n=eue(e);return tue(t.runSync(t.parse(n),n),e)}function Jce(e){const t=e.rehypePlugins||Uz,n=e.remarkPlugins||Uz,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qz}:qz;return Hce().use(Tle).use(n).use(Ace,r).use(t)}function eue(e){const t=e.children||"",n=new oB;return typeof t=="string"&&(n.value=t),n}function tue(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||nue;for(const p of Zce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Wce+p.id,void 0);return sB(e,f),dse(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function f(p,m,g){if(p.type==="raw"&&g&&typeof m=="number")return o?g.children.splice(m,1):g.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Ww)if(Object.hasOwn(Ww,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],b=Ww[v];(b===null||b.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,g)),v&&g&&typeof m=="number")return c&&p.children?g.children.splice(m,1,...p.children):g.children.splice(m,1),m}}}function nue(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||Yce.test(e.slice(0,t))?e:""}function rue(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Yv=rue();async function Fz(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ai(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function iue(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ai(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function aue(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ai(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function sue({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new ai(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const g=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",g,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
|
|
111
|
-
|
|
112
|
-
`);for(;b!==-1;){const j=m.slice(0,b);m=m.slice(b+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{}}b=m.indexOf(`
|
|
114
|
-
|
|
115
|
-
`)}}}finally{a?.removeEventListener("abort",g);try{f.releaseLock()}catch{}}}function lB(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const oue=[{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?"}],lue=[{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:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries 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"}],cg=e=>`canonry:aero:provider:${e}`,Kz=e=>`canonry:aero:scope:${e}`;function cue({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,o]=x.useState([]),[c,d]=x.useState(""),[f,p]=x.useState(!1),[m,g]=x.useState([]),[v,w]=x.useState(""),[b,j]=x.useState(null),[N,O]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(cg(e))??null),[C,A]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Kz(e))==="all"?"all":"read-only"),P=x.useRef(null),E=x.useRef(null),_=x.useRef(null),[z,I]=x.useState(0),q=x.useMemo(()=>{const F=c.trimStart();if(!F.startsWith("/"))return[];if(/\s/.test(F))return[];const D=F.toLowerCase();return lue.filter(V=>V.command.startsWith(D)||V.label.toLowerCase().includes(D.slice(1)))},[c]);x.useEffect(()=>{I(F=>q.length===0?0:Math.min(F,q.length-1))},[q.length]);const U=ha({queryKey:qe.agent.providers(e),queryFn:()=>iue(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const F=U.data?.providers??[];if(N){const V=F.find(oe=>oe.id===N&&oe.configured);if(V)return V}const D=U.data?.defaultProvider;return D?F.find(V=>V.id===D)??null:null},[N,U.data]);x.useEffect(()=>{if(!U.data||!N)return;U.data.providers.find(D=>D.id===N&&D.configured)||(O(null),window.localStorage.removeItem(cg(e)))},[U.data,N,e]);const H=x.useCallback(F=>{O(F),!(typeof window>"u")&&(F?window.localStorage.setItem(cg(e),F):window.localStorage.removeItem(cg(e)))},[e]),W=x.useCallback(()=>{A(F=>{const D=F==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Kz(e),D),D})},[e]);x.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]),x.useEffect(()=>{if(!t)return;let F=!1;j(null);const D=()=>{F||f||Fz(e).then(re=>{F||o(re.messages)}).catch(re=>{F||j(re instanceof Error?re.message:"Failed to load transcript")})};D();const oe=window.setInterval(D,15e3);return()=>{F=!0,window.clearInterval(oe)}},[t,e,f]),x.useEffect(()=>()=>{P.current?.abort()},[e]),x.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(""),g([]);const V={role:"user",content:D,timestamp:Date.now()};o(re=>[...re,V]);const oe=new AbortController;P.current=oe;try{await sue({project:e,prompt:D,provider:N??void 0,scope:C,signal:oe.signal,onEvent:K});const re=await Fz(e);o(re.messages)}catch(re){re.name!=="AbortError"&&j(re instanceof Error?re.message:"Prompt failed")}finally{p(!1),w(""),P.current=null}}function K(F){switch(F.type){case"message_update":w(lB(F.message));break;case"message_end":F.message.role==="assistant"&&w("");break;case"tool_execution_start":g(D=>[...D,{id:F.toolCallId,name:F.toolName,args:F.args,startedAt:Date.now()}]);break;case"tool_execution_end":g(D=>D.map(V=>V.id===F.toolCallId?{...V,endedAt:Date.now(),isError:F.isError,result:F.result}:V));break;case"error":j(F.message);break}}async function J(){P.current?.abort();try{await aue(e),o([]),j(null)}catch(F){j(F instanceof Error?F.message:"Reset failed")}}const se=a.length===0,me=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",L=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",M=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 l.jsx("div",{className:me,onClick:F=>{r&&F.target===F.currentTarget&&i(!1)},children:l.jsx("div",{className:L,children:t?l.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:[l.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(iT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),l.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(uue,{providers:U.data?.providers??[],active:B,override:N,onPick:H,disabled:f}),l.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:l.jsx(v5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.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?l.jsx(_W,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.jsx(CW,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.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:l.jsx(Jh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),l.jsxs("div",{ref:E,className:M,children:[b&&l.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:b}),se&&!f&&l.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",l.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:oue.map(F=>l.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))})]}),mue(a,e,N,C),m.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(F=>l.jsx(cB,{trail:F},F.id))}),f&&v&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(uB,{content:v})]}),f&&!v&&m.every(F=>F.endedAt!==void 0)&&l.jsx(xue,{})]}),l.jsx(due,{projectName:e,activeProvider:B,scope:C,onToggleScope:W,disabled:f}),l.jsxs("div",{className:"relative",children:[q.length>0&&l.jsx(fue,{matches:q,selectedIndex:z,onHover:I,onPick:F=>{d(""),_.current?.focus(),F.action==="clear"?J():Y(F.prompt)}}),l.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[z];d(""),D.action==="clear"?J():Y(D.prompt);return}Y(c)},children:[l.jsx("textarea",{ref:_,value:c,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[z];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[z];d(""),D.action==="clear"?J():Y(D.prompt)}else Y(c)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),l.jsx("button",{type:"submit",disabled:f||!c.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:l.jsx(JQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):l.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:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(iT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function uue({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=x.useState(!1),c=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=g=>{c.current?.contains(g.target)||o(!1)},m=g=>{g.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 l.jsxs("div",{ref:c,className:"relative",children:[l.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:[l.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&l.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),l.jsx(iW,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&l.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:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),l.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,g=n===p.id;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(g?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:[l.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?l.jsx(h5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),l.jsxs("span",{className:"flex-1",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),g&&l.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&&l.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),l.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&l.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&l.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",l.jsx("code",{className:"font-mono text-zinc-400",children:hue(p.id)})]})]})]})},p.id)})}),n&&l.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 due({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return l.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:[l.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:[l.jsx("span",{className:"text-zinc-600",children:"project"}),l.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&l.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:[l.jsx("span",{className:"text-zinc-600",children:"model"}),l.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),l.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:[l.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),l.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function fue({matches:e,selectedIndex:t,onHover:n,onPick:r}){return l.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:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),l.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return l.jsx("li",{children:l.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:[l.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),l.jsx("span",{className:"font-medium",children:i.label}),l.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),l.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[l.jsx("span",{className:"mr-3",children:"↑↓ to select"}),l.jsx("span",{className:"mr-3",children:"Enter to run"}),l.jsx("span",{children:"Tab to autocomplete"})]})]})}function hue(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 pue(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function mue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=pue(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(l.jsx(gue,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const g=e[f];d.set(g.toolCallId,g),f++}const p=vue(o,d,o.timestamp??0),m=lB(o);i.push(l.jsxs(x.Fragment,{children:[p.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(g=>l.jsx(cB,{trail:g},g.id))}),m.trim()&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(uB,{content:m})]})]},c)),a=f-1;continue}}return i}function gue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),o=x.useMemo(()=>yue(t,e,n,r),[t,e,n,r]);async function c(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return l.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),l.jsx("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:o,children:i?l.jsxs(l.Fragment,{children:[l.jsx(h5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):l.jsxs(l.Fragment,{children:[l.jsx(dW,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),l.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function yue(e,t,n,r){const i=["canonry","agent","ask",Hz(e),Hz(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function Hz(e){return`'${e.replace(/'/g,"'\\''")}'`}function vue(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 cB({trail:e}){const[t,n]=x.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,c=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return l.jsxs("div",{className:`rounded-md border ${c} ${d} font-mono`,children:[l.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:[l.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?l.jsx(y5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?l.jsx(dy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):l.jsx(WW,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),l.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),l.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?l.jsx("span",{className:"text-emerald-400",children:"running…"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:i?"failed":"ok"}),o&&l.jsx("span",{children:o})]}),l.jsx(Xh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&l.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),l.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Gz(e.args)}),!r&&e.result!==void 0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Gz(e.result)})]})]})]})}function Gz(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 uB({content:e}){return l.jsx("div",{className:"aero-markdown text-zinc-100",children:l.jsx(Xce,{components:{h1:t=>l.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>l.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>l.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>l.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>l.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>l.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>l.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>l.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>l.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>l.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>l.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=>l.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=>l.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>l.jsx("div",{className:"mb-2 overflow-x-auto",children:l.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>l.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>l.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>l.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>l.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>l.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>l.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function xue(){return l.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[l.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),l.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),l.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function bue(){const e=Y$(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=ha({queryKey:qe.projects.all,queryFn:sk,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?l.jsx(cue,{projectName:a.name},a.name):null}function Zv(e,t,n){switch(e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all}),t){case yt["answer-visibility"]:case yt["site-audit"]:case yt["backlink-extract"]:return;case yt["gsc-sync"]:case yt["inspect-sitemap"]:e.invalidateQueries({queryKey:qe.gsc.project(n)});return;case yt["ga-sync"]:e.invalidateQueries({queryKey:qe.traffic.project(n)});return;case yt["bing-inspect"]:case yt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:qe.bing.project(n)});return;default:return t}}const Vz=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:vW},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:tW},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:gW}],Qz=e=>({label:e,state:"checking",detail:"Checking service health"}),wue={apiStatus:Qz("API"),workerStatus:Qz("Worker")};function Sue(e){switch(e){case yt["answer-visibility"]:return"Visibility sweep";case yt["gsc-sync"]:return"GSC sync";case yt["inspect-sitemap"]:return"Sitemap inspection";case yt["ga-sync"]:return"GA sync";case yt["bing-inspect"]:return"Bing URL inspection";case yt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case yt["site-audit"]:return"Site audit";case yt["backlink-extract"]:return"Backlink extract"}}function jue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function Nue(e){const t=Sue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function kue(e,t){return e.error?`${t}: ${xk(e.error)}`:e.location?`${t} · ${e.location}`:t}function Cue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function Aue(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 Oue(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function Eue(){const e=ji(),t=x.useSyncExternalStore(rne,sc,sc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=ha({queryKey:qe.runs.all,queryFn:J$,enabled:n,staleTime:o1,refetchInterval:3e3}),i=ha({queryKey:qe.projects.all,queryFn:sk,enabled:n}),a=x.useRef({}),o=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&o()},[n,o]),x.useEffect(()=>{if(!n||typeof window>"u")return;const c=()=>{document.visibilityState==="visible"&&o()};return window.addEventListener("focus",o),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",o),document.removeEventListener("visibilitychange",c)}},[n,o]),x.useEffect(()=>{const c=r.data??[],d=i.data??[],f=Object.fromEntries(c.map(m=>[m.id,m])),p=Object.fromEntries(c.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const g=f[m.runId];if(!g||!jk(g.status)||(a.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;const w=d.find(j=>j.id===g.projectId);if(w&&Zv(e,g.kind,w.name),m.sourceAction==="run-all"){TT(g.id);continue}const b=Cue(g.projectId,m.projectLabel,d);vt({title:Nue(g),detail:kue(g,b),tone:jue(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),TT(g.id)}for(const m of Object.values(t.batches)){const g=sne(m.runIds,f);g.finished&&(vt({title:"Run-all batch finished",detail:Aue(g,m.skippedCount),tone:Oue(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),ane(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function _ue(){const e=ep(),{dashboard:t,isLoading:n,refetch:r}=Oc(),o=Gv(!e,e?.health).data??e?.health??wue,c=Y$(),{runId:d,evidenceId:f,closeDrawer:p}=kd(),[m,g]=x.useState(!1),v=zae(d),w=v.data??null,b=v.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{g(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const A=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[d,f,p]);const j=t??e?.dashboard??null,N=d&&j?nae(j,d):void 0,O=f&&j?rae(j,f):void 0,C=(()=>{const A=c.pathname;if(A==="/")return"Portfolio";if(A==="/projects")return"Projects";if(A==="/runs")return"Runs";if(A==="/settings")return"Settings";if(A==="/setup")return"Setup";if(A==="/backlinks")return"Backlinks";if(A.startsWith("/projects/")){const E=A.split("/").filter(Boolean)[1];if(E&&j){const _=j.projects.find(z=>z.project.id===E);if(_)return _.project.name}return"Project"}return"Not found"})();return l.jsxs("div",{className:"app-shell",children:[l.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),l.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx(qT,{version:o.apiStatus.version})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(Xt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(SW,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(Xt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(bW,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(Xt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(uy,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(Xt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(g5,{className:"sidebar-icon"}),l.jsx("span",{children:"Backlinks"})]}),l.jsxs(Xt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(BW,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),n?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(A=>l.jsxs("div",{className:"sidebar-skeleton-item",children:[l.jsx("span",{className:"skeleton-circle size-2"}),l.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+A*15}%`}})]},A))]}):j&&j.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(A=>{const P=A.visibilitySummary.tone;return l.jsxs(Xt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),l.jsx("span",{children:A.project.name})]},A.project.id)})]}):n?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(Xt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(MW,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:Vz.map(({label:A,href:P,Icon:E})=>l.jsx("a",{className:"sidebar-footer-icon",href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:l.jsx(E,{className:"size-4"})},P))})]}),l.jsxs("div",{className:"main-area",children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("div",{className:"topbar-left",children:[l.jsx("div",{className:"topbar-brand-mobile",children:l.jsx(qT,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(Xt,{to:"/",children:"Home"}),l.jsx(Xh,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:C})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:Ho(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:Ho(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),l.jsxs(be,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>g(A=>!A),children:[l.jsx(OW,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[l.jsxs(be,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>g(!1),children:[l.jsx(Jh,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(Xt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(Xt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(Xt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(Xt,{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?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(A=>l.jsx(Xt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"mobile-nav-link",children:A.project.name},A.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:n&&!e?l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-40"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(A=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text w-full"}),l.jsx("div",{className:"skeleton-text-sm w-3/4"})]},A))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(A=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-20"}),l.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>l.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},A))})]}):l.jsx(ak,{})}),l.jsxs("footer",{className:"footer",children:[l.jsxs("span",{className:"footer-brand",children:[l.jsx("span",{children:"Canonry"}),o.apiStatus.version&&o.apiStatus.version!=="unknown"?l.jsxs("span",{className:"footer-version",children:["v",o.apiStatus.version]}):null]}),l.jsx("div",{className:"footer-links",children:Vz.map(({label:A,href:P,Icon:E})=>l.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:l.jsx(E,{className:"size-3.5"})},P))})]})]}),N?l.jsxs(Hie,{open:N!==void 0,title:N.summary,subtitle:`${N.projectName} · ${N.kindLabel}`,onClose:p,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Uv,{status:N.status}),l.jsx("span",{className:"text-zinc-400",children:N.startedAt}),l.jsx("span",{className:"text-zinc-500",children:N.duration}),l.jsx("span",{className:"text-zinc-600",children:N.triggerLabel})]}),N.status==="failed"&&N.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:N.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(A=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:A.query??"Unknown query"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(oc,{provider:A.provider}),l.jsx(D4,{variant:A.citationState===Lr.cited?"success":"neutral",children:A.citationState})]})]}),A.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:A.model}),A.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",A.citedDomains.join(", ")]}),A.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",A.competitorOverlap.join(", ")]}),A.groundingSources&&A.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[A.groundingSources.length," grounding source",A.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:A.groundingSources.map((P,E)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},E))})]}),A.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:A.answerText})]})]},A.id)),w.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):w&&w.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):w&&w.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.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?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.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:Kte(w.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?l.jsx(Wie,{evidence:O.evidence,project:O.project,onClose:p}):null,l.jsx(Eue,{}),l.jsx(Iae,{}),l.jsx(bue,{})]})}class Pue extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(dy,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(be,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(v5,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.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=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ji("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 E1=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ji("flex flex-col gap-1.5 p-5",e),...t}));E1.displayName="CardHeader";const _1=x.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Ji("font-medium tracking-tight text-zinc-50",e),...t}));_1.displayName="CardTitle";const P1=x.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Ji("text-sm text-zinc-500",e),...t}));P1.displayName="CardDescription";const Hg=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ji("p-5 pt-0",e),...t}));Hg.displayName="CardContent";function Tue({points:e,tone:t}){const n=x.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((g,v)=>{const w=a+v/Math.max(e.length-1,1)*f,b=a+(1-(g-o)/d)*p;return`${w},${b}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:n,children:l.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),l.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function zue({project:e}){return l.jsxs(Xt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&l.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Lv(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(Tue,{points:e.trend,tone:p4(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Xh,{className:"h-4 w-4 text-zinc-500"})})]})}function Rue(){const e=ep(),{dashboard:t,isLoading:n}=Oc(),r=t??e?.dashboard;if(!r||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-32"}),l.jsx("div",{className:"skeleton-text-sm w-64"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("div",{className:"skeleton-text w-36"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,c=Gv(!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=Yte(i.systemHealth,c,r.settings),{openRun:f}=kd();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>l.jsx(zue,{project:p},p.project.id))}):l.jsxs(Be,{className:"surface-card empty-card",children:[l.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),l.jsx(be,{size:"sm",asChild:!0,children:l.jsx(Xt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>l.jsxs(Xt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:p.title}),l.jsx("p",{className:"attention-detail",children:p.detail})]}),l.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:p.projectName}),l.jsx("p",{className:"compact-run-detail",children:p.summary})]}),l.jsx(Uv,{status:p.status})]},p.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:d.map(p=>l.jsxs(Be,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),l.jsx("h3",{children:p.detail})]}),l.jsx(it,{tone:p.tone,title:p.id==="api"?Ho(c.apiStatus):p.id==="worker"?Ho(c.workerStatus):void 0,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Wk=Symbol.for("yaml.alias"),T1=Symbol.for("yaml.document"),Bo=Symbol.for("yaml.map"),dB=Symbol.for("yaml.pair"),Ka=Symbol.for("yaml.scalar"),Od=Symbol.for("yaml.seq"),Wi=Symbol.for("yaml.node.type"),_c=e=>!!e&&typeof e=="object"&&e[Wi]===Wk,Xv=e=>!!e&&typeof e=="object"&&e[Wi]===T1,rp=e=>!!e&&typeof e=="object"&&e[Wi]===Bo,Bn=e=>!!e&&typeof e=="object"&&e[Wi]===dB,tn=e=>!!e&&typeof e=="object"&&e[Wi]===Ka,ip=e=>!!e&&typeof e=="object"&&e[Wi]===Od;function Mn(e){if(e&&typeof e=="object")switch(e[Wi]){case Bo:case Od:return!0}return!1}function $n(e){if(e&&typeof e=="object")switch(e[Wi]){case Wk:case Bo:case Ka:case Od:return!0}return!1}const fB=e=>(tn(e)||Mn(e))&&!!e.anchor,Dl=Symbol("break visit"),Due=Symbol("skip children"),xh=Symbol("remove node");function Ed(e,t){const n=Iue(t);Xv(e)?Iu(null,e.contents,n,Object.freeze([e]))===xh&&(e.contents=null):Iu(null,e,n,Object.freeze([]))}Ed.BREAK=Dl;Ed.SKIP=Due;Ed.REMOVE=xh;function Iu(e,t,n,r){const i=Mue(e,t,n,r);if($n(i)||Bn(i))return Lue(e,r,i),Iu(e,i,n,r);if(typeof i!="symbol"){if(Mn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Iu(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===Dl)return Dl;o===xh&&(t.items.splice(a,1),a-=1)}}}else if(Bn(t)){r=Object.freeze(r.concat(t));const a=Iu("key",t.key,n,r);if(a===Dl)return Dl;a===xh&&(t.key=null);const o=Iu("value",t.value,n,r);if(o===Dl)return Dl;o===xh&&(t.value=null)}}return i}function Iue(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 Mue(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(rp(t))return n.Map?.(e,t,r);if(ip(t))return n.Seq?.(e,t,r);if(Bn(t))return n.Pair?.(e,t,r);if(tn(t))return n.Scalar?.(e,t,r);if(_c(t))return n.Alias?.(e,t,r)}function Lue(e,t,n){const r=t[t.length-1];if(Mn(r))r.items[e]=n;else if(Bn(r))e==="key"?r.key=n:r.value=n;else if(Xv(r))r.contents=n;else{const i=_c(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const $ue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Bue=e=>e.replace(/[!,[\]{}]/g,t=>$ue[t]);class Rr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Rr.defaultYaml,t),this.tags=Object.assign({},Rr.defaultTags,n)}clone(){const t=new Rr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Rr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Rr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Rr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Rr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Rr.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+Bue(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&&$n(t.contents)){const a={};Ed(t.contents,(o,c)=>{$n(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
117
|
-
`)}}Rr.defaultYaml={explicit:!1,version:"1.2"};Rr.defaultTags={"!!":"tag:yaml.org,2002:"};function hB(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 pB(e){const t=new Set;return Ed(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function mB(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Uue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=pB(e));const o=mB(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(tn(o.node)||Mn(o.node)))o.node.anchor=o.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Mu(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],c=Mu(e,r,String(i),o);c===void 0?delete r[i]:c!==o&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Mu(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=Mu(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=Mu(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function Gi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Gi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!fB(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 Yk{constructor(t){Object.defineProperty(this,Wi,{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(!Xv(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Gi(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?Mu(a,{"":c},"",c):c}}class Zk extends Yk{constructor(t){super(Wk),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=[],Ed(t,{Node:(a,o)=>{(_c(o)||fB(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(o);if(c||(Gi(o,null,n),c=r.get(o)),c?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Gg(i,o,r)),c.count*c.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(hB(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 Gg(e,t,n){if(_c(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Mn(t)){let r=0;for(const i of t.items){const a=Gg(e,i,n);a>r&&(r=a)}return r}else if(Bn(t)){const r=Gg(e,t.key,n),i=Gg(e,t.value,n);return Math.max(r,i)}return 1}const gB=e=>!e||typeof e!="function"&&typeof e!="object";class rt extends Yk{constructor(t){super(Ka),this.value=t}toJSON(t,n){return n?.keep?this.value:Gi(this.value,t,n)}toString(){return String(this.value)}}rt.BLOCK_FOLDED="BLOCK_FOLDED";rt.BLOCK_LITERAL="BLOCK_LITERAL";rt.PLAIN="PLAIN";rt.QUOTE_DOUBLE="QUOTE_DOUBLE";rt.QUOTE_SINGLE="QUOTE_SINGLE";const que="tag:yaml.org,2002:";function Fue(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 zh(e,t,n){if(Xv(e)&&(e=e.contents),$n(e))return e;if(Bn(e)){const m=n.schema[Bo].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new Zk(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=que+t.slice(2));let f=Fue(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new rt(e);return d&&(d.node=m),m}f=e instanceof Map?o[Bo]:Symbol.iterator in Object(e)?o[Od]:o[Bo]}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 rt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Ny(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 zh(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 ch=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class yB extends Yk{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=>$n(r)||Bn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(ch(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Mn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,Ny(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(Mn(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&&tn(a)?a.value:a:Mn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Bn(n))return!1;const r=n.value;return r==null||t&&tn(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 Mn(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(Mn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,Ny(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Kue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function As(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Fl=(e,t,n)=>e.endsWith(`
|
|
118
|
-
`)?As(n,t):n.includes(`
|
|
119
|
-
`)?`
|
|
120
|
-
`+As(n,t):(e.endsWith(" ")?"":" ")+n,vB="flow",z1="block",Vg="quoted";function Jv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:c}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let g,v,w=!1,b=-1,j=-1,N=-1;n===z1&&(b=Wz(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Vg&&C==="\\"){switch(j=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}N=b}if(C===`
|
|
121
|
-
`)n===z1&&(b=Wz(e,b,t.length)),m=b+t.length+d,g=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
|
|
122
|
-
`&&v!==" "){const A=e[b+1];A&&A!==" "&&A!==`
|
|
123
|
-
`&&A!==" "&&(g=b)}if(b>=m)if(g)f.push(g),m=g+d,g=void 0;else if(n===Vg){for(;v===" "||v===" ";)v=C,C=e[b+=1],w=!0;const A=b>N+1?b-2:j-1;if(p[A])return e;f.push(A),p[A]=!0,m=A+d,g=void 0}else w=!0}v=C}if(w&&c&&c(),f.length===0)return e;o&&o();let O=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const A=f[C],P=f[C+1]||e.length;A===0?O=`
|
|
124
|
-
${t}${e.slice(0,P)}`:(n===Vg&&p[A]&&(O+=`${e[A]}\\`),O+=`
|
|
125
|
-
${t}${e.slice(A+1,P)}`)}return O}function Wz(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 e0=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),t0=e=>/^(%|---|\.\.\.)/m.test(e);function Hue(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 bh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(t0(e)?" ":"");let o="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(c,d)+`
|
|
128
|
-
|
|
129
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
130
|
-
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,c=d+1}break;default:d+=1}return o=c?o+n.slice(c):n,r?o:Jv(o,a,Vg,e0(t,!1))}function R1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return bh(e,t);const n=t.indent||(t0(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
-
${n}`)+"'";return t.implicitKey?r:Jv(r,n,vB,e0(t,!1))}function Lu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=bh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=R1:a&&!i?r=bh:r=n?R1:bh}return r(e,t)}let D1;try{D1=new RegExp(`(^|(?<!
|
|
133
|
-
))
|
|
134
|
-
+(?!
|
|
135
|
-
|$)`,"g")}catch{D1=/\n+(?!\n|$)/g}function Qg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:c,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return Lu(n,r);const f=r.indent||(r.forceBlockIndent||t0(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===rt.BLOCK_FOLDED?!1:t===rt.BLOCK_LITERAL?!0:!Hue(n,d,f.length);if(!n)return p?`|
|
|
136
|
-
`:`>
|
|
137
|
-
`;let m,g;for(g=n.length;g>0;--g){const P=n[g-1];if(P!==`
|
|
138
|
-
`&&P!==" "&&P!==" ")break}let v=n.substring(g);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(D1,`$&${f}`));let b=!1,j,N=-1;for(j=0;j<n.length;++j){const P=n[j];if(P===" ")b=!0;else if(P===`
|
|
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 A=(b?f?"2":"1":"")+m;if(e&&(A+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
|
|
142
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let E=!1;const _=e0(r,!0);o!=="folded"&&t!==rt.BLOCK_FOLDED&&(_.onOverflow=()=>{E=!0});const z=Jv(`${O}${P}${v}`,f,z1,_);if(!E)return`>${A}
|
|
143
|
-
${f}${z}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
|
|
144
|
-
${f}${O}${n}${v}`}function Gue(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
|
|
145
|
-
`)||p&&/[[\]{},]/.test(a))return Lu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
|
|
146
|
-
`)?Lu(a,t):Qg(e,t,n,r);if(!c&&!p&&i!==rt.PLAIN&&a.includes(`
|
|
147
|
-
`))return Qg(e,t,n,r);if(t0(a)){if(d==="")return t.forceBlockIndent=!0,Qg(e,t,n,r);if(c&&d===f)return Lu(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
-
${d}`);if(o){const g=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(g)||v?.some(g))return Lu(a,t)}return c?m:Jv(m,d,vB,e0(t,!1))}function Xk(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==rt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(c=rt.QUOTE_DOUBLE);const d=p=>{switch(p){case rt.BLOCK_FOLDED:case rt.BLOCK_LITERAL:return i||a?Lu(o.value,t):Qg(o,t,n,r);case rt.QUOTE_DOUBLE:return bh(o.value,t);case rt.QUOTE_SINGLE:return R1(o.value,t);case rt.PLAIN:return Gue(o,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,g=i&&p||m;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function xB(e,t){const n=Object.assign({blockQuote:!0,commentString:Kue,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 Vue(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(tn(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 Que(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(tn(e)||Mn(e))&&e.anchor;a&&hB(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 od(e,t,n,r){if(Bn(e))return e.toString(t,n,r);if(_c(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=$n(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Vue(t.doc.schema.tags,a));const o=Que(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):tn(a)?Xk(a,t,n,r):a.toString(t,n,r);return o?tn(a)||c[0]==="{"||c[0]==="["?`${o} ${c}`:`${o}
|
|
149
|
-
${t.indent}${c}`:c}function Wue({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let g=$n(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Mn(e)||!$n(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||Mn(e)||(tn(e)?e.type===rt.BLOCK_FOLDED||e.type===rt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let w=!1,b=!1,j=od(e,n,()=>w=!0,()=>b=!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}`,g&&!w?j+=Fl(j,n.indent,f(g)):b&&i&&i(),j;w&&(g=null),v?(g&&(j+=Fl(j,n.indent,f(g))),j=`? ${j}
|
|
150
|
-
${c}:`):(j=`${j}:`,g&&(j+=Fl(j,n.indent,f(g))));let N,O,C;$n(t)?(N=!!t.spaceBefore,O=t.commentBefore,C=t.comment):(N=!1,O=null,C=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!g&&tn(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&ip(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let A=!1;const P=od(t,n,()=>A=!0,()=>b=!0);let E=" ";if(g||N||O){if(E=N?`
|
|
151
|
-
`:"",O){const _=f(O);E+=`
|
|
152
|
-
${As(_,n.indent)}`}P===""&&!n.inFlow?E===`
|
|
153
|
-
`&&C&&(E=`
|
|
154
|
-
|
|
155
|
-
`):E+=`
|
|
156
|
-
${n.indent}`}else if(!v&&Mn(t)){const _=P[0],z=P.indexOf(`
|
|
157
|
-
`),I=z!==-1,q=n.inFlow??t.flow??t.items.length===0;if(I||!q){let U=!1;if(I&&(_==="&"||_==="!")){let B=P.indexOf(" ");_==="&"&&B!==-1&&B<z&&P[B+1]==="!"&&(B=P.indexOf(" ",B+1)),(B===-1||z<B)&&(U=!0)}U||(E=`
|
|
158
|
-
${n.indent}`)}}else(P===""||P[0]===`
|
|
159
|
-
`)&&(E="");return j+=E+P,n.inFlow?A&&r&&r():C&&!A?j+=Fl(j,n.indent,f(C)):b&&i&&i(),j}function Yue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ug="<<",_s={identify:e=>e===ug||typeof e=="symbol"&&e.description===ug,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new rt(Symbol(ug)),{addToJSMap:bB}),stringify:()=>ug},Zue=(e,t)=>(_s.identify(t)||tn(t)&&(!t.type||t.type===rt.PLAIN)&&_s.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===_s.tag&&n.default);function bB(e,t,n){if(n=e&&_c(n)?n.resolve(e.doc):n,ip(n))for(const r of n.items)sS(e,t,r);else if(Array.isArray(n))for(const r of n)sS(e,t,r);else sS(e,t,n)}function sS(e,t,n){const r=e&&_c(n)?n.resolve(e.doc):n;if(!rp(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 wB(e,t,{key:n,value:r}){if($n(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Zue(e,n))bB(e,t,r);else{const i=Gi(n,"",e);if(t instanceof Map)t.set(i,Gi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Xue(n,i,e),o=Gi(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Xue(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if($n(e)&&n?.doc){const r=xB(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)+'..."'),Yue(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 Jk(e,t,n){const r=zh(e,void 0,n),i=zh(t,void 0,n);return new $r(r,i)}class $r{constructor(t,n=null){Object.defineProperty(this,Wi,{value:dB}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return $n(n)&&(n=n.clone(t)),$n(r)&&(r=r.clone(t)),new $r(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return wB(n,r,this)}toString(t,n,r){return t?.doc?Wue(this,t,n,r):JSON.stringify(this)}}function SB(e,t,n){return(t.inFlow??e.flow?ede:Jue)(e,t,n)}function Jue({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const g=[];for(let w=0;w<t.length;++w){const b=t[w];let j=null;if($n(b))!m&&b.spaceBefore&&g.push(""),ky(n,g,b.commentBefore,m),b.comment&&(j=b.comment);else if(Bn(b)){const O=$n(b.key)?b.key:null;O&&(!m&&O.spaceBefore&&g.push(""),ky(n,g,O.commentBefore,m))}m=!1;let N=od(b,p,()=>j=null,()=>m=!0);j&&(N+=Fl(N,a,f(j))),m&&j&&(m=!1),g.push(r+N)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let w=1;w<g.length;++w){const b=g[w];v+=b?`
|
|
160
|
-
${d}${b}`:`
|
|
161
|
-
`}}return e?(v+=`
|
|
162
|
-
`+As(f(e),d),c&&c()):m&&o&&o(),v}function ede({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:c}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let w=0;w<e.length;++w){const b=e[w];let j=null;if($n(b))b.spaceBefore&&m.push(""),ky(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(Bn(b)){const O=$n(b.key)?b.key:null;O&&(O.spaceBefore&&m.push(""),ky(t,m,O.commentBefore,!1),O.comment&&(f=!0));const C=$n(b.value)?b.value:null;C?(C.comment&&(j=C.comment),C.commentBefore&&(f=!0)):b.value==null&&O?.comment&&(j=O.comment)}j&&(f=!0);let N=od(b,d,()=>j=null);w<e.length-1&&(N+=","),j&&(N+=Fl(N,r,c(j))),!f&&(m.length>p||N.includes(`
|
|
163
|
-
`))&&(f=!0),m.push(N),p=m.length}const{start:g,end:v}=n;if(m.length===0)return g+v;if(!f){const w=m.reduce((b,j)=>b+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=g;for(const b of m)w+=b?`
|
|
164
|
-
${a}${i}${b}`:`
|
|
165
|
-
`;return`${w}
|
|
166
|
-
${i}${v}`}else return`${g}${o}${m.join(" ")}${o}${v}`}function ky({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=As(t(r),e);n.push(a.trimStart())}}function Kl(e,t){const n=tn(t)?t.value:t;for(const r of e)if(Bn(r)&&(r.key===t||r.key===n||tn(r.key)&&r.key.value===n))return r}class Fi extends yB{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Bo,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),c=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&o.items.push(Jk(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;Bn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new $r(t,t?.value):r=new $r(t.key,t.value);const i=Kl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);tn(i.value)&&gB(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(c=>a(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Kl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Kl(this.items,t)?.value;return(!n&&tn(i)?i.value:i)??void 0}has(t){return!!Kl(this.items,t)}set(t,n){this.add(new $r(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)wB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Bn(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})),SB(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const _d={collection:"map",default:!0,nodeClass:Fi,tag:"tag:yaml.org,2002:map",resolve(e,t){return rp(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Fi.from(e,t,n)};class cc extends yB{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Od,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=dg(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=dg(t);if(typeof r!="number")return;const i=this.items[r];return!n&&tn(i)?i.value:i}has(t){const n=dg(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=dg(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];tn(i)&&gB(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(Gi(a,String(i++),n));return r}toString(t,n,r){return t?SB(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(o++);c=i.call(n,d,c)}a.items.push(zh(c,void 0,r))}}return a}}function dg(e){let t=tn(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Pd={collection:"seq",default:!0,nodeClass:cc,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ip(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>cc.from(e,t,n)},n0={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),Xk(e,t,n,r)}},r0={identify:e=>e==null,createNode:()=>new rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rt(null),stringify:({source:e},t)=>typeof e=="string"&&r0.test.test(e)?e:t.options.nullStr},eC={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new rt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&eC.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 va({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let c=t-(a.length-o-1);for(;c-- >0;)a+="0"}return a}const jB={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:va},NB={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():va(e)}},kB={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 rt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:va},i0=e=>typeof e=="bigint"||Number.isInteger(e),tC=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function CB(e,t,n){const{value:r}=e;return i0(r)&&r>=0?n+r.toString(t):va(e)}const AB={identify:e=>i0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>tC(e,2,8,n),stringify:e=>CB(e,8,"0o")},OB={identify:i0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>tC(e,0,10,n),stringify:va},EB={identify:e=>i0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>tC(e,2,16,n),stringify:e=>CB(e,16,"0x")},tde=[_d,Pd,n0,r0,eC,AB,OB,EB,jB,NB,kB];function Yz(e){return typeof e=="bigint"||Number.isInteger(e)}const fg=({value:e})=>JSON.stringify(e),nde=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:fg},{identify:e=>e==null,createNode:()=>new rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fg},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:fg},{identify:Yz,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})=>Yz(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:fg}],rde={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},ide=[_d,Pd].concat(nde,rde),nC={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const o=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=rt.BLOCK_LITERAL),t!==rt.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let m=0,g=0;m<f;++m,g+=d)p[m]=c.substr(g,d);c=p.join(t===rt.BLOCK_LITERAL?`
|
|
167
|
-
`:" ")}return Xk({comment:e,type:t,value:c},r,i,a)}};function _B(e,t){if(ip(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Bn(r)){if(rp(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new $r(new rt(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]=Bn(r)?r:new $r(r)}}else t("Expected a sequence for this tag");return e}function PB(e,t,n){const{replacer:r}=n,i=new cc(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let c,d;if(Array.isArray(o))if(o.length===2)c=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)c=f[0],d=o[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=o;i.items.push(Jk(c,d,n))}return i}const rC={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_B,createNode:PB};class Qu extends cc{constructor(){super(),this.add=Fi.prototype.add.bind(this),this.delete=Fi.prototype.delete.bind(this),this.get=Fi.prototype.get.bind(this),this.has=Fi.prototype.has.bind(this),this.set=Fi.prototype.set.bind(this),this.tag=Qu.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(Bn(i)?(a=Gi(i.key,"",n),o=Gi(i.value,a,n)):a=Gi(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=PB(t,n,r),a=new this;return a.items=i.items,a}}Qu.tag="tag:yaml.org,2002:omap";const iC={collection:"seq",identify:e=>e instanceof Map,nodeClass:Qu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=_B(e,t),r=[];for(const{key:i}of n.items)tn(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Qu,n)},createNode:(e,t,n)=>Qu.from(e,t,n)};function TB({value:e,source:t},n){return t&&(e?zB:RB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const zB={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 rt(!0),stringify:TB},RB={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 rt(!1),stringify:TB},ade={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:va},sde={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():va(e)}},ode={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 rt(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:va},ap=e=>typeof e=="bigint"||Number.isInteger(e);function a0(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 aC(e,t,n){const{value:r}=e;if(ap(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return va(e)}const lde={identify:ap,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>a0(e,2,2,n),stringify:e=>aC(e,2,"0b")},cde={identify:ap,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>a0(e,1,8,n),stringify:e=>aC(e,8,"0")},ude={identify:ap,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>a0(e,0,10,n),stringify:va},dde={identify:ap,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>a0(e,2,16,n),stringify:e=>aC(e,16,"0x")};class Wu extends Fi{constructor(t){super(t),this.tag=Wu.tag}add(t){let n;Bn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new $r(t.key,null):n=new $r(t,null),Kl(this.items,n.key)||this.items.push(n)}get(t,n){const r=Kl(this.items,t);return!n&&Bn(r)?tn(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=Kl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new $r(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(Jk(o,null,r));return a}}Wu.tag="tag:yaml.org,2002:set";const sC={collection:"map",identify:e=>e instanceof Set,nodeClass:Wu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Wu.from(e,t,n),resolve(e,t){if(rp(e)){if(e.hasAllNullValues(!0))return Object.assign(new Wu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function oC(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,c)=>o*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function DB(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return va(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 IB={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})=>oC(e,n),stringify:DB},MB={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=>oC(e,!1),stringify:DB},s0={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(s0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,o||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=oC(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$/,"")??""},Zz=[_d,Pd,n0,r0,zB,RB,lde,cde,ude,dde,ade,sde,ode,nC,_s,iC,rC,sC,IB,MB,s0],Xz=new Map([["core",tde],["failsafe",[_d,Pd,n0]],["json",ide],["yaml11",Zz],["yaml-1.1",Zz]]),Jz={binary:nC,bool:eC,float:kB,floatExp:NB,floatNaN:jB,floatTime:MB,int:OB,intHex:EB,intOct:AB,intTime:IB,map:_d,merge:_s,null:r0,omap:iC,pairs:rC,seq:Pd,set:sC,timestamp:s0},fde={"tag:yaml.org,2002:binary":nC,"tag:yaml.org,2002:merge":_s,"tag:yaml.org,2002:omap":iC,"tag:yaml.org,2002:pairs":rC,"tag:yaml.org,2002:set":sC,"tag:yaml.org,2002:timestamp":s0};function oS(e,t,n){const r=Xz.get(t);if(r&&!e)return n&&!r.includes(_s)?r.concat(_s):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(Xz.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(_s)),i.reduce((a,o)=>{const c=typeof o=="string"?Jz[o]:o;if(!c){const d=JSON.stringify(o),f=Object.keys(Jz).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(c)||a.push(c),a},[])}const hde=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class lC{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:c}){this.compat=Array.isArray(t)?oS(t,"compat"):t?oS(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?fde:{},this.tags=oS(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Bo,{value:_d}),Object.defineProperty(this,Ka,{value:n0}),Object.defineProperty(this,Od,{value:Pd}),this.sortMapEntries=typeof o=="function"?o:o===!0?hde:null}clone(){const t=Object.create(lC.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function pde(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=xB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(As(d,""))}let o=!1,c=null;if(e.contents){if($n(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(As(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>o=!0;let f=od(e.contents,i,()=>c=null,d);c&&(f+=Fl(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(od(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
-
`)?(n.push("..."),n.push(As(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||c)&&n[n.length-1]!==""&&n.push(""),n.push(As(a(d),"")))}return n.join(`
|
|
171
|
-
`)+`
|
|
172
|
-
`}class o0{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wi,{value:T1});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 Rr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(o0.prototype,{[Wi]:{value:T1}});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=$n(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){wu(this.contents)&&this.contents.add(t)}addIn(t,n){wu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=pB(this);t.anchor=!n||r.has(n)?mB(n||"a",r):n}return new Zk(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:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=Uue(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=zh(t,p,w);return c&&Mn(b)&&(b.flow=!0),g(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new $r(i,a)}delete(t){return wu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return ch(t)?this.contents==null?!1:(this.contents=null,!0):wu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Mn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return ch(t)?!n&&tn(this.contents)?this.contents.value:this.contents:Mn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Mn(this.contents)?this.contents.has(t):!1}hasIn(t){return ch(t)?this.contents!==void 0:Mn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ny(this.schema,[t],n):wu(this.contents)&&this.contents.set(t,n)}setIn(t,n){ch(t)?this.contents=n:this.contents==null?this.contents=Ny(this.schema,Array.from(t),n):wu(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 Rr({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 Rr({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 lC(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Gi(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof o=="function"?Mu(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 pde(this,t)}}function wu(e){if(Mn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class LB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class hg extends LB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class mde extends LB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const eR=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const c=Math.min(a-39,o.length-79);o="…"+o.substring(c),a-=c-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
173
|
-
`),o=c+o}if(/[^ ]/.test(o)){let c=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(c=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
174
|
-
|
|
175
|
-
${o}
|
|
176
|
-
${f}
|
|
177
|
-
`}};function ld(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:c}){let d=!1,f=c,p=c,m="",g="",v=!1,w=!1,b=null,j=null,N=null,O=null,C=null,A=null,P=null;for(const z of e)switch(w&&(z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&a(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),b&&(f&&z.type!=="comment"&&z.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),z.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&z.source.includes(" ")&&(b=z),p=!0;break;case"comment":{p||a(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=z.source.substring(1)||" ";m?m+=g+I:m=I,g="",f=!1;break}case"newline":f?m?m+=z.source:(!A||n!=="seq-item-ind")&&(d=!0):g+=z.source,f=!0,v=!0,(j||N)&&(O=z),p=!0;break;case"anchor":j&&a(z,"MULTIPLE_ANCHORS","A node can have at most one anchor"),z.source.endsWith(":")&&a(z.offset+z.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=z,P??(P=z.offset),f=!1,p=!1,w=!0;break;case"tag":{N&&a(z,"MULTIPLE_TAGS","A node can have at most one tag"),N=z,P??(P=z.offset),f=!1,p=!1,w=!0;break}case n:(j||N)&&a(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),A&&a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),A=z,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=z,f=!1,p=!1;break}default:a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),f=!1,p=!1}const E=e[e.length-1],_=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"),b&&(f&&b.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:A,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:N,newlineAfterProp:O,end:_,start:P??_}}function Rh(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(Rh(t.key)||Rh(t.value))return!0}return!1;default:return!0}}function I1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Rh(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function $B(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||tn(a)&&tn(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const tR="All mapping items must start at the same column";function gde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Fi,c=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:g,sep:v,value:w}=p,b=ld(m,{indicator:"explicit-key-ind",next:g??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!b.found;if(j){if(g&&(g.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&i(d,"BAD_INDENT",tR)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(c.comment?c.comment+=`
|
|
179
|
-
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||Rh(g))&&i(g??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==r.indent&&i(d,"BAD_INDENT",tR);n.atKey=!0;const N=b.end,O=g?e(n,g,b,i):t(n,N,m,null,b,i);n.schema.compat&&I1(r.indent,g,i),n.atKey=!1,$B(n,c.items,O)&&i(N,"DUPLICATE_KEY","Map keys must be unique");const C=ld(v??[],{indicator:"map-value-ind",next:w,offset:O.range[2],onError:i,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(d=C.end,C.found){j&&(w?.type==="block-map"&&!C.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<C.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 A=w?e(n,w,C,i):t(n,d,v,null,C,i);n.schema.compat&&I1(r.indent,w,i),d=A.range[2];const P=new $r(O,A);n.options.keepSourceTokens&&(P.srcToken=p),c.items.push(P)}else{j&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(O.comment?O.comment+=`
|
|
180
|
-
`+C.comment:O.comment=C.comment);const A=new $r(O);n.options.keepSourceTokens&&(A.srcToken=p),c.items.push(A)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function yde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??cc,c=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const g=ld(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)m?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(c.comment=g.comment);continue}const v=m?e(n,m,g,i):t(n,g.end,p,null,g,i);n.schema.compat&&I1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function sp(e,t,n,r){let i="";if(e){let a=!1,o="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const lS="Block collections are not allowed within flow collections",cS=e=>e&&(e.type==="block-map"||e.type==="block-seq");function vde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",c=o?"flow map":"flow sequence",d=a?.nodeClass??(o?Fi:cc),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:C,sep:A,value:P}=N,E=ld(O,{flow:c,indicator:"explicit-key-ind",next:C??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!A&&!P){j===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),E.comment&&(f.comment?f.comment+=`
|
|
181
|
-
`+E.comment:f.comment=E.comment),m=E.end;continue}!o&&n.options.strict&&Rh(C)&&i(C,"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 ${c}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${c} items`),E.comment){let _="";e:for(const z of O)switch(z.type){case"comma":case"space":break;case"comment":_=z.source.substring(1);break e;default:break e}if(_){let z=f.items[f.items.length-1];Bn(z)&&(z=z.value??z.key),z.comment?z.comment+=`
|
|
182
|
-
`+_:z.comment=_,E.comment=E.comment.substring(_.length+1)}}if(!o&&!A&&!E.found){const _=P?e(n,P,E,i):t(n,E.end,A,null,E,i);f.items.push(_),m=_.range[2],cS(P)&&i(_.range,"BLOCK_IN_FLOW",lS)}else{n.atKey=!0;const _=E.end,z=C?e(n,C,E,i):t(n,_,O,null,E,i);cS(C)&&i(z.range,"BLOCK_IN_FLOW",lS),n.atKey=!1;const I=ld(A??[],{flow:c,indicator:"map-value-ind",next:P,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(I.found){if(!o&&!E.found&&n.options.strict){if(A)for(const B of A){if(B===I.found)break;if(B.type==="newline"){i(B,"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 P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${c}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const q=P?e(n,P,I,i):I.found?t(n,I.end,A,null,I,i):null;q?cS(P)&&i(q.range,"BLOCK_IN_FLOW",lS):I.comment&&(z.comment?z.comment+=`
|
|
183
|
-
`+I.comment:z.comment=I.comment);const U=new $r(z,q);if(n.options.keepSourceTokens&&(U.srcToken=N),o){const B=f;$B(n,B.items,z)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new Fi(n.schema);B.flow=!0,B.items.push(U);const H=(q??z).range;B.range=[z.range[0],H[1],H[2]],f.items.push(B)}m=q?q.range[2]:I.end}}const g=o?"}":"]",[v,...w]=r.end;let b=m;if(v?.source===g)b=v.offset+v.source.length;else{const j=c[0].toUpperCase()+c.substring(1),N=p?`${j} must end with a ${g}`:`${j} in block collection must be sufficiently indented and end with a ${g}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",N),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=sp(w,b,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
184
|
-
`+j.comment:f.comment=j.comment),f.range=[r.offset,b,j.offset]}else f.range=[r.offset,b,b];return f}function uS(e,t,n,r,i,a){const o=n.type==="block-map"?gde(e,t,n,r,a):n.type==="block-seq"?yde(e,t,n,r,a):vde(e,t,n,r,a),c=o.constructor;return i==="!"||i===c.tagName?(o.tag=c.tagName,o):(i&&(o.tag=i),o)}function xde(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,g=>i(a,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:v}=r,w=g&&a?g.offset>a.offset?g:a:g??a;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Fi.tagName&&c==="map"||o===cc.tagName&&c==="seq")return uS(e,t,n,i,o);let d=t.schema.tags.find(g=>g.tag===o&&g.collection===c);if(!d){const g=t.schema.knownTags[o];if(g?.collection===c)t.schema.tags.push(Object.assign({},g,{default:!1})),d=g;else return g?i(a,"BAD_COLLECTION_TYPE",`${g.tag} used for ${c} collection, but expects ${g.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),uS(e,t,n,i,o)}const f=uS(e,t,n,i,o,d),p=d.resolve?.(f,g=>i(a,"TAG_RESOLVE_FAILED",g),t.options)??f,m=$n(p)?p:new rt(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function bde(e,t,n){const r=t.offset,i=wde(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?rt.BLOCK_FOLDED:rt.BLOCK_LITERAL,o=t.source?Sde(t.source):[];let c=o.length;for(let b=o.length-1;b>=0;--b){const j=o[b][1];if(j===""||j==="\r")c=b;else break}if(c===0){const b=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:b,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<c;++b){const[j,N]=o[b];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=b,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 b=o.length-1;b>=c;--b)o[b][0].length>d&&(c=b+1);let m="",g="",v=!1;for(let b=0;b<p;++b)m+=o[b][0].slice(d)+`
|
|
186
|
-
`;for(let b=p;b<c;++b){let[j,N]=o[b];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 A=`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",A),j=""}a===rt.BLOCK_LITERAL?(m+=g+j.slice(d)+N,g=`
|
|
187
|
-
`):j.length>d||N[0]===" "?(g===" "?g=`
|
|
188
|
-
`:!v&&g===`
|
|
189
|
-
`&&(g=`
|
|
190
|
-
|
|
191
|
-
`),m+=g+j.slice(d)+N,g=`
|
|
192
|
-
`,v=!0):N===""?g===`
|
|
193
|
-
`?m+=`
|
|
194
|
-
`:g=`
|
|
195
|
-
`:(m+=g+N,g=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=c;b<o.length;++b)m+=`
|
|
196
|
-
`+o[b][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 wde({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,c="",d=-1;for(let g=1;g<i.length;++g){const v=i[g];if(!c&&(v==="-"||v==="+"))c=v;else{const w=Number(v);!o&&w?o=w:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let g=1;g<t.length;++g){const v=t[g];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 b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:o,chomp:c,comment:p,length:m}}function Sde(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 jde(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let c,d;const f=(g,v,w)=>n(r+g,v,w);switch(i){case"scalar":c=rt.PLAIN,d=Nde(a,f);break;case"single-quoted-scalar":c=rt.QUOTE_SINGLE,d=kde(a,f);break;case"double-quoted-scalar":c=rt.QUOTE_DOUBLE,d=Cde(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=sp(o,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function Nde(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}`),BB(e)}function kde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),BB(e.slice(1,-1)).replace(/''/g,"'")}function BB(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 c=/[ \t]*(.*)/sy;return c.lastIndex=o,r=c.exec(e),i+a+(r?.[1]??"")}function Cde(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}=Ade(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=Ode[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 c={x:2,u:4,U:8}[a];n+=Ede(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const a=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
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 Ade(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 Ode={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ede(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(o)}function UB(e,t,n,r){const{value:i,type:a,comment:o,range:c}=t.type==="block-scalar"?bde(e,t,r):jde(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[Ka]:d?f=_de(e.schema,i,d,n,r):t.type==="scalar"?f=Pde(e,i,t,r):f=e.schema[Ka];let p;try{const m=f.resolve(i,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=tn(m)?m:new rt(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),p=new rt(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function _de(e,t,n,r,i){if(n==="!")return e[Ka];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if(c.test?.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ka])}function Pde({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Ka];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[Ka];if(o.tag!==c.tag){const d=t.tagString(o.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Tde(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 zde={composeNode:qB,composeEmptyNode:cC};function qB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Rde(e,t,r),(c||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=UB(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=xde(zde,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=cC(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!tn(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 cC(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:c,end:d},f){const p={type:"scalar",offset:Tde(t,n,r),indent:-1,source:""},m=UB(e,p,c,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function Rde({options:e},{offset:t,source:n,end:r},i){const a=new Zk(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,c=sp(r,o,e.strict,i);return a.range=[t,o,c.offset],c.comment&&(a.comment=c.comment),a}function Dde(e,t,{offset:n,start:r,value:i,end:a},o){const c=Object.assign({_directives:t},e),d=new o0(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=ld(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?qB(f,i,p,o):cC(f,p.end,r,null,p,o);const m=d.contents.range[2],g=sp(a,m,!1,o);return g.comment&&(d.comment=g.comment),d.range=[n,m,g.offset],d}function Wf(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 nR(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 Ide{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Wf(n);a?this.warnings.push(new mde(o,r,i)):this.errors.push(new hg(o,r,i))},this.directives=new Rr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=nR(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(Mn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Bn(o)&&(o=o.key);const c=o.commentBefore;o.commentBefore=c?`${r}
|
|
219
|
-
${c}`: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:nR(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=Wf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Dde(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 hg(Wf(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 hg(Wf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=sp(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 hg(Wf(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 o0(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 FB="\uFEFF",KB="",HB="",M1="";function Mde(e){switch(e){case FB:return"byte-order-mark";case KB:return"doc-mode";case HB:return"flow-error-end";case M1: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 oa(e){switch(e){case void 0:case" ":case`
|
|
224
|
-
`:case"\r":case" ":return!0;default:return!1}}const rR=new Set("0123456789ABCDEFabcdef"),Lde=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pg=new Set(",[]{}"),$de=new Set(` ,[]{}
|
|
225
|
-
\r `),dS=e=>!e||$de.has(e);class Bde{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==="...")&&oa(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]===FB&&(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 KB,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==="...")&&oa(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&&!oa(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===":")&&oa(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(dS),"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("..."))&&oa(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield HB,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(dS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||oa(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=>oa(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 c=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
237
|
-
`&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield M1,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(oa(a)||t&&pg.has(a))break;n=r}else if(oa(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&&pg.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&&pg.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield M1,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(dS))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(oa(n)||t&&pg.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(;!oa(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(Lde.has(n))n=this.buffer[++t];else if(n==="%"&&rR.has(this.buffer[t+1])&&rR.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 Ude{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 Ao(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function iR(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 GB(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 mg(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 Su(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 aR(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ao(t.start,"explicit-key-ind")&&!Ao(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,GB(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 qde{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 Bde,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=Mde(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"&&aR(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&&iR(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":{iR(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=mg(this.peek(2)),r=Su(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 c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":o.push(c);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ao(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(GB(n.key)&&!Ao(n.sep,"newline")){const o=Su(n.start),c=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ao(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Su(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]}):Ao(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&&!Ao(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||Ao(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=mg(r),a=Su(i);aR(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
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=mg(t),r=Su(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=mg(t),r=Su(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 Fde(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ude||null,prettyErrors:t}}function Kde(e,t={}){const{lineCounter:n,prettyErrors:r}=Fde(t),i=new qde(n?.addNewLine),a=new Ide(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of o)c.errors.forEach(eR(e,n)),c.warnings.forEach(eR(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Hde({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,o]=x.useState([]),[c,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=Kde(t),m=[],g=[];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 b=w.toJSON();if(!(!b||typeof b!="object"))try{const j=await VV(b);g.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(g),d(m),i(!1),g.length>0&&(vt({title:"YAML applied",detail:`Applied ${g.length} document${g.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.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
|
-
queries: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>l.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),l.jsx("div",{className:"mt-3",children:l.jsx(be,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Gde(){const{dashboard:e,isLoading:t,refetch:n}=Oc();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-28"}),l.jsx("div",{className:"skeleton-text-sm w-40"})]}),l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>l.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>l.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"skeleton-text-sm w-16"})]}),l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),l.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=Zo(),[a,o]=x.useState(!1),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,w]=x.useState("US"),[b,j]=x.useState("en"),[N,O]=x.useState(!1),[C,A]=x.useState(null),P=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),E=async()=>{if(!(!P||!m)){O(!0),A(null);try{const _=await Tv(P,{displayName:f||c,canonicalDomain:m,country:v,language:b});vt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),g(""),w("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){A(_ instanceof Error?_.message:"Failed to create project")}finally{O(!1)}}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Projects"}),l.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(be,{type:"button",onClick:()=>o(_=>!_),children:[l.jsx(nT,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?l.jsxs(Be,{className:"surface-card mb-6",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),l.jsxs("div",{className:"compact-stack mt-4",children:[l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),l.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:_=>d(_.target.value)}),P&&P!==c?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),l.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>g(_.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),l.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>w(_.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>j(_.target.value.toLowerCase())})]})]})]}),C?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(be,{type:"button",disabled:!P||!m||N,onClick:E,children:N?"Creating...":"Create project"}),l.jsx(be,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?l.jsx("div",{className:"data-table-wrapper",children:l.jsxs("table",{className:"data-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Visibility"}),l.jsx("th",{children:"Last run"}),l.jsx("th",{className:"text-right",children:"Country"})]})}),l.jsx("tbody",{children:r.map(_=>{const z=_.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[l.jsxs("td",{children:[l.jsx(Xt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:I=>I.stopPropagation(),children:_.project.displayName||_.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),l.jsx("td",{children:l.jsx(it,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:z?l.jsx(Uv,{status:z.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:l.jsxs(Be,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(be,{type:"button",onClick:()=>o(!0),children:[l.jsx(nT,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(Hde,{onApplied:()=>{n()}})]})}function L1({state:e,label:t}){return l.jsx(it,{tone:Vte(e),children:t??Lv(e)})}function VB({run:e}){const{openRun:t}=kd();return l.jsxs("article",{className:"run-row",children:[l.jsxs("div",{className:"run-row-main",children:[l.jsxs("div",{className:"run-row-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:e.summary}),l.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),l.jsx(Uv,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(be,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function Vde({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:c,providerCoverage:d}){const m=2*Math.PI*48,g=Number.parseInt(e,10),v=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):o&&!Number.isNaN(g)?Math.min(g/100,1):.5,w=m*(1-v);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.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)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,a&&l.jsx(vr,{text:a})]}),l.jsx("p",{className:"gauge-delta",children:n}),d&&l.jsx("p",{className:"gauge-provider-coverage",children:d}),l.jsx("p",{className:"gauge-description",children:i})]})}function sR({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return l.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 l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,c)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},c))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Qde(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 oR(e,t){return t==="citations"?e.citationState:e.visibilityState==="pending"||e.answerMentioned==null&&e.visibilityState==null?"pending":e.visibilityState==="visible"||e.answerMentioned===!0?"cited":"not-cited"}function lR(e,t){if(t==="mentions")switch(e){case"cited":return"Mentioned";case"not-cited":return"Not Mentioned";case"pending":return"Pending";case"emerging":return"Newly Mentioned";case"lost":return"No Longer Mentioned"}switch(e){case"cited":return"Cited";case"not-cited":return"Not Cited";case"lost":return"Lost";case"emerging":return"Emerging";case"pending":return"Pending"}}function cR(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let o=0;for(let c=e.length-1;c>=0&&e[c].citationState===i;c--)o++;return i==="cited"?o<=1?`${r} in latest run`:`${r} for ${o} runs`:o<=1?`Not ${n} in latest run`:`Not ${n} across ${o} runs`}function Wde(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:oR(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:oR(r,t)}))}))}function Yde({evidence:e}){const{openEvidence:t}=kd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),o=x.useMemo(()=>{const m=Wde(e,i),g=new Map;for(const v of m){const w=g.get(v.query)??[];g.set(v.query,[...w,v])}return[...g.entries()].map(([v,w])=>({phrase:v,items:w}))},[e,i]),c=m=>{r(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},d=i==="mentions"?"mentioned":"cited",f=i==="mentions"?"Mention History":"Citation History",p=i==="mentions"?"mentioned":"cited";return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),l.jsxs("div",{className:"inline-flex gap-0.5 p-0.5 rounded-md bg-zinc-900/60 border border-zinc-800/40",role:"tablist","aria-label":"Citation tracking view",children:[l.jsx("button",{type:"button",role:"tab","aria-selected":i==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("citations"),children:"Citations"}),l.jsx("button",{type:"button",role:"tab","aria-selected":i==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("mentions"),children:"Mentions"})]}),l.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:f}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:o.map(({phrase:m,items:g})=>{const v=n.has(m),w=g.map(C=>C.citationState),b=w.includes("cited")?"cited":w.includes("emerging")?"emerging":w.includes("lost")?"lost":w.every(C=>C==="pending")?"pending":"not-cited",j=Qde(g),N=g.filter(C=>C.citationState===Lr.cited||C.citationState==="emerging").length,O=cR(j,i);return l.jsxs(x.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(m),"aria-expanded":v,children:[l.jsx("td",{children:l.jsx(Xh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-query-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:m}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(C=>l.jsx(oc,{provider:C.provider},C.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(L1,{state:b,label:lR(b,i)}),l.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${N} of ${g.length} engines ${p}`,children:[N,"/",g.length]})]})}),l.jsx("td",{children:l.jsx(sR,{history:j})}),l.jsx("td",{className:"evidence-change-cell",children:O}),l.jsx("td",{})]}),v&&g.map(C=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-query-cell pl-5",children:l.jsx(oc,{provider:C.provider})}),l.jsx("td",{children:l.jsx(L1,{state:C.citationState,label:lR(C.citationState,i)})}),l.jsx("td",{children:l.jsx(sR,{history:C.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:cR(C.runHistory,i)}),l.jsx("td",{children:l.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:A=>{A.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),l.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function Zde({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Queries"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(it,{tone:Qte(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function uR({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:c,updatedAt:d,active:f,onClick:p}){return l.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:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),l.jsx("h3",{children:t})]}),l.jsx(it,{tone:r,children:n})]}),l.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),l.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),l.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:[l.jsx("span",{children:c}),l.jsx("span",{children:d?`Updated ${ca(d)}`:"No recent sync yet"})]})]})}function gg({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Xde=["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 uC(e){if(typeof e!="string")return!1;var t=Xde;return t.includes(e)}var Jde=["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"],efe=new Set(Jde);function QB(e){return typeof e!="string"?!1:efe.has(e)}function WB(e){return typeof e=="string"&&e.startsWith("data-")}function Ur(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(QB(n)||WB(n))&&(t[n]=e[n]);return t}function uc(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ur(t)}return typeof e=="object"&&!Array.isArray(e)?Ur(e):null}function Or(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(QB(n)||WB(n)||uC(n))&&(t[n]=e[n]);return t}function tfe(e){return e==null?null:x.isValidElement(e)?Or(e.props):typeof e=="object"&&!Array.isArray(e)?Or(e):null}var nfe=["children","width","height","viewBox","className","style","title","desc"];function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$1.apply(null,arguments)}function rfe(e,t){if(e==null)return{};var n,r,i=ife(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 ife(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 dC=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:c,title:d,desc:f}=e,p=rfe(e,nfe),m=a||{width:r,height:i,x:0,y:0},g=jt("recharts-surface",o);return x.createElement("svg",$1({},Or(p),{className:g,width:r,height:i,style:c,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),x.createElement("title",null,d),x.createElement("desc",null,f),n)}),afe=["children","className"];function B1(){return B1=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},B1.apply(null,arguments)}function sfe(e,t){if(e==null)return{};var n,r,i=ofe(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 ofe(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 bn=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=sfe(e,afe),a=jt("recharts-layer",r);return x.createElement("g",B1({className:a},Or(i),{ref:t}),n)}),YB=x.createContext(null),lfe=()=>x.useContext(YB);function Jt(e){return function(){return e}}const ZB=Math.cos,Cy=Math.sin,xa=Math.sqrt,Ay=Math.PI,l0=2*Ay,U1=Math.PI,q1=2*U1,Il=1e-6,cfe=q1-Il;function XB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ufe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return XB;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 dfe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?XB:ufe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,c=this._y1,d=r-t,f=i-n,p=o-t,m=c-n,g=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Il)if(!(Math.abs(m*d-f*p)>Il)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,w=i-c,b=d*d+f*f,j=v*v+w*w,N=Math.sqrt(b),O=Math.sqrt(g),C=a*Math.tan((U1-Math.acos((b+g-j)/(2*N*O)))/2),A=C/O,P=C/N;Math.abs(A-1)>Il&&this._append`L${t+A*p},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Il||Math.abs(this._y1-p)>Il)&&this._append`L${f},${p}`,r&&(g<0&&(g=g%q1+q1),g>cfe?this._append`A${r},${r},0,1,${m},${t-c},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:g>Il&&this._append`A${r},${r},0,${+(g>=U1)},${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 fC(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 dfe(t)}function hC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JB(e){this._context=e}JB.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 c0(e){return new JB(e)}function e6(e){return e[0]}function t6(e){return e[1]}function n6(e,t){var n=Jt(!0),r=null,i=c0,a=null,o=fC(c);e=typeof e=="function"?e:e===void 0?e6:Jt(e),t=typeof t=="function"?t:t===void 0?t6:Jt(t);function c(d){var f,p=(d=hC(d)).length,m,g=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Jt(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Jt(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Jt(!!d),c):n},c.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),c):i},c.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),c):r},c}function yg(e,t,n){var r=null,i=Jt(!0),a=null,o=c0,c=null,d=fC(f);e=typeof e=="function"?e:e===void 0?e6:Jt(+e),t=typeof t=="function"?t:Jt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?t6:Jt(+n);function f(m){var g,v,w,b=(m=hC(m)).length,j,N=!1,O,C=new Array(b),A=new Array(b);for(a==null&&(c=o(O=d())),g=0;g<=b;++g){if(!(g<b&&i(j=m[g],g,m))===N)if(N=!N)v=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=g-1;w>=v;--w)c.point(C[w],A[w]);c.lineEnd(),c.areaEnd()}N&&(C[g]=+e(j,g,m),A[g]=+t(j,g,m),c.point(r?+r(j,g,m):C[g],n?+n(j,g,m):A[g]))}if(O)return c=null,O+""||null}function p(){return n6().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Jt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Jt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Jt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Jt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Jt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Jt(+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:Jt(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(c=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=c=null:c=o(a=m),f):a},f}class r6{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 ffe(e){return new r6(e,!0)}function hfe(e){return new r6(e,!1)}const pC={draw(e,t){const n=xa(t/Ay);e.moveTo(n,0),e.arc(0,0,n,0,l0)}},pfe={draw(e,t){const n=xa(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()}},i6=xa(1/3),mfe=i6*2,gfe={draw(e,t){const n=xa(t/mfe),r=n*i6;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},yfe={draw(e,t){const n=xa(t),r=-n/2;e.rect(r,r,n,n)}},vfe=.8908130915292852,a6=Cy(Ay/10)/Cy(7*Ay/10),xfe=Cy(l0/10)*a6,bfe=-ZB(l0/10)*a6,wfe={draw(e,t){const n=xa(t*vfe),r=xfe*n,i=bfe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=l0*a/5,c=ZB(o),d=Cy(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},fS=xa(3),Sfe={draw(e,t){const n=-xa(t/(fS*3));e.moveTo(0,n*2),e.lineTo(-fS*n,-n),e.lineTo(fS*n,-n),e.closePath()}},Ii=-.5,Mi=xa(3)/2,F1=1/xa(12),jfe=(F1/2+1)*3,Nfe={draw(e,t){const n=xa(t/jfe),r=n/2,i=n*F1,a=r,o=n*F1+n,c=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(c,d),e.lineTo(Ii*r-Mi*i,Mi*r+Ii*i),e.lineTo(Ii*a-Mi*o,Mi*a+Ii*o),e.lineTo(Ii*c-Mi*d,Mi*c+Ii*d),e.lineTo(Ii*r+Mi*i,Ii*i-Mi*r),e.lineTo(Ii*a+Mi*o,Ii*o-Mi*a),e.lineTo(Ii*c+Mi*d,Ii*d-Mi*c),e.closePath()}};function kfe(e,t){let n=null,r=fC(i);e=typeof e=="function"?e:Jt(e||pC),t=typeof t=="function"?t:Jt(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:Jt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Jt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Oy(){}function Ey(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 s6(e){this._context=e}s6.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:Ey(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:Ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Cfe(e){return new s6(e)}function o6(e){this._context=e}o6.prototype={areaStart:Oy,areaEnd:Oy,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:Ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Afe(e){return new o6(e)}function l6(e){this._context=e}l6.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:Ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ofe(e){return new l6(e)}function c6(e){this._context=e}c6.prototype={areaStart:Oy,areaEnd:Oy,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 Efe(e){return new c6(e)}function dR(e){return e<0?-1:1}function fR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),c=(a*i+o*r)/(r+i);return(dR(a)+dR(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function hR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function hS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,o-c*n,a,o)}function _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=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:hS(this,this._t0,hR(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,hS(this,hR(this,n=fR(this,e,t)),n);break;default:hS(this,this._t0,n=fR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function u6(e){this._context=new d6(e)}(u6.prototype=Object.create(_y.prototype)).point=function(e,t){_y.prototype.point.call(this,t,e)};function d6(e){this._context=e}d6.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 _fe(e){return new _y(e)}function Pfe(e){return new u6(e)}function f6(e){this._context=e}f6.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=pR(e),i=pR(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 pR(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 Tfe(e){return new f6(e)}function u0(e,t){this._context=e,this._t=t}u0.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 zfe(e){return new u0(e,.5)}function Rfe(e){return new u0(e,0)}function Dfe(e){return new u0(e,1)}function dc(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,c=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<c;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function K1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ife(e,t){return e[t]}function Mfe(e){const t=[];return t.key=e,t}function Lfe(){var e=Jt([]),t=K1,n=dc,r=Ife;function i(a){var o=Array.from(e.apply(this,arguments),Mfe),c,d=o.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(m,o[c].key,f,a)]).data=m;for(c=0,p=hC(t(o));c<d;++c)o[p[c]].index=c;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Jt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Jt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?K1:typeof a=="function"?a:Jt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??dc,i):n},i}function $fe(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}dc(e,t)}}function Bfe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,c=0;o<i;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}dc(e,t)}}function Ufe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var c=0,d=0,f=0;c<o;++c){for(var p=e[t[c]],m=p[r][1]||0,g=p[r-1][1]||0,v=(m-g)/2,w=0;w<c;++w){var b=e[t[w]],j=b[r][1]||0,N=b[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,dc(e,t)}}var pS={},mS={},mR;function qfe(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(mS)),mS}var gS={},gR;function h6(){return gR||(gR=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})(gS)),gS}var yS={},yR;function mC(){return yR||(yR=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})(yS)),yS}var vS={},xS={},vR;function Ffe(){return vR||(vR=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})(xS)),xS}var xR;function gC(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ffe(),n=mC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<o;){const m=i[c];f?m==="\\"&&c+1<o?(c++,d+=i[c]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,c++}return d&&a.push(d),a}e.toPath=r})(vS)),vS}var bR;function yC(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qfe(),n=h6(),r=mC(),i=gC();function a(c,d,f){if(c==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?n.isDeepKey(d)?a(c,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=c[d];return p===void 0?f:p}default:{if(Array.isArray(d))return o(c,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?f:p}}}function o(c,d,f){if(d.length===0)return f;let p=c;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(pS)),pS}var bS,wR;function Kfe(){return wR||(wR=1,bS=yC().get),bS}var Hfe=Kfe();const fc=ga(Hfe);var Gfe=4;function Do(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function On(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var c=n[o-1];return typeof c=="string"?i+c+a:c!==void 0?i+Do(c)+a:i+a},"")}var or=e=>e===0?0:e>0?1:-1,pa=e=>typeof e=="number"&&e!=+e,hc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Te=e=>(typeof e=="number"||e instanceof Number)&&!pa(e),Ha=e=>Te(e)||typeof e=="string",Vfe=0,Dh=e=>{var t=++Vfe;return"".concat(e||"").concat(t)},Ar=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(!Te(t)&&typeof t!="string")return r;var a;if(hc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return pa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},p6=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 Dt(e,t,n){return Te(e)&&Te(t)?Do(e+n*(t-e)):t}function m6(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):fc(r,t))===n)}var un=e=>e===null||typeof e>"u",op=e=>un(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ei(e){return e!=null}function nl(){}var Qfe=["type","size","sizeType"];function H1(){return H1=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},H1.apply(null,arguments)}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){Wfe(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 Wfe(e,t,n){return(t=Yfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yfe(e){var t=Zfe(e,"string");return typeof t=="symbol"?t:t+""}function Zfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xfe(e,t){if(e==null)return{};var n,r,i=Jfe(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 Jfe(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 g6={symbolCircle:pC,symbolCross:pfe,symbolDiamond:gfe,symbolSquare:yfe,symbolStar:wfe,symbolTriangle:Sfe,symbolWye:Nfe},ehe=Math.PI/180,the=e=>{var t="symbol".concat(op(e));return g6[t]||pC},nhe=(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*ehe;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}},rhe=(e,t)=>{g6["symbol".concat(op(e))]=t},vC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Xfe(e,Qfe),a=jR(jR({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var c=()=>{var g=the(o),v=kfe().type(g).size(nhe(n,r,o)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Or(a);return Te(f)&&Te(p)&&Te(n)?x.createElement("path",H1({},m,{className:jt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};vC.registerSymbol=rhe;var y6=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,xC=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{uC(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},ihe=(e,t,n)=>r=>(e(t,n,r),null),lp=(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];uC(i)&&typeof a=="function"&&(r||(r={}),r[i]=ihe(a,t,n))}),r};function NR(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 ahe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){she(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function she(e,t,n){return(t=ohe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ohe(e){var t=lhe(e,"string");return typeof t=="symbol"?t:t+""}function lhe(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 Un(e,t){var n=ahe({},e),r=t,i=Object.keys(t),a=i.reduce((o,c)=>(o[c]===void 0&&r[c]!==void 0&&(o[c]=r[c]),o),n);return a}function Py(){return Py=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},Py.apply(null,arguments)}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 v6(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){che(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 che(e,t,n){return(t=uhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uhe(e){var t=dhe(e,"string");return typeof t=="symbol"?t:t+""}function dhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $i=32,fhe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function hhe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function phe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=$i/2,a=$i/6,o=$i/3,c=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:hhe(t.payload),x1:0,y1:i,x2:$i,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(o,`
|
|
255
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
256
|
-
H`).concat($i,"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 x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat($i/8,"h").concat($i,"v").concat($i*3/4,"h").concat(-$i,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=v6({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(vC,{fill:c,cx:i,cy:i,size:$i,sizeType:"diameter",type:d})}function mhe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:c}=e,d={x:0,y:0,width:$i,height:$i},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,g)=>{var v=m.formatter||i,w=jt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof c=="object"?v6({},c):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,g):m.value;return x.createElement("li",Py({className:w,style:f,key:"legend-item-".concat(g)},lp(e,m,g)),x.createElement(dC,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(phe,{data:m,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var ghe=e=>{var t=Un(e,fhe),{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 x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(mhe,Py({},t,{payload:n})))},wS={},SS={},CR;function yhe(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],c=r(o,a,n);i.has(c)||i.set(c,o)}return Array.from(i.values())}e.uniqBy=t})(SS)),SS}var jS={},AR;function vhe(){return AR||(AR=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})(jS)),jS}var NS={},OR;function x6(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(NS)),NS}var kS={},CS={},AS={},ER;function xhe(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(AS)),AS}var _R;function b6(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xhe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(CS)),CS}var OS={},PR;function bhe(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(OS)),OS}var TR;function whe(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b6(),n=bhe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(kS)),kS}var ES={},_S={},zR;function She(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(_S)),_S}var PS={},TS={},zS={},RS={},RR;function w6(){return RR||(RR=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})(RS)),RS}var DS={},DR;function S6(){return DR||(DR=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})(DS)),DS}var IS={},IR;function j6(){return IR||(IR=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})(IS)),IS}var MR;function jhe(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w6(),n=S6(),r=j6();function i(p,m,g){return typeof g!="function"?i(p,m,()=>{}):a(p,m,function v(w,b,j,N,O,C){const A=g(w,b,j,N,O,C);return A!==void 0?!!A:a(w,b,v,C)},new Map)}function a(p,m,g,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,g,v);case"function":return Object.keys(m).length>0?a(p,{...m},g,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,g,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,g,v);if(m instanceof Map)return c(p,m,g,v);if(m instanceof Set)return f(p,m,g,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 b=0;b<w.length;b++){const j=w[b];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!g(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function c(p,m,g,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,b]of m.entries()){const j=p.get(w);if(g(j,b,w,p,m,v)===!1)return!1}return!0}function d(p,m,g,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let b=0;b<m.length;b++){const j=m[b];let N=!1;for(let O=0;O<p.length;O++){if(w.has(O))continue;const C=p[O];let A=!1;if(g(C,j,b,p,m,v)&&(A=!0),A){w.add(O),N=!0;break}}if(!N)return!1}return!0}function f(p,m,g,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(zS)),zS}var LR;function N6(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jhe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(TS)),TS}var MS={},LS={},$S={},$R;function Nhe(){return $R||($R=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})($S)),$S}var BS={},BR;function bC(){return BR||(BR=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})(BS)),BS}var US={},UR;function k6(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",c="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",g="[object ArrayBuffer]",v="[object Object]",w="[object Error]",b="[object DataView]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",O="[object Uint16Array]",C="[object Uint32Array]",A="[object BigUint64Array]",P="[object Int8Array]",E="[object Int16Array]",_="[object Int32Array]",z="[object BigInt64Array]",I="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=p,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=b,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=I,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=E,e.int32ArrayTag=_,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=O,e.uint32ArrayTag=C,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=N})(US)),US}var qS={},qR;function khe(){return qR||(qR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(qS)),qS}var FR;function C6(){return FR||(FR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nhe(),n=bC(),r=k6(),i=S6(),a=khe();function o(p,m){return c(p,void 0,p,new Map,m)}function c(p,m,g,v=new Map,w=void 0){const b=w?.(p,m,g,v);if(b!==void 0)return b;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]=c(p[N],N,g,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,c(O,N,g,v,w));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const N of p)j.add(c(N,void 0,g,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]=c(p[N],N,g,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,g,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,g,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,g,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,g,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,g,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,g,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,g,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,g,v,w),j}return p}function d(p,m,g=p,v,w){const b=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<b.length;j++){const N=b[j],O=Object.getOwnPropertyDescriptor(p,N);(O==null||O.writable)&&(p[N]=c(m[N],N,g,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=c,e.copyProperties=d})(LS)),LS}var KR;function Che(){return KR||(KR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(MS)),MS}var HR;function Ahe(){return HR||(HR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N6(),n=Che();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(PS)),PS}var FS={},KS={},HS={},GR;function Ohe(){return GR||(GR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C6(),n=bC(),r=k6();function i(a,o){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=o?.(c,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return p.set(a,g),t.copyProperties(g,a,f,p),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a?.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(HS)),HS}var VR;function Ehe(){return VR||(VR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ohe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(KS)),KS}var GS={},VS={},QR;function A6(){return QR||(QR=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})(VS)),VS}var QS={},WR;function _he(){return WR||(WR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(QS)),QS}var YR;function Phe(){return YR||(YR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=h6(),n=A6(),r=_he(),i=gC();function a(o,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&o?.[c]==null?d=i.toPath(c):d=[c],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(GS)),GS}var ZR;function The(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N6(),n=mC(),r=Ehe(),i=yC(),a=Phe();function o(c,d){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,c);return p===void 0?a.has(f,c):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=o})(FS)),FS}var XR;function zhe(){return XR||(XR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=x6(),n=She(),r=Ahe(),i=The();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})(ES)),ES}var JR;function Rhe(){return JR||(JR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yhe(),n=vhe(),r=x6(),i=whe(),a=zhe();function o(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(wS)),wS}var WS,eD;function Dhe(){return eD||(eD=1,WS=Rhe().uniqBy),WS}var Ihe=Dhe();const tD=ga(Ihe);function O6(e,t,n){return t===!0?tD(e,n):typeof t=="function"?tD(e,t):e}var wC=x.createContext(null),Mhe=e=>e,Ht=()=>{var e=x.useContext(wC);return e?e.store.dispatch:Mhe},Wg=()=>{},Lhe=()=>Wg,$he=(e,t)=>e===t;function Re(e){var t=x.useContext(wC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Wg,[t,e]);return V$.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Lhe,t?t.store.getState:Wg,t?t.store.getState:Wg,n,$he)}function Bhe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Uhe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function qhe(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 nD=e=>Array.isArray(e)?e:[e];function Fhe(e){const t=Array.isArray(e[0])?e[0]:e;return qhe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Khe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Hhe=class{constructor(e){this.value=e}deref(){return this.value}},Ghe=typeof WeakRef<"u"?WeakRef:Hhe,Vhe=0,rD=1;function vg(){return{s:Vhe,v:void 0,o:null,p:null}}function E6(e,t={}){let n=vg();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let c=n;const{length:d}=arguments;for(let m=0,g=d;m<g;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const b=w.get(v);b===void 0?(c=vg(),w.set(v,c)):c=b}else{let w=c.p;w===null&&(c.p=w=new Map);const b=w.get(v);b===void 0?(c=vg(),w.set(v,c)):c=b}}const f=c;let p;if(c.s===rD)p=c.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Ghe(p):p}return f.s=rD,f.v=p,p}return o.clearCache=()=>{n=vg(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Qhe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Bhe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=E6,argsMemoizeOptions:w=[]}=p,b=nD(g),j=nD(w),N=Fhe(i),O=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){o++;const P=Khe(N,arguments);return c=O.apply(null,P),c},...j);return Object.assign(C,{resultFunc:f,memoizedResultFunc:O,dependencies:N,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var ne=Qhe(E6),Whe=Object.assign((e,t=ne)=>{Uhe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,c,d)=>(o[n[d]]=c,o),{}))},{withTypes:()=>Whe}),YS={},ZS={},XS={},iD;function Yhe(){return iD||(iD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),c=t(i);if(o===c&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-o:o-c}return 0};e.compareValues=n})(XS)),XS}var JS={},ej={},aD;function _6(){return aD||(aD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(ej)),ej}var sD;function Zhe(){return sD||(sD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_6(),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})(JS)),JS}var oD;function Xhe(){return oD||(oD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yhe(),n=Zhe(),r=gC();function i(a,o,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const f=(v,w)=>{let b=v;for(let j=0;j<w.length&&b!=null;++j)b=b[w[j]];return b},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 b=0;b<m.length;b++){const j=t.compareValues(v.criteria[b],w.criteria[b],c[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(ZS)),ZS}var tj={},lD;function Jhe(){return lD||(lD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(tj)),tj}var nj={},cD;function P6(){return cD||(cD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A6(),n=b6(),r=w6(),i=j6();function a(o,c,d){return r.isObject(d)&&(typeof c=="number"&&n.isArrayLike(d)&&t.isIndex(c)&&c<d.length||typeof c=="string"&&c in d)?i.isEqualsSameValueZero(d[c],o):!1}e.isIterateeCall=a})(nj)),nj}var uD;function epe(){return uD||(uD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xhe(),n=Jhe(),r=P6();function i(a,...o){const c=o.length;return c>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:c>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(YS)),YS}var rj,dD;function tpe(){return dD||(dD=1,rj=epe().sortBy),rj}var npe=tpe();const d0=ga(npe);var T6=e=>e.legend.settings,rpe=e=>e.legend.size,ipe=e=>e.legend.payload,ape=ne([ipe,T6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?d0(r,n):r});function spe(){return Re(ape)}var xg=1;function z6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>xg||Math.abs(o.left-t.left)>xg||Math.abs(o.top-t.top)>xg||Math.abs(o.width-t.width)>xg)&&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 gr(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 ope=typeof Symbol=="function"&&Symbol.observable||"@@observable",fD=ope,ij=()=>Math.random().toString(36).substring(7).split("").join("."),lpe={INIT:`@@redux/INIT${ij()}`,REPLACE:`@@redux/REPLACE${ij()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ij()}`},Ty=lpe;function SC(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 R6(e,t,n){if(typeof e!="function")throw new Error(gr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(gr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(gr(1));return n(R6)(e,t)}let r=e,i=t,a=new Map,o=a,c=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,N)=>{o.set(N,j)}))}function p(){if(d)throw new Error(gr(3));return i}function m(j){if(typeof j!="function")throw new Error(gr(4));if(d)throw new Error(gr(5));let N=!0;f();const O=c++;return o.set(O,j),function(){if(N){if(d)throw new Error(gr(6));N=!1,f(),o.delete(O),a=null}}}function g(j){if(!SC(j))throw new Error(gr(7));if(typeof j.type>"u")throw new Error(gr(8));if(typeof j.type!="string")throw new Error(gr(17));if(d)throw new Error(gr(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(gr(10));r=j,g({type:Ty.REPLACE})}function w(){const j=m;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(gr(11));function O(){const A=N;A.next&&A.next(p())}return O(),{unsubscribe:j(O)}},[fD](){return this}}}return g({type:Ty.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:v,[fD]:w}}function cpe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Ty.INIT})>"u")throw new Error(gr(12));if(typeof n(void 0,{type:Ty.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(gr(13))})}function D6(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{cpe(n)}catch(a){i=a}return function(o={},c){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],g=n[m],v=o[m],w=g(v,c);if(typeof w>"u")throw c&&c.type,new Error(gr(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function zy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function upe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(gr(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(o));return a=zy(...c)(i.dispatch),{...i,dispatch:a}}}function I6(e){return SC(e)&&"type"in e&&typeof e.type=="string"}var M6=Symbol.for("immer-nothing"),hD=Symbol.for("immer-draftable"),qr=Symbol.for("immer-state");function ua(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xi=Object,cd=xi.getPrototypeOf,Ry="constructor",f0="prototype",G1="configurable",Dy="enumerable",Yg="writable",Ih="value",Rs=e=>!!e&&!!e[qr];function ma(e){return e?L6(e)||p0(e)||!!e[hD]||!!e[Ry]?.[hD]||m0(e)||g0(e):!1}var dpe=xi[f0][Ry].toString(),pD=new WeakMap;function L6(e){if(!e||!jC(e))return!1;const t=cd(e);if(t===null||t===xi[f0])return!0;const n=xi.hasOwnProperty.call(t,Ry)&&t[Ry];if(n===Object)return!0;if(!zu(n))return!1;let r=pD.get(n);return r===void 0&&(r=Function.toString.call(n),pD.set(n,r)),r===dpe}function h0(e,t,n=!0){cp(e)===0?(n?Reflect.ownKeys(e):xi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function cp(e){const t=e[qr];return t?t.type_:p0(e)?1:m0(e)?2:g0(e)?3:0}var mD=(e,t,n=cp(e))=>n===2?e.has(t):xi[f0].hasOwnProperty.call(e,t),V1=(e,t,n=cp(e))=>n===2?e.get(t):e[t],Iy=(e,t,n,r=cp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function fpe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var p0=Array.isArray,m0=e=>e instanceof Map,g0=e=>e instanceof Set,jC=e=>typeof e=="object",zu=e=>typeof e=="function",aj=e=>typeof e=="boolean";function hpe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ns=e=>e.copy_||e.base_,NC=e=>e.modified_?e.copy_:e.base_;function Q1(e,t){if(m0(e))return new Map(e);if(g0(e))return new Set(e);if(p0(e))return Array[f0].slice.call(e);const n=L6(e);if(t===!0||t==="class_only"&&!n){const r=xi.getOwnPropertyDescriptors(e);delete r[qr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c[Yg]===!1&&(c[Yg]=!0,c[G1]=!0),(c.get||c.set)&&(r[o]={[G1]:!0,[Yg]:!0,[Dy]:c[Dy],[Ih]:e[o]})}return xi.create(cd(e),r)}else{const r=cd(e);if(r!==null&&n)return{...e};const i=xi.create(r);return xi.assign(i,e)}}function kC(e,t=!1){return y0(e)||Rs(e)||!ma(e)||(cp(e)>1&&xi.defineProperties(e,{set:bg,add:bg,clear:bg,delete:bg}),xi.freeze(e),t&&h0(e,(n,r)=>{kC(r,!0)},!1)),e}function ppe(){ua(2)}var bg={[Ih]:ppe};function y0(e){return e===null||!jC(e)?!0:xi.isFrozen(e)}var My="MapSet",W1="Patches",gD="ArrayMethods",$6={};function pc(e){const t=$6[e];return t||ua(0,e),t}var yD=e=>!!$6[e],Mh,B6=()=>Mh,mpe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:yD(My)?pc(My):void 0,arrayMethodsPlugin_:yD(gD)?pc(gD):void 0});function vD(e,t){t&&(e.patchPlugin_=pc(W1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Y1(e){Z1(e),e.drafts_.forEach(gpe),e.drafts_=null}function Z1(e){e===Mh&&(Mh=e.parent_)}var xD=e=>Mh=mpe(Mh,e);function gpe(e){const t=e[qr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[qr].modified_&&(Y1(t),ua(4)),ma(e)&&(e=wD(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[qr].base_,e,t)}else e=wD(t,n);return ype(t,e,!0),Y1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==M6?e:void 0}function wD(e,t){if(y0(t))return t;const n=t[qr];if(!n)return Ly(t,e.handledSet_,e);if(!v0(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);F6(n,e)}return n.copy_}function ype(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kC(t,n)}function U6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var v0=(e,t)=>e.scope_===t,vpe=[];function q6(e,t,n,r){const i=Ns(e),a=e.type_;if(r!==void 0&&V1(i,r,a)===t){Iy(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;h0(i,(d,f)=>{if(Rs(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const o=e.draftLocations_.get(t)??vpe;for(const c of o)Iy(i,c,n,a)}function xpe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!v0(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=NC(a);q6(e,a.draft_??a,o,n),F6(a,i)})}function F6(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)}U6(e)}}function bpe(e,t,n){const{scope_:r}=e;if(Rs(n)){const i=n[qr];v0(i,r)&&i.callbacks_.push(function(){Zg(e);const o=NC(i);q6(e,n,o,t)})}else ma(n)&&e.callbacks_.push(function(){const a=Ns(e);e.type_===3?a.has(n)&&Ly(n,r.handledSet_,r):V1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ly(V1(e.copy_,t,e.type_),r.handledSet_,r)})}function Ly(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Rs(e)||t.has(e)||!ma(e)||y0(e)||(t.add(e),h0(e,(r,i)=>{if(Rs(i)){const a=i[qr];if(v0(a,n)){const o=NC(a);Iy(e,r,o,e.type_),U6(a)}}else ma(i)&&Ly(i,t,n)})),e}function wpe(e,t){const n=p0(e),r={type_:n?1:0,scope_:t?t.scope_:B6(),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=$y;n&&(i=[r],a=Lh);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,[c,r]}var $y={get(e,t){if(t===qr)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=Ns(e);if(!mD(i,t,e.type_))return Spe(e,i,t);const a=i[t];if(e.finalized_||!ma(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&hpe(t))return a;if(a===sj(e.base_,t)){Zg(e);const o=e.type_===1?+t:t,c=J1(e.scope_,a,e,o);return e.copy_[o]=c}return a},has(e,t){return t in Ns(e)},ownKeys(e){return Reflect.ownKeys(Ns(e))},set(e,t,n){const r=K6(Ns(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=sj(Ns(e),t),a=i?.[qr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(fpe(n,i)&&(n!==void 0||mD(e.base_,t,e.type_)))return!0;Zg(e),X1(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),bpe(e,t,n)),!0},deleteProperty(e,t){return Zg(e),sj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),X1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ns(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Yg]:!0,[G1]:e.type_!==1||t!=="length",[Dy]:r[Dy],[Ih]:n[t]}},defineProperty(){ua(11)},getPrototypeOf(e){return cd(e.base_)},setPrototypeOf(){ua(12)}},Lh={};for(let e in $y){let t=$y[e];Lh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Lh.deleteProperty=function(e,t){return Lh.set.call(this,e,t,void 0)};Lh.set=function(e,t,n){return $y.set.call(this,e[0],t,n,e[0])};function sj(e,t){const n=e[qr];return(n?Ns(n):e)[t]}function Spe(e,t,n){const r=K6(t,n);return r?Ih in r?r[Ih]:r.get?.call(e.draft_):void 0}function K6(e,t){if(!(t in e))return;let n=cd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cd(n)}}function X1(e){e.modified_||(e.modified_=!0,e.parent_&&X1(e.parent_))}function Zg(e){e.copy_||(e.assigned_=new Map,e.copy_=Q1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var jpe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(zu(n)&&!zu(r)){const o=r;r=n;const c=this;return function(f=o,...p){return c.produce(f,m=>r.call(this,m,...p))}}zu(r)||ua(6),i!==void 0&&!zu(i)&&ua(7);let a;if(ma(n)){const o=xD(this),c=J1(o,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?Y1(o):Z1(o)}return vD(o,i),bD(a,o)}else if(!n||!jC(n)){if(a=r(n),a===void 0&&(a=n),a===M6&&(a=void 0),this.autoFreeze_&&kC(a,!0),i){const o=[],c=[];pc(W1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:c}),i(o,c)}return a}else ua(1,n)},this.produceWithPatches=(n,r)=>{if(zu(n))return(c,...d)=>this.produceWithPatches(c,f=>n(f,...d));let i,a;return[this.produce(n,r,(c,d)=>{i=c,a=d}),i,a]},aj(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),aj(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),aj(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ma(t)||ua(8),Rs(t)&&(t=Ki(t));const n=xD(this),r=J1(n,t,void 0);return r[qr].isManual_=!0,Z1(n),r}finishDraft(t,n){const r=t&&t[qr];(!r||!r.isManual_)&&ua(9);const{scope_:i}=r;return vD(i,n),bD(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=pc(W1).applyPatches_;return Rs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function J1(e,t,n,r){const[i,a]=m0(t)?pc(My).proxyMap_(t,n):g0(t)?pc(My).proxySet_(t,n):wpe(t,n);return(n?.scope_??B6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?xpe(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 Ki(e){return Rs(e)||ua(10,e),H6(e)}function H6(e){if(!ma(e)||y0(e))return e;const t=e[qr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Q1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Q1(e,!0);return h0(n,(i,a)=>{Iy(n,i,H6(a))},r),t&&(t.finalized_=!1),n}var Npe=new jpe,G6=Npe.produce;function V6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var kpe=V6(),Cpe=V6,Ape=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zy:zy.apply(null,arguments)};function wi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(bi(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=>I6(r)&&r.type===e,n}var Q6=class uh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,uh.prototype)}static get[Symbol.species](){return uh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new uh(...t[0].concat(this)):new uh(...t.concat(this))}};function SD(e){return ma(e)?G6(e,()=>{}):e}function wg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ope(e){return typeof e=="boolean"}var Epe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Q6;return n&&(Ope(n)?o.push(kpe):o.push(Cpe(n.extraArgument))),o},W6="RTK_autoBatch",on=()=>e=>({payload:e,meta:{[W6]:!0}}),jD=e=>t=>{setTimeout(t,e)},Y6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:jD(10):e.type==="callback"?e.queueNotification:jD(e.timeout),f=()=>{o=!1,a&&(a=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),g=r.subscribe(m);return c.add(p),()=>{g(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[W6],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},_pe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Q6(e);return r&&i.push(Y6(typeof r=="object"?r:void 0)),i};function Ppe(e){const t=Epe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(SC(n))c=D6(n);else throw new Error(bi(1));let d;typeof r=="function"?d=r(t):d=t();let f=zy;i&&(f=Ape({trace:!1,...typeof i=="object"&&i}));const p=upe(...d),m=_pe(p);let g=typeof o=="function"?o(m):m();const v=f(...g);return R6(c,a,v)}function Z6(e){const t={},n=[];let r;const i={addCase(a,o){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(bi(28));if(c in t)throw new Error(bi(29));return t[c]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Tpe(e){return typeof e=="function"}function zpe(e,t){let[n,r,i]=Z6(t),a;if(Tpe(e))a=()=>SD(e());else{const c=SD(e);a=()=>c}function o(c=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(Rs(p)){const v=m(p,d);return v===void 0?p:v}else{if(ma(p))return G6(p,g=>m(g,d));{const g=m(p,d);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},c)}return o.getInitialState=a,o}var Rpe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Dpe=(e=21)=>{let t="",n=e;for(;n--;)t+=Rpe[Math.random()*64|0];return t},Ipe=Symbol.for("rtk-slice-createasyncthunk");function Mpe(e,t){return`${e}/${t}`}function Lpe({creators:e}={}){const t=e?.asyncThunk?.[Ipe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(bi(11));const o=(typeof r.reducers=="function"?r.reducers(Bpe()):r.reducers)||{},c=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,A){const P=typeof C=="string"?C:C.type;if(!P)throw new Error(bi(12));if(P in d.sliceCaseReducersByType)throw new Error(bi(13));return d.sliceCaseReducersByType[P]=A,f},addMatcher(C,A){return d.sliceMatchers.push({matcher:C,reducer:A}),f},exposeAction(C,A){return d.actionCreators[C]=A,f},exposeCaseReducer(C,A){return d.sliceCaseReducersByName[C]=A,f}};c.forEach(C=>{const A=o[C],P={reducerName:C,type:Mpe(i,C),createNotation:typeof r.reducers=="function"};qpe(A)?Kpe(P,A,f,t):Upe(P,A,f)});function p(){const[C={},A=[],P=void 0]=typeof r.extraReducers=="function"?Z6(r.extraReducers):[r.extraReducers],E={...C,...d.sliceCaseReducersByType};return zpe(r.initialState,_=>{for(let z in E)_.addCase(z,E[z]);for(let z of d.sliceMatchers)_.addMatcher(z.matcher,z.reducer);for(let z of A)_.addMatcher(z.matcher,z.reducer);P&&_.addDefaultCase(P)})}const m=C=>C,g=new Map,v=new WeakMap;let w;function b(C,A){return w||(w=p()),w(C,A)}function j(){return w||(w=p()),w.getInitialState()}function N(C,A=!1){function P(_){let z=_[C];return typeof z>"u"&&A&&(z=wg(v,P,j)),z}function E(_=m){const z=wg(g,A,()=>new WeakMap);return wg(z,_,()=>{const I={};for(const[q,U]of Object.entries(r.selectors??{}))I[q]=$pe(U,_,()=>wg(v,_,j),A);return I})}return{reducerPath:C,getSelectors:E,get selectors(){return E(P)},selectSlice:P}}const O={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...N(a),injectInto(C,{reducerPath:A,...P}={}){const E=A??a;return C.inject({reducerPath:E,reducer:b},P),{...O,...N(E,!0)}}};return O}}function $pe(e,t,n,r){function i(a,...o){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...o)}return i.unwrapped=e,i}var _r=Lpe();function Bpe(){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 Upe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Fpe(r))throw new Error(bi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?wi(e,o):wi(e))}function qpe(e){return e._reducerDefinitionType==="asyncThunk"}function Fpe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Kpe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(bi(18));const{payloadCreator:a,fulfilled:o,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Sg,pending:c||Sg,rejected:d||Sg,settled:f||Sg})}function Sg(){}var Hpe="task",X6="listener",J6="completed",CC="cancelled",Gpe=`task-${CC}`,Vpe=`task-${J6}`,eN=`${X6}-${CC}`,Qpe=`${X6}-${J6}`,x0=class{constructor(e){this.code=e,this.message=`${Hpe} ${CC} (reason: ${e})`}name="TaskAbortError";message},AC=(e,t)=>{if(typeof e!="function")throw new TypeError(bi(32))},By=()=>{},eU=(e,t=By)=>(e.catch(t),e),tU=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Jl=e=>{if(e.aborted)throw new x0(e.reason)};function nU(e,t){let n=By;return new Promise((r,i)=>{const a=()=>i(new x0(e.reason));if(e.aborted){a();return}n=tU(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=By})}var Wpe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof x0?"cancelled":"rejected",error:n}}finally{t?.()}},Uy=e=>t=>eU(nU(e,t).then(n=>(Jl(e),n))),rU=e=>{const t=Uy(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Yu}=Object,ND={},b0="listenerMiddleware",Ype=(e,t)=>{const n=r=>tU(e,()=>r.abort(e.reason));return(r,i)=>{AC(r);const a=new AbortController;n(a);const o=Wpe(async()=>{Jl(e),Jl(a.signal);const c=await r({pause:Uy(a.signal),delay:rU(a.signal),signal:a.signal});return Jl(a.signal),c},()=>a.abort(Vpe));return i?.autoJoin&&t.push(o.catch(By)),{result:Uy(e)(o),cancel(){a.abort(Gpe)}}}},Zpe=(e,t)=>{const n=async(r,i)=>{Jl(t);let a=()=>{};const c=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,g)=>{g.unsubscribe(),d([m,g.getState(),g.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&c.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await nU(t,Promise.race(c));return Jl(t),d}finally{a()}};return(r,i)=>eU(n(r,i))},iU=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=wi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(bi(21));return AC(a),{predicate:i,type:t,effect:a}},aU=Yu(e=>{const{type:t,predicate:n,effect:r}=iU(e);return{id:Dpe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(bi(22))}}},{withTypes:()=>aU}),kD=(e,t)=>{const{type:n,effect:r,predicate:i}=iU(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},tN=e=>{e.pending.forEach(t=>{t.abort(eN)})},Xpe=(e,t)=>()=>{for(const n of t.keys())tN(n);e.clear()},CD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},sU=Yu(wi(`${b0}/add`),{withTypes:()=>sU}),Jpe=wi(`${b0}/removeAll`),oU=Yu(wi(`${b0}/remove`),{withTypes:()=>oU}),eme=(...e)=>{console.error(`${b0}/error`,...e)},up=(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=eme}=e;AC(o);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&tN(v)}),d=v=>{const w=kD(t,v)??aU(v);return c(w)};Yu(d,{withTypes:()=>d});const f=v=>{const w=kD(t,v);return w&&(w.unsubscribe(),v.cancelActive&&tN(w)),!!w};Yu(f,{withTypes:()=>f});const p=async(v,w,b,j)=>{const N=new AbortController,O=Zpe(d,N.signal),C=[];try{v.pending.add(N),r(v),await Promise.resolve(v.effect(w,Yu({},b,{getOriginalState:j,condition:(A,P)=>O(A,P).then(Boolean),take:O,delay:rU(N.signal),pause:Uy(N.signal),extra:a,signal:N.signal,fork:Ype(N.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,P,E)=>{A!==N&&(A.abort(eN),E.delete(A))})},cancel:()=>{N.abort(eN),v.pending.delete(N)},throwIfCancelled:()=>{Jl(N.signal)}})))}catch(A){A instanceof x0||CD(o,A,{raisedBy:"effect"})}finally{await Promise.all(C),N.abort(Qpe),i(v),v.pending.delete(N)}},m=Xpe(t,n);return{middleware:v=>w=>b=>{if(!I6(b))return w(b);if(sU.match(b))return d(b.payload);if(Jpe.match(b)){m();return}if(oU.match(b))return f(b.payload);let j=v.getState();const N=()=>{if(j===ND)throw new Error(bi(23));return j};let O;try{if(O=w(b),t.size>0){const C=v.getState(),A=Array.from(t.values());for(const P of A){let E=!1;try{E=P.predicate(b,C,j)}catch(_){E=!1,CD(o,_,{raisedBy:"predicate"})}E&&p(P,b,v,N)}}}finally{j=ND}return O},startListening:d,stopListening:f,clearListeners:m}};function bi(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 tme={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},lU=_r({name:"chartLayout",initialState:tme,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:nme,setLayout:rme,setChartSize:ime,setScale:ame}=lU.actions,sme=lU.reducer;function cU(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ft(e){return Number.isFinite(e)}function Ga(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function AD(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 $u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){ome(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ome(e,t,n){return(t=lme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lme(e){var t=cme(e,"string");return typeof t=="symbol"?t:t+""}function cme(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 _t(e,t,n){return un(e)||un(t)?n:Ha(t)?fc(e,t,n):typeof t=="function"?t(e):n}var ume=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:c}=t;if((c==="vertical"||c==="horizontal"&&o==="middle")&&a!=="center"&&Te(e[a]))return $u($u({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&o!=="middle"&&Te(e[o]))return $u($u({},e),{},{[o]:e[o]+(i||0)})}return e},ba=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",uU=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,o=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||o.push(t),a||o.push(n),o},dU=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:g,axisType:v}=e;if(!o)return null;var w=c==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,b=i==="category"&&o.bandwidth?o.bandwidth()/w:0;if(b=v==="angleAxis"&&a&&a.length>=2?or(a[0]-a[1])*2*b:b,m||g){var j=(m||g||[]).map((N,O)=>{var C=r?r.indexOf(N):N,A=o.map(C);return ft(A)?{coordinate:A+b,value:N,offset:b,index:O}:null}).filter(ei);return j}return d&&f?f.map((N,O)=>{var C=o.map(N);return ft(C)?{coordinate:C+b,value:N,index:O,offset:b}:null}).filter(ei):o.ticks&&p!=null?o.ticks(p).map((N,O)=>{var C=o.map(N);return ft(C)?{coordinate:C+b,value:N,index:O,offset:b}:null}).filter(ei):o.domain().map((N,O)=>{var C=o.map(N);return ft(C)?{coordinate:C+b,value:r?r[N]:N,index:O,offset:b}:null}).filter(ei)},dme=(e,t)=>{if(!t||t.length!==2||!Te(t[0])||!Te(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Te(e[0])||e[0]<n)&&(i[0]=n),(!Te(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},fme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],g=pa(p)?m:p;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=o,o+=g,f[1]=o)}}}},hme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var c=e[o],d=c?.[i];if(d!=null){var f=pa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},pme={sign:fme,expand:$fe,none:dc,silhouette:Bfe,wiggle:Ufe,positive:hme},mme=(e,t,n)=>{var r,i=(r=pme[n])!==null&&r!==void 0?r:dc,a=Lfe().keys(t).value((c,d)=>Number(_t(c,d,0))).order(K1).offset(i),o=a(e);return o.forEach((c,d)=>{c.forEach((f,p)=>{var m=_t(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Te(m[0])&&Te(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function fU(e){return e==null?void 0:String(e)}function qy(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!un(i[t.dataKey])){var c=m6(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=_t(i,un(o)?t.dataKey:o),f=t.scale.map(d);return Te(f)?f:null}var OD=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var c=_t(a,t.dataKey,t.scale.domain()[o]);if(un(c))return null;var d=t.scale.map(c);return Te(d)?d-i/2+r:null},gme=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},yme=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},vme=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],xme=(e,t,n)=>{if(e!=null)return vme(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,c=o.reduce((d,f)=>{var p=cU(f,t,n),m=yme(p);return!ft(m[0])||!ft(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},ED=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_D=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Go=(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=d0(t,p=>p.coordinate),a=1/0,o=1,c=i.length;o<c;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function PD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return $u($u({},t),{},{dataKey:n,payload:r,value:i,name:a})}function rl(e,t){if(e)return String(e);if(typeof t=="string")return t}var bme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},wme=(e,t)=>t==="centric"?e.angle:e.radius,Bs=e=>e.layout.width,Us=e=>e.layout.height,Sme=e=>e.layout.scale,hU=e=>e.layout.margin,w0=ne(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),S0=ne(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),pU="data-recharts-item-index",mU="data-recharts-item-id",dp=60;function TD(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 jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TD(Object(n),!0).forEach(function(r){jme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jme(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=kme(e,"string");return typeof t=="symbol"?t:t+""}function kme(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 Cme=e=>e.brush.height;function Ame(e){var t=S0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:dp;return n+i}return n},0)}function Ome(e){var t=S0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:dp;return n+i}return n},0)}function Eme(e){var t=w0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function _me(e){var t=w0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var nr=ne([Bs,Us,hU,Cme,Ame,Ome,Eme,_me,T6,rpe],(e,t,n,r,i,a,o,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+c},g=jg(jg({},m),p),v=g.bottom;g.bottom+=r,g=ume(g,d,f);var w=e-g.left-g.right,b=t-g.top-g.bottom;return jg(jg({brushBottom:v},g),{},{width:Math.max(w,0),height:Math.max(b,0)})}),Pme=ne(nr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),OC=ne(Bs,Us,(e,t)=>({x:0,y:0,width:e,height:t})),Tme=x.createContext(null),cr=()=>x.useContext(Tme)!=null,j0=e=>e.brush,N0=ne([j0,nr,hU],(e,t,n)=>({height:e.height,x:Te(e.x)?e.x:t.left,y:Te(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Te(e.width)?e.width:t.width})),oj={},lj={},cj={},zD;function zme(){return zD||(zD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(o,c),o=void 0,c=null)},m=()=>{f&&p(),b()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,m()},r)},w=()=>{g!==null&&(clearTimeout(g),g=null)},b=()=>{w(),o=void 0,c=null},j=()=>{p()},N=function(...O){if(i?.aborted)return;o=this,c=O;const C=g==null;v(),d&&C&&p()};return N.schedule=v,N.cancel=b,N.flush=j,i?.addEventListener("abort",b,{once:!0}),N}e.debounce=t})(cj)),cj}var RD;function Rme(){return RD||(RD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zme();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),c&&(f[1]="trailing");let p,m=null;const g=t.debounce(function(...b){p=r.apply(this,b),m=null},i,{edges:f}),v=function(...b){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,b),m=Date.now(),g.cancel(),g.schedule(),p):(g.apply(this,b),p)},w=()=>(g.flush(),p);return v.cancel=g.cancel,v.flush=w,v}e.debounce=n})(lj)),lj}var DD;function Dme(){return DD||(DD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rme();function n(r,i=0,a={}){const{leading:o=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:c})}e.throttle=n})(oj)),oj}var uj,ID;function Ime(){return ID||(ID=1,uj=Dme().throttle),uj}var Mme=Ime();const Lme=ga(Mme);var Fy=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++]))}},La={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},gU=(e,t,n)=>{var{width:r=La.width,height:i=La.height,aspect:a,maxHeight:o}=n,c=hc(r)?e:Number(r),d=hc(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:c,calculatedHeight:d}},$me={width:0,height:0,overflow:"visible"},Bme={width:0,overflowX:"visible"},Ume={height:0,overflowY:"visible"},qme={},Fme=e=>{var{width:t,height:n}=e,r=hc(t),i=hc(n);return r&&i?$me:r?Bme:i?Ume:qme};function Kme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=La.width,a=La.height):i===void 0?i=r&&r>0?void 0:La.width:a===void 0&&(a=r&&r>0?void 0:La.height),{width:i,height:a}}function nN(){return nN=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},nN.apply(null,arguments)}function MD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MD(Object(n),!0).forEach(function(r){Hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hme(e,t,n){return(t=Gme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gme(e){var t=Vme(e,"string");return typeof t=="symbol"?t:t+""}function Vme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yU=x.createContext(La.initialDimension);function Qme(e){return Ga(e.width)&&Ga(e.height)}function vU(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Qme(i)?x.createElement(yU.Provider,{value:i},t):null}var EC=()=>x.useContext(yU),Wme=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=La.initialDimension,width:i,height:a,minWidth:o=La.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=La.debounce,id:m,className:g,onResize:v,style:w={}}=e,b=x.useRef(null),j=x.useRef();j.current=v,x.useImperativeHandle(t,()=>b.current);var[N,O]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((z,I)=>{O(q=>{var U=Math.round(z),B=Math.round(I);return q.containerWidth===U&&q.containerHeight===B?q:{containerWidth:U,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return nl;var z=B=>{var H,W=B[0];if(W!=null){var{width:Y,height:K}=W.contentRect;C(Y,K),(H=j.current)===null||H===void 0||H.call(j,Y,K)}};p>0&&(z=Lme(z,p,{trailing:!0,leading:!1}));var I=new ResizeObserver(z),{width:q,height:U}=b.current.getBoundingClientRect();return C(q,U),I.observe(b.current),()=>{I.disconnect()}},[C,p]);var{containerWidth:A,containerHeight:P}=N;Fy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:E,calculatedHeight:_}=gU(A,P,{width:i,height:a,aspect:n,maxHeight:d});return Fy(E!=null&&E>0||_!=null&&_>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,_,i,a,o,c,n),x.createElement("div",{id:m?"".concat(m):void 0,className:jt("recharts-responsive-container",g),style:LD(LD({},w),{},{width:i,height:a,minWidth:o,minHeight:c,maxHeight:d}),ref:b},x.createElement("div",{style:Fme({width:i,height:a})},x.createElement(vU,{width:E,height:_},f)))}),Va=x.forwardRef((e,t)=>{var n=EC();if(Ga(n.width)&&Ga(n.height))return e.children;var{width:r,height:i}=Kme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=gU(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(o)?x.createElement(vU,{width:a,height:o},e.children):x.createElement(Wme,nN({},e,{width:r,height:i,ref:t}))});function _C(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 k0=()=>{var e,t=cr(),n=Re(Pme),r=Re(N0),i=(e=Re(j0))===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}},Yme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},xU=()=>{var e;return(e=Re(nr))!==null&&e!==void 0?e:Yme},PC=()=>Re(Bs),TC=()=>Re(Us),Zme=()=>Re(e=>e.layout.margin),Nt=e=>e.layout.layoutType,il=()=>Re(Nt),zC=()=>{var e=il();if(e==="horizontal"||e==="vertical")return e},bU=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Xme=()=>{var e=il();return e!==void 0},fp=e=>{var t=Ht(),n=cr(),{width:r,height:i}=e,a=EC(),o=r,c=i;return a&&(o=a.width>0?a.width:r,c=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ga(o)&&Ga(c)&&t(ime({width:o,height:c}))},[t,n,o,c]),null},wU=Symbol.for("immer-nothing"),$D=Symbol.for("immer-draftable"),Si=Symbol.for("immer-state");function da(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $h=Object.getPrototypeOf;function ud(e){return!!e&&!!e[Si]}function mc(e){return e?SU(e)||Array.isArray(e)||!!e[$D]||!!e.constructor?.[$D]||hp(e)||A0(e):!1}var Jme=Object.prototype.constructor.toString(),BD=new WeakMap;function SU(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=BD.get(n);return r===void 0&&(r=Function.toString.call(n),BD.set(n,r)),r===Jme}function Ky(e,t,n=!0){C0(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 C0(e){const t=e[Si];return t?t.type_:Array.isArray(e)?1:hp(e)?2:A0(e)?3:0}function rN(e,t){return C0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function jU(e,t,n){const r=C0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function ege(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function hp(e){return e instanceof Map}function A0(e){return e instanceof Set}function Ml(e){return e.copy_||e.base_}function iN(e,t){if(hp(e))return new Map(e);if(A0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=SU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Si];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[o]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[o]})}return Object.create($h(e),r)}else{const r=$h(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function RC(e,t=!1){return O0(e)||ud(e)||!mc(e)||(C0(e)>1&&Object.defineProperties(e,{set:Ng,add:Ng,clear:Ng,delete:Ng}),Object.freeze(e),t&&Object.values(e).forEach(n=>RC(n,!0))),e}function tge(){da(2)}var Ng={value:tge};function O0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var nge={};function gc(e){const t=nge[e];return t||da(0,e),t}var Bh;function NU(){return Bh}function rge(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function UD(e,t){t&&(gc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function aN(e){sN(e),e.drafts_.forEach(ige),e.drafts_=null}function sN(e){e===Bh&&(Bh=e.parent_)}function qD(e){return Bh=rge(Bh,e)}function ige(e){const t=e[Si];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function FD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Si].modified_&&(aN(t),da(4)),mc(e)&&(e=Hy(t,e),t.parent_||Gy(t,e)),t.patches_&&gc("Patches").generateReplacementPatches_(n[Si].base_,e,t.patches_,t.inversePatches_)):e=Hy(t,n,[]),aN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wU?e:void 0}function Hy(e,t,n){if(O0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Si];if(!i)return Ky(t,(a,o)=>KD(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Gy(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,c=!1;i.type_===3&&(o=new Set(a),a.clear(),c=!0),Ky(o,(d,f)=>KD(e,i,a,d,f,n,c),r),Gy(e,a,!1),n&&e.patches_&&gc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function KD(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const c=O0(i);if(!(c&&!o)){if(ud(i)){const d=a&&t&&t.type_!==3&&!rN(t.assigned_,r)?a.concat(r):void 0,f=Hy(e,i,d);if(jU(n,r,f),ud(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(mc(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Hy(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(hp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Gy(e,i)}}}function Gy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&RC(t,n)}function age(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:NU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=DC;n&&(i=[r],a=Uh);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,c}var DC={get(e,t){if(t===Si)return e;const n=Ml(e);if(!rN(n,t))return sge(e,n,t);const r=n[t];return e.finalized_||!mc(r)?r:r===dj(e.base_,t)?(fj(e),e.copy_[t]=lN(r,e)):r},has(e,t){return t in Ml(e)},ownKeys(e){return Reflect.ownKeys(Ml(e))},set(e,t,n){const r=kU(Ml(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=dj(Ml(e),t),a=i?.[Si];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(ege(n,i)&&(n!==void 0||rN(e.base_,t)))return!0;fj(e),oN(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 dj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fj(e),oN(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ml(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){da(11)},getPrototypeOf(e){return $h(e.base_)},setPrototypeOf(){da(12)}},Uh={};Ky(DC,(e,t)=>{Uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Uh.deleteProperty=function(e,t){return Uh.set.call(this,e,t,void 0)};Uh.set=function(e,t,n){return DC.set.call(this,e[0],t,n,e[0])};function dj(e,t){const n=e[Si];return(n?Ml(n):e)[t]}function sge(e,t,n){const r=kU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function kU(e,t){if(!(t in e))return;let n=$h(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=$h(n)}}function oN(e){e.modified_||(e.modified_=!0,e.parent_&&oN(e.parent_))}function fj(e){e.copy_||(e.copy_=iN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oge=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"&&da(6),r!==void 0&&typeof r!="function"&&da(7);let i;if(mc(t)){const a=qD(this),o=lN(t,void 0);let c=!0;try{i=n(o),c=!1}finally{c?aN(a):sN(a)}return UD(a,r),FD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===wU&&(i=void 0),this.autoFreeze_&&RC(i,!0),r){const a=[],o=[];gc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else da(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...c)=>this.produceWithPatches(o,d=>t(d,...c));let r,i;return[this.produce(t,n,(o,c)=>{r=o,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){mc(e)||da(8),ud(e)&&(e=lge(e));const t=qD(this),n=lN(e,void 0);return n[Si].isManual_=!0,sN(t),n}finishDraft(e,t){const n=e&&e[Si];(!n||!n.isManual_)&&da(9);const{scope_:r}=n;return UD(r,t),FD(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=gc("Patches").applyPatches_;return ud(e)?r(e,t):this.produce(e,i=>r(i,t))}};function lN(e,t){const n=hp(e)?gc("MapSet").proxyMap_(e,t):A0(e)?gc("MapSet").proxySet_(e,t):age(e,t);return(t?t.scope_:NU()).drafts_.push(n),n}function lge(e){return ud(e)||da(10,e),CU(e)}function CU(e){if(!mc(e)||O0(e))return e;const t=e[Si];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=iN(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=iN(e,!0);return Ky(n,(i,a)=>{jU(n,i,CU(a))},r),t&&(t.finalized_=!1),n}var cge=new oge;cge.produce;var uge={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},AU=_r({name:"legend",initialState:uge,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:on()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:on()},removeLegendPayload:{reducer(e,t){var n=Ki(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:on()}}}),{setLegendSize:HD,setLegendSettings:dge,addLegendPayload:OU,replaceLegendPayload:EU,removeLegendPayload:_U}=AU.actions,fge=AU.reducer,hj={exports:{}},pj={};var GD;function hge(){if(GD)return pj;GD=1;var e=Sd();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return pj.useSyncExternalStoreWithSelector=function(d,f,p,m,g){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(P){if(!N){if(N=!0,O=P,P=m(P),g!==void 0&&w.hasValue){var E=w.value;if(g(E,P))return C=E}return C=P}if(E=C,n(O,P))return E;var _=m(P);return g!==void 0&&g(E,_)?(O=P,E):(O=P,C=_)}var N=!1,O,C,A=p===void 0?null:p;return[function(){return j(f())},A===null?void 0:function(){return j(A())}]},[f,p,m,g]);var b=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=b},[b]),c(b),b},pj}var VD;function pge(){return VD||(VD=1,hj.exports=hge()),hj.exports}pge();function mge(e){e()}function gge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){mge(()=>{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 QD={notify(){},get:()=>[]};function yge(e,t){let n,r=QD,i=0,a=!1;function o(b){p();const j=r.subscribe(b);let N=!1;return()=>{N||(N=!0,j(),m())}}function c(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=gge())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=QD)}function g(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:o,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return w}var vge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xge=vge(),bge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",wge=bge(),Sge=()=>xge||wge?x.useLayoutEffect:x.useEffect,jge=Sge();function WD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Nge(e,t){if(WD(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])||!WD(e[n[i]],t[n[i]]))return!1;return!0}var kge=Symbol.for("react-redux-context"),Cge=typeof globalThis<"u"?globalThis:{};function Age(){if(!x.createContext)return{};const e=Cge[kge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Oge=Age();function Ege(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=yge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);jge(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const c=n||Oge;return x.createElement(c.Provider,{value:a},t)}var _ge=Ege,Pge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Tge(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Pc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Pge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Nge(e[r],t[r]))return!1}else if(!Tge(e[r],t[r]))return!1;return!0}var zge=["contextPayload"];function cN(){return cN=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},cN.apply(null,arguments)}function YD(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 dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YD(Object(n),!0).forEach(function(r){Rge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rge(e,t,n){return(t=Dge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dge(e){var t=Ige(e,"string");return typeof t=="symbol"?t:t+""}function Ige(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 Mge(e,t){if(e==null)return{};var n,r,i=Lge(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 Lge(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 $ge(e){return e.value}function Bge(e){var{contextPayload:t}=e,n=Mge(e,zge),r=O6(t,e.payloadUniqBy,$ge),i=dd(dd({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(ghe,i)}function Uge(e,t,n,r,i,a){var{layout:o,align:c,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),dd(dd({},f),p)}function qge(e){var t=Ht();return x.useEffect(()=>{t(dge(e))},[t,e]),null}function Fge(e){var t=Ht();return x.useEffect(()=>(t(HD(e)),()=>{t(HD({width:0,height:0}))}),[t,e]),null}function Kge(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Hge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Gge(e){var t=Un(e,Hge),n=spe(),r=lfe(),i=Zme(),{width:a,height:o,wrapperStyle:c,portal:d}=t,[f,p]=z6([n]),m=PC(),g=TC();if(m==null||g==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=Kge(t.layout,o,a,v),b=d?c:dd(dd({position:"absolute",width:w?.width||a||"auto",height:w?.height||o||"auto"},Uge(c,t,i,m,g,f)),c),j=d??r;if(j==null||n==null)return null;var N=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(qge,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Fge,{width:f.width,height:f.height}),x.createElement(Bge,cN({},t,w,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return jc.createPortal(N,j)}var IC=x.memo(Gge,Pc);IC.displayName="Legend";function uN(){return uN=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},uN.apply(null,arguments)}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 Yf(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){Vge(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 Vge(e,t,n){return(t=Qge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qge(e){var t=Wge(e,"string");return typeof t=="symbol"?t:t+""}function Wge(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 Yge(e){return Array.isArray(e)&&Ha(e[0])&&Ha(e[1])?e.join(" ~ "):e}var ju={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 Zge(e,t){return t==null?e:d0(e,t)}var Xge=e=>{var{separator:t=ju.separator,contentStyle:n,itemStyle:r,labelStyle:i=ju.labelStyle,payload:a,formatter:o,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:g=ju.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},E=Zge(a,c),_=E.map((z,I)=>{if(!z||z.type==="none")return null;var q=z.formatter||o||Yge,{value:U,name:B}=z,H=U,W=B;if(q){var Y=q(U,B,z,I,a);if(Array.isArray(Y))[H,W]=Y;else if(Y!=null)H=Y;else return null}var K=Yf(Yf({},ju.itemStyle),{},{color:z.color||ju.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:K},Ha(W)?x.createElement("span",{className:"recharts-tooltip-item-name"},W):null,Ha(W)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},H),x.createElement("span",{className:"recharts-tooltip-item-unit"},z.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:P},_)}return null},w=Yf(Yf({},ju.contentStyle),n),b=Yf({margin:0},i),j=!un(p),N=j?p:"",O=jt("recharts-default-tooltip",d),C=jt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(N=m(p,a));var A=g?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",uN({className:O,style:w},A),x.createElement("p",{className:C,style:b},x.isValidElement(N)?N:"".concat(N)),v())},Zf="recharts-tooltip-wrapper",Jge={visibility:"hidden"};function eye(e){var{coordinate:t,translateX:n,translateY:r}=e;return jt(Zf,{["".concat(Zf,"-right")]:Te(n)&&t&&Te(t.x)&&n>=t.x,["".concat(Zf,"-left")]:Te(n)&&t&&Te(t.x)&&n<t.x,["".concat(Zf,"-bottom")]:Te(r)&&t&&Te(t.y)&&r>=t.y,["".concat(Zf,"-top")]:Te(r)&&t&&Te(t.y)&&r<t.y})}function XD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&Te(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var g=d[r];if(g==null)return 0;if(o[r]){var v=p,w=g;return v<w?Math.max(m,g):Math.max(p,g)}if(f==null)return 0;var b=m+c,j=g+f;return b>j?Math.max(p,g):Math.max(m,g)}function tye(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 nye(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,g;return c.height>0&&c.width>0&&n?(m=XD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),g=XD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=tye({translateX:m,translateY:g,useTranslate3d:d})):p=Jge,{cssProperties:p,cssClasses:eye({translateX:m,translateY:g,coordinate:n})}}var rye=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),pp={isSsr:rye()};function PU(){var[e,t]=x.useState(()=>pp.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function JD(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 Nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(r){iye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iye(e,t,n){return(t=aye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aye(e){var t=sye(e,"string");return typeof t=="symbol"?t:t+""}function sye(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 oye(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function lye(e){var t,n,r,i,a,o,c=PU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=b=>{if(b.key==="Escape"){var j,N,O,C;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=(C=e.coordinate)===null||C===void 0?void 0:C.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(Nu(Nu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=nye({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}),g=e.hasPortalFromProps?{}:Nu(Nu({transition:oye({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Nu(Nu({},g),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var cye=x.memo(lye),TU=()=>{var e;return(e=Re(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function dN(){return dN=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},dN.apply(null,arguments)}function eI(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 tI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uye(e,t,n){return(t=dye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(e){var t=fye(e,"string");return typeof t=="symbol"?t:t+""}function fye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nI={curveBasisClosed:Afe,curveBasisOpen:Ofe,curveBasis:Cfe,curveBumpX:ffe,curveBumpY:hfe,curveLinearClosed:Efe,curveLinear:c0,curveMonotoneX:_fe,curveMonotoneY:Pfe,curveNatural:Tfe,curveStep:zfe,curveStepAfter:Dfe,curveStepBefore:Rfe},Vy=e=>ft(e.x)&&ft(e.y),rI=e=>e.base!=null&&Vy(e.base)&&Vy(e),Xf=e=>e.x,Jf=e=>e.y,hye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(op(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=nI["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return nI[n]||c0},iI={connectNulls:!1,type:"linear"},pye=e=>{var{type:t=iI.type,points:n=[],baseLine:r,layout:i,connectNulls:a=iI.connectNulls}=e,o=hye(t,i),c=a?n.filter(Vy):n;if(Array.isArray(r)){var d,f=n.map((w,b)=>tI(tI({},w),{},{base:r[b]}));i==="vertical"?d=yg().y(Jf).x1(Xf).x0(w=>w.base.x):d=yg().x(Xf).y1(Jf).y0(w=>w.base.y);var p=d.defined(rI).curve(o),m=a?f.filter(rI):f;return p(m)}var g;i==="vertical"&&Te(r)?g=yg().y(Jf).x1(Xf).x0(r):Te(r)?g=yg().x(Xf).y1(Jf).y0(r):g=n6().x(Xf).y(Jf);var v=g.defined(Vy).curve(o);return v(c)},Zu=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=il();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},c=n&&n.length?pye(o):r;return x.createElement("path",dN({},Ur(e),xC(e),{className:jt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},mye=["x","y","top","left","width","height","className"];function fN(){return fN=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},fN.apply(null,arguments)}function aI(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 gye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aI(Object(n),!0).forEach(function(r){yye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yye(e,t,n){return(t=vye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vye(e){var t=xye(e,"string");return typeof t=="symbol"?t:t+""}function xye(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 bye(e,t){if(e==null)return{};var n,r,i=wye(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 wye(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 Sye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),jye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:c}=e,d=bye(e,mye),f=gye({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Te(t)||!Te(n)||!Te(a)||!Te(o)||!Te(r)||!Te(i)?null:x.createElement("path",fN({},Or(f),{className:jt("recharts-cross",c),d:Sye(t,n,a,o,r,i)}))};function Nye(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 sI(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 oI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kye(e,t,n){return(t=Cye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cye(e){var t=Aye(e,"string");return typeof t=="symbol"?t:t+""}function Aye(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 Oye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),zU=(e,t,n)=>e.map(r=>"".concat(Oye(r)," ").concat(t,"ms ").concat(n)).join(","),Eye=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),qh=(e,t)=>Object.keys(t).reduce((n,r)=>oI(oI({},n),{},{[r]:e(r,t[r])}),{});function lI(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?lI(Object(n),!0).forEach(function(r){_ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ye(e,t,n){return(t=Pye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pye(e){var t=Tye(e,"string");return typeof t=="symbol"?t:t+""}function Tye(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 Qy=(e,t,n)=>e+(t-e)*n,hN=e=>{var{from:t,to:n}=e;return t!==n},RU=(e,t,n)=>{var r=qh((i,a)=>{if(hN(a)){var[o,c]=e(a.from,a.to,a.velocity);return tr(tr({},a),{},{from:o,velocity:c})}return a},t);return n<1?qh((i,a)=>hN(a)&&r[i]!=null?tr(tr({},a),{},{velocity:Qy(a.velocity,r[i].velocity,n),from:Qy(a.from,r[i].from,n)}):a,t):RU(e,r,n-1)};function zye(e,t,n,r,i,a){var o,c=r.reduce((g,v)=>tr(tr({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>qh((g,v)=>v.from,c),f=()=>!Object.values(c).filter(hN).length,p=null,m=g=>{o||(o=g);var v=g-o,w=v/n.dt;c=RU(n,c,w),i(tr(tr(tr({},e),t),d())),o=g,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var g;(g=p)===null||g===void 0||g()})}function Rye(e,t,n,r,i,a,o){var c=null,d=i.reduce((m,g)=>{var v=e[g],w=t[g];return v==null||w==null?m:tr(tr({},m),{},{[g]:[v,w]})},{}),f,p=m=>{f||(f=m);var g=(m-f)/r,v=qh((b,j)=>Qy(...j,n(g)),d);if(a(tr(tr(tr({},e),t),v)),g<1)c=o.setTimeout(p);else{var w=qh((b,j)=>Qy(...j,n(1)),d);a(tr(tr(tr({},e),t),w))}};return()=>(c=o.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const Dye=(e,t,n,r,i,a)=>{var o=Eye(e,t);return n==null?()=>(i(tr(tr({},e),t)),()=>{}):n.isStepper===!0?zye(e,t,n,o,i,a):Rye(e,t,n,r,o,i,a)};var Wy=1e-4,DU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],IU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),cI=(e,t)=>n=>{var r=DU(e,t);return IU(r,n)},Iye=(e,t)=>n=>{var r=DU(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return IU(i,n)},Mye=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]]},Lye=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=Mye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},$ye=(e,t,n,r)=>{var i=cI(e,n),a=cI(t,r),o=Iye(e,n),c=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,g=0;g<8;++g){var v=i(m)-p,w=o(m);if(Math.abs(v-p)<Wy||w<Wy)return a(m);m=c(m-v/w)}return a(m)};return d.isStepper=!1,d},uI=function(){return $ye(...Lye(...arguments))},Bye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,c,d)=>{var f=-(o-c)*n,p=d*r,m=d+(f-p)*i/1e3,g=d*i/1e3+o;return Math.abs(g-c)<Wy&&Math.abs(m)<Wy?[c,0]:[g,m]};return a.isStepper=!0,a.dt=i,a},Uye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return uI(e);case"spring":return Bye();default:if(e.split("(")[0]==="cubic-bezier")return uI(e)}return typeof e=="function"?e:null};function qye(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var c=o,[d,...f]=c;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class Fye{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 Kye(){return qye(new Fye)}var Hye=x.createContext(Kye);function Gye(e,t){var n=x.useContext(Hye);return x.useMemo(()=>t??n(e),[e,t,n])}var Vye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},dI={t:0},mj={t:1};function Td(e){var t=Un(e,Vye),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=PU(),m=n==="auto"?!pp.isSsr&&!p:n,g=Gye(t.animationId,t.animationManager),[v,w]=x.useState(m?dI:mj),b=x.useRef(null);return x.useEffect(()=>{m||w(mj)},[m]),x.useEffect(()=>{if(!m||!r)return nl;var j=Dye(dI,mj,Uye(a),i,w,g.getTimeoutController()),N=()=>{b.current=j()};return g.start([d,o,N,i,c]),()=>{g.stop(),b.current&&b.current(),c()}},[m,r,i,a,o,d,c,g]),f(v.t)}function zd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Dh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Dh(t),r.current=e),n.current}var Qye=["radius"],Wye=["radius"],fI,hI,pI,mI,gI,yI,vI,xI,bI,wI;function SI(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 jI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(n),!0).forEach(function(r){Yye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yye(e,t,n){return(t=Zye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zye(e){var t=Xye(e,"string");return typeof t=="symbol"?t:t+""}function Xye(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 Yy(){return Yy=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},Yy.apply(null,arguments)}function NI(e,t){if(e==null)return{};var n,r,i=Jye(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 Jye(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 Ea(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var kI=(e,t,n,r,i)=>{var a=Do(n),o=Do(r),c=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(c>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,w=4;v<w;v++){var b,j=(b=i[v])!==null&&b!==void 0?b:0;g[v]=j>c?c:j}m=On(fI||(fI=Ea(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=On(hI||(hI=Ea(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+f*g[0],t)),m+=On(pI||(pI=Ea(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(m+=On(mI||(mI=Ea(["A ",",",",0,0,",`,
|
|
261
|
-
`,",",""])),g[1],g[1],p,e+n,t+d*g[1])),m+=On(gI||(gI=Ea(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=On(yI||(yI=Ea(["A ",",",",0,0,",`,
|
|
262
|
-
`,",",""])),g[2],g[2],p,e+n-f*g[2],t+r)),m+=On(vI||(vI=Ea(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(m+=On(xI||(xI=Ea(["A ",",",",0,0,",`,
|
|
263
|
-
`,",",""])),g[3],g[3],p,e,t+r-d*g[3])),m+="Z"}else if(c>0&&i===+i&&i>0){var N=Math.min(c,i);m=On(bI||(bI=Ea(["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=On(wI||(wI=Ea(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},CI={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},MU=e=>{var t=Un(e,CI),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:o,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:g,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:b}=t,j=x.useRef(c),N=x.useRef(d),O=x.useRef(a),C=x.useRef(o),A=x.useMemo(()=>({x:a,y:o,width:c,height:d,radius:f}),[a,o,c,d,f]),P=zd(A,"rectangle-");if(a!==+a||o!==+o||c!==+c||d!==+d||c===0||d===0)return null;var E=jt("recharts-rectangle",p);if(!b){var _=Or(t),{radius:z}=_,I=NI(_,Qye);return x.createElement("path",Yy({},I,{x:Do(a),y:Do(o),width:Do(c),height:Do(d),radius:typeof f=="number"?f:void 0,className:E,d:kI(a,o,c,d,f)}))}var q=j.current,U=N.current,B=O.current,H=C.current,W="0px ".concat(r===-1?1:r,"px"),Y="".concat(r,"px ").concat(r,"px"),K=zU(["strokeDasharray"],g,typeof m=="string"?m:CI.animationEasing);return x.createElement(Td,{animationId:P,key:P,canBegin:r>0,duration:g,easing:m,isActive:b,begin:v},J=>{var se=Dt(q,c,J),me=Dt(U,d,J),L=Dt(B,a,J),M=Dt(H,o,J);n.current&&(j.current=se,N.current=me,O.current=L,C.current=M);var F;w?J>0?F={transition:K,strokeDasharray:Y}:F={strokeDasharray:W}:F={strokeDasharray:Y};var D=Or(t),{radius:V}=D,oe=NI(D,Wye);return x.createElement("path",Yy({},oe,{radius:typeof f=="number"?f:void 0,className:E,d:kI(L,M,se,me,f),ref:n,style:jI(jI({},F),t.style)}))})};function AI(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 OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){eve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eve(e,t,n){return(t=tve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tve(e){var t=nve(e,"string");return typeof t=="symbol"?t:t+""}function nve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zy=Math.PI/180,rve=e=>e*180/Math.PI,Vn=(e,t,n,r)=>({x:e+Math.cos(-Zy*r)*n,y:t+Math.sin(-Zy*r)*n}),LU=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},ive=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},ave=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=ive({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var c=(n-i)/o,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:o,angle:rve(d),angleInRadian:d}},sve=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}},ove=(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},lve=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=ave({x:n,y:r},t),{innerRadius:o,outerRadius:c}=t;if(i<o||i>c||i===0)return null;var{startAngle:d,endAngle:f}=sve(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?OI(OI({},t),{},{radius:i,angle:ove(p,t)}):null};function $U(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Vn(t,n,r,i),c=Vn(t,n,r,a);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var EI,_I,PI,TI,zI,RI,DI;function pN(){return pN=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},pN.apply(null,arguments)}function Hl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cve=(e,t)=>{var n=or(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},kg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:c,cornerIsExternal:d}=e,f=c*(o?1:-1)+r,p=Math.asin(c/f)/Zy,m=d?i:i+a*p,g=Vn(t,n,f,m),v=Vn(t,n,r,m),w=d?i-a*p:i,b=Vn(t,n,f*Math.cos(p*Zy),w);return{center:g,circleTangency:v,lineTangency:b,theta:p}},BU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,c=cve(a,o),d=a+c,f=Vn(t,n,i,a),p=Vn(t,n,i,d),m=On(EI||(EI=Hl(["M ",",",`
|
|
271
|
-
A `,",",`,0,
|
|
272
|
-
`,",",`,
|
|
273
|
-
`,",",`
|
|
274
|
-
`])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var g=Vn(t,n,r,a),v=Vn(t,n,r,d);m+=On(_I||(_I=Hl(["L ",",",`
|
|
275
|
-
A `,",",`,0,
|
|
276
|
-
`,",",`,
|
|
277
|
-
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),g.x,g.y)}else m+=On(PI||(PI=Hl(["L ",","," Z"])),t,n);return m},uve=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=or(f-d),{circleTangency:m,lineTangency:g,theta:v}=kg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:w,lineTangency:b,theta:j}=kg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:c}),N=c?Math.abs(d-f):Math.abs(d-f)-v-j;if(N<0)return o?On(TI||(TI=Hl(["M ",",",`
|
|
278
|
-
a`,",",",0,0,1,",`,0
|
|
279
|
-
a`,",",",0,0,1,",`,0
|
|
280
|
-
`])),g.x,g.y,a,a,a*2,a,a,-a*2):BU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=On(zI||(zI=Hl(["M ",",",`
|
|
281
|
-
A`,",",",0,0,",",",",",`
|
|
282
|
-
A`,",",",0,",",",",",",",`
|
|
283
|
-
A`,",",",0,0,",",",",",`
|
|
284
|
-
`])),g.x,g.y,a,a,+(p<0),m.x,m.y,i,i,+(N>180),+(p<0),w.x,w.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:A,theta:P}=kg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:E,lineTangency:_,theta:z}=kg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),I=c?Math.abs(d-f):Math.abs(d-f)-P-z;if(I<0&&a===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=On(RI||(RI=Hl(["L",",",`
|
|
285
|
-
A`,",",",0,0,",",",",",`
|
|
286
|
-
A`,",",",0,",",",",",",",`
|
|
287
|
-
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),E.x,E.y,r,r,+(I>180),+(p>0),C.x,C.y,a,a,+(p<0),A.x,A.y)}else O+=On(DI||(DI=Hl(["L",",","Z"])),t,n);return O},dve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},UU=e=>{var t=Un(e,dve),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var g=jt("recharts-sector",m),v=a-i,w=Ar(o,v,0,!0),b;return w>0&&Math.abs(f-p)<360?b=uve({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):b=BU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",pN({},Or(t),{className:g,d:b}))};function fve(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(y6(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:c}=t,d=Vn(r,i,a,c),f=Vn(r,i,o,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return $U(t)}}var gj={},yj={},vj={},II;function hve(){return II||(II=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(vj)),vj}var MI;function pve(){return MI||(MI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hve();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})(yj)),yj}var LI;function mve(){return LI||(LI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P6(),n=pve();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const c=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=o;return d}e.range=r})(gj)),gj}var xj,$I;function gve(){return $I||($I=1,xj=mve().range),xj}var yve=gve();const qU=ga(yve);var wa=e=>e.chartData,mp=ne([wa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),gp=(e,t,n,r)=>r?mp(e):wa(e),FU=(e,t,n)=>n?mp(e):wa(e),vve=ne([gp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),xve=ne([mp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),bve=ne([wa],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Ba(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ft(t)&&ft(n))return!0}return!1}function BI(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function KU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ft(n))i=n;else if(typeof n=="function")return;if(ft(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(Ba(o))return o}}function wve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ba(r))return BI(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,c;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Te(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&ED.test(i)){var d=ED.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(c=Math.max(...t));else if(Te(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&_D.test(a)){var p=_D.exec(a);if(p==null||p[1]==null||t==null)c=void 0;else{var m=+p[1];c=t[1]+m}}else c=t?.[1];var g=[o,c];if(Ba(g))return t==null?g:BI(g,t,n)}}}var Rd=1e9,Sve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},LC,mn=!0,Yi="[DecimalError] ",ec=Yi+"Invalid argument: ",MC=Yi+"Exponent out of range: ",Dd=Math.floor,Ll=Math.pow,jve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yi,sr=1e7,ln=7,HU=9007199254740991,Xy=Dd(HU/ln),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};De.decimalPlaces=De.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ln;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};De.dividedBy=De.div=function(e){return Ps(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return Yt(Ps(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return Wn(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(yi))throw Error(Yi+"NaN");if(n.s<1)throw Error(Yi+(n.s?"NaN":"-Infinity"));return n.eq(yi)?new r(0):(mn=!1,t=Ps(Fh(n,a),Fh(e,a),a),mn=!0,Yt(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?QU(t,e):GU(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Yi+"NaN");return n.s?(mn=!1,t=Ps(n,e,0,1).times(e),mn=!0,n.minus(t)):Yt(new r(n),i)};De.naturalExponential=De.exp=function(){return VU(this)};De.naturalLogarithm=De.ln=function(){return Fh(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GU(t,e):QU(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ec+e);if(t=Wn(i)+1,r=i.d.length-1,n=r*ln+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};De.squareRoot=De.sqrt=function(){var e,t,n,r,i,a,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Yi+"NaN")}for(e=Wn(c),mn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=$a(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Dd((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(Ps(c,a,o+2)).times(.5),$a(a.d).slice(0,o)===(t=$a(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Yt(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;o+=4}return mn=!0,Yt(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,c,d,f,p=this,m=p.constructor,g=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=g.length,f=v.length,d<f&&(a=g,g=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)c=a[i]+v[r]*g[i-r-1]+t,a[i--]=c%sr|0,t=c/sr|0;a[i]=(a[i]+t)%sr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,mn?Yt(e,m.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Qa(e,0,Rd),t===void 0?t=r.rounding:Qa(t,0,8),Yt(n,e+Wn(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=yc(r,!0):(Qa(e,0,Rd),t===void 0?t=i.rounding:Qa(t,0,8),r=Yt(new i(r),e+1,t),n=yc(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?yc(i):(Qa(e,0,Rd),t===void 0?t=a.rounding:Qa(t,0,8),r=Yt(new a(i),e+Wn(i)+1,t),n=yc(r.abs(),!1,e+Wn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return Yt(new t(e),Wn(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(yi);if(c=new d(c),!c.s){if(e.s<1)throw Error(Yi+"Infinity");return c}if(c.eq(yi))return c;if(r=d.precision,e.eq(yi))return Yt(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=c.s,o){if((n=p<0?-p:p)<=HU){for(i=new d(yi),t=Math.ceil(r/ln+4),mn=!1;n%2&&(i=i.times(c),qI(i.d,t)),n=Dd(n/2),n!==0;)c=c.times(c),qI(c.d,t);return mn=!0,e.s<0?new d(yi).div(i):Yt(i,r)}}else if(a<0)throw Error(Yi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,mn=!1,i=e.times(Fh(c,r+f)),mn=!0,i=VU(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Wn(i),r=yc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Qa(e,1,Rd),t===void 0?t=a.rounding:Qa(t,0,8),i=Yt(new a(i),e,t),n=Wn(i),r=yc(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Qa(e,1,Rd),t===void 0?t=r.rounding:Qa(t,0,8)),Yt(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Wn(e),n=e.constructor;return yc(e,t<=n.toExpNeg||t>=n.toExpPos)};function GU(e,t){var n,r,i,a,o,c,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),mn?Yt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,c=f.length):(r=f,i=o,c=d.length),o=Math.ceil(m/ln),c=o>c?o+1:c+1,a>c&&(a=c,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(c=d.length,a=f.length,c-a<0&&(a=c,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/sr|0,d[a]%=sr;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,mn?Yt(t,m):t}function Qa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ec+e)}function $a(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=ln-r.length,n&&(a+=Oo(n)),a+=r;o=e[t],r=o+"",n=ln-r.length,n&&(a+=Oo(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Ps=(function(){function e(r,i){var a,o=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+o,r[c]=a%sr|0,o=a/sr|0;return o&&r.unshift(o),r}function t(r,i,a,o){var c,d;if(a!=o)d=a>o?1:-1;else for(c=d=0;c<a;c++)if(r[c]!=i[c]){d=r[c]>i[c]?1:-1;break}return d}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*sr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var c,d,f,p,m,g,v,w,b,j,N,O,C,A,P,E,_,z,I=r.constructor,q=r.s==i.s?1:-1,U=r.d,B=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(Yi+"Division by zero");for(d=r.e-i.e,_=B.length,P=U.length,v=new I(q),w=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?O=a=I.precision:o?O=a+(Wn(r)-Wn(i))+1:O=a,O<0)return new I(0);if(O=O/ln+2|0,f=0,_==1)for(p=0,B=B[0],O++;(f<P||p)&&O--;f++)C=p*sr+(U[f]||0),w[f]=C/B|0,p=C%B|0;else{for(p=sr/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),_=B.length,P=U.length),A=_,b=U.slice(0,_),j=b.length;j<_;)b[j++]=0;z=B.slice(),z.unshift(0),E=B[0],B[1]>=sr/2&&++E;do p=0,c=t(B,b,_,j),c<0?(N=b[0],_!=j&&(N=N*sr+(b[1]||0)),p=N/E|0,p>1?(p>=sr&&(p=sr-1),m=e(B,p),g=m.length,j=b.length,c=t(m,b,g,j),c==1&&(p--,n(m,_<g?z:B,g))):(p==0&&(c=p=1),m=B.slice()),g=m.length,g<j&&m.unshift(0),n(b,m,j),c==-1&&(j=b.length,c=t(B,b,_,j),c<1&&(p++,n(b,_<j?z:B,j))),j=b.length):c===0&&(p++,b=[0]),w[f++]=p,c&&b[0]?b[j++]=U[A]||0:(b=[U[A]],j=1);while((A++<P||b[0]!==void 0)&&O--)}return w[0]||w.shift(),v.e=d,Yt(v,o?a+Wn(v)+1:a)}})();function VU(e,t){var n,r,i,a,o,c,d=0,f=0,p=e.constructor,m=p.precision;if(Wn(e)>16)throw Error(MC+Wn(e));if(!e.s)return new p(yi);for(mn=!1,c=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,c+=r,n=i=a=new p(yi),p.precision=c;;){if(i=Yt(i.times(e),c),n=n.times(++d),o=a.plus(Ps(i,n,c)),$a(o.d).slice(0,c)===$a(a.d).slice(0,c)){for(;f--;)a=Yt(a.times(a),c);return p.precision=m,t==null?(mn=!0,Yt(a,m)):a}a=o}}function Wn(e){for(var t=e.e*ln,n=e.d[0];n>=10;n/=10)t++;return t}function bj(e,t,n){if(t>e.LN10.sd())throw mn=!0,n&&(e.precision=n),Error(Yi+"LN10 precision limit exceeded");return Yt(new e(e.LN10),t)}function Oo(e){for(var t="";e--;)t+="0";return t}function Fh(e,t){var n,r,i,a,o,c,d,f,p,m=1,g=10,v=e,w=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Yi+(v.s?"NaN":"-Infinity"));if(v.eq(yi))return new b(0);if(t==null?(mn=!1,f=j):f=t,v.eq(10))return t==null&&(mn=!0),bj(b,f);if(f+=g,b.precision=f,n=$a(w),r=n.charAt(0),a=Wn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=$a(v.d),r=n.charAt(0),m++;a=Wn(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=bj(b,f+2,j).times(a+""),v=Fh(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=j,t==null?(mn=!0,Yt(v,j)):v;for(c=o=v=Ps(v.minus(yi),v.plus(yi),f),p=Yt(v.times(v),f),i=3;;){if(o=Yt(o.times(p),f),d=c.plus(Ps(o,new b(i),f)),$a(d.d).slice(0,f)===$a(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(bj(b,f+2,j).times(a+""))),c=Ps(c,new b(m),f),b.precision=j,t==null?(mn=!0,Yt(c,j)):c;c=d,i+=2}}function UI(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=Dd(n/ln),e.d=[],r=(n+1)%ln,n<0&&(r+=ln),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ln;r<i;)e.d.push(+t.slice(r,r+=ln));t=t.slice(r),r=ln-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),mn&&(e.e>Xy||e.e<-Xy))throw Error(MC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Yt(e,t,n){var r,i,a,o,c,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=ln,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/ln),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=ln,i=r-ln+o}if(n!==void 0&&(a=Ll(10,o-i-1),c=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?i>0?f/Ll(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Wn(e),m.length=1,t=t-a-1,m[0]=Ll(10,(ln-t%ln)%ln),e.e=Dd(-t/ln)||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,ln-r),m[p]=i>0?(f/Ll(10,o-i)%Ll(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==sr&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=sr)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(mn&&(e.e>Xy||e.e<-Xy))throw Error(MC+Wn(e));return e}function QU(e,t){var n,r,i,a,o,c,d,f,p,m,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),mn?Yt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/ln),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=d.length,c=m.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}o=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),c=d.length,i=m.length-c;i>0;--i)d[c++]=0;for(i=m.length;i>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=sr-1;--d[a],d[i]+=sr}d[i]-=m[i]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,mn?Yt(t,v):t):new g(0)}function yc(e,t,n){var r,i=Wn(e),a=$a(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Oo(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Oo(-i-1)+a,n&&(r=n-o)>0&&(a+=Oo(r))):i>=o?(a+=Oo(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Oo(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Oo(r))),e.s<0?"-"+a:a}function qI(e,t){if(e.length>t)return e.length=t,!0}function WU(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(ec+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 UI(o,a.toString())}else if(typeof a!="string")throw Error(ec+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,jve.test(a))UI(o,a);else throw Error(ec+a)}if(i.prototype=De,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=WU,i.config=i.set=Nve,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 Nve(e){if(!e||typeof e!="object")throw Error(Yi+"Object expected");var t,n,r,i=["precision",1,Rd,"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(Dd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ec+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ec+n+": "+r);return this}var LC=WU(Sve);yi=new LC(1);const St=LC;function YU(e){var t;return e===0?t=1:t=Math.floor(new St(e).abs().log(10).toNumber())+1,t}function ZU(e,t,n){for(var r=new St(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var XU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},$C=(e,t,n)=>{if(e.lte(0))return new St(0);var r=YU(e.toNumber()),i=new St(10).pow(r),a=e.div(i),o=r!==1?.05:.1,c=new St(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=c.mul(i);return t?new St(d.toNumber()):new St(Math.ceil(d.toNumber()))},JU=(e,t,n)=>{var r;if(e.lte(0))return new St(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new St(a).abs().log(10).toNumber()),c=new St(10).pow(o),d=e.div(c).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(c=c.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,c=c.mul(new St(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,g=new St(m).mul(c);return t?g:new St(Math.ceil(g.toNumber()))},kve=(e,t,n)=>{var r=new St(1),i=new St(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new St(10).pow(YU(e)-1),i=new St(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new St(Math.floor(e)))}else e===0?i=new St(Math.floor((t-1)/2)):n||(i=new St(Math.floor(e)));for(var o=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new St(d-o).mul(r)).toNumber());return c},eq=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]:$C;if(!Number.isFinite((n-t)/(r-1)))return{step:new St(0),tickMin:new St(0),tickMax:new St(0)};var c=o(new St(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new St(0):(d=new St(t).add(n).div(2),d=d.sub(new St(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new St(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?eq(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new St(f).mul(c)),tickMax:d.add(new St(p).mul(c))})},FI=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[d,f]=XU([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 kve(d,i,a);var m=o==="snap125"?JU:$C,{step:g,tickMin:v,tickMax:w}=eq(d,f,c,a,0,m),b=ZU(v,w.add(new St(.1).mul(g)),g);return n>r?b.reverse():b},KI=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,d]=XU([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=o==="snap125"?JU:$C,p=Math.max(n,2),m=f(new St(d).sub(c).div(p-1),a,0),g=[...ZU(new St(c),new St(d),m),d];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},tq=e=>e.rootProps.maxBarSize,Cve=e=>e.rootProps.barGap,nq=e=>e.rootProps.barCategoryGap,Ave=e=>e.rootProps.barSize,yp=e=>e.rootProps.stackOffset,rq=e=>e.rootProps.reverseStackOrder,BC=e=>e.options.chartName,UC=e=>e.rootProps.syncId,iq=e=>e.rootProps.syncMethod,qC=e=>e.options.eventEmitter,Ove=e=>e.rootProps.baseValue,Ln={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},_l={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},_a={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},E0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function _0(e,t,n){if(n!=="auto")return n;if(e!=null)return ba(e,t)?"category":"number"}function HI(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 Jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(n),!0).forEach(function(r){Eve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eve(e,t,n){return(t=_ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ve(e){var t=Pve(e,"string");return typeof t=="symbol"?t:t+""}function Pve(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={allowDataOverflow:_l.allowDataOverflow,allowDecimals:_l.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:_l.angleAxisId,includeHidden:!1,name:void 0,reversed:_l.reversed,scale:_l.scale,tick:_l.tick,tickCount:void 0,ticks:void 0,type:_l.type,unit:void 0,niceTicks:"auto"},VI={allowDataOverflow:_a.allowDataOverflow,allowDecimals:_a.allowDecimals,allowDuplicatedCategory:_a.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_a.radiusAxisId,includeHidden:_a.includeHidden,name:void 0,reversed:_a.reversed,scale:_a.scale,tick:_a.tick,tickCount:_a.tickCount,ticks:void 0,type:_a.type,unit:void 0,niceTicks:"auto"},Tve=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},FC=ne([Tve,bU],(e,t)=>{var n;if(e!=null)return e;var r=(n=_0(t,"angleAxis",GI.type))!==null&&n!==void 0?n:"category";return Jy(Jy({},GI),{},{type:r})}),zve=(e,t)=>e.polarAxis.radiusAxis[t],KC=ne([zve,bU],(e,t)=>{var n;if(e!=null)return e;var r=(n=_0(t,"radiusAxis",VI.type))!==null&&n!==void 0?n:"category";return Jy(Jy({},VI),{},{type:r})}),P0=e=>e.polarOptions,HC=ne([Bs,Us,nr],LU),aq=ne([P0,HC],(e,t)=>{if(e!=null)return Ar(e.innerRadius,t,0)}),sq=ne([P0,HC],(e,t)=>{if(e!=null)return Ar(e.outerRadius,t,t*.8)}),Rve=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},oq=ne([P0],Rve);ne([FC,oq],E0);var lq=ne([HC,aq,sq],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ne([KC,lq],E0);var cq=ne([Nt,P0,aq,sq,Bs,Us],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:c,startAngle:d,endAngle:f}=t;return{cx:Ar(o,i,i/2),cy:Ar(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Nn=(e,t)=>t,vp=(e,t,n)=>n;function T0(e){return e?.id}function uq(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(c=>{var d,f=(d=c.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=T0(c);f.forEach((m,g)=>{var v=a==null||i?g:String(_t(m,a,null)),w=_t(m,c.dataKey,0),b;o.has(v)?b=o.get(v):b={},Object.assign(b,{[p]:w}),o.set(v,b)})}}),Array.from(o.values())}function z0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var R0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function D0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Dve(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 ur=e=>{var t=Nt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Id=e=>e.tooltip.settings.axisId;function GC(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],c=i[1];return o<=c?a>=o&&a<=c:a>=c&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var c=e(a);if(c!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var dq=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ba(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];ft(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 Uo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ive(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function VC(e){let t,n,r;e.length!==2?(t=Uo,n=(c,d)=>Uo(e(c),d),r=(c,d)=>e(c)-d):(t=e===Uo||e===Ive?e:Mve,n=e,r=e);function i(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function o(c,d,f=0,p=c.length){const m=i(c,d,f,p-1);return m>f&&r(c[m-1],d)>-r(c[m],d)?m-1:m}return{left:i,center:o,right:a}}function Mve(){return 0}function fq(e){return e===null?NaN:+e}function*Lve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $ve=VC(Uo),xp=$ve.right;VC(fq).center;class QI extends Map{constructor(t,n=qve){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(WI(this,t))}has(t){return super.has(WI(this,t))}set(t,n){return super.set(Bve(this,t),n)}delete(t){return super.delete(Uve(this,t))}}function WI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Bve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Uve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qve(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fve(e=Uo){if(e===Uo)return hq;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 hq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Kve=Math.sqrt(50),Hve=Math.sqrt(10),Gve=Math.sqrt(2);function ev(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>=Kve?10:a>=Hve?5:a>=Gve?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?ev(e,t,n*2):[c,d,f]}function mN(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?ev(t,e,n):ev(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(a-f)/-o;else for(let f=0;f<c;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(i+f)/-o;else for(let f=0;f<c;++f)d[f]=(i+f)*o;return d}function gN(e,t,n){return t=+t,e=+e,n=+n,ev(e,t,n)[2]}function yN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gN(t,e,n):gN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function YI(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function ZI(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function pq(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?hq:Fve(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),g=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+g)),w=Math.min(r,Math.floor(t+(d-f)*m/d+g));pq(e,t,v,w,i)}const a=e[t];let o=n,c=r;for(eh(e,n,t),i(e[r],a)>0&&eh(e,n,r);o<c;){for(eh(e,o,c),++o,--c;i(e[o],a)<0;)++o;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?eh(e,n,c):(++c,eh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function eh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Vve(e,t,n){if(e=Float64Array.from(Lve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ZI(e);if(t>=1)return YI(e);var r,i=(r-1)*t,a=Math.floor(i),o=YI(pq(e,a).subarray(0,a+1)),c=ZI(e.subarray(a+1));return o+(c-o)*(i-a)}}function Qve(e,t,n=fq){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),c=+n(e[a+1],a+1,e);return o+(c-o)*(i-a)}}function Wve(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 ea(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qs(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 vN=Symbol("implicit");function QC(){var e=new QI,t=[],n=[],r=vN;function i(a){let o=e.get(a);if(o===void 0){if(r!==vN)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 QI;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 QC(t,n).unknown(r)},ea.apply(i,arguments),i}function WC(){var e=QC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,c=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var g=t().length,v=i<r,w=v?i:r,b=v?r:i;a=(b-w)/Math.max(1,g-d+f*2),c&&(a=Math.floor(a)),w+=(b-w-a*(g-d))*p,o=a*(1-d),c&&(w=Math.round(w),o=Math.round(o));var j=Wve(g).map(function(N){return w+a*N});return n(v?j.reverse():j)}return e.domain=function(g){return arguments.length?(t(g),m()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,c=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(c=!!g,m()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),m()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),m()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,m()):f},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),m()):p},e.copy=function(){return WC(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},ea.apply(m(),arguments)}function mq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return mq(t())},e}function Yve(){return mq(WC.apply(null,arguments).paddingInner(1))}function YC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bp(){}var Kh=.7,tv=1/Kh,Xu="\\s*([+-]?\\d+)\\s*",Hh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ua="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zve=/^#([0-9a-f]{3,8})$/,Xve=new RegExp(`^rgb\\(${Xu},${Xu},${Xu}\\)$`),Jve=new RegExp(`^rgb\\(${Ua},${Ua},${Ua}\\)$`),e0e=new RegExp(`^rgba\\(${Xu},${Xu},${Xu},${Hh}\\)$`),t0e=new RegExp(`^rgba\\(${Ua},${Ua},${Ua},${Hh}\\)$`),n0e=new RegExp(`^hsl\\(${Hh},${Ua},${Ua}\\)$`),r0e=new RegExp(`^hsla\\(${Hh},${Ua},${Ua},${Hh}\\)$`),XI={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};YC(bp,Gh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JI,formatHex:JI,formatHex8:i0e,formatHsl:a0e,formatRgb:eM,toString:eM});function JI(){return this.rgb().formatHex()}function i0e(){return this.rgb().formatHex8()}function a0e(){return yq(this).formatHsl()}function eM(){return this.rgb().formatRgb()}function Gh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tM(t):n===3?new ti(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cg(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=Xve.exec(e))?new ti(t[1],t[2],t[3],1):(t=Jve.exec(e))?new ti(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e0e.exec(e))?Cg(t[1],t[2],t[3],t[4]):(t=t0e.exec(e))?Cg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=n0e.exec(e))?iM(t[1],t[2]/100,t[3]/100,1):(t=r0e.exec(e))?iM(t[1],t[2]/100,t[3]/100,t[4]):XI.hasOwnProperty(e)?tM(XI[e]):e==="transparent"?new ti(NaN,NaN,NaN,0):null}function tM(e){return new ti(e>>16&255,e>>8&255,e&255,1)}function Cg(e,t,n,r){return r<=0&&(e=t=n=NaN),new ti(e,t,n,r)}function s0e(e){return e instanceof bp||(e=Gh(e)),e?(e=e.rgb(),new ti(e.r,e.g,e.b,e.opacity)):new ti}function xN(e,t,n,r){return arguments.length===1?s0e(e):new ti(e,t,n,r??1)}function ti(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}YC(ti,xN,gq(bp,{brighter(e){return e=e==null?tv:Math.pow(tv,e),new ti(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kh:Math.pow(Kh,e),new ti(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ti(tc(this.r),tc(this.g),tc(this.b),nv(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:nM,formatHex:nM,formatHex8:o0e,formatRgb:rM,toString:rM}));function nM(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}`}function o0e(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}${Gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function rM(){const e=nv(this.opacity);return`${e===1?"rgb(":"rgba("}${tc(this.r)}, ${tc(this.g)}, ${tc(this.b)}${e===1?")":`, ${e})`}`}function nv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gl(e){return e=tc(e),(e<16?"0":"")+e.toString(16)}function iM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fa(e,t,n,r)}function yq(e){if(e instanceof fa)return new fa(e.h,e.s,e.l,e.opacity);if(e instanceof bp||(e=Gh(e)),!e)return new fa;if(e instanceof fa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,c=a-i,d=(a+i)/2;return c?(t===a?o=(n-r)/c+(n<r)*6:n===a?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?a+i:2-a-i,o*=60):c=d>0&&d<1?0:o,new fa(o,c,d,e.opacity)}function l0e(e,t,n,r){return arguments.length===1?yq(e):new fa(e,t,n,r??1)}function fa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}YC(fa,l0e,gq(bp,{brighter(e){return e=e==null?tv:Math.pow(tv,e),new fa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kh:Math.pow(Kh,e),new fa(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 ti(wj(e>=240?e-240:e+120,i,r),wj(e,i,r),wj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fa(aM(this.h),Ag(this.s),Ag(this.l),nv(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=nv(this.opacity);return`${e===1?"hsl(":"hsla("}${aM(this.h)}, ${Ag(this.s)*100}%, ${Ag(this.l)*100}%${e===1?")":`, ${e})`}`}}));function aM(e){return e=(e||0)%360,e<0?e+360:e}function Ag(e){return Math.max(0,Math.min(1,e||0))}function wj(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 ZC=e=>()=>e;function c0e(e,t){return function(n){return e+n*t}}function u0e(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 d0e(e){return(e=+e)==1?vq:function(t,n){return n-t?u0e(t,n,e):ZC(isNaN(t)?n:t)}}function vq(e,t){var n=t-e;return n?c0e(e,n):ZC(isNaN(e)?t:e)}const sM=(function e(t){var n=d0e(t);function r(i,a){var o=n((i=xN(i)).r,(a=xN(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=vq(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function f0e(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 h0e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function p0e(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]=Md(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(c){for(o=0;o<r;++o)a[o]=i[o](c);return a}}function m0e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function rv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function g0e(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]=Md(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var bN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sj=new RegExp(bN.source,"g");function y0e(e){return function(){return e}}function v0e(e){return function(t){return e(t)+""}}function x0e(e,t){var n=bN.lastIndex=Sj.lastIndex=0,r,i,a,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=bN.exec(e))&&(i=Sj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[o]?c[o]+=a:c[++o]=a),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,d.push({i:o,x:rv(r,i)})),n=Sj.lastIndex;return n<t.length&&(a=t.slice(n),c[o]?c[o]+=a:c[++o]=a),c.length<2?d[0]?v0e(d[0].x):y0e(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)c[(m=d[p]).i]=m.x(f);return c.join("")})}function Md(e,t){var n=typeof t,r;return t==null||n==="boolean"?ZC(t):(n==="number"?rv:n==="string"?(r=Gh(t))?(t=r,sM):x0e:t instanceof Gh?sM:t instanceof Date?m0e:h0e(t)?f0e:Array.isArray(t)?p0e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?g0e:rv)(e,t)}function XC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function b0e(e,t){t===void 0&&(t=e,e=Md);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[c](o-c)}}function w0e(e){return function(){return e}}function iv(e){return+e}var oM=[0,1];function Ir(e){return e}function wN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:w0e(isNaN(t)?NaN:.5)}function S0e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function j0e(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=wN(i,r),a=n(o,a)):(r=wN(r,i),a=n(a,o)),function(c){return a(r(c))}}function N0e(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]=wN(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(c){var d=xp(e,c,1,r)-1;return a[d](i[d](c))}}function wp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function I0(){var e=oM,t=oM,n=Md,r,i,a,o=Ir,c,d,f;function p(){var g=Math.min(e.length,t.length);return o!==Ir&&(o=S0e(e[0],e[g-1])),c=g>2?N0e:j0e,d=f=null,m}function m(g){return g==null||isNaN(g=+g)?a:(d||(d=c(e.map(r),t,n)))(r(o(g)))}return m.invert=function(g){return o(i((f||(f=c(t,e.map(r),rv)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,iv),p()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=XC,p()},m.clamp=function(g){return arguments.length?(o=g?!0:Ir,p()):o!==Ir},m.interpolate=function(g){return arguments.length?(n=g,p()):n},m.unknown=function(g){return arguments.length?(a=g,m):a},function(g,v){return r=g,i=v,p()}}function JC(){return I0()(Ir,Ir)}function k0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function av(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 fd(e){return e=av(Math.abs(e)),e?e[1]:NaN}function C0e(e,t){return function(n,r){for(var i=n.length,a=[],o=0,c=e[0],d=0;i>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),a.push(n.substring(i-=c,i+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return a.reverse().join(t)}}function A0e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var O0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vh(e){if(!(t=O0e.exec(e)))throw new Error("invalid format: "+e);var t;return new eA({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]})}Vh.prototype=eA.prototype;function eA(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+""}eA.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 E0e(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 sv;function _0e(e,t){var n=av(e,t);if(!n)return sv=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(sv=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")+av(e,Math.max(0,t+a-1))[0]}function lM(e,t){var n=av(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 cM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:k0e,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)=>lM(e*100,t),r:lM,s:_0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uM(e){return e}var dM=Array.prototype.map,fM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function P0e(e){var t=e.grouping===void 0||e.thousands===void 0?uM:C0e(dM.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?uM:A0e(dM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,g){m=Vh(m);var v=m.fill,w=m.align,b=m.sign,j=m.symbol,N=m.zero,O=m.width,C=m.comma,A=m.precision,P=m.trim,E=m.type;E==="n"?(C=!0,E="g"):cM[E]||(A===void 0&&(A=12),P=!0,E="g"),(N||v==="0"&&w==="=")&&(N=!0,v="0",w="=");var _=(g&&g.prefix!==void 0?g.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),z=(j==="$"?r:/[%p]/.test(E)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),I=cM[E],q=/[defgprs%]/.test(E);A=A===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function U(B){var H=_,W=z,Y,K,J;if(E==="c")W=I(B)+W,B="";else{B=+B;var se=B<0||1/B<0;if(B=isNaN(B)?d:I(Math.abs(B),A),P&&(B=E0e(B)),se&&+B==0&&b!=="+"&&(se=!1),H=(se?b==="("?b:c:b==="-"||b==="("?"":b)+H,W=(E==="s"&&!isNaN(B)&&sv!==void 0?fM[8+sv/3]:"")+W+(se&&b==="("?")":""),q){for(Y=-1,K=B.length;++Y<K;)if(J=B.charCodeAt(Y),48>J||J>57){W=(J===46?i+B.slice(Y+1):B.slice(Y))+W,B=B.slice(0,Y);break}}}C&&!N&&(B=t(B,1/0));var me=H.length+B.length+W.length,L=me<O?new Array(O-me+1).join(v):"";switch(C&&N&&(B=t(L+B,L.length?O-W.length:1/0),L=""),w){case"<":B=H+B+W+L;break;case"=":B=H+L+B+W;break;case"^":B=L.slice(0,me=L.length>>1)+H+B+W+L.slice(me);break;default:B=L+H+B+W;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,g){var v=Math.max(-8,Math.min(8,Math.floor(fd(g)/3)))*3,w=Math.pow(10,-v),b=f((m=Vh(m),m.type="f",m),{suffix:fM[8+v/3]});return function(j){return b(w*j)}}return{format:f,formatPrefix:p}}var Og,tA,xq;T0e({thousands:",",grouping:[3],currency:["$",""]});function T0e(e){return Og=P0e(e),tA=Og.format,xq=Og.formatPrefix,Og}function z0e(e){return Math.max(0,-fd(Math.abs(e)))}function R0e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(fd(t)/3)))*3-fd(Math.abs(e)))}function D0e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,fd(t)-fd(e))+1}function bq(e,t,n,r){var i=yN(e,t,n),a;switch(r=Vh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=R0e(i,o))&&(r.precision=a),xq(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=D0e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=z0e(i))&&(r.precision=a-(r.type==="%")*2);break}}return tA(r)}function al(e){var t=e.domain;return e.ticks=function(n){var r=t();return mN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return bq(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],c=r[a],d,f,p=10;for(c<o&&(f=o,o=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=gN(o,c,n),f===d)return r[i]=o,r[a]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function wq(){var e=JC();return e.copy=function(){return wp(e,wq())},ea.apply(e,arguments),al(e)}function Sq(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,iv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Sq(e).unknown(t)},e=arguments.length?Array.from(e,iv):[0,1],al(n)}function jq(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 hM(e){return Math.log(e)}function pM(e){return Math.exp(e)}function I0e(e){return-Math.log(-e)}function M0e(e){return-Math.exp(-e)}function L0e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $0e(e){return e===10?L0e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function B0e(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 mM(e){return(t,n)=>-e(-t,n)}function nA(e){const t=e(hM,pM),n=t.domain;let r=10,i,a;function o(){return i=B0e(r),a=$0e(r),n()[0]<0?(i=mM(i),a=mM(a),e(I0e,M0e)):e(hM,pM),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let g=i(f),v=i(p),w,b;const j=c==null?10:+c;let N=[];if(!(r%1)&&v-g<j){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(w=1;w<r;++w)if(b=g<0?w/a(-g):w*a(g),!(b<f)){if(b>p)break;N.push(b)}}else for(;g<=v;++g)for(w=r-1;w>=1;--w)if(b=g>0?w/a(-g):w*a(g),!(b<f)){if(b>p)break;N.push(b)}N.length*2<j&&(N=mN(f,p,j))}else N=mN(g,v,Math.min(v-g,j)).map(a);return m?N.reverse():N},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Vh(d)).precision==null&&(d.trim=!0),d=tA(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(jq(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function Nq(){const e=nA(I0()).domain([1,10]);return e.copy=()=>wp(e,Nq()).base(e.base()),ea.apply(e,arguments),e}function gM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function yM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rA(e){var t=1,n=e(gM(t),yM(t));return n.constant=function(r){return arguments.length?e(gM(t=+r),yM(t)):t},al(n)}function kq(){var e=rA(I0());return e.copy=function(){return wp(e,kq()).constant(e.constant())},ea.apply(e,arguments)}function vM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function U0e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function q0e(e){return e<0?-e*e:e*e}function iA(e){var t=e(Ir,Ir),n=1;function r(){return n===1?e(Ir,Ir):n===.5?e(U0e,q0e):e(vM(n),vM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},al(t)}function aA(){var e=iA(I0());return e.copy=function(){return wp(e,aA()).exponent(e.exponent())},ea.apply(e,arguments),e}function F0e(){return aA.apply(null,arguments).exponent(.5)}function xM(e){return Math.sign(e)*e*e}function K0e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Cq(){var e=JC(),t=[0,1],n=!1,r;function i(a){var o=K0e(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(xM(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,iv)).map(xM)),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 Cq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ea.apply(i,arguments),al(i)}function Aq(){var e=[],t=[],n=[],r;function i(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=Qve(e,o/c);return a}function a(o){return o==null||isNaN(o=+o)?r:t[xp(n,o)]}return a.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Uo),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 Aq().domain(e).range(t).unknown(r)},ea.apply(a,arguments)}function Oq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[xp(r,d,0,n)]:a}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Oq().domain([e,t]).range(i).unknown(a)},ea.apply(al(o),arguments)}function Eq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[xp(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 Eq().domain(e).range(t).unknown(n)},ea.apply(i,arguments)}const jj=new Date,Nj=new Date;function rr(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<o);return d},i.filter=a=>rr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!a(o););else for(;--c>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(jj.setTime(+a),Nj.setTime(+o),e(jj),e(Nj),Math.floor(n(jj,Nj))),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 ov=rr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ov.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?rr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ov);ov.range;const Os=1e3,Hi=Os*60,Es=Hi*60,Ds=Es*24,sA=Ds*7,bM=Ds*30,kj=Ds*365,Vl=rr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Os)},(e,t)=>(t-e)/Os,e=>e.getUTCSeconds());Vl.range;const oA=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Os)},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getMinutes());oA.range;const lA=rr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCMinutes());lA.range;const cA=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Os-e.getMinutes()*Hi)},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getHours());cA.range;const uA=rr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getUTCHours());uA.range;const Sp=rr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hi)/Ds,e=>e.getDate()-1);Sp.range;const M0=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ds,e=>e.getUTCDate()-1);M0.range;const _q=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ds,e=>Math.floor(e/Ds));_q.range;function Tc(e){return rr(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())*Hi)/sA)}const L0=Tc(0),lv=Tc(1),H0e=Tc(2),G0e=Tc(3),hd=Tc(4),V0e=Tc(5),Q0e=Tc(6);L0.range;lv.range;H0e.range;G0e.range;hd.range;V0e.range;Q0e.range;function zc(e){return rr(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)/sA)}const $0=zc(0),cv=zc(1),W0e=zc(2),Y0e=zc(3),pd=zc(4),Z0e=zc(5),X0e=zc(6);$0.range;cv.range;W0e.range;Y0e.range;pd.range;Z0e.range;X0e.range;const dA=rr(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());dA.range;const fA=rr(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());fA.range;const Is=rr(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());Is.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});Is.range;const Ms=rr(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());Ms.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});Ms.range;function Pq(e,t,n,r,i,a){const o=[[Vl,1,Os],[Vl,5,5*Os],[Vl,15,15*Os],[Vl,30,30*Os],[a,1,Hi],[a,5,5*Hi],[a,15,15*Hi],[a,30,30*Hi],[i,1,Es],[i,3,3*Es],[i,6,6*Es],[i,12,12*Es],[r,1,Ds],[r,2,2*Ds],[n,1,sA],[t,1,bM],[t,3,3*bM],[e,1,kj]];function c(f,p,m){const g=p<f;g&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return g?w.reverse():w}function d(f,p,m){const g=Math.abs(p-f)/m,v=VC(([,,j])=>j).right(o,g);if(v===o.length)return e.every(yN(f/kj,p/kj,m));if(v===0)return ov.every(Math.max(yN(f,p,m),1));const[w,b]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return w.every(b)}return[c,d]}const[J0e,exe]=Pq(Ms,fA,$0,_q,uA,lA),[txe,nxe]=Pq(Is,dA,L0,Sp,cA,oA);function Cj(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 Aj(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 th(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rxe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=nh(i),p=rh(i),m=nh(a),g=rh(a),v=nh(o),w=rh(o),b=nh(c),j=rh(c),N=nh(d),O=rh(d),C={a:J,A:se,b:me,B:L,c:null,d:CM,e:CM,f:Cxe,g:Ixe,G:Lxe,H:jxe,I:Nxe,j:kxe,L:Tq,m:Axe,M:Oxe,p:M,q:F,Q:EM,s:_M,S:Exe,u:_xe,U:Pxe,V:Txe,w:zxe,W:Rxe,x:null,X:null,y:Dxe,Y:Mxe,Z:$xe,"%":OM},A={a:D,A:V,b:oe,B:re,c:null,d:AM,e:AM,f:Fxe,g:Jxe,G:tbe,H:Bxe,I:Uxe,j:qxe,L:Rq,m:Kxe,M:Hxe,p:Ce,q:je,Q:EM,s:_M,S:Gxe,u:Vxe,U:Qxe,V:Wxe,w:Yxe,W:Zxe,x:null,X:null,y:Xxe,Y:ebe,Z:nbe,"%":OM},P={a:q,A:U,b:B,B:H,c:W,d:NM,e:NM,f:xxe,g:jM,G:SM,H:kM,I:kM,j:mxe,L:vxe,m:pxe,M:gxe,p:I,q:hxe,Q:wxe,s:Sxe,S:yxe,u:lxe,U:cxe,V:uxe,w:oxe,W:dxe,x:Y,X:K,y:jM,Y:SM,Z:fxe,"%":bxe};C.x=E(n,C),C.X=E(r,C),C.c=E(t,C),A.x=E(n,A),A.X=E(r,A),A.c=E(t,A);function E(ee,pe){return function(Ee){var X=[],Ke=-1,ze=0,at=ee.length,Ve,Gt,$t;for(Ee instanceof Date||(Ee=new Date(+Ee));++Ke<at;)ee.charCodeAt(Ke)===37&&(X.push(ee.slice(ze,Ke)),(Gt=wM[Ve=ee.charAt(++Ke)])!=null?Ve=ee.charAt(++Ke):Gt=Ve==="e"?" ":"0",($t=pe[Ve])&&(Ve=$t(Ee,Gt)),X.push(Ve),ze=Ke+1);return X.push(ee.slice(ze,Ke)),X.join("")}}function _(ee,pe){return function(Ee){var X=th(1900,void 0,1),Ke=z(X,ee,Ee+="",0),ze,at;if(Ke!=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(pe&&!("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?(ze=Aj(th(X.y,0,1)),at=ze.getUTCDay(),ze=at>4||at===0?cv.ceil(ze):cv(ze),ze=M0.offset(ze,(X.V-1)*7),X.y=ze.getUTCFullYear(),X.m=ze.getUTCMonth(),X.d=ze.getUTCDate()+(X.w+6)%7):(ze=Cj(th(X.y,0,1)),at=ze.getDay(),ze=at>4||at===0?lv.ceil(ze):lv(ze),ze=Sp.offset(ze,(X.V-1)*7),X.y=ze.getFullYear(),X.m=ze.getMonth(),X.d=ze.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),at="Z"in X?Aj(th(X.y,0,1)).getUTCDay():Cj(th(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(at+5)%7:X.w+X.U*7-(at+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Aj(X)):Cj(X)}}function z(ee,pe,Ee,X){for(var Ke=0,ze=pe.length,at=Ee.length,Ve,Gt;Ke<ze;){if(X>=at)return-1;if(Ve=pe.charCodeAt(Ke++),Ve===37){if(Ve=pe.charAt(Ke++),Gt=P[Ve in wM?pe.charAt(Ke++):Ve],!Gt||(X=Gt(ee,Ee,X))<0)return-1}else if(Ve!=Ee.charCodeAt(X++))return-1}return X}function I(ee,pe,Ee){var X=f.exec(pe.slice(Ee));return X?(ee.p=p.get(X[0].toLowerCase()),Ee+X[0].length):-1}function q(ee,pe,Ee){var X=v.exec(pe.slice(Ee));return X?(ee.w=w.get(X[0].toLowerCase()),Ee+X[0].length):-1}function U(ee,pe,Ee){var X=m.exec(pe.slice(Ee));return X?(ee.w=g.get(X[0].toLowerCase()),Ee+X[0].length):-1}function B(ee,pe,Ee){var X=N.exec(pe.slice(Ee));return X?(ee.m=O.get(X[0].toLowerCase()),Ee+X[0].length):-1}function H(ee,pe,Ee){var X=b.exec(pe.slice(Ee));return X?(ee.m=j.get(X[0].toLowerCase()),Ee+X[0].length):-1}function W(ee,pe,Ee){return z(ee,t,pe,Ee)}function Y(ee,pe,Ee){return z(ee,n,pe,Ee)}function K(ee,pe,Ee){return z(ee,r,pe,Ee)}function J(ee){return o[ee.getDay()]}function se(ee){return a[ee.getDay()]}function me(ee){return d[ee.getMonth()]}function L(ee){return c[ee.getMonth()]}function M(ee){return i[+(ee.getHours()>=12)]}function F(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return o[ee.getUTCDay()]}function V(ee){return a[ee.getUTCDay()]}function oe(ee){return d[ee.getUTCMonth()]}function re(ee){return c[ee.getUTCMonth()]}function Ce(ee){return i[+(ee.getUTCHours()>=12)]}function je(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var pe=E(ee+="",C);return pe.toString=function(){return ee},pe},parse:function(ee){var pe=_(ee+="",!1);return pe.toString=function(){return ee},pe},utcFormat:function(ee){var pe=E(ee+="",A);return pe.toString=function(){return ee},pe},utcParse:function(ee){var pe=_(ee+="",!0);return pe.toString=function(){return ee},pe}}}var wM={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,ixe=/^%/,axe=/[\\^$*+?|[\]().{}]/g;function Pt(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 sxe(e){return e.replace(axe,"\\$&")}function nh(e){return new RegExp("^(?:"+e.map(sxe).join("|")+")","i")}function rh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function oxe(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function lxe(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function cxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function uxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function dxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function SM(e,t,n){var r=dr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function jM(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fxe(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 hxe(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function pxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NM(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mxe(e,t,n){var r=dr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kM(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function gxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yxe(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function vxe(e,t,n){var r=dr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xxe(e,t,n){var r=dr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function bxe(e,t,n){var r=ixe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wxe(e,t,n){var r=dr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Sxe(e,t,n){var r=dr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function CM(e,t){return Pt(e.getDate(),t,2)}function jxe(e,t){return Pt(e.getHours(),t,2)}function Nxe(e,t){return Pt(e.getHours()%12||12,t,2)}function kxe(e,t){return Pt(1+Sp.count(Is(e),e),t,3)}function Tq(e,t){return Pt(e.getMilliseconds(),t,3)}function Cxe(e,t){return Tq(e,t)+"000"}function Axe(e,t){return Pt(e.getMonth()+1,t,2)}function Oxe(e,t){return Pt(e.getMinutes(),t,2)}function Exe(e,t){return Pt(e.getSeconds(),t,2)}function _xe(e){var t=e.getDay();return t===0?7:t}function Pxe(e,t){return Pt(L0.count(Is(e)-1,e),t,2)}function zq(e){var t=e.getDay();return t>=4||t===0?hd(e):hd.ceil(e)}function Txe(e,t){return e=zq(e),Pt(hd.count(Is(e),e)+(Is(e).getDay()===4),t,2)}function zxe(e){return e.getDay()}function Rxe(e,t){return Pt(lv.count(Is(e)-1,e),t,2)}function Dxe(e,t){return Pt(e.getFullYear()%100,t,2)}function Ixe(e,t){return e=zq(e),Pt(e.getFullYear()%100,t,2)}function Mxe(e,t){return Pt(e.getFullYear()%1e4,t,4)}function Lxe(e,t){var n=e.getDay();return e=n>=4||n===0?hd(e):hd.ceil(e),Pt(e.getFullYear()%1e4,t,4)}function $xe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pt(t/60|0,"0",2)+Pt(t%60,"0",2)}function AM(e,t){return Pt(e.getUTCDate(),t,2)}function Bxe(e,t){return Pt(e.getUTCHours(),t,2)}function Uxe(e,t){return Pt(e.getUTCHours()%12||12,t,2)}function qxe(e,t){return Pt(1+M0.count(Ms(e),e),t,3)}function Rq(e,t){return Pt(e.getUTCMilliseconds(),t,3)}function Fxe(e,t){return Rq(e,t)+"000"}function Kxe(e,t){return Pt(e.getUTCMonth()+1,t,2)}function Hxe(e,t){return Pt(e.getUTCMinutes(),t,2)}function Gxe(e,t){return Pt(e.getUTCSeconds(),t,2)}function Vxe(e){var t=e.getUTCDay();return t===0?7:t}function Qxe(e,t){return Pt($0.count(Ms(e)-1,e),t,2)}function Dq(e){var t=e.getUTCDay();return t>=4||t===0?pd(e):pd.ceil(e)}function Wxe(e,t){return e=Dq(e),Pt(pd.count(Ms(e),e)+(Ms(e).getUTCDay()===4),t,2)}function Yxe(e){return e.getUTCDay()}function Zxe(e,t){return Pt(cv.count(Ms(e)-1,e),t,2)}function Xxe(e,t){return Pt(e.getUTCFullYear()%100,t,2)}function Jxe(e,t){return e=Dq(e),Pt(e.getUTCFullYear()%100,t,2)}function ebe(e,t){return Pt(e.getUTCFullYear()%1e4,t,4)}function tbe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?pd(e):pd.ceil(e),Pt(e.getUTCFullYear()%1e4,t,4)}function nbe(){return"+0000"}function OM(){return"%"}function EM(e){return+e}function _M(e){return Math.floor(+e/1e3)}var ku,Iq,Mq;rbe({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 rbe(e){return ku=rxe(e),Iq=ku.format,ku.parse,Mq=ku.utcFormat,ku.utcParse,ku}function ibe(e){return new Date(e)}function abe(e){return e instanceof Date?+e:+new Date(+e)}function hA(e,t,n,r,i,a,o,c,d,f){var p=JC(),m=p.invert,g=p.domain,v=f(".%L"),w=f(":%S"),b=f("%I:%M"),j=f("%I %p"),N=f("%a %d"),O=f("%b %d"),C=f("%B"),A=f("%Y");function P(E){return(d(E)<E?v:c(E)<E?w:o(E)<E?b:a(E)<E?j:r(E)<E?i(E)<E?N:O:n(E)<E?C:A)(E)}return p.invert=function(E){return new Date(m(E))},p.domain=function(E){return arguments.length?g(Array.from(E,abe)):g().map(ibe)},p.ticks=function(E){var _=g();return e(_[0],_[_.length-1],E??10)},p.tickFormat=function(E,_){return _==null?P:f(_)},p.nice=function(E){var _=g();return(!E||typeof E.range!="function")&&(E=t(_[0],_[_.length-1],E??10)),E?g(jq(_,E)):p},p.copy=function(){return wp(p,hA(e,t,n,r,i,a,o,c,d,f))},p}function sbe(){return ea.apply(hA(txe,nxe,Is,dA,L0,Sp,cA,oA,Vl,Iq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function obe(){return ea.apply(hA(J0e,exe,Ms,fA,$0,M0,uA,lA,Vl,Mq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function B0(){var e=0,t=1,n,r,i,a,o=Ir,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(i===0?.5:(m=(a(m)-n)*i,c?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(c=!!m,f):c},f.interpolator=function(m){return arguments.length?(o=m,f):o};function p(m){return function(g){var v,w;return arguments.length?([v,w]=g,o=m(v,w),f):[o(0),o(1)]}}return f.range=p(Md),f.rangeRound=p(XC),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 sl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Lq(){var e=al(B0()(Ir));return e.copy=function(){return sl(e,Lq())},qs.apply(e,arguments)}function $q(){var e=nA(B0()).domain([1,10]);return e.copy=function(){return sl(e,$q()).base(e.base())},qs.apply(e,arguments)}function Bq(){var e=rA(B0());return e.copy=function(){return sl(e,Bq()).constant(e.constant())},qs.apply(e,arguments)}function pA(){var e=iA(B0());return e.copy=function(){return sl(e,pA()).exponent(e.exponent())},qs.apply(e,arguments)}function lbe(){return pA.apply(null,arguments).exponent(.5)}function Uq(){var e=[],t=Ir;function n(r){if(r!=null&&!isNaN(r=+r))return t((xp(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(Uo),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)=>Vve(e,a/r))},n.copy=function(){return Uq(t).domain(e)},qs.apply(n,arguments)}function U0(){var e=0,t=.5,n=1,r=1,i,a,o,c,d,f=Ir,p,m=!1,g;function v(b){return isNaN(b=+b)?g:(b=.5+((b=+p(b))-a)*(r*b<r*a?c:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),o=p(n=+n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(b){return arguments.length?(m=!!b,v):m},v.interpolator=function(b){return arguments.length?(f=b,v):f};function w(b){return function(j){var N,O,C;return arguments.length?([N,O,C]=j,f=b0e(b,[N,O,C]),v):[f(0),f(.5),f(1)]}}return v.range=w(Md),v.rangeRound=w(XC),v.unknown=function(b){return arguments.length?(g=b,v):g},function(b){return p=b,i=b(e),a=b(t),o=b(n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function qq(){var e=al(U0()(Ir));return e.copy=function(){return sl(e,qq())},qs.apply(e,arguments)}function Fq(){var e=nA(U0()).domain([.1,1,10]);return e.copy=function(){return sl(e,Fq()).base(e.base())},qs.apply(e,arguments)}function Kq(){var e=rA(U0());return e.copy=function(){return sl(e,Kq()).constant(e.constant())},qs.apply(e,arguments)}function mA(){var e=iA(U0());return e.copy=function(){return sl(e,mA()).exponent(e.exponent())},qs.apply(e,arguments)}function cbe(){return mA.apply(null,arguments).exponent(.5)}const Hq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:WC,scaleDiverging:qq,scaleDivergingLog:Fq,scaleDivergingPow:mA,scaleDivergingSqrt:cbe,scaleDivergingSymlog:Kq,scaleIdentity:Sq,scaleImplicit:vN,scaleLinear:wq,scaleLog:Nq,scaleOrdinal:QC,scalePoint:Yve,scalePow:aA,scaleQuantile:Aq,scaleQuantize:Oq,scaleRadial:Cq,scaleSequential:Lq,scaleSequentialLog:$q,scaleSequentialPow:pA,scaleSequentialQuantile:Uq,scaleSequentialSqrt:lbe,scaleSequentialSymlog:Bq,scaleSqrt:F0e,scaleSymlog:kq,scaleThreshold:Eq,scaleTime:sbe,scaleUtc:obe,tickFormat:bq},Symbol.toStringTag,{value:"Module"}));function ube(e){var t=Hq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(op(e));if(n in t&&typeof t[n]=="function")return t[n]()}function PM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=ube(e);if(r!=null)return r.domain(t).range(n),r}}function gA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?PM(e.scale,n,r):PM(t,n,r)}function dbe(e){return"scale".concat(op(e))}function fbe(e){return dbe(e)in Hq}var Gq=(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 fbe(r)?r:"point"}};function hbe(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 Vq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,c,d=hbe(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function pbe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Vq(e,void 0)}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 uv(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){mbe(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 mbe(e,t,n){return(t=gbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gbe(e){var t=ybe(e,"string");return typeof t=="symbol"?t:t+""}function ybe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SN=[0,"auto"],Jn={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"},Qq=(e,t)=>e.cartesianAxis.xAxis[t],Fs=(e,t)=>{var n=Qq(e,t);return n??Jn},er={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:SN,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:dp},Wq=(e,t)=>e.cartesianAxis.yAxis[t],Ks=(e,t)=>{var n=Wq(e,t);return n??er},vbe={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:""},yA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??vbe},Pn=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Ks(e,n);case"zAxis":return yA(e,n);case"angleAxis":return FC(e,n);case"radiusAxis":return KC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},xbe=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Ks(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ld=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Ks(e,n);case"angleAxis":return FC(e,n);case"radiusAxis":return KC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Yq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function vA(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 jp=e=>e.graphicalItems.cartesianItems,bbe=ne([Nn,vp],vA),xA=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),$d=ne([jp,Pn,bbe],xA,{memoizeOptions:{resultEqualityCheck:D0}}),Zq=ne([$d],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(z0)),Xq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),wbe=ne([$d],Xq),bA=e=>e.map(t=>t.data).filter(Boolean).flat(1),Sbe=ne([$d],e=>e.some(t=>!t.data)),Jq=ne([$d],bA,{memoizeOptions:{resultEqualityCheck:D0}}),wA=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},SA=ne([Jq,gp],wA),eF=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:_t(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:_t(i,r)}))):e.map(r=>({value:r})),tF=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:c,dataEndIndex:d}=r,f=eF(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(c,d+1),m=p.map(g=>({value:_t(g,t.dataKey)})).filter(g=>g.value!=null);return[...m,...f]}return f},Np=ne([SA,Pn,$d,gp,Sbe,Jq],tF);function Ju(e){if(Ha(e)||e instanceof Date){var t=Number(e);if(ft(t))return t}}function zM(e){if(Array.isArray(e)){var t=[Ju(e[0]),Ju(e[1])];return Ba(t)?t:void 0}var n=Ju(e);if(n!=null)return[n,n]}function Wa(e){return e.map(Ju).filter(ei)}function jbe(e,t){var n=Ju(e),r=Ju(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Nbe=ne([Np],e=>e?.map(t=>t.value).sort(jbe));function nF(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function kbe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!pa(t))r=t;else if(Array.isArray(t)){var i=Wa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Wa(n.flatMap(a=>{var o=_t(e,a.dataKey),c,d;if(Array.isArray(o)?[c,d]=o:c=d=o,!(!ft(c)||!ft(d)))return[r-c,r+d]}))}var ir=e=>{var t=ur(e),n=Id(e);return Ld(e,t,n)},md=ne([ir],e=>e?.dataKey),Cbe=ne([Zq,gp,ir],uq),rF=(e,t,n,r)=>{var i={},a=t.reduce((o,c)=>{if(c.stackId==null)return o;var d=o[c.stackId];return d==null&&(d=[]),d.push(c),o[c.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[c,d]=o,f=r?[...d].reverse():d,p=f.map(T0);return[c,{stackedData:mme(e,p,n),graphicalItems:f}]}))},dv=ne([Cbe,Zq,yp,rq],rF),iF=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=xme(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Abe=ne([Pn],e=>e.allowDataOverflow),jA=e=>{var t;if(e==null||!("domain"in e))return SN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Wa(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:SN},NA=ne([Pn],jA),kA=ne([NA,Abe],KU),Obe=ne([dv,wa,Nn,kA],iF,{memoizeOptions:{resultEqualityCheck:R0}}),q0=e=>e.errorBars,Ebe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>nF(n,r)),fv=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),c=Math.max(...a);return[o,c]}},CA=function(t,n,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:o,g=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>nF(a,v));m.forEach(v=>{var w,b=_t(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=kbe(v,b,g);if(j.length>=2){var N=Math.min(...j),O=Math.max(...j);(c==null||N<c)&&(c=N),(d==null||O>d)&&(d=O)}var C=zM(b);C!=null&&(c=c==null?C[0]:Math.min(c,C[0]),d=d==null?C[1]:Math.max(d,C[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=zM(_t(f,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),ft(c)&&ft(d))return[c,d]},_be=ne([SA,Pn,wbe,q0,Nn,vve],CA,{memoizeOptions:{resultEqualityCheck:R0}});function Pbe(e){var{value:t}=e;if(Ha(t)||t instanceof Date)return t}var Tbe=(e,t,n)=>{var r=e.map(Pbe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&p6(r))?qU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},aF=e=>e.referenceElements.dots,Bd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),zbe=ne([aF,Nn,vp],Bd),sF=e=>e.referenceElements.areas,Rbe=ne([sF,Nn,vp],Bd),oF=e=>e.referenceElements.lines,Dbe=ne([oF,Nn,vp],Bd),lF=(e,t)=>{if(e!=null){var n=Wa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ibe=ne(zbe,Nn,lF),cF=(e,t)=>{if(e!=null){var n=Wa(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)]}},Mbe=ne([Rbe,Nn],cF);function Lbe(e){var t;if(e.x!=null)return Wa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Wa(n)}function $be(e){var t;if(e.y!=null)return Wa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Wa(n)}var uF=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Lbe(r):$be(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Bbe=ne([Dbe,Nn],uF),Ube=ne(Ibe,Bbe,Mbe,(e,t,n)=>fv(e,n,t)),AA=(e,t,n,r,i,a,o,c)=>{if(n!=null)return n;var d=o==="vertical"&&c==="xAxis"||o==="horizontal"&&c==="yAxis",f=d?fv(r,a,i):fv(a,i);return wve(t,f,e.allowDataOverflow)},qbe=ne([Pn,NA,kA,Obe,_be,Ube,Nt,Nn],AA,{memoizeOptions:{resultEqualityCheck:R0}}),Fbe=[0,1],OA=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:c,type:d}=e,f=ba(t,a);if(f&&c==null){var p;return qU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Tbe(r,e,f):i==="expand"&&!f?Fbe:o}},EA=ne([Pn,Nt,SA,Np,yp,Nn,qbe],OA),ol=ne([Pn,Yq,BC],Gq),_A=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=jA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ba(e)){if(a)return FI(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return KI(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Ba(e))return FI(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ba(e))return KI(e,t.tickCount,t.allowDecimals,"adaptive")}}},PA=ne([EA,Ld,ol],_A),TA=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Ba(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,c),Math.max(d,f)]}return t},Kbe=ne([Pn,EA,PA,Nn],TA),Hbe=ne(Np,Pn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Wa(e.map(m=>m.value))).sort((m,g)=>m-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var c=0;c<r.length-1;c++){var d=r[c],f=r[c+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/o}}),dF=ne(Hbe,Nt,nq,nr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ft(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Ar(n,e*a),c=e*a/2;return c-o-(c-o)/a*o}return 0}),Gbe=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:dF(e,"xAxis",t,n,r.padding)},Vbe=(e,t,n)=>{var r=Ks(e,t);return r==null||typeof r.padding!="string"?0:dF(e,"yAxis",t,n,r.padding)},Qbe=ne(Fs,Gbe,(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}}),Wbe=ne(Ks,Vbe,(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}}),Ybe=ne([nr,Qbe,N0,j0,(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]}),Zbe=ne([nr,Nt,Wbe,N0,j0,(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]}),kp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Ybe(e,n,r);case"yAxis":return Zbe(e,n,r);case"zAxis":return(i=yA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return oq(e);case"radiusAxis":return lq(e,n);default:return}},fF=ne([Pn,kp],E0),Xbe=ne([ol,Kbe],dq),zA=ne([Pn,ol,Xbe,fF],gA),hF=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=ba(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},RA=ne([Nt,Np,Ld,Nn],hF),F0=ne([zA],GC);ne([zA],pbe);ne([zA,Nbe],Vq);ne([$d,q0,Nn],Ebe);function pF(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var K0=(e,t)=>t,H0=(e,t,n)=>n,Jbe=ne(w0,K0,H0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(pF)),ewe=ne(S0,K0,H0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(pF)),mF=(e,t)=>({width:e.width,height:t.height}),twe=(e,t)=>{var n=typeof t.width=="number"?t.width:dp;return{width:n,height:e.height}},gF=ne(nr,Fs,mF),nwe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},rwe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},iwe=ne(Us,nr,Jbe,K0,H0,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=mF(t,c);o==null&&(o=nwe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),awe=ne(Bs,nr,ewe,K0,H0,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=twe(t,c);o==null&&(o=rwe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),swe=(e,t)=>{var n=Fs(e,t);if(n!=null)return iwe(e,n.orientation,n.mirror)},owe=ne([nr,Fs,swe,(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}}}),lwe=(e,t)=>{var n=Ks(e,t);if(n!=null)return awe(e,n.orientation,n.mirror)},cwe=ne([nr,Ks,lwe,(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}}}),yF=ne(nr,Ks,(e,t)=>{var n=typeof t.width=="number"?t.width:dp;return{width:n,height:e.height}}),RM=(e,t,n)=>{switch(t){case"xAxis":return gF(e,n).width;case"yAxis":return yF(e,n).height;default:return}},vF=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,c=ba(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&c&&a==="category"&&i&&p6(f))return d}},DA=ne([Nt,Np,Pn,Nn],vF),DM=ne([Nt,xbe,ol,F0,DA,RA,kp,PA,Nn],(e,t,n,r,i,a,o,c,d)=>{if(t!=null){var f=ba(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:c,range:o,realScaleType:n,scale:r}}}),uwe=(e,t,n,r,i,a,o,c,d)=>{if(!(t==null||r==null)){var f=ba(e,d),{type:p,ticks:m,tickCount:g}=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?or(a[0]-a[1])*2*w:w;var b=m||i;return b?b.map((j,N)=>{var O=o?o.indexOf(j):j,C=r.map(O);return ft(C)?{index:N,coordinate:C+w,value:j,offset:w}:null}).filter(ei):f&&c?c.map((j,N)=>{var O=r.map(j);return ft(O)?{coordinate:O+w,value:j,index:N,offset:w}:null}).filter(ei):r.ticks?r.ticks(g).map((j,N)=>{var O=r.map(j);return ft(O)?{coordinate:O+w,value:j,index:N,offset:w}:null}).filter(ei):r.domain().map((j,N)=>{var O=r.map(j);return ft(O)?{coordinate:O+w,value:o?o[j]:j,index:N,offset:w}:null}).filter(ei)}},xF=ne([Nt,Ld,ol,F0,PA,kp,DA,RA,Nn],uwe),dwe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=ba(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?or(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var g=n.map(p);return ft(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(ei):n.ticks?n.ticks(d).map((p,m)=>{var g=n.map(p);return ft(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(ei):n.domain().map((p,m)=>{var g=n.map(p);return ft(g)?{coordinate:g+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(ei)}},Ya=ne([Nt,Ld,F0,kp,DA,RA,Nn],dwe),Za=ne(Pn,F0,(e,t)=>{if(!(e==null||t==null))return uv(uv({},e),{},{scale:t})}),fwe=ne([Pn,ol,EA,fF],gA),hwe=ne([fwe],GC);ne((e,t,n)=>yA(e,n),hwe,(e,t)=>{if(!(e==null||t==null))return uv(uv({},e),{},{scale:t})});var pwe=ne([Nt,w0,S0],(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}}),mwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ne([mwe],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 bF=e=>e.options.defaultTooltipEventType,wF=e=>e.options.validateTooltipEventTypes;function SF(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Cp(e,t){var n=bF(e),r=wF(e);return SF(t,n,r)}function gwe(e){return Re(t=>Cp(t,e))}var jF=(e,t)=>{var n,r=Number(t);if(!(pa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},ywe=e=>e.tooltip.settings,Po={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},vwe={itemInteraction:{click:Po,hover:Po},axisInteraction:{click:Po,hover:Po},keyboardInteraction:Po,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}},NF=_r({name:"tooltip",initialState:vwe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:on()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:on()},removeTooltipEntrySettings:{reducer(e,t){var n=Ki(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:on()},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:xwe,replaceTooltipEntrySettings:bwe,removeTooltipEntrySettings:wwe,setTooltipSettingsState:Swe,setActiveMouseOverItemIndex:kF,mouseLeaveItem:jwe,mouseLeaveChart:CF,setActiveClickItemIndex:Nwe,setMouseOverAxisIndex:AF,setMouseClickAxisIndex:kwe,setSyncInteraction:dh,setKeyboardInteraction:hv}=NF.actions,Cwe=NF.reducer;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 Eg(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){Awe(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 Awe(e,t,n){return(t=Owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Owe(e){var t=Ewe(e,"string");return typeof t=="symbol"?t:t+""}function Ewe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _we(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Pwe(e){return e.index!=null}var OF=(e,t,n,r)=>{if(t==null)return Po;var i=_we(e,t,n);if(i==null)return Po;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(Pwe(i)){if(a)return Eg(Eg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Eg(Eg({},Po),{},{coordinate:i.coordinate})};function Twe(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 zwe(e,t){var n=Twe(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 Rwe(e,t,n){if(n==null||t==null)return!0;var r=_t(e,t);return r==null||!Ba(n)?!0:zwe(r,n)}var wh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!ft(a))return i;var o=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(o,Math.min(a,c)),f=t[d];return f==null||Rwe(f,n,r)?String(d):null},EF=(e,t,n,r,i,a,o)=>{if(a!=null){var c=o[0],d=c?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},_F=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var c;return((c=o.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},PF=e=>e.options.tooltipPayloadSearcher,Ud=e=>e.tooltip;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 LM(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){Dwe(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 Dwe(e,t,n){return(t=Iwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iwe(e){var t=Mwe(e,"string");return typeof t=="symbol"?t:t+""}function Mwe(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 Lwe(e){if(typeof e=="string"||typeof e=="number")return e}function $we(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Bwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function $M(e){if(typeof e=="string")return e}function Uwe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Lwe(e.name):void 0,n="unit"in e?$we(e.unit):void 0,r="dataKey"in e?Bwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?$M(e.color):void 0,o="fill"in e?$M(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function qwe(e,t){return e??t}var TF=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((g,v)=>{var w,{dataDefinedOnItem:b,settings:j}=v,N=qwe(b,c),O=Array.isArray(N)?cU(N,f,p):N,C=(w=j?.dataKey)!==null&&w!==void 0?w:r,A=j?.nameKey,P;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&o==="axis"?P=m6(O,r,i):P=a(O,t,d,A),Array.isArray(P))P.forEach(_=>{var z,I,q=Uwe(_),U=q?.name,B=q?.dataKey,H=q?.payload,W=LM(LM({},j),{},{name:U,unit:q?.unit,color:(z=q?.color)!==null&&z!==void 0?z:j?.color,fill:(I=q?.fill)!==null&&I!==void 0?I:j?.fill});g.push(PD({tooltipEntrySettings:W,dataKey:B,payload:H,value:_t(H,B),name:U==null?void 0:String(U)}))});else{var E;g.push(PD({tooltipEntrySettings:j,dataKey:C,payload:P,value:_t(P,C),name:(E=_t(P,A))!==null&&E!==void 0?E:j?.name}))}return g},m)}},IA=ne([ir,Yq,BC],Gq),Fwe=ne([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Kwe=ne([ur,Id],vA),Rc=ne([Fwe,ir,Kwe],xA,{memoizeOptions:{resultEqualityCheck:D0}}),Hwe=ne([Rc],e=>e.filter(z0)),zF=ne([Rc],bA,{memoizeOptions:{resultEqualityCheck:D0}}),Gwe=ne([Rc],e=>e.some(t=>!t.data)),vc=ne([zF,wa],wA),Vwe=ne([Hwe,wa,ir],uq),MA=ne([vc,ir,Rc,wa,Gwe,zF],tF),RF=ne([ir],jA),Qwe=ne([ir],e=>e.allowDataOverflow),DF=ne([RF,Qwe],KU),Wwe=ne([Rc],e=>e.filter(z0)),Ywe=ne([Vwe,Wwe,yp,rq],rF),Zwe=ne([Ywe,wa,ur,DF],iF),Xwe=ne([Rc],Xq),Jwe=ne([vc,ir,Xwe,q0,ur,bve],CA,{memoizeOptions:{resultEqualityCheck:R0}}),eSe=ne([aF,ur,Id],Bd),tSe=ne([eSe,ur],lF),nSe=ne([sF,ur,Id],Bd),rSe=ne([nSe,ur],cF),iSe=ne([oF,ur,Id],Bd),aSe=ne([iSe,ur],uF),sSe=ne([tSe,aSe,rSe],fv),oSe=ne([ir,RF,DF,Zwe,Jwe,sSe,Nt,ur],AA),gd=ne([ir,Nt,vc,MA,yp,ur,oSe],OA),lSe=ne([gd,ir,IA],_A),cSe=ne([ir,gd,lSe,ur],TA),IF=e=>{var t=ur(e),n=Id(e),r=!1;return kp(e,t,n,r)},MF=ne([ir,IF],E0),uSe=ne([ir,IA,cSe,MF],gA),LF=ne([uSe],GC),dSe=ne([Nt,MA,ir,ur],vF),fSe=ne([Nt,MA,ir,ur],hF),hSe=(e,t,n,r,i,a,o,c)=>{if(t){var{type:d}=t,f=ba(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=c==="angleAxis"&&i!=null&&i?.length>=2?or(i[0]-i[1])*2*m:m,f&&o?o.map((g,v)=>{var w=r.map(g);return ft(w)?{coordinate:w+m,value:g,index:v,offset:m}:null}).filter(ei):r.domain().map((g,v)=>{var w=r.map(g);return ft(w)?{coordinate:w+m,value:a?a[g]:g,index:v,offset:m}:null}).filter(ei)}}},Hs=ne([Nt,ir,IA,LF,IF,dSe,fSe,ur],hSe),LA=ne([bF,wF,ywe],(e,t,n)=>SF(n.shared,e,t)),$F=e=>e.tooltip.settings.trigger,$A=e=>e.tooltip.settings.defaultIndex,Ap=ne([Ud,LA,$F,$A],OF),Vo=ne([Ap,vc,md,gd],wh),BF=ne([Hs,Vo],jF),BA=ne([Ap],e=>{if(e)return e.dataKey}),UF=ne([Ap],e=>{if(e)return e.graphicalItemId}),qF=ne([Ud,LA,$F,$A],_F),pSe=ne([Bs,Us,Nt,nr,Hs,$A,qF],EF),mSe=ne([Ap,pSe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),gSe=ne([Ap],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),ySe=ne([qF,Vo,wa,md,BF,PF,LA],TF),vSe=ne([ySe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function BM(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?BM(Object(n),!0).forEach(function(r){xSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xSe(e,t,n){return(t=bSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bSe(e){var t=wSe(e,"string");return typeof t=="symbol"?t:t+""}function wSe(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 SSe=()=>Re(ir),jSe=()=>{var e=SSe(),t=Re(Hs),n=Re(LF);return Go(!e||!n?void 0:UM(UM({},e),{},{scale:n}),t)};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 Cu(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){NSe(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 NSe(e,t,n){return(t=kSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kSe(e){var t=CSe(e,"string");return typeof t=="symbol"?t:t+""}function CSe(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 ASe=(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}},OSe=(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 Cu(Cu(Cu({},r),Vn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var c=i.coordinate,{angle:d}=r;return Cu(Cu(Cu({},r),Vn(r.cx,r.cy,c,d)),{},{angle:d,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function ESe(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 FF=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<o;c++){var d,f,p,m,g,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[c])===null||p===void 0?void 0:p.coordinate,b=c>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(g=n[c+1])===null||g===void 0?void 0:g.coordinate,j=void 0;if(!(v==null||w==null||b==null))if(or(w-v)!==or(b-w)){var N=[];if(or(b-w)===or(i[1]-i[0])){j=b;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 C=b+i[1]-i[0];N[0]=Math.min(w,(C+w)/2),N[1]=Math.max(w,(C+w)/2)}var A=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>A[0]&&e<=A[1]||e>=N[0]&&e<=N[1]){var P;return(P=n[c])===null||P===void 0?void 0:P.index}}else{var E=Math.min(v,b),_=Math.max(v,b);if(e>(E+w)/2&&e<=(_+w)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var I=0;I<o;I++){var q=t[I];if(q!=null){var U=t[I+1],B=t[I-1];if(I===0&&U!=null&&e<=(q.coordinate+U.coordinate)/2||I===o-1&&B!=null&&e>(q.coordinate+B.coordinate)/2||I>0&&I<o-1&&B!=null&&U!=null&&e>(q.coordinate+B.coordinate)/2&&e<=(q.coordinate+U.coordinate)/2)return q.index}}return-1},KF=()=>Re(BC),UA=(e,t)=>t,HF=(e,t,n)=>n,qA=(e,t,n,r)=>r,_Se=ne(Hs,e=>d0(e,t=>t.coordinate)),FA=ne([Ud,UA,HF,qA],OF),KA=ne([FA,vc,md,gd],wh),PSe=(e,t,n)=>{if(t!=null){var r=Ud(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},GF=ne([Ud,UA,HF,qA],_F),pv=ne([Bs,Us,Nt,nr,Hs,qA,GF],EF),TSe=ne([FA,pv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),VF=ne([Hs,KA],jF),zSe=ne([GF,KA,wa,md,VF,PF,UA],TF),RSe=ne([FA,KA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),DSe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&ESe(e,o)){var c=bme(e,t),d=FF(c,a,i,n,r),f=ASe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},ISe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var c=lve(e,n);if(c){var d=wme(c,t),f=FF(d,o,a,r,i),p=OSe(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},MSe=(e,t,n,r,i,a,o,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?DSe(e,t,r,i,a,o,c):ISe(e,t,n,r,i,a,o)},LSe=ne(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}}),$Se=ne(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Ln)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Dve}});function FM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(n),!0).forEach(function(r){BSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BSe(e,t,n){return(t=USe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function USe(e){var t=qSe(e,"string");return typeof t=="symbol"?t:t+""}function qSe(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 FSe={},KSe={zIndexMap:Object.values(Ln).reduce((e,t)=>KM(KM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),FSe)},HSe=new Set(Object.values(Ln));function GSe(e){return HSe.has(e)}var QF=_r({name:"zIndex",initialState:KSe,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:on()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!GSe(n)&&delete e.zIndexMap[n])},prepare:on()},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:on()},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:on()}}}),{registerZIndexPortal:VSe,unregisterZIndexPortal:Oj,registerZIndexPortalElement:QSe,unregisterZIndexPortalElement:WSe}=QF.actions,YSe=QF.reducer;function Fr(e){var{zIndex:t,children:n}=e,r=Xme(),i=r&&t!==void 0&&t!==0,a=cr(),o=x.useRef(void 0),c=x.useRef(new Set),d=Ht(),f=Re(m=>LSe(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(Oj({zIndex:v}))}),m.clear(),o.current=void 0;return}if(c.current.has(t)||(d(VSe({zIndex:t})),c.current.add(t)),f){o.current=f;var g=c.current;g.forEach(v=>{v!==t&&(d(Oj({zIndex:v})),g.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(g=>{d(Oj({zIndex:g}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?jc.createPortal(n,p):null}function jN(){return jN=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},jN.apply(null,arguments)}function HM(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 _g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HM(Object(n),!0).forEach(function(r){ZSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZSe(e,t,n){return(t=XSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XSe(e){var t=JSe(e,"string");return typeof t=="symbol"?t:t+""}function JSe(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 eje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function tje(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:c,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,g=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,b,j;if(p==="ScatterChart")w=m,b=jye,j=Ln.cursorLine;else if(p==="BarChart")w=Nye(c,m,a,o),b=MU,j=Ln.cursorRectangle;else if(c==="radial"&&y6(m)){var{cx:N,cy:O,radius:C,startAngle:A,endAngle:P}=$U(m);w={cx:N,cy:O,startAngle:A,endAngle:P,innerRadius:C,outerRadius:C},b=UU,j=Ln.cursorLine}else w={points:fve(c,m,a)},b=Zu,j=Ln.cursorLine;var E=typeof d=="object"&&"className"in d?d.className:void 0,_=_g(_g(_g(_g({stroke:"#ccc",pointerEvents:"none"},a),w),uc(d)),{},{payload:g,payloadIndex:v,className:jt("recharts-tooltip-cursor",E)});return x.createElement(Fr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(eje,{cursor:d,cursorComp:b,cursorProps:_}))}function nje(e){var t=jSe(),n=xU(),r=il(),i=KF();return t==null||n==null||r==null||i==null?null:x.createElement(tje,jN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var WF=x.createContext(null),rje=()=>x.useContext(WF),Ej={exports:{}},GM;function ije(){return GM||(GM=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,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,g),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 c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var g=0,v=m.length,w=new Array(v);g<v;g++)w[g]=m[g].fn;return w},c.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},c.prototype.emit=function(f,p,m,g,v,w){var b=n?n+f:f;if(!this._events[b])return!1;var j=this._events[b],N=arguments.length,O,C;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,g),!0;case 5:return j.fn.call(j.context,p,m,g,v),!0;case 6:return j.fn.call(j.context,p,m,g,v,w),!0}for(C=1,O=new Array(N-1);C<N;C++)O[C-1]=arguments[C];j.fn.apply(j.context,O)}else{var A=j.length,P;for(C=0;C<A;C++)switch(j[C].once&&this.removeListener(f,j[C].fn,void 0,!0),N){case 1:j[C].fn.call(j[C].context);break;case 2:j[C].fn.call(j[C].context,p);break;case 3:j[C].fn.call(j[C].context,p,m);break;case 4:j[C].fn.call(j[C].context,p,m,g);break;default:if(!O)for(P=1,O=new Array(N-1);P<N;P++)O[P-1]=arguments[P];j[C].fn.apply(j[C].context,O)}}return!0},c.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},c.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},c.prototype.removeListener=function(f,p,m,g){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&&(!g||w.once)&&(!m||w.context===m)&&o(this,v);else{for(var b=0,j=[],N=w.length;b<N;b++)(w[b].fn!==p||g&&!w[b].once||m&&w[b].context!==m)&&j.push(w[b]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},c.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Ej)),Ej.exports}var aje=ije();const sje=ga(aje);var Qh=new sje,NN="recharts.syncEvent.tooltip",VM="recharts.syncEvent.brush",G0=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!pa(n))return e[n]}},oje={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},YF=_r({name:"options",initialState:oje,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),lje=YF.reducer,{createEventEmitter:cje}=YF.actions;function uje(e){return e.tooltip.syncInteraction}var dje={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},ZF=_r({name:"chartData",initialState:dje,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:QM,setDataStartEndIndexes:fje,setComputedData:g2e}=ZF.actions,hje=ZF.reducer,pje=["x","y"];function WM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WM(Object(n),!0).forEach(function(r){mje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mje(e,t,n){return(t=gje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gje(e){var t=yje(e,"string");return typeof t=="symbol"?t:t+""}function yje(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 vje(e,t){if(e==null)return{};var n,r,i=xje(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 xje(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 bje(){var e=Re(UC),t=Re(qC),n=Ht(),r=Re(iq),i=Re(Hs),a=il(),o=k0(),c=Re(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return nl;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(dh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(o&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:b}=v,j=vje(v,pje),{x:N,y:O,width:C,height:A}=p.payload.sourceViewBox,P=Au(Au({},j),{},{x:o.x+(C?(w-N)/C:0)*o.width,y:o.y+(A?(b-O)/A:0)*o.height});n(Au(Au({},p),{},{payload:Au(Au({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var E;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},z=r(i,_);E=i[z]}else r==="value"&&(E=i.find(K=>String(K.value)===p.payload.label));var{coordinate:I}=p.payload;if(I==null||o==null){n(dh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(E==null){n(dh({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:U}=I,B=Math.min(q,o.x+o.width),H=Math.min(U,o.y+o.height),W={x:a==="horizontal"?E.coordinate:B,y:a==="horizontal"?H:E.coordinate},Y=dh({active:p.payload.active,coordinate:W,dataKey:p.payload.dataKey,index:String(E.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Y)}}};return Qh.on(NN,d),()=>{Qh.off(NN,d)}},[c,n,t,e,r,i,a,o])}function wje(){var e=Re(UC),t=Re(qC),n=Ht();x.useEffect(()=>{if(e==null)return nl;var r=(i,a,o)=>{t!==o&&e===i&&n(fje(a))};return Qh.on(VM,r),()=>{Qh.off(VM,r)}},[n,t,e])}function Sje(){var e=Ht();x.useEffect(()=>{e(cje())},[e]),bje(),wje()}function jje(e,t,n,r,i,a){var o=Re(w=>PSe(w,e,t)),c=Re(UF),d=Re(qC),f=Re(UC),p=Re(iq),m=Re(uje),g=m?.sourceViewBox!=null,v=k0();x.useEffect(()=>{if(!g&&f!=null&&d!=null){var w=dh({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Qh.emit(NN,f,w,d)}},[g,n,o,c,i,r,d,f,p,a,v])}function YM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YM(Object(n),!0).forEach(function(r){Nje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nje(e,t,n){return(t=kje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kje(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 Aje(e){return e.dataKey}function Oje(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Xge,t)}var XM=[],Eje={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 Xa(e){var t,n,r=Un(e,Eje),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:g,position:v,reverseDirection:w,useTranslate3d:b,wrapperStyle:j,cursor:N,shared:O,trigger:C,defaultIndex:A,portal:P,axisId:E}=r,_=Ht(),z=typeof A=="number"?String(A):A;x.useEffect(()=>{_(Swe({shared:O,trigger:C,axisId:E,active:i,defaultIndex:z}))},[_,O,C,E,i,z]);var I=k0(),q=TU(),U=gwe(O),{activeIndex:B,isActive:H}=(t=Re(je=>RSe(je,U,C,z)))!==null&&t!==void 0?t:{},W=Re(je=>zSe(je,U,C,z)),Y=Re(je=>VF(je,U,C,z)),K=Re(je=>TSe(je,U,C,z)),J=W,se=rje(),me=(n=i??H)!==null&&n!==void 0?n:!1,[L,M]=z6([J,me]),F=U==="axis"?Y:void 0;jje(U,C,K,F,B,me);var D=P??se;if(D==null||I==null||U==null)return null;var V=J??XM;me||(V=XM),f&&V.length&&(V=O6(V.filter(je=>je.value!=null&&(je.hide!==!0||r.includeHidden)),g,Aje));var oe=V.length>0,re=ZM(ZM({},r),{},{payload:V,label:F,active:me,activeIndex:B,coordinate:K,accessibilityLayer:q}),Ce=x.createElement(cye,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:p,active:me,coordinate:K,hasPayload:oe,offset:m,position:v,reverseDirection:w,useTranslate3d:b,viewBox:I,wrapperStyle:j,lastBoundingBox:L,innerRef:M,hasPortalFromProps:!!P},Oje(d,re));return x.createElement(x.Fragment,null,jc.createPortal(Ce,D),me&&x.createElement(nje,{cursor:N,tooltipEventType:U,coordinate:K,payload:V,index:B}))}var xc=e=>null;xc.displayName="Cell";function _je(e,t,n){return(t=Pje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pje(e){var t=Tje(e,"string");return typeof t=="symbol"?t:t+""}function Tje(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 zje{constructor(t){_je(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 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 Rje(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){Dje(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 Dje(e,t,n){return(t=Ije(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ije(e){var t=Mje(e,"string");return typeof t=="symbol"?t:t+""}function Mje(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 Lje={cacheSize:2e3,enableCache:!0},XF=Rje({},Lje),eL=new zje(XF.cacheSize),$je={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},tL="recharts_measurement_span";function Bje(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(c)}var nL=(e,t)=>{try{var n=document.getElementById(tL);n||(n=document.createElement("span"),n.setAttribute("id",tL),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,$je,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Sh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||pp.isSsr)return{width:0,height:0};if(!XF.enableCache)return nL(t,n);var r=Bje(t,n),i=eL.get(r);if(i)return i;var a=nL(t,n);return eL.set(r,a),a},JF;function Uje(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=Fje(e,"string");return typeof t=="symbol"?t:t+""}function Fje(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 rL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,iL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kje=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Hje=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Gje={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Vje=["cm","mm","pt","pc","in","Q","px"];function Qje(e){return Vje.includes(e)}var Bu="NaN";function Wje(e,t){return e*Gje[t]}class yr{static parse(t){var n,[,r,i]=(n=Hje.exec(t))!==null&&n!==void 0?n:[];return r==null?yr.NaN:new yr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,pa(t)&&(this.unit=""),n!==""&&!Kje.test(n)&&(this.num=NaN,this.unit=""),Qje(n)&&(this.num=Wje(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return pa(this.num)}}JF=yr;Uje(yr,"NaN",new JF(NaN,""));function e8(e){if(e==null||e.includes(Bu))return Bu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=rL.exec(t))!==null&&n!==void 0?n:[],o=yr.parse(r??""),c=yr.parse(a??""),d=i==="*"?o.multiply(c):o.divide(c);if(d.isNaN())return Bu;t=t.replace(rL,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,g]=(f=iL.exec(t))!==null&&f!==void 0?f:[],v=yr.parse(p??""),w=yr.parse(g??""),b=m==="+"?v.add(w):v.subtract(w);if(b.isNaN())return Bu;t=t.replace(iL,b.toString())}return t}var aL=/\(([^()]*)\)/;function Yje(e){for(var t=e,n;(n=aL.exec(t))!=null;){var[,r]=n;t=t.replace(aL,e8(r))}return t}function Zje(e){var t=e.replace(/\s+/g,"");return t=Yje(t),t=e8(t),t}function Xje(e){try{return Zje(e)}catch{return Bu}}function _j(e){var t=Xje(e.slice(5,-1));return t===Bu?"":t}var Jje=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],e1e=["dx","dy","angle","className","breakAll"];function kN(){return kN=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},kN.apply(null,arguments)}function sL(e,t){if(e==null)return{};var n,r,i=t1e(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 t1e(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 t8=/[ \f\n\r\t\v\u2028\u2029]+/,n8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];un(t)||(n?i=t.toString().split(""):i=t.toString().split(t8));var a=i.map(c=>({word:c,width:Sh(c,r).width})),o=n?0:Sh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function r8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function n1e(e){return un(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var i8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(o),d.width+=c+n;else{var f={words:[o],width:c};i.push(f)}return i},[]),a8=e=>e.reduce((t,n)=>t.width>n.width?t:n),r1e="…",oL=(e,t,n,r,i,a,o,c)=>{var d=e.slice(0,t),f=n8({breakAll:n,style:r,children:d+r1e});if(!f)return[!1,[]];var p=i8(f.wordsWithComputedWidth,a,o,c),m=p.length>i||a8(p).width>Number(a);return[m,p]},i1e=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:c,breakAll:d}=e,f=Te(a),p=String(o),m=i8(t,r,n,i);if(!f||i)return m;var g=m.length>a||a8(m).width>Number(r);if(!g)return m;for(var v=0,w=p.length-1,b=0,j;v<=w&&b<=p.length-1;){var N=Math.floor((v+w)/2),O=N-1,[C,A]=oL(p,O,d,c,a,r,n,i),[P]=oL(p,N,d,c,a,r,n,i);if(!C&&!P&&(v=N+1),C&&P&&(w=N-1),!C&&P){j=A;break}b++}return j||m},lL=e=>{var t=un(e)?[]:e.toString().split(t8);return[{words:t,width:void 0}]},a1e=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!pp.isSsr){var c,d,f=n8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return lL(r);return i1e({breakAll:a,children:r,maxLines:o,style:i},c,d,t,!!n)}return lL(r)},s8="#808080",s1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:s8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},V0=x.forwardRef((e,t)=>{var n=Un(e,s1e),{x:r,y:i,lineHeight:a,capHeight:o,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=sL(n,Jje),g=x.useMemo(()=>a1e({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:b,className:j,breakAll:N}=m,O=sL(m,e1e);if(!Ha(r)||!Ha(i)||g.length===0)return null;var C=Number(r)+(Te(v)?v:0),A=Number(i)+(Te(w)?w:0);if(!ft(C)||!ft(A))return null;var P;switch(p){case"start":P=_j("calc(".concat(o,")"));break;case"middle":P=_j("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:P=_j("calc(".concat(g.length-1," * -").concat(a,")"));break}var E=[],_=g[0];if(d&&_!=null){var z=_.width,{width:I}=m;E.push("scale(".concat(Te(I)&&Te(z)?I/z:1,")"))}return b&&E.push("rotate(".concat(b,", ").concat(C,", ").concat(A,")")),E.length&&(O.transform=E.join(" ")),x.createElement("text",kN({},Or(O),{ref:t,x:C,y:A,className:jt("recharts-text",j),textAnchor:f,fill:c.includes("url")?s8:c}),g.map((q,U)=>{var B=q.words.join(N?"":" ");return x.createElement("tspan",{x:C,dy:U===0?P:a,key:"".concat(B,"-").concat(U)},B)}))});V0.displayName="Text";function cL(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 Pa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){o1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o1e(e,t,n){return(t=l1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l1e(e){var t=c1e(e,"string");return typeof t=="symbol"?t:t+""}function c1e(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 u1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:c,upperWidth:d,lowerWidth:f}=_C(t),p=a,m=a+(d-f)/2,g=(p+m)/2,v=(d+f)/2,w=p+d/2,b=c>=0?1:-1,j=b*r,N=b>0?"end":"start",O=b>0?"start":"end",C=d>=0?1:-1,A=C*r,P=C>0?"end":"start",E=C>0?"start":"end",_=i;if(n==="top"){var z={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:N};return _&&(z.height=Math.max(o-_.y,0),z.width=d),z}if(n==="bottom"){var I={x:m+f/2,y:o+c+j,horizontalAnchor:"middle",verticalAnchor:O};return _&&(I.height=Math.max(_.y+_.height-(o+c),0),I.width=f),I}if(n==="left"){var q={x:g-A,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return _&&(q.width=Math.max(q.x-_.x,0),q.height=c),q}if(n==="right"){var U={x:g+v+A,y:o+c/2,horizontalAnchor:E,verticalAnchor:"middle"};return _&&(U.width=Math.max(_.x+_.width-U.x,0),U.height=c),U}var B=_?{width:v,height:c}:{};return n==="insideLeft"?Pa({x:g+A,y:o+c/2,horizontalAnchor:E,verticalAnchor:"middle"},B):n==="insideRight"?Pa({x:g+v-A,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"},B):n==="insideTop"?Pa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:O},B):n==="insideBottom"?Pa({x:m+f/2,y:o+c-j,horizontalAnchor:"middle",verticalAnchor:N},B):n==="insideTopLeft"?Pa({x:p+A,y:o+j,horizontalAnchor:E,verticalAnchor:O},B):n==="insideTopRight"?Pa({x:p+d-A,y:o+j,horizontalAnchor:P,verticalAnchor:O},B):n==="insideBottomLeft"?Pa({x:m+A,y:o+c-j,horizontalAnchor:E,verticalAnchor:N},B):n==="insideBottomRight"?Pa({x:m+f-A,y:o+c-j,horizontalAnchor:P,verticalAnchor:N},B):n&&typeof n=="object"&&(Te(n.x)||hc(n.x))&&(Te(n.y)||hc(n.y))?Pa({x:a+Ar(n.x,v),y:o+Ar(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},B):Pa({x:w,y:o+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},d1e=["labelRef"],f1e=["content"];function uL(e,t){if(e==null)return{};var n,r,i=h1e(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 h1e(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 dL(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 fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){p1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p1e(e,t,n){return(t=m1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m1e(e){var t=g1e(e,"string");return typeof t=="symbol"?t:t+""}function g1e(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 Cs(){return Cs=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},Cs.apply(null,arguments)}var o8=x.createContext(null),y1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:c}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return x.createElement(o8.Provider,{value:d},c)},l8=()=>{var e=x.useContext(o8),t=k0();return e||(t?_C(t):void 0)},v1e=x.createContext(null),x1e=()=>{var e=x.useContext(v1e),t=Re(cq);return e||t},b1e=e=>{var{value:t,formatter:n}=e,r=un(e.children)?t:e.children;return typeof n=="function"?n(r):r},HA=e=>e!=null&&typeof e=="function",w1e=(e,t)=>{var n=or(t-e),r=Math.min(Math.abs(t-e),360);return n*r},S1e=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:g,clockWise:v}=i,w=(f+p)/2,b=w1e(m,g),j=b>=0?1:-1,N,O;switch(t){case"insideStart":N=m+j*a,O=v;break;case"insideEnd":N=g-j*a,O=!v;break;case"end":N=g+j*a,O=v;break;default:throw new Error("Unsupported position ".concat(t))}O=b<=0?O:!O;var C=Vn(c,d,w,N),A=Vn(c,d,w,N+(O?1:-1)*359),P="M".concat(C.x,",").concat(C.y,`
|
|
288
|
-
A`).concat(w,",").concat(w,",0,1,").concat(O?0:1,`,
|
|
289
|
-
`).concat(A.x,",").concat(A.y),E=un(e.id)?Dh("recharts-radial-line-"):e.id;return x.createElement("text",Cs({},r,{dominantBaseline:"central",className:jt("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:E,d:P})),x.createElement("textPath",{xlinkHref:"#".concat(E)},n))},j1e=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=Vn(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 g=(a+o)/2,{x:v,y:w}=Vn(r,i,g,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Xg=e=>e!=null&&"cx"in e&&Te(e.cx),N1e={angle:0,offset:5,zIndex:Ln.label,position:"middle",textBreakAll:!1};function k1e(e){if(!Xg(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 Eo(e){var t=Un(e,N1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=x1e(),g=l8(),v=i==="center"?g:m??g,w,b,j;n==null?w=v:Xg(n)?w=n:w=_C(n);var N=k1e(w);if(!w||un(a)&&un(o)&&!x.isValidElement(c)&&typeof c!="function")return null;var O=fh(fh({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:C}=O,A=uL(O,d1e);return x.cloneElement(c,A)}if(typeof c=="function"){var{content:P}=O,E=uL(O,f1e);if(b=x.createElement(c,E),x.isValidElement(b))return b}else b=b1e(t);var _=Or(t);if(Xg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return S1e(t,i,b,_,w);j=j1e(w,t.offset,t.position)}else{if(!N)return null;var z=u1e({viewBox:N,position:i,offset:t.offset,parentViewBox:Xg(r)?void 0:r});j=fh(fh({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return x.createElement(Fr,{zIndex:t.zIndex},x.createElement(V0,Cs({ref:p,className:jt("recharts-label",d)},_,j,{textAnchor:r8(_.textAnchor)?_.textAnchor:j.textAnchor,breakAll:f}),b))}Eo.displayName="Label";var C1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Eo,Cs({key:"label-implicit"},r)):Ha(e)?x.createElement(Eo,Cs({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Eo?x.cloneElement(e,fh({key:"label-implicit"},r)):x.createElement(Eo,Cs({key:"label-implicit",content:e},r)):HA(e)?x.createElement(Eo,Cs({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Eo,Cs({},e,{key:"label-implicit"},r)):null};function A1e(e){var{label:t,labelRef:n}=e,r=l8();return C1e(t,r,n)||null}var O1e=["valueAccessor"],E1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function mv(){return mv=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},mv.apply(null,arguments)}function fL(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 P1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(n1e(t))return t},c8=x.createContext(void 0),GA=c8.Provider,u8=x.createContext(void 0),T1e=u8.Provider;function z1e(){return x.useContext(c8)}function R1e(){return x.useContext(u8)}function Jg(e){var{valueAccessor:t=P1e}=e,n=fL(e,O1e),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:c}=n,d=fL(n,E1e),f=z1e(),p=R1e(),m=f||p;return!m||!m.length?null:x.createElement(Fr,{zIndex:c??Ln.label},x.createElement(bn,{className:"recharts-label-list"},m.map((g,v)=>{var w,b=un(r)?t(g,v):_t(g.payload,r),j=un(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(Eo,mv({key:"label-".concat(v)},Or(g),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:g.fill,parentViewBox:g.parentViewBox,value:b,textBreakAll:o,viewBox:g.viewBox,index:v,zIndex:0}))})))}Jg.displayName="LabelList";function Q0(e){var{label:t}=e;return t?t===!0?x.createElement(Jg,{key:"labelList-implicit"}):x.isValidElement(t)||HA(t)?x.createElement(Jg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Jg,mv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function CN(){return CN=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},CN.apply(null,arguments)}var d8=e=>{var{cx:t,cy:n,r,className:i}=e,a=jt("recharts-dot",i);return Te(t)&&Te(n)&&Te(r)?x.createElement("circle",CN({},Ur(e),xC(e),{className:a,cx:t,cy:n,r})):null},f8=e=>e.graphicalItems.polarItems,D1e=ne([Nn,vp],vA),W0=ne([f8,Pn,D1e],xA),I1e=ne([W0],bA),Y0=ne([I1e,mp],wA),M1e=ne([Y0,Pn,W0],eF);ne([Y0,Pn,W0],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=_t(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(r=>({value:_t(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var hL=()=>{},L1e=ne([Y0,Pn,W0,q0,Nn,xve],CA),$1e=ne([Pn,NA,kA,hL,L1e,hL,Nt,Nn],AA),h8=ne([Pn,Nt,Y0,M1e,yp,Nn,$1e],OA),B1e=ne([h8,Ld,ol],_A),U1e=ne([Pn,h8,B1e,Nn],TA);ne([ol,U1e],dq);var q1e={radiusAxis:{},angleAxis:{}},p8=_r({name:"polarAxis",initialState:q1e,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:y2e,removeRadiusAxis:v2e,addAngleAxis:x2e,removeAngleAxis:b2e}=p8.actions,F1e=p8.reducer;function m8(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function pL(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 mL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(n),!0).forEach(function(r){K1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K1e(e,t,n){return(t=H1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H1e(e){var t=G1e(e,"string");return typeof t=="symbol"?t:t+""}function G1e(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 V1e=(e,t)=>t,VA=ne([f8,V1e],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),Q1e=[],QA=(e,t,n)=>n?.length===0?Q1e:n,g8=ne([mp,VA,QA],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if(t?.data!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>mL(mL({},t.presentationProps),a.props))),i!=null)return i}}),W1e=ne([g8,VA,QA],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=_t(r,t.nameKey,t.name),c;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?c=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?c=r.fill:c=t.fill,{value:rl(o,t.dataKey),color:c,payload:r,type:t.legendType}})}),Y1e=ne([g8,VA,QA,nr],(e,t,n,r)=>{if(!(t==null||e==null))return eke({offset:r,pieSettings:t,displayedData:e,cells:n})}),Pj={exports:{}},Ft={};var gL;function Z1e(){if(gL)return Ft;gL=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function w(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case g:return b;default:switch(b=b&&b.$$typeof,b){case o:case c:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return Ft.ContextConsumer=a,Ft.ContextProvider=o,Ft.Element=e,Ft.ForwardRef=c,Ft.Fragment=n,Ft.Lazy=m,Ft.Memo=p,Ft.Portal=t,Ft.Profiler=i,Ft.StrictMode=r,Ft.Suspense=d,Ft.SuspenseList=f,Ft.isContextConsumer=function(b){return w(b)===a},Ft.isContextProvider=function(b){return w(b)===o},Ft.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ft.isForwardRef=function(b){return w(b)===c},Ft.isFragment=function(b){return w(b)===n},Ft.isLazy=function(b){return w(b)===m},Ft.isMemo=function(b){return w(b)===p},Ft.isPortal=function(b){return w(b)===t},Ft.isProfiler=function(b){return w(b)===i},Ft.isStrictMode=function(b){return w(b)===r},Ft.isSuspense=function(b){return w(b)===d},Ft.isSuspenseList=function(b){return w(b)===f},Ft.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===o||b.$$typeof===a||b.$$typeof===c||b.$$typeof===v||b.getModuleId!==void 0)},Ft.typeOf=w,Ft}var yL;function X1e(){return yL||(yL=1,Pj.exports=Z1e()),Pj.exports}var J1e=X1e(),vL=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",xL=null,Tj=null,y8=e=>{if(e===xL&&Array.isArray(Tj))return Tj;var t=[];return x.Children.forEach(e,n=>{un(n)||(J1e.isFragment(n)?t=t.concat(y8(n.props.children)):t.push(n))}),Tj=t,xL=e,t};function WA(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>vL(i)):r=[vL(t)],y8(e).forEach(i=>{var a=fc(i,"type.displayName")||fc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var YA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,zj={},bL;function eNe(){return bL||(bL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(zj)),zj}var Rj,wL;function tNe(){return wL||(wL=1,Rj=eNe().isPlainObject),Rj}var nNe=tNe();const rNe=ga(nNe);var SL,jL,NL,kL,CL;function AL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AL(Object(n),!0).forEach(function(r){iNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iNe(e,t,n){return(t=aNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aNe(e){var t=sNe(e,"string");return typeof t=="symbol"?t:t+""}function sNe(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 gv(){return gv=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},gv.apply(null,arguments)}function ih(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var EL=(e,t,n,r,i)=>{var a=n-r,o;return o=On(SL||(SL=ih(["M ",",",""])),e,t),o+=On(jL||(jL=ih(["L ",",",""])),e+n,t),o+=On(NL||(NL=ih(["L ",",",""])),e+n-a/2,t+i),o+=On(kL||(kL=ih(["L ",",",""])),e+n-a/2-r,t+i),o+=On(CL||(CL=ih(["L ",","," Z"])),e,t),o},oNe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lNe=e=>{var t=Un(e,oNe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:c}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,g=x.useRef(null),[v,w]=x.useState(-1),b=x.useRef(i),j=x.useRef(a),N=x.useRef(o),O=x.useRef(n),C=x.useRef(r),A=zd(e,"trapezoid-");if(x.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var W=g.current.getTotalLength();W&&w(W)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var P=jt("recharts-trapezoid",c);if(!m)return x.createElement("g",null,x.createElement("path",gv({},Or(t),{className:P,d:EL(n,r,i,a,o)})));var E=b.current,_=j.current,z=N.current,I=O.current,q=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),H=zU(["strokeDasharray"],f,d);return x.createElement(Td,{animationId:A,key:A,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},W=>{var Y=Dt(E,i,W),K=Dt(_,a,W),J=Dt(z,o,W),se=Dt(I,n,W),me=Dt(q,r,W);g.current&&(b.current=Y,j.current=K,N.current=J,O.current=se,C.current=me);var L=W>0?{transition:H,strokeDasharray:B}:{strokeDasharray:U};return x.createElement("path",gv({},Or(t),{className:P,d:EL(se,me,Y,K,J),ref:g,style:OL(OL({},L),t.style)}))})},cNe=["option","shapeType","activeClassName","inActiveClassName"];function uNe(e,t){if(e==null)return{};var n,r,i=dNe(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 dNe(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 _L(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 yv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(n),!0).forEach(function(r){fNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fNe(e,t,n){return(t=hNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hNe(e){var t=pNe(e,"string");return typeof t=="symbol"?t:t+""}function pNe(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 mNe(e,t){return yv(yv({},t),e)}function gNe(e,t){return e==="symbols"}function PL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(MU,n);case"trapezoid":return x.createElement(lNe,n);case"sector":return x.createElement(UU,n);case"symbols":if(gNe(t))return x.createElement(vC,n);break;case"curve":return x.createElement(Zu,n);default:return null}}function yNe(e){return x.isValidElement(e)?e.props:e}function ZA(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=uNe(e,cNe),o;if(x.isValidElement(t))o=x.cloneElement(t,yv(yv({},a),yNe(t)));else if(typeof t=="function")o=t(a,a.index);else if(rNe(t)&&typeof t!="boolean"){var c=mNe(t,a);o=x.createElement(PL,{shapeType:n,elementProps:c})}else{var d=a;o=x.createElement(PL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(bn,{className:r},o):x.createElement(bn,{className:i},o)}var XA=(e,t,n)=>{var r=Ht();return(i,a)=>o=>{e?.(i,a,o),r(kF({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},JA=e=>{var t=Ht();return(n,r)=>i=>{e?.(n,r,i),t(jwe())}},eO=(e,t,n)=>{var r=Ht();return(i,a)=>o=>{e?.(i,a,o),r(Nwe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Z0(e){var{tooltipEntrySettings:t}=e,n=Ht(),r=cr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(xwe(t)):i.current!==t&&n(bwe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(wwe(i.current)),i.current=null)},[n]),null}function tO(e){var{legendPayload:t}=e,n=Ht(),r=cr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(OU(t)):i.current!==t&&n(EU({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(_U(i.current)),i.current=null)},[n]),null}function vNe(e){var{legendPayload:t}=e,n=Ht(),r=Re(Nt),i=x.useRef(null);return x.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(OU(t)):i.current!==t&&n(EU({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(_U(i.current)),i.current=null)},[n]),null}var Dj,xNe=()=>{var[e]=x.useState(()=>Dh("uid-"));return e},bNe=(Dj=kv.useId)!==null&&Dj!==void 0?Dj:xNe;function wNe(e,t){var n=bNe();return t||(e?"".concat(e,"-").concat(n):n)}var SNe=x.createContext(void 0),X0=e=>{var{id:t,type:n,children:r}=e,i=wNe("recharts-".concat(n),t);return x.createElement(SNe.Provider,{value:i},r(i))},jNe={cartesianItems:[],polarItems:[]},v8=_r({name:"graphicalItems",initialState:jNe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:on()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:on()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ki(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:on()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:on()},removePolarGraphicalItem:{reducer(e,t){var n=Ki(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:on()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:on()}}}),{addCartesianGraphicalItem:NNe,replaceCartesianGraphicalItem:kNe,removeCartesianGraphicalItem:CNe,addPolarGraphicalItem:ANe,removePolarGraphicalItem:ONe,replacePolarGraphicalItem:ENe}=v8.actions,_Ne=v8.reducer,PNe=e=>{var t=Ht(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(NNe(e)):n.current!==e&&t(kNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(CNe(n.current)),n.current=null)},[t]),null},nO=x.memo(PNe),TNe=e=>{var t=Ht(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(ANe(e)):n.current!==e&&t(ENe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(ONe(n.current)),n.current=null)},[t]),null},zNe=x.memo(TNe),RNe=["key"],DNe=["onMouseEnter","onClick","onMouseLeave"],INe=["id"],MNe=["id"];function Qo(){return Qo=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},Qo.apply(null,arguments)}function J0(e,t){if(e==null)return{};var n,r,i=LNe(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 LNe(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 TL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TL(Object(n),!0).forEach(function(r){$Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ne(e,t,n){return(t=BNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BNe(e){var t=UNe(e,"string");return typeof t=="symbol"?t:t+""}function UNe(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 qNe(e){var t=x.useMemo(()=>WA(e.children,xc),[e.children]),n=Re(r=>W1e(r,e.id,t));return n==null?null:x.createElement(vNe,{legendPayload:n})}function FNe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(x.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var KNe=x.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:c,hide:d,tooltipType:f,id:p,activeShape:m}=e,g=FNe(m),v=r.map(b=>{var j=b.tooltipPayload;return g==null||j==null?j:j.map(N=>pn(pn({},N),{},{color:g,fill:g}))}),w={dataDefinedOnItem:v,getPosition:b=>{var j;return(j=r[Number(b)])===null||j===void 0?void 0:j.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:rl(c,t),hide:d,type:f,color:o,unit:"",graphicalItemId:p}};return x.createElement(Z0,{tooltipEntrySettings:w})}),HNe=(e,t)=>e>t?"start":e<t?"end":"middle",GNe=(e,t,n)=>Ar(typeof t=="function"?t(e):t,n,n*.8),VNe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,c=LU(a,o),d=i+Ar(e.cx,a,a/2),f=r+Ar(e.cy,o,o/2),p=Ar(e.innerRadius,c,0),m=GNe(n,e.outerRadius,c),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:d,cy:f,innerRadius:p,outerRadius:m,maxRadius:g}},QNe=(e,t)=>{var n=or(t-e),r=Math.min(Math.abs(t-e),360);return n*r},WNe=(e,t)=>{if(x.isValidElement(e))return x.cloneElement(e,t);if(typeof e=="function")return e(t);var n=jt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=J0(t,RNe);return x.createElement(Zu,Qo({},i,{type:"linear",className:n}))},YNe=(e,t,n)=>{if(x.isValidElement(e))return x.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),x.isValidElement(r)))return r;var i=jt("recharts-pie-label-text",m8(e));return x.createElement(V0,Qo({},t,{alignmentBaseline:"middle",className:i}),r)};function ZNe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var c=Ur(n),d=uc(i),f=uc(a),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,m=t.map((g,v)=>{var w=(g.startAngle+g.endAngle)/2,b=Vn(g.cx,g.cy,g.outerRadius+p,w),j=pn(pn(pn(pn({},c),g),{},{stroke:"none"},d),{},{index:v,textAnchor:HNe(b.x,g.cx)},b),N=pn(pn(pn(pn({},c),g),{},{fill:"none",stroke:g.fill},f),{},{index:v,points:[Vn(g.cx,g.cy,g.outerRadius,w),b],key:"line"});return x.createElement(Fr,{zIndex:Ln.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},x.createElement(bn,null,a&&WNe(a,N),YNe(i,j,_t(g,o))))});return x.createElement(bn,{className:"recharts-pie-labels"},m)}function XNe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?x.createElement(Q0,{label:i}):x.createElement(ZNe,{sectors:t,props:n,showLabels:r})}function JNe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,c=Re(Vo),d=Re(BA),f=Re(UF),{onMouseEnter:p,onClick:m,onMouseLeave:g}=i,v=J0(i,DNe),w=XA(p,i.dataKey,o),b=JA(g),j=eO(m,i.dataKey,o);return t==null||t.length===0?null:x.createElement(x.Fragment,null,t.map((N,O)=>{if(N?.startAngle===0&&N?.endAngle===0&&t.length!==1)return null;var C=f==null||f===o,A=String(O)===c&&(d==null||i.dataKey===d)&&C,P=c?r:null,E=n&&A?n:P,_=pn(pn({},N),{},{stroke:N.stroke,tabIndex:-1,[pU]:O,[mU]:o});return x.createElement(bn,Qo({key:"sector-".concat(N?.startAngle,"-").concat(N?.endAngle,"-").concat(N.midAngle,"-").concat(O),tabIndex:-1,className:"recharts-pie-sector"},lp(v,N,O),{onMouseEnter:w(N,O),onMouseLeave:b(N,O),onClick:j(N,O)}),x.createElement(ZA,Qo({option:a??E,index:O,shapeType:"sector",isActive:A},_)))}))}function eke(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:c,endAngle:d,dataKey:f,nameKey:p,tooltipType:m}=n,g=Math.abs(n.minAngle),v=QNe(c,d),w=Math.abs(v),b=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,j=r.filter(z=>_t(z,f,0)!==0).length,N=(w>=360?j:j-1)*b,O=r.reduce((z,I)=>{var q=_t(I,f,0);return z+(Te(q)?q:0)},0),C=g>0&&O>0&&r.some(z=>{var I=_t(z,f,0),q=(Te(I)?I:0)/O;return I!==0&&q*w<g}),A=C?g:0,P=w-j*A-N,E;if(O>0){var _;E=r.map((z,I)=>{var q=_t(z,f,0),U=_t(z,p,I),B=VNe(n,a,z),H=(Te(q)?q:0)/O,W,Y=pn(pn({},z),i&&i[I]&&i[I].props),K=Y!=null&&"fill"in Y&&typeof Y.fill=="string"?Y.fill:n.fill;I?W=_.endAngle+or(v)*b*(q!==0?1:0):W=c;var J=W+or(v)*((q!==0?A:0)+H*P),se=(W+J)/2,me=(B.innerRadius+B.outerRadius)/2,L=[{name:U,value:q,payload:Y,dataKey:f,type:m,color:K,fill:K,graphicalItemId:n.id}],M=Vn(B.cx,B.cy,me,se);return _=pn(pn(pn(pn({},n.presentationProps),{},{percent:H,cornerRadius:typeof o=="string"?parseFloat(o):o,name:U,tooltipPayload:L,midAngle:se,middleRadius:me,tooltipPosition:M},Y),B),{},{value:q,dataKey:f,startAngle:W,endAngle:J,payload:Y,paddingAngle:q!==0?or(v)*b:0}),_})}return E}function tke(e){var{showLabels:t,sectors:n,children:r}=e,i=x.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return x.createElement(T1e,{value:t?i:void 0},r)}function nke(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:c,animationEasing:d,activeShape:f,inactiveShape:p,onAnimationStart:m,onAnimationEnd:g}=t,v=zd(t,"recharts-pie-"),w=n.current,[b,j]=x.useState(!1),N=x.useCallback(()=>{typeof g=="function"&&g(),j(!1)},[g]),O=x.useCallback(()=>{typeof m=="function"&&m(),j(!0)},[m]);return x.createElement(tke,{showLabels:!b,sectors:i},x.createElement(Td,{animationId:v,begin:o,duration:c,isActive:a,easing:d,onAnimationStart:O,onAnimationEnd:N,key:v},C=>{var A,P=[],E=i&&i[0],_=(A=E?.startAngle)!==null&&A!==void 0?A:0;return i?.forEach((z,I)=>{var q=w&&w[I],U=I>0?fc(z,"paddingAngle",0):0;if(q){var B=Dt(q.endAngle-q.startAngle,z.endAngle-z.startAngle,C),H=pn(pn({},z),{},{startAngle:_+U,endAngle:_+B+U});P.push(H),_=H.endAngle}else{var{endAngle:W,startAngle:Y}=z,K=Dt(0,W-Y,C),J=pn(pn({},z),{},{startAngle:_+U,endAngle:_+K+U});P.push(J),_=J.endAngle}}),n.current=P,x.createElement(bn,null,x.createElement(JNe,{sectors:P,activeShape:f,inactiveShape:p,allOtherPieProps:t,shape:t.shape,id:r}))}),x.createElement(XNe,{showLabels:!b,sectors:i,props:t}),t.children)}var rke={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Ln.area};function ike(e){var{id:t}=e,n=J0(e,INe),{hide:r,className:i,rootTabIndex:a}=e,o=x.useMemo(()=>WA(e.children,xc),[e.children]),c=Re(p=>Y1e(p,t,o)),d=x.useRef(null),f=jt("recharts-pie",i);return r||c==null?(d.current=null,x.createElement(bn,{tabIndex:a,className:f})):x.createElement(Fr,{zIndex:e.zIndex},x.createElement(KNe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:c,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),x.createElement(bn,{tabIndex:a,className:f},x.createElement(nke,{props:pn(pn({},n),{},{sectors:c}),previousSectorsRef:d,id:t})))}function ake(e){var t=Un(e,rke),{id:n}=t,r=J0(t,MNe),i=Ur(r);return x.createElement(X0,{id:n,type:"pie"},a=>x.createElement(x.Fragment,null,x.createElement(zNe,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),x.createElement(qNe,Qo({},r,{id:a})),x.createElement(ike,Qo({},r,{id:a}))))}var x8=ake;x8.displayName="Pie";var ske=["points"];function zL(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 Ij(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zL(Object(n),!0).forEach(function(r){oke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oke(e,t,n){return(t=lke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lke(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 vv(){return vv=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},vv.apply(null,arguments)}function uke(e,t){if(e==null)return{};var n,r,i=dke(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 dke(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 fke(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=jt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,c=uke(a,ske);return x.createElement(d8,vv({},c,{className:i}))}function hke(e,t){return e==null?!1:t?!0:e.length===1}function b8(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:c,clipPathId:d,zIndex:f=Ln.scatter}=e;if(!hke(t,n))return null;var p=YA(n),m=tfe(n),g=t.map((w,b)=>{var j,N,O=Ij(Ij(Ij({r:3},o),m),{},{index:b,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 x.createElement(fke,{key:"dot-".concat(b),option:n,dotProps:O,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(Fr,{zIndex:f},x.createElement(bn,vv({className:r},v),g))}function RL(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 DL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(n),!0).forEach(function(r){pke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pke(e,t,n){return(t=mke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mke(e){var t=gke(e,"string");return typeof t=="symbol"?t:t+""}function gke(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 w8=0,yke={xAxis:{},yAxis:{},zAxis:{}},S8=_r({name:"cartesianAxis",initialState:yke,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:on()},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:on()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:on()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:on()},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:on()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:on()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:on()},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:on()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:on()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var c=[...o,r].slice(-3);e.yAxis[n]=DL(DL({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:vke,replaceXAxis:xke,removeXAxis:bke,addYAxis:wke,replaceYAxis:Ske,removeYAxis:jke,addZAxis:w2e,replaceZAxis:S2e,removeZAxis:j2e,updateYAxisWidth:Nke}=S8.actions,kke=S8.reducer,Cke=ne([nr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Ake=ne([Cke,Bs,Us],(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)}}),ex=()=>Re(Ake),Oke=()=>Re(vSe);function IL(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 Mj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IL(Object(n),!0).forEach(function(r){Eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eke(e,t,n){return(t=_ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ke(e){var t=Pke(e,"string");return typeof t=="symbol"?t:t+""}function Pke(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 Tke=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Mj(Mj(Mj({},c),uc(i)),xC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(d8,d),x.createElement(bn,{className:"recharts-active-dot",clipPath:o},f)};function AN(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Ln.activeDot}=e,c=Re(Vo),d=Oke();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return un(f)?null:x.createElement(Fr,{zIndex:o},x.createElement(Tke,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var ML=(e,t,n)=>{var r=n??e;if(!un(r))return Ar(r,t,0)},zke=(e,t,n)=>{var r={},i=e.filter(z0),a=e.filter(f=>f.stackId==null),o=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),c=Object.entries(o).map(f=>{var p,[m,g]=f,v=g.map(b=>b.dataKey),w=ML(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:w}}),d=a.map(f=>{var p=[f.dataKey].filter(g=>g!=null),m=ML(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...c,...d]};function LL(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 Pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LL(Object(n),!0).forEach(function(r){Rke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rke(e,t,n){return(t=Dke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dke(e){var t=Ike(e,"string");return typeof t=="symbol"?t:t+""}function Ike(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 Mke(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var c=Ar(e,n,0,!0),d,f=[];if(ft((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/o,g=r.reduce((O,C)=>O+(C.barSize||0),0);g+=(o-1)*c,g>=n&&(g-=(o-1)*c,c=0),g>=n&&m>0&&(p=!0,m*=.9,g=o*m);var v=(n-g)/2>>0,w={offset:v-c,size:0};d=r.reduce((O,C)=>{var A,P={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:w.offset+w.size+c,size:p?m:(A=C.barSize)!==null&&A!==void 0?A:0}},E=[...O,P];return w=P.position,E},f)}else{var b=Ar(t,n,0,!0);n-2*b-(o-1)*c<=0&&(c=0);var j=(n-2*b-(o-1)*c)/o;j>1&&(j>>=0);var N=ft(i)?Math.min(j,i):j;d=r.reduce((O,C,A)=>[...O,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(j+c)*A+(j-N)/2,size:N}}],f)}return d}}var Lke=(e,t,n,r,i,a,o)=>{var c=un(o)?t:o,d=Mke(n,r,i!==a?i:a,e,c);return i!==a&&d!=null&&(d=d.map(f=>Pg(Pg({},f),{},{position:Pg(Pg({},f.position),{},{offset:f.position.offset-i/2})}))),d},$ke=(e,t)=>{var n=T0(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(o=>o.key===n)}}}},Bke=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Uke(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ft(e.zIndex)?e.zIndex:t}var j8=e=>{var{chartData:t}=e,n=Ht(),r=cr();return x.useEffect(()=>r?()=>{}:(n(QM(t)),()=>{n(QM(void 0))}),[t,n,r]),null},$L={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},N8=_r({name:"brush",initialState:$L,reducers:{setBrushSettings(e,t){return t.payload==null?$L:t.payload}}}),{setBrushSettings:N2e}=N8.actions,qke=N8.reducer;function Fke(e){return(e%180+180)%180}var Kke=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Fke(i),o=a*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Hke={dots:[],areas:[],lines:[]},k8=_r({name:"referenceElements",initialState:Hke,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ki(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=Ki(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=Ki(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:k2e,removeDot:C2e,addArea:A2e,removeArea:O2e,addLine:E2e,removeLine:_2e}=k8.actions,Gke=k8.reducer,Vke=x.createContext(void 0),Qke=e=>{var{children:t}=e,[n]=x.useState("".concat(Dh("recharts"),"-clip")),r=ex();if(r==null)return null;var{x:i,y:a,width:o,height:c}=r;return x.createElement(Vke.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:c,width:o}))),t)};function C8(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 Wke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Kke(r,n)}function Yke(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:c}=e;return t===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function Wh(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 Zke(e,t){return C8(e,t+1)}function Xke(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:c}=t,d=0,f=1,p=o,m=function(){var w=r?.[d];if(w===void 0)return{v:C8(r,f)};var b=d,j,N=()=>(j===void 0&&(j=n(w,b)),j),O=w.coordinate,C=d===0||Wh(e,O,N,p,c);C||(d=0,p=o,f+=1),C&&(p=O+e*(N()/2+i),d+=f)},g;f<=a.length;)if(g=m(),g)return g.v;return[]}function Jke(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:c,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=c,g=!0,v=function(){var A=r[b];if(A==null)return 0;var P=b,E,_=()=>(E===void 0&&(E=n(A,P)),E),z=A.coordinate,I=b===p||Wh(e,z,_,m,d);if(!I)return g=!1,1;I&&(m=z+e*(_()/2+i))},w,b=p;b<o&&(w=v(),!(w!==0&&w===1));b+=f);if(g){for(var j=[],N=p;N<o;N+=f){var O=r[N];O!=null&&j.push(O)}return j}}return[]}function BL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BL(Object(n),!0).forEach(function(r){eCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eCe(e,t,n){return(t=tCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tCe(e){var t=nCe(e,"string");return typeof t=="symbol"?t:t+""}function nCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rCe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:c}=t,{end:d}=t,f=function(g){var v=a[g];if(v==null)return 1;var w=v,b,j=()=>(b===void 0&&(b=n(v,g)),b);if(g===o-1){var N=e*(w.coordinate+e*j()/2-d);a[g]=w=wr(wr({},w),{},{tickCoord:N>0?w.coordinate-N*e:w.coordinate})}else a[g]=w=wr(wr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var O=Wh(e,w.tickCoord,j,c,d);O&&(d=w.tickCoord-e*(j()/2+i),a[g]=wr(wr({},w),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function iCe(e,t,n,r,i,a){var o=(r||[]).slice(),c=o.length,{start:d,end:f}=t;if(a){var p=r[c-1];if(p!=null){var m=n(p,c-1),g=e*(p.coordinate+e*m/2-f);if(o[c-1]=p=wr(wr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var v=Wh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[c-1]=wr(wr({},p),{},{isShow:!0}))}}}for(var w=a?c-1:c,b=function(O){var C=o[O];if(C==null)return 1;var A=C,P,E=()=>(P===void 0&&(P=n(C,O)),P);if(O===0){var _=e*(A.coordinate-e*E()/2-d);o[O]=A=wr(wr({},A),{},{tickCoord:_<0?A.coordinate-_*e:A.coordinate})}else o[O]=A=wr(wr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var z=Wh(e,A.tickCoord,E,d,f);z&&(d=A.tickCoord+e*(E()/2+i),o[O]=wr(wr({},A),{},{isShow:!0}))}},j=0;j<w;j++)b(j);return o}function rO(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Te(d)||pp.isSsr){var g;return(g=Zke(i,Te(d)?d:0))!==null&&g!==void 0?g:[]}var v=[],w=c==="top"||c==="bottom"?"width":"height",b=p&&w==="width"?Sh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,E)=>{var _=typeof f=="function"?f(P.value,E):P.value;return w==="width"?Wke(Sh(_,{fontSize:t,letterSpacing:n}),b,m):Sh(_,{fontSize:t,letterSpacing:n})[w]},N=i[0],O=i[1],C=i.length>=2&&N!=null&&O!=null?or(O.coordinate-N.coordinate):1,A=Yke(a,C,w);return d==="equidistantPreserveStart"?Xke(C,A,j,i,o):d==="equidistantPreserveEnd"?Jke(C,A,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=iCe(C,A,j,i,o,d==="preserveStartEnd"):v=rCe(C,A,j,i,o),v.filter(P=>P.isShow))}var aCe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var c=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+c+(n?r:0);return Math.round(f)}return 0},sCe={xAxis:{},yAxis:{}},A8=_r({name:"renderedTicks",initialState:sCe,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:oCe,removeRenderedTicks:lCe}=A8.actions,cCe=A8.reducer,uCe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function dCe(e,t){if(e==null)return{};var n,r,i=fCe(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 fCe(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 bc(){return bc=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},bc.apply(null,arguments)}function UL(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 An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UL(Object(n),!0).forEach(function(r){hCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hCe(e,t,n){return(t=pCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pCe(e){var t=mCe(e,"string");return typeof t=="symbol"?t:t+""}function mCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ts={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:Ln.axis};function gCe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=An(An(An({},d),Ur(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=An(An({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=An(An({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",bc({},f,{className:jt("recharts-cartesian-axis-line",fc(c,"className"))}))}function yCe(e,t,n,r,i,a,o,c,d){var f,p,m,g,v,w,b=c?-1:1,j=e.tickSize||o,N=Te(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,g=n+ +!c*i,m=g-b*j,w=m-b*d,v=N;break;case"left":m=g=e.coordinate,p=t+ +!c*r,f=p-b*j,v=f-b*d,w=N;break;case"right":m=g=e.coordinate,p=t+ +c*r,f=p+b*j,v=f+b*d,w=N;break;default:f=p=e.coordinate,g=n+ +c*i,m=g+b*j,w=m+b*d,v=N;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:v,y:w}}}function vCe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function xCe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function bCe(e){var{option:t,tickProps:n,value:r}=e,i,a=jt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,An(An({},n),{},{className:a}));else if(typeof t=="function")i=t(An(An({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=jt(o,m8(t))),i=x.createElement(V0,bc({},n,{className:o}),r)}return i}function wCe(e){var{ticks:t,axisType:n,axisId:r}=e,i=Ht();return x.useEffect(()=>{if(r==null||n==null)return nl;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(oCe({ticks:a,axisId:r,axisType:n})),()=>{i(lCe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var SCe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:g,y:v,width:w,height:b,tickSize:j,tickMargin:N,fontSize:O,letterSpacing:C,getTicksConfig:A,events:P,axisType:E,axisId:_}=e,z=rO(An(An({},A),{},{ticks:n}),O,C),I=Ur(A),q=uc(r),U=r8(I.textAnchor)?I.textAnchor:vCe(p,m),B=xCe(p,m),H={};typeof i=="object"&&(H=i);var W=An(An({},I),{},{fill:"none"},H),Y=z.map(se=>An({entry:se},yCe(se,g,v,w,b,p,j,m,N))),K=Y.map(se=>{var{entry:me,line:L}=se;return x.createElement(bn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(me.value,"-").concat(me.coordinate,"-").concat(me.tickCoord)},i&&x.createElement("line",bc({},W,L,{className:jt("recharts-cartesian-axis-tick-line",fc(i,"className"))})))}),J=Y.map((se,me)=>{var L,M,{entry:F,tick:D}=se,V=An(An(An(An({verticalAnchor:B},I),{},{textAnchor:U,stroke:"none",fill:a},D),{},{index:me,payload:F,visibleTicksCount:z.length,tickFormatter:o,padding:d},f),{},{angle:(L=(M=f?.angle)!==null&&M!==void 0?M:I.angle)!==null&&L!==void 0?L:0}),oe=An(An({},V),q);return x.createElement(bn,bc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},lp(P,F,me)),r&&x.createElement(bCe,{option:r,tickProps:oe,value:"".concat(typeof o=="function"?o(F.value,me):F.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},x.createElement(wCe,{ticks:z,axisId:_,axisType:E}),J.length>0&&x.createElement(Fr,{zIndex:Ln.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},J)),K.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},K))}),jCe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:c,axisType:d,axisId:f}=e,p=dCe(e,uCe),[m,g]=x.useState(""),[v,w]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var N;return aCe({ticks:b.current,label:(N=e.labelRef)===null||N===void 0?void 0:N.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=x.useCallback(N=>{if(N){var O=N.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=O;var C=O[0];if(C){var A=window.getComputedStyle(C),P=A.fontSize,E=A.letterSpacing;(P!==m||E!==v)&&(g(P),w(E))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(Fr,{zIndex:e.zIndex},x.createElement(bn,{className:jt("recharts-cartesian-axis",a)},x.createElement(gCe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ur(e)}),x.createElement(SCe,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(y1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(A1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),iO=x.forwardRef((e,t)=>{var n=Un(e,Ts);return x.createElement(jCe,bc({},n,{ref:t}))});iO.displayName="CartesianAxis";var NCe=["x1","y1","x2","y2","key"],kCe=["offset"],CCe=["xAxisId","yAxisId"],ACe=["xAxisId","yAxisId"];function qL(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 kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qL(Object(n),!0).forEach(function(r){OCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OCe(e,t,n){return(t=ECe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ECe(e){var t=_Ce(e,"string");return typeof t=="symbol"?t:t+""}function _Ce(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 Ql(){return Ql=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},Ql.apply(null,arguments)}function xv(e,t){if(e==null)return{};var n,r,i=PCe(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 PCe(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 TCe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function O8(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:c,y2:d,key:f}=n,p=xv(n,NCe),m=(i=Ur(p))!==null&&i!==void 0?i:{},{offset:g}=m,v=xv(m,kCe);r=x.createElement("line",Ql({},v,{x1:a,y1:o,x2:c,y2:d,fill:"none",key:f}))}return r}function zCe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=xv(e,CCe),d=i.map((f,p)=>{var m=kr(kr({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(O8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function RCe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=xv(e,ACe),d=i.map((f,p)=>{var m=kr(kr({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(O8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function DCe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:c,horizontal:d=!0}=e;if(!d||!t||!t.length||c==null)return null;var f=c.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],w=v==null,b=w?i+o-m:v-m;if(b<=0)return null;var j=g%t.length;return x.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:b,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function ICe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:c,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],w=v==null,b=w?i+o-m:v-m;if(b<=0)return null;var j=g%n.length;return x.createElement("rect",{key:"react-".concat(g),x:m,y:a,width:b,height:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var MCe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return uU(rO(kr(kr(kr({},Ts),n),{},{ticks:dU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},LCe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return uU(rO(kr(kr(kr({},Ts),n),{},{ticks:dU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},$Ce={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Ln.grid};function wc(e){var t=PC(),n=TC(),r=xU(),i=kr(kr({},Un(e,$Ce)),{},{x:Te(e.x)?e.x:r.left,y:Te(e.y)?e.y:r.top,width:Te(e.width)?e.width:r.width,height:Te(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:g,verticalValues:v}=i,w=cr(),b=Re(I=>DM(I,"xAxis",a,w)),j=Re(I=>DM(I,"yAxis",o,w));if(!Ga(f)||!Ga(p)||!Te(c)||!Te(d))return null;var N=i.verticalCoordinatesGenerator||MCe,O=i.horizontalCoordinatesGenerator||LCe,{horizontalPoints:C,verticalPoints:A}=i;if((!C||!C.length)&&typeof O=="function"){var P=g&&g.length,E=O({yAxis:j?kr(kr({},j),{},{ticks:P?g:j.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);Fy(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(C=E)}if((!A||!A.length)&&typeof N=="function"){var _=v&&v.length,z=N({xAxis:b?kr(kr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);Fy(Array.isArray(z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(A=z)}return x.createElement(Fr,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(TCe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(DCe,Ql({},i,{horizontalPoints:C})),x.createElement(ICe,Ql({},i,{verticalPoints:A})),x.createElement(zCe,Ql({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:j})),x.createElement(RCe,Ql({},i,{offset:r,verticalPoints:A,xAxis:b,yAxis:j}))))}wc.displayName="CartesianGrid";var BCe={},E8=_r({name:"errorBars",initialState:BCe,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:P2e,replaceErrorBar:T2e,removeErrorBar:z2e}=E8.actions,UCe=E8.reducer,qCe=["children"];function FCe(e,t){if(e==null)return{};var n,r,i=KCe(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 KCe(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 HCe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},GCe=x.createContext(HCe);function _8(e){var{children:t}=e,n=FCe(e,qCe);return x.createElement(GCe.Provider,{value:n},t)}function tx(e,t){var n,r,i=Re(f=>Fs(f,e)),a=Re(f=>Ks(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Jn.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:er.allowDataOverflow,d=o||c;return{needClip:d,needClipX:o,needClipY:c}}function aO(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=ex(),{needClipX:a,needClipY:o,needClip:c}=tx(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}var P8=(e,t,n,r)=>Za(e,"xAxis",t,r),T8=(e,t,n,r)=>Ya(e,"xAxis",t,r),z8=(e,t,n,r)=>Za(e,"yAxis",n,r),R8=(e,t,n,r)=>Ya(e,"yAxis",n,r),VCe=ne([Nt,P8,z8,T8,R8],(e,t,n,r,i)=>ba(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),QCe=(e,t,n,r,i)=>i;function WCe(e){return e.type==="line"}var YCe=ne([jp,QCe],(e,t)=>e.filter(WCe).find(n=>n.id===t)),ZCe=ne([Nt,P8,z8,T8,R8,YCe,VCe,gp],(e,t,n,r,i,a,o,c)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:p}=c;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:m,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=d?.slice(f,p+1),v!=null)return yAe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:m,bandSize:o,displayedData:v})}});function D8(e){var t=uc(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),c=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(c)||c<0)&&(c=r),{r:o,strokeWidth:c}}return{r:n,strokeWidth:r}}var XCe=["id"],JCe=["type","layout","connectNulls","needClip","shape"],eAe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Yh(){return Yh=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},Yh.apply(null,arguments)}function FL(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 Da(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FL(Object(n),!0).forEach(function(r){tAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tAe(e,t,n){return(t=nAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nAe(e){var t=rAe(e,"string");return typeof t=="symbol"?t:t+""}function rAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sO(e,t){if(e==null)return{};var n,r,i=iAe(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 iAe(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 aAe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:rl(n,t),payload:e}]},sAe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:nl,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:rl(o,t),hide:c,type:f,color:r,unit:d,graphicalItemId:p}};return x.createElement(Z0,{tooltipEntrySettings:m})}),I8=(e,t)=>"".concat(t,"px ").concat(e,"px");function oAe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var lAe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return I8(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],c=0,d=0;c<n.length;d+=(f=n[c])!==null&&f!==void 0?f:0,++c){var f,p=n[c];if(p!=null&&d+p>a){o=[...n.slice(0,c),a-d];break}}var m=o.length%2===0?[0,t]:[t];return[...oAe(n,i),...o,...m].map(g=>"".concat(g,"px")).join(", ")};function cAe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:c}=r,d=sO(r,XCe),f=Ur(d);return x.createElement(b8,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:o,clipPathId:t})}function uAe(e){var{showLabels:t,children:n,points:r}=e,i=x.useMemo(()=>r?.map(a=>{var o,c,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Da(Da({},d),{},{value:a.value,payload:a.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(GA,{value:t?i:void 0},n)}function KL(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:c,connectNulls:d,needClip:f,shape:p}=a,m=sO(a,JCe),g=Da(Da({},Or(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:c,connectNulls:d,strokeDasharray:i??a.strokeDasharray});return x.createElement(x.Fragment,null,r?.length>1&&x.createElement(ZA,Yh({shapeType:"curve",option:p},g,{pathRef:n})),x.createElement(cAe,{points:r,clipPathId:t,props:a}))}function dAe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function fAe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,animateNewValues:g,width:v,height:w,onAnimationEnd:b,onAnimationStart:j}=n,N=i.current,O=zd(o,"recharts-line-"),C=x.useRef(O),[A,P]=x.useState(!1),E=!A,_=x.useCallback(()=>{typeof b=="function"&&b(),P(!1)},[b]),z=x.useCallback(()=>{typeof j=="function"&&j(),P(!0)},[j]),I=dAe(r.current),q=x.useRef(0);C.current!==O&&(q.current=a.current,C.current=O);var U=q.current;return x.createElement(uAe,{points:o,showLabels:E},n.children,x.createElement(Td,{animationId:O,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:_,onAnimationStart:z,key:O},B=>{var H=Dt(U,I+U,B),W=Math.min(H,I),Y;if(d)if(c){var K="".concat(c).split(/[,\s]+/gim).map(me=>parseFloat(me));Y=lAe(W,I,K)}else Y=I8(I,W);else Y=c==null?void 0:String(c);if(B>0&&I>0&&(i.current=o,a.current=Math.max(a.current,W)),N){var J=N.length/o.length,se=B===1?o:o.map((me,L)=>{var M=Math.floor(L*J);if(N[M]){var F=N[M];return Da(Da({},me),{},{x:Dt(F.x,me.x,B),y:Dt(F.y,me.y,B)})}return g?Da(Da({},me),{},{x:Dt(v*2,me.x,B),y:Dt(w/2,me.y,B)}):Da(Da({},me),{},{x:me.x,y:me.y})});return i.current=se,x.createElement(KL,{props:n,points:se,clipPathId:t,pathRef:r,strokeDasharray:Y})}return x.createElement(KL,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:Y})}),x.createElement(Q0,{label:n.label}))}function hAe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(fAe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var pAe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:_t(e.payload,t)}};class mAe extends x.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:c,left:d,width:f,height:p,id:m,needClip:g,zIndex:v}=this.props;if(t)return null;var w=jt("recharts-line",i),b=m,{r:j,strokeWidth:N}=D8(n),O=YA(n),C=j*2+N,A=g?"url(#clipPath-".concat(O?"":"dots-").concat(b,")"):void 0;return x.createElement(Fr,{zIndex:v},x.createElement(bn,{className:w},g&&x.createElement("defs",null,x.createElement(aO,{clipPathId:b,xAxisId:a,yAxisId:o}),!O&&x.createElement("clipPath",{id:"clipPath-dots-".concat(b)},x.createElement("rect",{x:d-C/2,y:c-C/2,width:f+C,height:p+C}))),x.createElement(_8,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:pAe,errorBarOffset:0},x.createElement(hAe,{props:this.props,clipPathId:b}))),x.createElement(AN,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var M8={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Ln.line,type:"linear"};function gAe(e){var t=Un(e,M8),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:c,dot:d,hide:f,isAnimationActive:p,label:m,legendType:g,xAxisId:v,yAxisId:w,id:b}=t,j=sO(t,eAe),{needClip:N}=tx(v,w),O=ex(),C=il(),A=cr(),P=Re(q=>ZCe(q,v,w,A,b));if(C!=="horizontal"&&C!=="vertical"||P==null||O==null)return null;var{height:E,width:_,x:z,y:I}=O;return x.createElement(mAe,Yh({},j,{id:b,connectNulls:c,dot:d,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:p,hide:f,label:m,legendType:g,xAxisId:v,yAxisId:w,points:P,layout:C,height:E,width:_,left:z,top:I,needClip:N}))}function yAe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:c,displayedData:d}=e;return d.map((f,p)=>{var m=_t(f,o);if(t==="horizontal"){var g=qy({axis:n,ticks:i,bandSize:c,entry:f,index:p}),v=un(m)?null:r.scale.map(m);return{x:g,y:v??null,value:m,payload:f}}var w=un(m)?null:n.scale.map(m),b=qy({axis:r,ticks:a,bandSize:c,entry:f,index:p});return w==null||b==null?null:{x:w,y:b,value:m,payload:f}}).filter(Boolean)}function vAe(e){var t=Un(e,M8),n=cr();return x.createElement(X0,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(tO,{legendPayload:aAe(t)}),x.createElement(sAe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(nO,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(gAe,Yh({},t,{id:r}))))}var nx=x.memo(vAe,Pc);nx.displayName="Line";function ts(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:w8}function ns(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:w8}var L8=(e,t,n)=>Za(e,"xAxis",ts(e,t),n),$8=(e,t,n)=>Ya(e,"xAxis",ts(e,t),n),B8=(e,t,n)=>Za(e,"yAxis",ns(e,t),n),U8=(e,t,n)=>Ya(e,"yAxis",ns(e,t),n),xAe=ne([Nt,L8,B8,$8,U8],(e,t,n,r,i)=>ba(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),bAe=(e,t)=>t,q8=ne([jp,bAe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),F8=e=>{var t=Nt(e),n=ba(t,"xAxis");return n?"yAxis":"xAxis"},wAe=(e,t)=>{var n=F8(e);return n==="yAxis"?ns(e,t):ts(e,t)},SAe=(e,t,n)=>dv(e,F8(e),wAe(e,t),n),jAe=ne([q8,SAe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=T0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(c=>c.key===i);if(o!=null)return o.map(c=>[c[0],c[1]])}}}),NAe=ne([Nt,L8,B8,$8,U8,jAe,FU,xAe,q8,Ove],(e,t,n,r,i,a,o,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:g}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,g+1),w!=null)return KAe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:c})}}),kAe=["id"],CAe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function nc(){return nc=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},nc.apply(null,arguments)}function K8(e,t){if(e==null)return{};var n,r,i=AAe(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 AAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function HL(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 Uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){OAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OAe(e,t,n){return(t=EAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EAe(e){var t=_Ae(e,"string");return typeof t=="symbol"?t:t+""}function _Ae(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 bv(e,t){return e&&e!=="none"?e:t}var PAe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:bv(r,i),value:rl(n,t),payload:e}]},TAe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:nl,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:rl(o,t),hide:c,type:f,color:bv(r,a),unit:d,graphicalItemId:p}};return x.createElement(Z0,{tooltipEntrySettings:m})});function zAe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,c=Ur(r);return x.createElement(b8,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:c,needClip:i,clipPathId:t})}function RAe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,c,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Uu(Uu({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(GA,{value:t?i:void 0},n)}function GL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,g=K8(a,kAe),v=Ur(g),w=Or(g);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(bn,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(Zu,nc({},w,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(Zu,nc({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(Zu,nc({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:n}))),x.createElement(zAe,{points:t,props:g,clipPathId:i}))}function DAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!ft(c)||!ft(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Te(p)?x.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function IAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!ft(c)||!ft(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Te(p)?x.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function MAe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(DAe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(IAe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function LAe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:g,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:o,baseLine:c}),[o,c]),b=zd(w,"recharts-area-"),j=zC(),[N,O]=x.useState(!1),C=!N,A=x.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),P=x.useCallback(()=>{typeof g=="function"&&g(),O(!0)},[g]);if(j==null)return null;var E=i.current,_=a.current;return x.createElement(RAe,{showLabels:C,points:o},r.children,x.createElement(Td,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:A,onAnimationStart:P,key:b},z=>{if(E){var I=E.length/o.length,q=z===1?o:o.map((B,H)=>{var W=Math.floor(H*I);if(E[W]){var Y=E[W];return Uu(Uu({},B),{},{x:Dt(Y.x,B.x,z),y:Dt(Y.y,B.y,z)})}return B}),U;return Te(c)?U=Dt(_,c,z):un(c)||pa(c)?U=Dt(_,0,z):U=c.map((B,H)=>{var W=Math.floor(H*I);if(Array.isArray(_)&&_[W]){var Y=_[W];return Uu(Uu({},B),{},{x:Dt(Y.x,B.x,z),y:Dt(Y.y,B.y,z)})}return B}),z>0&&(i.current=q,a.current=U),x.createElement(GL,{points:q,baseLine:U,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=c),x.createElement(bn,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(MAe,{alpha:z,points:o,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(bn,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(GL,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(Q0,{label:r.label}))}function $Ae(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(LAe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class BAe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:c,xAxisId:d,yAxisId:f,width:p,height:m,id:g,baseLine:v,zIndex:w}=this.props;if(t)return null;var b=jt("recharts-area",i),j=g,{r:N,strokeWidth:O}=D8(n),C=YA(n),A=N*2+O,P=c?"url(#clipPath-".concat(C?"":"dots-").concat(j,")"):void 0;return x.createElement(Fr,{zIndex:w},x.createElement(bn,{className:b},c&&x.createElement("defs",null,x.createElement(aO,{clipPathId:j,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:o-A/2,y:a-A/2,width:p+A,height:m+A}))),x.createElement($Ae,{needClip:c,clipPathId:j,props:this.props})),x.createElement(AN,{points:r,mainColor:bv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&x.createElement(AN,{points:v,mainColor:bv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var UAe={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:Ln.area};function qAe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:g,stroke:v,xAxisId:w,yAxisId:b}=e,j=K8(e,CAe),N=il(),O=KF(),{needClip:C}=tx(w,b),A=cr(),{points:P,isRange:E,baseLine:_}=(t=Re(H=>NAe(H,e.id,A)))!==null&&t!==void 0?t:{},z=ex();if(N!=="horizontal"&&N!=="vertical"||z==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:I,width:q,x:U,y:B}=z;return!P||!P.length?null:x.createElement(BAe,nc({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:o,dot:c,fill:d,fillOpacity:f,height:I,hide:p,layout:N,isAnimationActive:m,isRange:E,legendType:g,needClip:C,points:P,stroke:v,width:q,left:U,top:B,xAxisId:w,yAxisId:b}))}var FAe=(e,t,n,r,i)=>{var a=n??t;if(Te(a))return a;var o=e==="horizontal"?i:r,c=o.scale.domain();if(o.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]};function KAe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:g,bandSize:v}=e,w=i&&i.length,b=FAe(a,o,n,c,d),j=a==="horizontal",N=!1,O=f.map((A,P)=>{var E,_,z,I;if(w)I=i[p+P];else{var q=_t(A,r);Array.isArray(q)?(I=q,N=!0):I=[b,q]}var U=(E=(_=I)===null||_===void 0?void 0:_[1])!==null&&E!==void 0?E:null,B=U==null||w&&!t&&_t(A,r)==null;if(j){var H;return{x:qy({axis:c,ticks:m,bandSize:v,entry:A,index:P}),y:B?null:(H=d.scale.map(U))!==null&&H!==void 0?H:null,value:I,payload:A}}return{x:B?null:(z=c.scale.map(U))!==null&&z!==void 0?z:null,y:qy({axis:d,ticks:g,bandSize:v,entry:A,index:P}),value:I,payload:A}}),C;return w||N?C=O.map(A=>{var P,E=Array.isArray(A.value)?A.value[0]:null;if(j){var _;return{x:A.x,y:E!=null&&A.y!=null&&(_=d.scale.map(E))!==null&&_!==void 0?_:null,payload:A.payload}}return{x:E!=null&&(P=c.scale.map(E))!==null&&P!==void 0?P:null,y:A.y,payload:A.payload}}):C=j?d.scale.map(b):c.scale.map(b),{points:O,baseLine:C??0,isRange:N}}function HAe(e){var t=Un(e,UAe),n=cr();return x.createElement(X0,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(tO,{legendPayload:PAe(t)}),x.createElement(TAe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(nO,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:fU(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(qAe,nc({},t,{id:r}))))}var qu=x.memo(HAe,Pc);qu.displayName="Area";function ON(){return ON=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},ON.apply(null,arguments)}function oO(e){return x.createElement(ZA,ON({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var GAe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Te(t))return t;var a=Te(r)||un(r);return a?t(r,i):(a||zs(!1),n)}},VAe=(e,t,n)=>n,QAe=(e,t)=>t,Op=ne([jp,QAe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),WAe=ne([Op],e=>e?.maxBarSize),YAe=(e,t,n,r)=>r,ZAe=ne([Nt,jp,ts,ns,VAe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),XAe=(e,t,n)=>{var r=Nt(e),i=ts(e,t),a=ns(e,t);if(!(i==null||a==null))return r==="horizontal"?dv(e,"yAxis",a,n):dv(e,"xAxis",i,n)},JAe=(e,t)=>{var n=Nt(e),r=ts(e,t),i=ns(e,t);if(!(r==null||i==null))return n==="horizontal"?RM(e,"xAxis",r):RM(e,"yAxis",i)},eOe=ne([ZAe,Ave,JAe],zke),tOe=(e,t,n)=>{var r,i,a=Op(e,t);if(a==null)return 0;var o=ts(e,t),c=ns(e,t);if(o==null||c==null)return 0;var d=Nt(e),f=tq(e),{maxBarSize:p}=a,m=un(p)?f:p,g,v;return d==="horizontal"?(g=Za(e,"xAxis",o,n),v=Ya(e,"xAxis",o,n)):(g=Za(e,"yAxis",c,n),v=Ya(e,"yAxis",c,n)),(r=(i=Go(g,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},H8=(e,t,n)=>{var r=Nt(e),i=ts(e,t),a=ns(e,t);if(!(i==null||a==null)){var o,c;return r==="horizontal"?(o=Za(e,"xAxis",i,n),c=Ya(e,"xAxis",i,n)):(o=Za(e,"yAxis",a,n),c=Ya(e,"yAxis",a,n)),Go(o,c)}},nOe=ne([eOe,tq,Cve,nq,tOe,H8,WAe],Lke),rOe=(e,t,n)=>{var r=ts(e,t);if(r!=null)return Za(e,"xAxis",r,n)},iOe=(e,t,n)=>{var r=ns(e,t);if(r!=null)return Za(e,"yAxis",r,n)},aOe=(e,t,n)=>{var r=ts(e,t);if(r!=null)return Ya(e,"xAxis",r,n)},sOe=(e,t,n)=>{var r=ns(e,t);if(r!=null)return Ya(e,"yAxis",r,n)},oOe=ne([nOe,Op],Bke),lOe=ne([XAe,Op],$ke),cOe=ne([nr,OC,rOe,iOe,aOe,sOe,oOe,Nt,FU,H8,lOe,Op,YAe],(e,t,n,r,i,a,o,c,d,f,p,m,g)=>{var{chartData:v,dataStartIndex:w,dataEndIndex:b}=d;if(!(m==null||o==null||t==null||c!=="horizontal"&&c!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:j}=m,N;if(j!=null&&j.length>0?N=j:N=v?.slice(w,b+1),N!=null)return MOe({layout:c,barSettings:m,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:N,offset:e,cells:g,dataStartIndex:w})}}),uOe=["index"];function EN(){return EN=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},EN.apply(null,arguments)}function dOe(e,t){if(e==null)return{};var n,r,i=fOe(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 fOe(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 G8=x.createContext(void 0),hOe=e=>{var t=x.useContext(G8);if(t!=null)return t.stackId;if(e!=null)return fU(e)},pOe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),mOe=e=>{var t=x.useContext(G8);if(t!=null){var{stackId:n}=t;return"url(#".concat(pOe(n,e),")")}},V8=e=>{var{index:t}=e,n=dOe(e,uOe),r=mOe(t);return x.createElement(bn,EN({className:"recharts-bar-stack-layer",clipPath:r},n))},gOe=["onMouseEnter","onMouseLeave","onClick"],yOe=["value","background","tooltipPosition"],vOe=["id"],xOe=["onMouseEnter","onClick","onMouseLeave"];function Wo(){return Wo=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},Wo.apply(null,arguments)}function VL(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 Dr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VL(Object(n),!0).forEach(function(r){bOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bOe(e,t,n){return(t=wOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wOe(e){var t=SOe(e,"string");return typeof t=="symbol"?t:t+""}function SOe(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 wv(e,t){if(e==null)return{};var n,r,i=jOe(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 jOe(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 NOe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:rl(n,t),payload:e}]},kOe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:c,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:nl,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:rl(a,t),hide:o,type:d,color:i,unit:c,graphicalItemId:f}};return x.createElement(Z0,{tooltipEntrySettings:p})});function COe(e){var t=Re(Vo),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:c,onClick:d}=a,f=wv(a,gOe),p=XA(o,r,a.id),m=JA(c),g=eO(d,r,a.id);if(!i||n==null)return null;var v=uc(i);return x.createElement(Fr,{zIndex:Uke(i,Ln.barBackground)},n.map((w,b)=>{var{value:j,background:N,tooltipPosition:O}=w,C=wv(w,yOe);if(!N)return null;var A=p(w,b),P=m(w,b),E=g(w,b),_=Dr(Dr(Dr(Dr(Dr({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},N),v),lp(f,w,b)),{},{onMouseEnter:A,onMouseLeave:P,onClick:E,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(oO,Wo({key:"background-bar-".concat(b)},_))}))}function AOe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Dr(Dr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return x.createElement(GA,{value:t?i:void 0},n)}function OOe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,c=Re(Vo),d=Re(BA),f=n&&String(i.originalDataIndex)===c&&(d==null||o===d),[p,m]=x.useState(!1),[g,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var w=x.useCallback(()=>{f||m(!1)},[f]),b=f&&g,j=f||p,N;f?n===!0?N=t:N=n:N=t;var O=x.createElement(oO,Wo({},r,{name:String(r.name)},i,{isActive:b,option:N,index:a,dataKey:o,onTransitionEnd:w}));return j?x.createElement(Fr,{zIndex:Ln.activeBar},x.createElement(V8,{index:i.originalDataIndex},O)):O}function EOe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(oO,Wo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function _Oe(e){var t,{data:n,props:r}=e,i=(t=Ur(r))!==null&&t!==void 0?t:{},{id:a}=i,o=wv(i,vOe),{shape:c,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:g}=r,v=wv(r,xOe),w=XA(p,d,a),b=JA(g),j=eO(m,d,a);return n?x.createElement(x.Fragment,null,n.map((N,O)=>x.createElement(V8,Wo({index:N.originalDataIndex,key:"rectangle-".concat(N?.x,"-").concat(N?.y,"-").concat(N?.value,"-").concat(O),className:"recharts-bar-rectangle"},lp(v,N,O),{onMouseEnter:w(N,O),onMouseLeave:b(N,O),onClick:j(N,O)}),f?x.createElement(OOe,{shape:c,activeBar:f,baseProps:o,entry:N,index:O,dataKey:d}):x.createElement(EOe,{shape:c,baseProps:o,entry:N,index:O,dataKey:d})))):null}function POe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:c,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,g=zd(t,"recharts-bar-"),[v,w]=x.useState(!1),b=!v,j=x.useCallback(()=>{typeof f=="function"&&f(),w(!1)},[f]),N=x.useCallback(()=>{typeof p=="function"&&p(),w(!0)},[p]);return x.createElement(AOe,{showLabels:b,rects:r},x.createElement(Td,{animationId:g,begin:o,duration:c,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:N,key:g},O=>{var C=O===1?r:r?.map((A,P)=>{var E=m&&m[P];if(E)return Dr(Dr({},A),{},{x:Dt(E.x,A.x,O),y:Dt(E.y,A.y,O),width:Dt(E.width,A.width,O),height:Dt(E.height,A.height,O)});if(i==="horizontal"){var _=Dt(0,A.height,O),z=Dt(A.stackedBarStart,A.y,O);return Dr(Dr({},A),{},{y:z,height:_})}var I=Dt(0,A.width,O),q=Dt(A.stackedBarStart,A.x,O);return Dr(Dr({},A),{},{width:I,x:q})});return O>0&&(n.current=C??null),C==null?null:x.createElement(bn,null,x.createElement(_Oe,{props:t,data:C}))}),x.createElement(Q0,{label:t.label}),t.children)}function TOe(e){var t=x.useRef(null);return x.createElement(POe,{previousRectanglesRef:t,props:e})}var Q8=0,zOe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:_t(e,t)}};class ROe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:c,background:d,id:f}=this.props;if(t||n==null)return null;var p=jt("recharts-bar",i),m=f;return x.createElement(bn,{className:p,id:f},c&&x.createElement("defs",null,x.createElement(aO,{clipPathId:m,xAxisId:a,yAxisId:o})),x.createElement(bn,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(m,")"):void 0},x.createElement(COe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(TOe,this.props)))}}var DOe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Q8,xAxisId:0,yAxisId:0,zIndex:Ln.bar};function IOe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=tx(t,n),g=il(),v=cr(),w=WA(e.children,xc),b=Re(O=>cOe(O,e.id,v,w));if(g!=="vertical"&&g!=="horizontal")return null;var j,N=b?.[0];return N==null||N.height==null||N.width==null?j=0:j=g==="vertical"?N.height/2:N.width/2,x.createElement(_8,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:zOe,errorBarOffset:j},x.createElement(ROe,Wo({},e,{layout:g,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function MOe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:c,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:g,offset:v,cells:w,parentViewBox:b,dataStartIndex:j}=e,N=t==="horizontal"?d:c,O=m?N.scale.domain():null,C=gme({numericAxis:N}),A=N.scale.map(C);return g.map((P,E)=>{var _,z,I,q,U,B;if(m){var H=m[E+j];if(H==null)return null;_=dme(H,O)}else _=_t(P,n),Array.isArray(_)||(_=[C,_]);var W=GAe(r,Q8)(_[1],E);if(t==="horizontal"){var Y,K=d.scale.map(_[0]),J=d.scale.map(_[1]);if(K==null||J==null)return null;z=OD({axis:c,ticks:f,bandSize:o,offset:a.offset,entry:P,index:E}),I=(Y=J??K)!==null&&Y!==void 0?Y:void 0,q=a.size;var se=K-J;if(U=pa(se)?0:se,B={x:z,y:v.top,width:q,height:v.height},Math.abs(W)>0&&Math.abs(U)<Math.abs(W)){var me=or(U||W)*(Math.abs(W)-Math.abs(U));I-=me,U+=me}}else{var L=c.scale.map(_[0]),M=c.scale.map(_[1]);if(L==null||M==null)return null;if(z=L,I=OD({axis:d,ticks:p,bandSize:o,offset:a.offset,entry:P,index:E}),q=M-L,U=a.size,B={x:v.left,y:I,width:v.width,height:U},Math.abs(W)>0&&Math.abs(q)<Math.abs(W)){var F=or(q||W)*(Math.abs(W)-Math.abs(q));q+=F}}if(z==null||I==null||q==null||U==null||!i&&(q===0||U===0))return null;var D=Dr(Dr({},P),{},{stackedBarStart:A,x:z,y:I,width:q,height:U,value:m?_:_[1],payload:P,background:B,tooltipPosition:{x:z+q/2,y:I+U/2},parentViewBox:b,originalDataIndex:E},w&&w[E]&&w[E].props);return D}).filter(Boolean)}function LOe(e){var t=Un(e,DOe),n=hOe(t.stackId),r=cr();return x.createElement(X0,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(tO,{legendPayload:NOe(t)}),x.createElement(kOe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),x.createElement(nO,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(Fr,{zIndex:t.zIndex},x.createElement(IOe,Wo({},t,{id:i})))))}var Sv=x.memo(LOe,Pc);Sv.displayName="Bar";var $Oe=["domain","range"],BOe=["domain","range"];function QL(e,t){if(e==null)return{};var n,r,i=UOe(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 UOe(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 WL(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 W8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=QL(e,$Oe),{domain:a,range:o}=t,c=QL(t,BOe);return!WL(n,a)||!WL(r,o)?!1:Pc(i,c)}var qOe=["type"],FOe=["dangerouslySetInnerHTML","ticks","scale"],KOe=["id","scale"];function _N(){return _N=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},_N.apply(null,arguments)}function YL(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 ZL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YL(Object(n),!0).forEach(function(r){HOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HOe(e,t,n){return(t=GOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GOe(e){var t=VOe(e,"string");return typeof t=="symbol"?t:t+""}function VOe(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 PN(e,t){if(e==null)return{};var n,r,i=QOe(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 QOe(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 WOe(e){var t=Ht(),n=x.useRef(null),r=zC(),{type:i}=e,a=PN(e,qOe),o=_0(r,"xAxis",i),c=x.useMemo(()=>{if(o!=null)return ZL(ZL({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(vke(c)):n.current!==c&&t(xke({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(bke(n.current)),n.current=null)},[t]),null}var YOe=e=>{var{xAxisId:t,className:n}=e,r=Re(OC),i=cr(),a="xAxis",o=Re(N=>xF(N,a,t,i)),c=Re(N=>gF(N,t)),d=Re(N=>owe(N,t)),f=Re(N=>Qq(N,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:g}=e,v=PN(e,FOe),{id:w,scale:b}=f,j=PN(f,KOe);return x.createElement(iO,_N({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:jt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},ZOe={allowDataOverflow:Jn.allowDataOverflow,allowDecimals:Jn.allowDecimals,allowDuplicatedCategory:Jn.allowDuplicatedCategory,angle:Jn.angle,axisLine:Ts.axisLine,height:Jn.height,hide:!1,includeHidden:Jn.includeHidden,interval:Jn.interval,label:!1,minTickGap:Jn.minTickGap,mirror:Jn.mirror,orientation:Jn.orientation,padding:Jn.padding,reversed:Jn.reversed,scale:Jn.scale,tick:Jn.tick,tickCount:Jn.tickCount,tickLine:Ts.tickLine,tickSize:Ts.tickSize,type:Jn.type,niceTicks:Jn.niceTicks,xAxisId:0},XOe=e=>{var t=Un(e,ZOe);return x.createElement(x.Fragment,null,x.createElement(WOe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(YOe,t))},Ja=x.memo(XOe,W8);Ja.displayName="XAxis";var JOe=["type"],eEe=["dangerouslySetInnerHTML","ticks","scale"],tEe=["id","scale"];function TN(){return TN=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},TN.apply(null,arguments)}function XL(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 JL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XL(Object(n),!0).forEach(function(r){nEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nEe(e,t,n){return(t=rEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rEe(e){var t=iEe(e,"string");return typeof t=="symbol"?t:t+""}function iEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zN(e,t){if(e==null)return{};var n,r,i=aEe(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 aEe(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 sEe(e){var t=Ht(),n=x.useRef(null),r=zC(),{type:i}=e,a=zN(e,JOe),o=_0(r,"yAxis",i),c=x.useMemo(()=>{if(o!=null)return JL(JL({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(wke(c)):n.current!==c&&t(Ske({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(jke(n.current)),n.current=null)},[t]),null}function oEe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),c=Re(OC),d=cr(),f=Ht(),p="yAxis",m=Re(E=>yF(E,t)),g=Re(E=>cwe(E,t)),v=Re(E=>xF(E,p,t,d)),w=Re(E=>Wq(E,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||HA(i)||x.isValidElement(i)||w==null)){var E=a.current;if(E){var _=E.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(Nke({id:t,width:_}))}}},[v,m,f,i,t,r,w]),m==null||g==null||w==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:N}=e,O=zN(e,eEe),{id:C,scale:A}=w,P=zN(w,tEe);return x.createElement(iO,TN({},O,P,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:jt("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:v,axisType:p,axisId:t}))}var lEe={allowDataOverflow:er.allowDataOverflow,allowDecimals:er.allowDecimals,allowDuplicatedCategory:er.allowDuplicatedCategory,angle:er.angle,axisLine:Ts.axisLine,hide:!1,includeHidden:er.includeHidden,interval:er.interval,label:!1,minTickGap:er.minTickGap,mirror:er.mirror,orientation:er.orientation,padding:er.padding,reversed:er.reversed,scale:er.scale,tick:er.tick,tickCount:er.tickCount,tickLine:Ts.tickLine,tickSize:Ts.tickSize,type:er.type,niceTicks:er.niceTicks,width:er.width,yAxisId:0},cEe=e=>{var t=Un(e,lEe);return x.createElement(x.Fragment,null,x.createElement(sEe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(oEe,t))},es=x.memo(cEe,W8);es.displayName="YAxis";var uEe=(e,t)=>t,lO=ne([uEe,Nt,cq,ur,MF,Hs,_Se,nr],MSe);function dEe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function cO(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(dEe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(c,d)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>o(c.clientX,c.clientY)):o(e.clientX,e.clientY)}var Y8=wi("mouseClick"),Z8=up();Z8.startListening({actionCreator:Y8,effect:(e,t)=>{var n=e.payload,r=lO(t.getState(),cO(n));r?.activeIndex!=null&&t.dispatch(kwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var RN=wi("mouseMove"),X8=up(),Ou=null,Pl=null,Lj=null;X8.startListening({actionCreator:RN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Ou!==null&&(cancelAnimationFrame(Ou),Ou=null),Pl!==null&&(typeof i!="number"||!o)&&(clearTimeout(Pl),Pl=null),Lj=cO(n);var c=()=>{var d=t.getState(),f=Cp(d,d.tooltip.settings.shared);if(!Lj){Ou=null,Pl=null;return}if(f==="axis"){var p=lO(d,Lj);p?.activeIndex!=null?t.dispatch(AF({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(CF())}Ou=null,Pl=null};if(!o){c();return}i==="raf"?Ou=requestAnimationFrame(c):typeof i=="number"&&Pl===null&&(Pl=setTimeout(c,i))}});function fEe(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 e$={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},J8=_r({name:"rootProps",initialState:e$,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:e$.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}}}),hEe=J8.reducer,{updateOptions:pEe}=J8.actions,mEe=null,gEe={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)},e9=_r({name:"polarOptions",initialState:mEe,reducers:gEe}),{updatePolarOptions:yEe}=e9.actions,vEe=e9.reducer,t9=wi("keyDown"),n9=wi("focus"),r9=wi("blur"),rx=up(),Eu=null,Tl=null,Tg=null;rx.startListening({actionCreator:t9,effect:(e,t)=>{Tg=e.payload,Eu!==null&&(cancelAnimationFrame(Eu),Eu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Tl!==null&&(typeof r!="number"||!a)&&(clearTimeout(Tl),Tl=null);var o=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=Tg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=wh(f,vc(c),md(c),gd(c)),g=m==null?-1:Number(m),v=!Number.isFinite(g)||g<0,w=Hs(c),b=vc(c),j=Cp(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var N=pv(c,j,"hover",String(f.index));t.dispatch(hv({active:!f.active,activeIndex:f.index,activeCoordinate:N}));return}var O=pwe(c),C=O==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,P;if(v){var E=md(c),_=gd(c),z=A*C,I=W=>({active:!1,index:String(W),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,z>0){for(var q=0;q<b.length;q++)if(wh(I(q),b,E,_)!=null){P=q;break}}else for(var U=b.length-1;U>=0;U--)if(wh(I(U),b,E,_)!=null){P=U;break}if(P<0)return}else{P=g+A*C;var B=w?.length||b.length;if(B===0||P>=B||P<0)return}var H=pv(c,j,"hover",String(P));t.dispatch(hv({active:!0,activeIndex:P.toString(),activeCoordinate:H}))}finally{Eu=null,Tl=null}};if(!a){o();return}r==="raf"?Eu=requestAnimationFrame(o):typeof r=="number"&&Tl===null&&(o(),Tg=null,Tl=setTimeout(()=>{Tg?o():(Tl=null,Eu=null)},r))}});rx.startListening({actionCreator:n9,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=Cp(n,n.tooltip.settings.shared),c=pv(n,o,"hover",String(a));t.dispatch(hv({active:!0,activeIndex:a,activeCoordinate:c}))}}}});rx.startListening({actionCreator:r9,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(hv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function i9(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 Li=wi("externalEvent"),a9=up(),zg=new Map,ah=new Map,$j=new Map;a9.startListening({actionCreator:Li,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=i9(r);$j.set(i,{handler:n,reactEvent:a});var o=zg.get(i);o!==void 0&&(cancelAnimationFrame(o),zg.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),g=ah.get(i);g!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(g),ah.delete(i));var v=()=>{var j=$j.get(i);try{if(!j)return;var{handler:N,reactEvent:O}=j,C=t.getState(),A={activeCoordinate:mSe(C),activeDataKey:BA(C),activeIndex:Vo(C),activeLabel:BF(C),activeTooltipIndex:Vo(C),isTooltipActive:gSe(C)};N&&N(A,O)}finally{zg.delete(i),ah.delete(i),$j.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);zg.set(i,w)}else if(typeof d=="number"){if(!ah.has(i)){v();var b=setTimeout(v,d);ah.set(i,b)}}else v()}}});var xEe=ne([Ud],e=>e.tooltipItemPayloads),bEe=ne([xEe,(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)}}}),s9=wi("touchMove"),o9=up(),zl=null,No=null,t$=null,sh=null;o9.startListening({actionCreator:s9,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){sh=i9(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");zl!==null&&(cancelAnimationFrame(zl),zl=null),No!==null&&(typeof i!="number"||!o)&&(clearTimeout(No),No=null),t$=Array.from(n.touches).map(d=>cO({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(sh!=null){var d=t.getState(),f=Cp(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=t$)===null||p===void 0?void 0:p[0];if(m==null){zl=null,No=null;return}var g=lO(d,m);g?.activeIndex!=null&&t.dispatch(AF({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,w=sh.touches[0];if(document.elementFromPoint==null||w==null)return;var b=document.elementFromPoint(w.clientX,w.clientY);if(!b||!b.getAttribute)return;var j=b.getAttribute(pU),N=(v=b.getAttribute(mU))!==null&&v!==void 0?v:void 0,O=Rc(d).find(P=>P.id===N);if(j==null||O==null||N==null)return;var{dataKey:C}=O,A=bEe(d,j,N);t.dispatch(kF({activeDataKey:C,activeIndex:j,activeCoordinate:A,activeGraphicalItemId:N}))}zl=null,No=null}};if(!o){c();return}i==="raf"?zl=requestAnimationFrame(c):typeof i=="number"&&No===null&&(c(),sh=null,No=setTimeout(()=>{sh?c():(No=null,zl=null)},i))}}});var uO={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},l9=_r({name:"eventSettings",initialState:uO,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:wEe}=l9.actions,SEe=l9.reducer,jEe=D6({brush:qke,cartesianAxis:kke,chartData:hje,errorBars:UCe,eventSettings:SEe,graphicalItems:_Ne,layout:sme,legend:fge,options:lje,polarAxis:F1e,polarOptions:vEe,referenceElements:Gke,renderedTicks:cCe,rootProps:hEe,tooltip:Cwe,zIndex:YSe}),NEe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Ppe({reducer:jEe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([Z8.middleware,X8.middleware,rx.middleware,a9.middleware,o9.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Y6({type:"raf"}))},devTools:{serialize:{replacer:fEe},name:"recharts-".concat(n)}})};function c9(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=cr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=NEe(t,r));var o=wC;return x.createElement(_ge,{context:o,store:a.current},n)}function kEe(e){var{layout:t,margin:n}=e,r=Ht(),i=cr();return x.useEffect(()=>{i||(r(rme(t)),r(nme(n)))},[r,i,t,n]),null}var u9=x.memo(kEe,Pc);function d9(e){var t=Ht();return x.useEffect(()=>{t(pEe(e))},[t,e]),null}var CEe=e=>{var t=Ht();return x.useEffect(()=>{t(wEe(e))},[t,e]),null},f9=x.memo(CEe,Pc);function n$(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Ht();return x.useLayoutEffect(()=>(r.current&&i(QSe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(WSe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function r$(e){var{children:t,isPanorama:n}=e,r=Re($Se);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return x.createElement(x.Fragment,null,i.map(o=>x.createElement(n$,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(n$,{key:o,zIndex:o,isPanorama:n})))}var AEe=["children"];function OEe(e,t){if(e==null)return{};var n,r,i=EEe(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 EEe(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 jv(){return jv=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},jv.apply(null,arguments)}var _Ee={width:"100%",height:"100%",display:"block"},PEe=x.forwardRef((e,t)=>{var n=PC(),r=TC(),i=TU();if(!Ga(n)||!Ga(r))return null;var{children:a,otherAttributes:o,title:c,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),x.createElement(dC,jv({},o,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:_Ee,ref:t}),a)}),TEe=e=>{var{children:t}=e,n=Re(N0);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(dC,{width:r,height:i,x:o,y:a},t)},i$=x.forwardRef((e,t)=>{var{children:n}=e,r=OEe(e,AEe),i=cr();return i?x.createElement(TEe,null,x.createElement(r$,{isPanorama:!0},n)):x.createElement(PEe,jv({ref:t},r),x.createElement(r$,{isPanorama:!1},n))});function zEe(){var e=Ht(),[t,n]=x.useState(null),r=Re(Sme);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ft(a)&&a!==r&&e(ame(a))}},[t,e,r]),n}function a$(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 REe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a$(Object(n),!0).forEach(function(r){DEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DEe(e,t,n){return(t=IEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IEe(e){var t=MEe(e,"string");return typeof t=="symbol"?t:t+""}function MEe(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 qo(){return qo=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},qo.apply(null,arguments)}var LEe=()=>(Sje(),null);function Nv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var $Ee=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:Nv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Nv((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((f,p)=>{o(m=>{var g=Math.round(f),v=Math.round(p);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),d=x.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();c(p,m);var g=w=>{var b=w[0];if(b!=null){var{width:j,height:N}=b.contentRect;c(j,N)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(fp,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",qo({ref:d},e)))}),BEe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:Nv(n),containerHeight:Nv(r)}),o=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),g=Math.round(f);return p.containerWidth===m&&p.containerHeight===g?p:{containerWidth:m,containerHeight:g}})},[]),c=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return x.createElement(x.Fragment,null,x.createElement(fp,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",qo({ref:c},e)))}),UEe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(fp,{width:n,height:r}),x.createElement("div",qo({ref:t},e)))}),qEe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(BEe,qo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(UEe,qo({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(fp,{width:n,height:r}),x.createElement("div",qo({ref:t},e)))});function FEe(e){return e?$Ee:qEe}var KEe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:g,onTouchEnd:v,onTouchMove:w,onTouchStart:b,style:j,width:N,responsive:O,dispatchTouchEvents:C=!0}=e,A=x.useRef(null),P=Ht(),[E,_]=x.useState(null),[z,I]=x.useState(null),q=zEe(),U=EC(),B=U?.width>0?U.width:N,H=U?.height>0?U.height:i,W=x.useCallback(pe=>{q(pe),typeof t=="function"&&t(pe),_(pe),I(pe),pe!=null&&(A.current=pe)},[q,t,_,I]),Y=x.useCallback(pe=>{P(Y8(pe)),P(Li({handler:a,reactEvent:pe}))},[P,a]),K=x.useCallback(pe=>{P(RN(pe)),P(Li({handler:f,reactEvent:pe}))},[P,f]),J=x.useCallback(pe=>{P(CF()),P(Li({handler:p,reactEvent:pe}))},[P,p]),se=x.useCallback(pe=>{P(RN(pe)),P(Li({handler:m,reactEvent:pe}))},[P,m]),me=x.useCallback(()=>{P(n9())},[P]),L=x.useCallback(()=>{P(r9())},[P]),M=x.useCallback(pe=>{P(t9(pe.key))},[P]),F=x.useCallback(pe=>{P(Li({handler:o,reactEvent:pe}))},[P,o]),D=x.useCallback(pe=>{P(Li({handler:c,reactEvent:pe}))},[P,c]),V=x.useCallback(pe=>{P(Li({handler:d,reactEvent:pe}))},[P,d]),oe=x.useCallback(pe=>{P(Li({handler:g,reactEvent:pe}))},[P,g]),re=x.useCallback(pe=>{P(Li({handler:b,reactEvent:pe}))},[P,b]),Ce=x.useCallback(pe=>{C&&P(s9(pe)),P(Li({handler:w,reactEvent:pe}))},[P,C,w]),je=x.useCallback(pe=>{P(Li({handler:v,reactEvent:pe}))},[P,v]),ee=FEe(O);return x.createElement(WF.Provider,{value:E},x.createElement(YB.Provider,{value:z},x.createElement(ee,{width:B??j?.width,height:H??j?.height,className:jt("recharts-wrapper",r),style:REe({position:"relative",cursor:"default",width:B,height:H},j),onClick:Y,onContextMenu:F,onDoubleClick:D,onFocus:me,onBlur:L,onKeyDown:M,onMouseDown:V,onMouseEnter:K,onMouseLeave:J,onMouseMove:se,onMouseUp:oe,onTouchEnd:je,onTouchMove:Ce,onTouchStart:re,ref:W},x.createElement(LEe,null),n)))}),HEe=["width","height","responsive","children","className","style","compact","title","desc"];function GEe(e,t){if(e==null)return{};var n,r,i=VEe(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 VEe(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 h9=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:c,compact:d,title:f,desc:p}=e,m=GEe(e,HEe),g=Ur(m);return d?x.createElement(x.Fragment,null,x.createElement(fp,{width:n,height:r}),x.createElement(i$,{otherAttributes:g,title:f,desc:p},a)):x.createElement(KEe,{className:o,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(i$,{otherAttributes:g,title:f,desc:p,ref:t},x.createElement(Qke,null,a)))});function DN(){return DN=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},DN.apply(null,arguments)}function s$(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 QEe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s$(Object(n),!0).forEach(function(r){WEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WEe(e,t,n){return(t=YEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YEe(e){var t=ZEe(e,"string");return typeof t=="symbol"?t:t+""}function ZEe(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 XEe={top:5,right:5,bottom:5,left:5},JEe=QEe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:XEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},uO),dO=x.forwardRef(function(t,n){var r,i=Un(t.categoricalChartProps,JEe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(c9,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(j8,{chartData:f.data}),x.createElement(u9,{layout:i.layout,margin:i.margin}),x.createElement(f9,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(d9,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(h9,DN({},i,{ref:n})))}),e_e=["axis"],fO=x.forwardRef((e,t)=>x.createElement(dO,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:e_e,tooltipPayloadSearcher:G0,categoricalChartProps:e,ref:t})),t_e=["axis","item"],IN=x.forwardRef((e,t)=>x.createElement(dO,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:t_e,tooltipPayloadSearcher:G0,categoricalChartProps:e,ref:t}));function n_e(e){var t=Ht();return x.useEffect(()=>{t(yEe(e))},[t,e]),null}var r_e=["layout"];function MN(){return MN=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},MN.apply(null,arguments)}function i_e(e,t){if(e==null)return{};var n,r,i=a_e(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 a_e(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 o$(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 s_e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o$(Object(n),!0).forEach(function(r){o_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o_e(e,t,n){return(t=l_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_e(e){var t=c_e(e,"string");return typeof t=="symbol"?t:t+""}function c_e(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 u_e={top:5,right:5,bottom:5,left:5},p9=s_e({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:u_e,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},uO),d_e=x.forwardRef(function(t,n){var r,i=Un(t.categoricalChartProps,p9),{layout:a}=i,o=i_e(i,r_e),{chartName:c,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:p}=t,m={chartName:c,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:p,eventEmitter:void 0};return x.createElement(c9,{preloadedState:{options:m},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:c},x.createElement(j8,{chartData:i.data}),x.createElement(u9,{layout:a,margin:i.margin}),x.createElement(f9,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(d9,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(n_e,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),x.createElement(h9,MN({},o,{ref:n})))});function l$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function c$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l$(Object(n),!0).forEach(function(r){f_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f_e(e,t,n){return(t=h_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_e(e){var t=p_e(e,"string");return typeof t=="symbol"?t:t+""}function p_e(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 m_e=["item"],g_e=c$(c$({},p9),{},{layout:"centric",startAngle:0,endAngle:360}),y_e=x.forwardRef((e,t)=>{var n=Un(e,g_e);return x.createElement(d_e,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:m_e,tooltipPayloadSearcher:G0,categoricalChartProps:n,ref:t})}),v_e=["axis"],LN=x.forwardRef((e,t)=>x.createElement(dO,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:v_e,tooltipPayloadSearcher:G0,categoricalChartProps:e,ref:t}));const Vi={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},lr={fill:"#71717a",fontSize:11},yd="#27272a",Cr="#27272a",ni=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function m9(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function vd(e){return m9(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function xd(e){const t=m9(e);return`${t.getMonth()+1}/${t.getDate()}`}const x_e=6,bd="__other__",ed="_socialTotal";function b_e(e,t=x_e){const n=new Map;for(const p of e)n.set(p.source,(n.get(p.source)??0)+p.sessions);const r=[...n.entries()].sort((p,m)=>m[1]!==p[1]?m[1]-p[1]:p[0].localeCompare(m[0])),i=r.slice(0,t),a=new Set(i.map(([p])=>p)),o=Math.max(0,r.length-t),c=new Map;for(const p of e){let m=c.get(p.date);m||(m={date:p.date,[ed]:0},c.set(p.date,m));const g=a.has(p.source)?p.source:bd;m[g]=(m[g]??0)+p.sessions,m[ed]=(m[ed]??0)+p.sessions}const d=[...c.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return o>0&&f.push(bd),{data:d,sources:f,otherCount:o}}function td(e){return e.replace(/\+/g," ")}function g9(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const w_e=["7d","30d","90d","all"],_o=ni,$N="#71717a",y9="#52525b",oh=25;function Rg(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function S_e(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 j_e({projectName:e}){const t=ji(),[n,r]=x.useState(null),[i,a]=x.useState(null),[o,c]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(null),[w,b]=x.useState(null),[j,N]=x.useState("sessions"),[O,C]=x.useState("desc"),[A,P]=x.useState("sessions"),[E,_]=x.useState("desc"),[z,I]=x.useState("sessions"),[q,U]=x.useState("desc"),[B,H]=x.useState("sessions"),[W,Y]=x.useState("desc"),[K,J]=x.useState([]),[se,me]=x.useState([]),[L,M]=x.useState([]),[F,D]=x.useState(!1),[V,oe]=x.useState("30d");async function re(de){c(!0),v(null);try{const Pe=await t.fetchQuery({queryKey:qe.traffic.status(e),queryFn:()=>vQ(e),staleTime:qf});if(de.current)return;if(r(Pe),!Pe.connected){a(null),J([]),me([]),M([]),c(!1);return}const[fe,Qe,Yn,Ni]=await Promise.all([t.fetchQuery({queryKey:qe.traffic.summary(e,V),queryFn:()=>xQ(e,void 0,V),staleTime:qf}),t.fetchQuery({queryKey:qe.traffic.aiHistory(e,V),queryFn:()=>wQ(e,V).catch(()=>[]),staleTime:qf}),t.fetchQuery({queryKey:qe.traffic.sessionHistory(e,V),queryFn:()=>jQ(e,V).catch(()=>[]),staleTime:qf}),t.fetchQuery({queryKey:qe.traffic.socialHistory(e,V),queryFn:()=>SQ(e,V).catch(()=>[]),staleTime:qf})]);if(de.current)return;a(fe),J(Qe),me(Yn),M(Ni),c(!1)}catch(Pe){if(de.current)return;v(Pe instanceof Error?Pe.message:"Failed to load GA4 data"),c(!1)}}x.useEffect(()=>{const de={current:!1};return re(de),()=>{de.current=!0}},[e,V,t]);async function Ce(){f(!0),v(null),b(null);try{const de=await l5(e);b(`Synced ${de.rowCount.toLocaleString()} page rows, ${de.aiReferralCount.toLocaleString()} AI and ${de.socialReferralCount.toLocaleString()} social referral rows (${de.days} days)`),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await re({current:!1})}catch(de){v(de instanceof Error?de.message:"Sync failed")}finally{f(!1)}}async function je(){m(!0),v(null),b(null);try{await NQ(e),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(de){v(de instanceof Error?de.message:"Disconnect failed")}finally{m(!1)}}function ee(de){j===de?C(Pe=>Pe==="desc"?"asc":"desc"):(N(de),C("desc"))}function pe(de){A===de?_(Pe=>Pe==="desc"?"asc":"desc"):(P(de),_("desc"))}function Ee(de){z===de?U(Pe=>Pe==="desc"?"asc":"desc"):(I(de),U("desc"))}function X(de){B===de?Y(Pe=>Pe==="desc"?"asc":"desc"):(H(de),Y("desc"))}const Ke=x.useMemo(()=>i?.topPages?[...i.topPages].sort((de,Pe)=>{const fe=de[j],Qe=Pe[j];return typeof fe=="string"&&typeof Qe=="string"?O==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):O==="asc"?fe-Qe:Qe-fe}):[],[i?.topPages,j,O]),ze=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((de,Pe)=>{const fe=de[A],Qe=Pe[A];return typeof fe=="string"&&typeof Qe=="string"?E==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):E==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferrals,A,E]),at=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((de,Pe)=>{const fe=de[B],Qe=Pe[B];return typeof fe=="string"&&typeof Qe=="string"?W==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):W==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferralLandingPages,B,W]),Ve=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((de,Pe)=>{const fe=de[z],Qe=Pe[z];return typeof fe=="string"&&typeof Qe=="string"?q==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):q==="asc"?fe-Qe:Qe-fe}):[],[i?.socialReferrals,z,q]),{socialChartData:Gt,socialChartSources:$t,socialOtherCount:dn}=x.useMemo(()=>{const de=b_e(L);return{socialChartData:de.data,socialChartSources:de.sources,socialOtherCount:de.otherCount}},[L]),{chartData:nn,chartSources:Se,dateRange:Ze}=x.useMemo(()=>{const de=[...new Set(K.map(rn=>rn.source))],Pe=new Map;for(const rn of se)Pe.set(rn.date,{_totalSessions:rn.sessions,_organicSessions:rn.organicSessions});const fe=new Map;for(const rn of K){const zn=`${rn.date}::${rn.source}`,Kr=fe.get(zn)??0;fe.set(zn,Math.max(Kr,rn.sessions))}for(const[rn,zn]of fe){const[Kr,ta]=rn.split("::");let Sa=Pe.get(Kr);Sa||(Sa={_totalSessions:0,_organicSessions:0},Pe.set(Kr,Sa)),Sa[ta]=(Sa[ta]??0)+zn}const Qe=[...Pe.entries()].sort(([rn],[zn])=>rn.localeCompare(zn)).map(([rn,zn])=>({date:rn,...zn})),Yn=Qe.map(rn=>rn.date),Ni=Yn.length>0?{start:Yn[0],end:Yn[Yn.length-1]}:null;return{chartData:Qe,chartSources:de,dateRange:Ni}},[K,se]);if(o&&!n)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return l.jsx(N_e,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await re({current:!1})))()}});const Rt=i?.organicSharePctDisplay??"0%",pt=i?.totalOrganicSessions??0,Xe=i?.aiSessionsDeduped??0,ce=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",Me=i?new Set(i.aiReferrals.map(de=>de.source.toLowerCase())).size:0,Ge=ze[0]??null,ht=i?.totalDirectSessions??0,yn=i?.directSharePctDisplay??"0%",Tn=i?.socialSessions??0,vn=i?.socialSharePctDisplay??"0%",We=i?new Set(i.socialReferrals.map(de=>de.source.toLowerCase())).size:0,Vt=Ve[0]??null;return l.jsxs(l.Fragment,{children:[g&&l.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),w&&l.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:w}),l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",l.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[l.jsx(rT,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),l.jsxs(be,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:je,children:[l.jsx(HW,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",l.jsx(vr,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${i?.periodStart&&i?.periodEnd?` Data available: ${new Date(i.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(i.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),l.jsx("div",{className:"flex gap-1",children:w_e.map(de=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${V===de?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>oe(de),children:de==="all"?"All":de},de))})]}),i?l.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[l.jsx(Bj,{value:Rg(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),l.jsx(Bj,{value:Rg(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Rt} of total`,tone:"positive"}),l.jsx(Bj,{value:Rg(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):l.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),l.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[l.jsx(rT,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",l.jsx(vr,{text:"Decomposes GA4 sessions into four disjoint channels — organic search, social, direct, and known AI referrers. The AI cell is rendered separately so AI-driven traffic never inflates the Direct count. Detected via sessionDefaultChannelGrouping plus AI-source matching on sessionSource/firstUserSource/sessionManualSource (generic search sources excluded)."})]})]}),Ze&&l.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Ze.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Ze.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),nn.length>0&&l.jsxs(Be,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:Se.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Se.length===0&&l.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Se.length===0&&l.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),l.jsx("div",{className:"h-64",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(LN,{data:nn,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ja,{dataKey:"date",tick:lr,tickLine:!1,axisLine:{stroke:Cr},tickFormatter:xd}),l.jsx(es,{tick:lr,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(Xa,{...Vi,labelFormatter:vd,formatter:(de,Pe)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(Pe??"");return Qe==="_totalSessions"?[fe,"Total Sessions"]:Qe==="_organicSessions"?[fe,"Organic Sessions"]:[fe,Qe]}}),l.jsx(IC,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:de=>de==="_totalSessions"?"Total Sessions":de==="_organicSessions"?"Organic Sessions":de}),l.jsx(qu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Se.map((de,Pe)=>l.jsx(qu,{type:"monotone",dataKey:de,stackId:"ai",stroke:_o[Pe%_o.length],fill:_o[Pe%_o.length],fillOpacity:.4,strokeWidth:1.5},de))]})})})]}),l.jsxs(Be,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(Ta,{label:"Organic",value:Rt,hint:`${pt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),l.jsx(Ta,{label:"Social",value:vn,hint:`${Tn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),l.jsx(Ta,{label:"Direct",value:yn,hint:`${ht.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."}),l.jsx(Ta,{label:"Known AI referrers (lower bound)",value:Ne,hint:`${ce.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."})]}),Ge&&l.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: ",l.jsx("span",{className:"font-medium",children:Ge.source})," via ",Ge.medium,", accounting for ",Ge.sessions.toLocaleString()," sessions."]})]}),l.jsxs(Be,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Me} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(br,{label:"Source",sortKey:"source",current:A,dir:E,onSort:pe,align:"left"}),l.jsx(br,{label:"Medium",sortKey:"medium",current:A,dir:E,onSort:pe,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(br,{label:"Sessions",sortKey:"sessions",current:A,dir:E,onSort:pe,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(br,{label:"Users",sortKey:"users",current:A,dir:E,onSort:pe,align:"right"})]})}),l.jsx("tbody",{children:ze.map(de=>l.jsx(C_e,{referral:de,totalSessions:Xe},`${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),l.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."})]})]}),l.jsxs(Be,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:at.length>0?`${at.length} rows`:"No landing-page rows"})]}),at.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(br,{label:"Landing Page",sortKey:"landingPage",current:B,dir:W,onSort:X,align:"left"}),l.jsx(br,{label:"Source",sortKey:"source",current:B,dir:W,onSort:X,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(br,{label:"Sessions",sortKey:"sessions",current:B,dir:W,onSort:X,align:"right"}),l.jsx(br,{label:"Users",sortKey:"users",current:B,dir:W,onSort:X,align:"right"})]})}),l.jsx("tbody",{children:at.map(de=>l.jsx(A_e,{row:de},`${de.landingPage}:${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),l.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"Known-AI landing pages appear after a GA4 sync records visits from AI referrers."})]})]})]})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",l.jsx(vr,{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."})]})]}),Gt.length>0&&l.jsxs(Be,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),dn>0&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",$t.length-1," sources · ",dn," more grouped as Other"]})]}),l.jsx("div",{className:"h-64",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(LN,{data:Gt,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ja,{dataKey:"date",tick:lr,tickLine:!1,axisLine:{stroke:Cr},tickFormatter:xd}),l.jsx(es,{tick:lr,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(Xa,{...Vi,labelFormatter:vd,formatter:(de,Pe)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(Pe??"");if(Qe===ed)return[fe,"Total Social"];if(Qe===bd){const Yn=`Other (${dn} source${dn===1?"":"s"})`;return[fe,Yn]}return[fe,td(Qe)]}}),l.jsx(qu,{type:"monotone",dataKey:ed,stroke:y9,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),$t.map((de,Pe)=>{const Qe=de===bd?$N:_o[Pe%_o.length];return l.jsx(qu,{type:"monotone",dataKey:de,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},de)})]})})}),l.jsx(E_e,{sources:$t,otherCount:dn})]}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[l.jsxs(Be,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(Ta,{label:"Social Sessions",value:Rg(Tn),hint:`${Tn.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),l.jsx(Ta,{label:"Share of Traffic",value:vn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),l.jsx(Ta,{label:"Platforms",value:String(We),hint:`${i.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Vt&&l.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:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),l.jsx("p",{className:"font-medium truncate",title:`${Vt.source} via ${Vt.medium}`,children:g9(td(Vt.source),64)}),l.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Vt.medium,children:["via ",td(Vt.medium)," · ",Vt.sessions.toLocaleString()," sessions"]})]})]}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(Ta,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),l.jsx(Ta,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),l.jsx(Ta,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[l.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),l.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."})]})]})]}),l.jsxs(Be,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Ve.length>oh&&!F?`Top ${oh} of ${Ve.length}`:`${Ve.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm table-fixed",children:[l.jsxs("colgroup",{children:[l.jsx("col",{className:"w-[32%]"}),l.jsx("col",{className:"w-[22%]"}),l.jsx("col",{className:"w-[12%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[12%]"})]}),l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(br,{label:"Source",sortKey:"source",current:z,dir:q,onSort:Ee,align:"left"}),l.jsx(br,{label:"Medium",sortKey:"medium",current:z,dir:q,onSort:Ee,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),l.jsx(br,{label:"Sessions",sortKey:"sessions",current:z,dir:q,onSort:Ee,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(br,{label:"Users",sortKey:"users",current:z,dir:q,onSort:Ee,align:"right"})]})}),l.jsx("tbody",{children:(F?Ve:Ve.slice(0,oh)).map(de=>l.jsx(O_e,{referral:de,totalSessions:Tn},`${de.source}:${de.medium}:${de.channelGroup}`))})]})}),Ve.length>oh&&l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("button",{type:"button",onClick:()=>D(de=>!de),className:"text-xs text-zinc-400 hover:text-zinc-200 px-3 py-1 rounded-full border border-zinc-800 hover:border-zinc-700 transition-colors",children:F?`Show top ${oh}`:`Show all ${Ve.length} sources`})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),l.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."})]})]})]})]})]}),i&&i.topPages.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",l.jsx(vr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(br,{label:"Landing Page",sortKey:"landingPage",current:j,dir:O,onSort:ee,align:"left"}),l.jsx(br,{label:"Sessions",sortKey:"sessions",current:j,dir:O,onSort:ee,align:"right"}),l.jsx(br,{label:"Organic",sortKey:"organicSessions",current:j,dir:O,onSort:ee,align:"right"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),l.jsx(br,{label:"Users",sortKey:"users",current:j,dir:O,onSort:ee,align:"right"})]})}),l.jsx("tbody",{children:Ke.map(de=>l.jsx(k_e,{page:de},de.landingPage))})]})})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[l.jsx("span",{children:i?.lastSyncedAt?`Last synced ${S_e(i.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function N_e({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[o,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),g=x.useRef(null),v=x.useCallback(b=>{const j=b.target.files?.[0];if(!j)return;m(null),a(j.name);const N=new FileReader;N.onload=()=>{const O=N.result;try{const C=JSON.parse(O);if(!C.client_email||!C.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(O)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},N.onerror=()=>{m("Failed to read file."),c(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 bQ(e,{propertyId:n.trim(),keyJson:o});try{await l5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return l.jsxs(Be,{className:"surface-card p-6",children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),l.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&&l.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}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),l.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:b=>r(b.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"}),l.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)."})]}),l.jsxs("div",{className:"mb-5",children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),l.jsx("input",{ref:g,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>g.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:[l.jsx(VW,{className:"w-4 h-4 shrink-0"}),i?l.jsx("span",{className:"text-zinc-200 truncate",children:i}):l.jsx("span",{children:"Upload .json key file"})]}),l.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 ",l.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),l.jsx(be,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function br({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return l.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&&l.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const v9={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function Bj({value:e,label:t,subtitle:n,tone:r}){return l.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),l.jsx("p",{className:`text-2xl font-bold tabular-nums ${v9[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Ta({value:e,label:t,hint:n,tone:r,tooltip:i}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[l.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&l.jsx(vr,{text:i})]}),l.jsx("p",{className:`text-xl font-semibold tabular-nums ${v9[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function k_e({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const x9={session:"Session",first_user:"First Visit",manual_utm:"UTM"},b9={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 C_e({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=x9[e.sourceDimension]??e.sourceDimension,i=b9[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),l.jsx("td",{className:"py-1.5",children:l.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})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function A_e({row:e}){const t=x9[e.sourceDimension]??e.sourceDimension,n=b9[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5",children:l.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:n,children:t})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function O_e({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=td(e.source),a=td(e.medium);return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),l.jsx("td",{className:"py-1.5 pr-3",children:l.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})}),l.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function E_e({sources:e,otherCount:t}){const n=[{key:ed,color:y9,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===bd)n.push({key:bd,color:$N,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=td(i);n.push({key:i,color:_o[r%_o.length]??$N,label:g9(a,32),tooltip:a})}}return l.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[l.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),l.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function w9(e){e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all})}function __e(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function P_e(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 ix(e,t){y4({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),vt({title:__e(e.kind),detail:P_e(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function T_e(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){vt({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)y4({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=ine({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});vt({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 ax(e,t){if(e instanceof ai&&e.code==="RUN_IN_PROGRESS"){vt({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}vt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function S9(){const e=ji();return Zh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>EV(t,n),onSuccess:(t,n)=>{w9(e),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function z_e(){const e=ji();return Zh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>QV(t),onSuccess:t=>{w9(e),T_e(t)},onError:t=>{vt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function R_e(){const e=ji();return Zh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>i5(t,n),onSuccess:(t,n)=>{Zv(e,yt["gsc-sync"],n.projectName),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function D_e(){const e=ji();return Zh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>oQ(t),onSuccess:(t,n)=>{Zv(e,t.run.kind,n.projectName),ix(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function I_e(){const e=ji();return Zh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>aQ(t,n),onSuccess:(t,n)=>{Zv(e,yt["inspect-sitemap"],n.projectName),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const M_e=["7d","30d","90d","all"];function L_e({projectName:e}){const t=ji(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[o,c]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[g,v]=x.useState([]),[w,b]=x.useState(null),[j,N]=x.useState(""),[O,C]=x.useState(""),[A,P]=x.useState("30"),[E,_]=x.useState(!1),[z,I]=x.useState("30d"),[q,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,H]=x.useState(""),[W,Y]=x.useState(!0),[K,J]=x.useState(!1),[se,me]=x.useState(!1),[L,M]=x.useState(!1),[F,D]=x.useState(!1),[V,oe]=x.useState(!1),[re,Ce]=x.useState(!1),[je,ee]=x.useState(null),[pe,Ee]=x.useState(!1),[X,Ke]=x.useState(!1),[ze,at]=x.useState(null),[Ve,Gt]=x.useState(""),[$t,dn]=x.useState(!1),[nn,Se]=x.useState(!1),[Ze,Rt]=x.useState("indexed"),[pt,Xe]=x.useState(null),ce=x.useMemo(()=>{if(!pt)return d;const{key:Q,dir:ke}=pt;return[...d].sort((et,kt)=>{const Rn=Q===Ro.CTR?Number.isFinite(et.ctr)?et.ctr:0:et[Q],ja=Q===Ro.CTR?Number.isFinite(kt.ctr)?kt.ctr:0:kt[Q];return ke==="asc"?Rn-ja:ja-Rn})},[d,pt]),[Ne,Me]=x.useState([]),[Ge,ht]=x.useState(null),[yn,Tn]=x.useState(!1),[vn,We]=x.useState(null),[Vt,de]=x.useState(null),Pe=i.find(Q=>Q.connectionType==="gsc"),fe=d.length>0||p.length>0||g.length>0,Qe=R_e(),Yn=D_e(),Ni=I_e();async function rn(Q){if(!Q){c([]),N("");return}me(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:qe.gsc.properties(e),queryFn:()=>ZV(e),staleTime:Nr});c(ke),N(Q.propertyId??ke[0]?.siteUrl??"")}catch(ke){c([]),We(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{me(!1)}}async function zn(){D(!0);try{const Q={startDate:q.startDate,endDate:q.endDate,query:q.query,page:q.page,limit:q.limit,window:z},ke=await t.fetchQuery({queryKey:qe.gsc.performance(e,Q),queryFn:()=>eQ(e,{startDate:q.startDate||void 0,endDate:q.endDate||void 0,query:q.query||void 0,page:q.page||void 0,limit:parseInt(q.limit,10)||20,window:z}),staleTime:Nr});f(ke)}catch(Q){f([]),We(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function Kr(){oe(!0);try{const Q=B.trim()||void 0,[ke,et]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.inspections(e,Q),queryFn:()=>nQ(e,{url:Q,limit:20}),staleTime:Nr}),t.fetchQuery({queryKey:qe.gsc.deindexed(e),queryFn:()=>rQ(e),staleTime:Nr})]);m(ke),v(et)}catch(Q){m([]),v([]),We(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{oe(!1)}}async function ta(){Ee(!0);try{const[Q,ke]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>lk(e),staleTime:Nr}),t.fetchQuery({queryKey:qe.gsc.coverageHistory(e),queryFn:()=>iQ(e).catch(()=>[]),staleTime:Nr})]);ee(Q),Me(ke)}catch(Q){ee(null),Me([]),We(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{Ee(!1)}}async function Sa(Q){Tn(!0),We(null);try{const ke=await Z2(e,{urls:Q}),{succeeded:et,failed:kt,total:Rn}=ke.summary;vt({title:"Indexing requested",detail:kt===0?`${et} URL${et!==1?"s":""} submitted for indexing.`:`${et}/${Rn} submitted successfully, ${kt} failed.`,tone:kt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){We(ke instanceof Error?ke.message:"Failed to request indexing")}finally{Tn(!1)}}async function _p(){Tn(!0),We(null);try{const Q=await Z2(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:et,total:kt}=Q.summary;vt({title:"Indexing requested",detail:et===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${kt} submitted successfully, ${et} failed.`,tone:et===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to request indexing")}finally{Tn(!1)}}async function Gs(){if(Ve.trim()){dn(!0),We(null);try{await JV(e,"gsc",Ve.trim()),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ve.trim()}:ke)),vt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Gt("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{dn(!1)}}}async function Vs(){We(null);try{const Q=await Yn.mutateAsync({projectName:e,projectLabel:e});at(Q.sitemaps),a(ke=>ke.map(et=>et.connectionType==="gsc"?{...et,sitemapUrl:Q.primarySitemapUrl}:et))}catch{}}async function sx(){Ke(!0),We(null);try{const Q=await sQ(e);t.setQueryData(qe.gsc.sitemaps(e),Q),at(Q.sitemaps),Q.sitemaps.length===0&&de("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){We(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{Ke(!1)}}async function Kd(){Y(!0),We(null);try{const[Q,ke]=await Promise.all([ok().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>r5(e).catch(()=>[]),staleTime:Nr})]);r(!!Q?.google?.configured),a(ke);const et=ke.find(kt=>kt.connectionType==="gsc");await Promise.all([rn(et),zn(),Kr(),ta()])}finally{Y(!1)}}x.useEffect(()=>{Kd()},[e]),x.useEffect(()=>{zn()},[z]);async function Pp(){if(!n){We("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}J(!0),We(null),de(null);try{const{authUrl:Q}=await WV(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){We("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Q,"_blank","width=600,height=700");if(!ke){window.location.assign(Q);return}de("Finish the Google consent flow in the popup, then close it to refresh this project.");const et=window.setInterval(()=>{ke.closed&&(window.clearInterval(et),de(null),t.invalidateQueries({queryKey:qe.gsc.project(e)}),Kd())},1e3)}catch(Q){We(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{J(!1)}}async function Tp(){We(null),de(null);try{await YV(e,"gsc"),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.filter(ke=>ke.connectionType!=="gsc")),c([]),N("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to disconnect")}}async function Hd(){if(j){M(!0),We(null);try{await XV(e,"gsc",j),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,propertyId:j}:ke)),vt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{M(!1)}}}async function Gd(){We(null),de(null);try{await Qe.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:E||void 0}}),await t.invalidateQueries({queryKey:qe.gsc.project(e)})}catch{}}async function Vd(){if(O.trim()){Ce(!0),We(null),de(null);try{const Q=await tQ(e,O.trim());await t.invalidateQueries({queryKey:qe.gsc.project(e)}),b(Q),C(""),await Kr()}catch(Q){We(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ce(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:M_e.map(Q=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${z===Q?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>I(Q),children:Q==="all"?"All":Q},Q))}),Pe&&l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:F,onClick:()=>{zn()},children:F?"Refreshing…":"Refresh data"})]})]}),vn&&l.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:[vn,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>We(null),children:"×"})]}),Vt&&l.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:[Vt,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>de(null),children:"×"})]}),W?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(it,{tone:Pe?"positive":n?"caution":"negative",children:Pe?"Connected":n?"Ready to connect":"App credentials missing"})]}),Pe?l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:Pe.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Tp,children:"Disconnect"})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",l.jsx("code",{children:Pe.domain}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Pe.propertyId??"No property selected yet"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ca(Pe.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.jsx("p",{className:"text-sm text-zinc-300",children:n?"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."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:K,onClick:Pp,children:K?"Opening…":"Connect Google Search Console"}):l.jsx(be,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(Xt,{to:"/settings",children:"Open Settings"})}),!n&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Pe&&!Pe.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.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:l.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"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.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."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(be,{type:"button",size:"sm",disabled:Yn.isPending||!Pe.propertyId,onClick:Vs,children:Yn.isPending?"Discovering…":"Auto-discover from GSC"}),l.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:Ve,onChange:Q=>Gt(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Gs()}),l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:$t||!Ve.trim(),onClick:Gs,children:$t?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Pe||fe)&&l.jsxs(l.Fragment,{children:[l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[je&&je.notIndexed.length>0&&l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:yn,onClick:()=>{_p()},children:yn?"Requesting…":`Request indexing (${je.notIndexed.length})`}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:()=>{ta()},children:pe?"Loading…":"Refresh coverage"})]})]}),je&&je.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Q=je.summary.indexed+je.summary.notIndexed,ke=Q>0?je.summary.indexed/Q:0,et=Q>0?je.summary.notIndexed/Q:0,kt=54,Rn=2*Math.PI*kt,ja=Rn*(1-ke),rs=Rn*et,Qs=Rn*ke;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative h-48 w-48",children:[l.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[l.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Rn,strokeDashoffset:ja,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),je.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${rs} ${Rn-rs}`,strokeDashoffset:-Qs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ke*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(je.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(je.reasonGroups??[]).length," ",(je.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),je.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:je.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Q=>{const ke=Q==="indexed"?je.indexed.length:Q==="notIndexed"?je.notIndexed.length:je.deindexed.length,et=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ze===Q?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Rt(Q),ht(null)},children:[et," (",ke,")"]},Q)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&je.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:je.indexed.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Ze==="notIndexed"&&!Ge&&(je.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(je.reasonGroups??[]).map(Q=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>ht(Q.reason),children:[l.jsx("td",{className:"text-zinc-200",children:Q.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Ze==="notIndexed"&&!Ge&&(je.reasonGroups??[]).length===0&&je.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:je.notIndexed.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Ze==="notIndexed"&&Ge&&(()=>{const Q=(je.reasonGroups??[]).find(ke=>ke.reason===Ge);return Q?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>ht(null),children:["←"," Back to reasons"]})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:yn,onClick:()=>{Sa(Q.urls.map(ke=>ke.url))},children:yn?"Requesting…":`Request indexing (${Q.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:Q.urls.map(ke=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ke.url}),l.jsx("td",{className:"text-zinc-400",children:ke.crawlTime?ke.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:yn,onClick:()=>{Sa([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),Ze==="deindexed"&&je.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:je.deindexed.map((Q,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState}),l.jsx("td",{className:"text-zinc-400",children:Q.currentState}),l.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${ke}`))})]}),(Ze==="indexed"&&je.indexed.length===0||Ze==="notIndexed"&&!Ge&&je.notIndexed.length===0||Ze==="deindexed"&&je.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:pe?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:F,onClick:()=>{zn()},children:F?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const ut of d){const Qt=Q.get(ut.date);Qt?(Qt.clicks+=ut.clicks,Qt.impressions+=ut.impressions):Q.set(ut.date,{clicks:ut.clicks,impressions:ut.impressions})}const ke=[...Q.entries()].sort(([ut],[Qt])=>ut.localeCompare(Qt));if(ke.length===0)return null;const et=Math.max(...ke.map(([,ut])=>ut.impressions),1),kt=ke.reduce((ut,[,Qt])=>ut+Qt.clicks,0),Rn=ke.reduce((ut,[,Qt])=>ut+Qt.impressions,0),ja=Rn>0?(kt/Rn*100).toFixed(1):"0.0",rs=700,Qs=220,Pr={top:12,bottom:36,left:48,right:12},ll=rs-Pr.left-Pr.right,Na=Qs-Pr.top-Pr.bottom,ki=ll/ke.length,na=Math.max(Math.min(ki*.35,24),4),Ws=Math.max(na*.15,1),Ys=ut=>{if(ut<=0)return 1;const Qt=Math.pow(10,Math.floor(Math.log10(ut))),Hr=ut/Qt,ra=Hr<=1.5?1.5:Hr<=3?3:Hr<=5?5:10;return Math.ceil(ra*Qt)},xn=4,cl=Math.ceil(Ys(et)/xn)*xn,zp=Array.from({length:xn+1},(ut,Qt)=>cl/xn*Qt),is=ut=>ut>=1e3?`${(ut/1e3).toFixed(ut>=1e4?0:1)}k`:String(ut);return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:kt.toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Rn.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[ja,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${rs} / ${Qs}`},children:l.jsxs("svg",{viewBox:`0 0 ${rs} ${Qs}`,className:"h-full w-full",children:[zp.map((ut,Qt)=>{const Hr=Pr.top+Na-ut/cl*Na;return l.jsxs("g",{children:[l.jsx("line",{x1:Pr.left,y1:Hr,x2:rs-Pr.right,y2:Hr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:Pr.left-6,y:Hr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:is(ut)})]},`t-${Qt}`)}),ke.map(([ut,Qt],Hr)=>{const ra=Pr.left+ki*Hr+ki/2,Dc=Qt.impressions/cl*Na,ul=Qt.clicks/cl*Na;return l.jsxs("g",{children:[l.jsx("title",{children:`${ut}
|
|
290
|
-
Clicks: ${Qt.clicks}
|
|
291
|
-
Impressions: ${Qt.impressions}
|
|
292
|
-
CTR: ${Qt.impressions>0?(Qt.clicks/Qt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:ra-na-Ws/2,y:Pr.top+Na-Dc,width:na,height:Math.max(Dc,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:ra+Ws/2,y:Pr.top+Na-ul,width:na,height:Math.max(ul,1),rx:2,fill:"#10b981",opacity:.85})]},ut)}),(()=>{const ut=Math.min(ke.length,7);return Array.from({length:ut},(Qt,Hr)=>{const ra=ke.length===1?0:Math.round(Hr/(ut-1)*(ke.length-1)),Dc=Pr.left+ki*ra+ki/2;return l.jsx("text",{x:Dc,y:Qs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[ra][0].slice(5)},`xl-${ra}`)})})()]})})]})})(),l.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[l.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:q.startDate,onChange:Q=>U(ke=>({...ke,startDate:Q.target.value}))}),l.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:q.endDate,onChange:Q=>U(ke=>({...ke,endDate:Q.target.value}))}),l.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:q.query,onChange:Q=>U(ke=>({...ke,query:Q.target.value}))}),l.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:q.page,onChange:Q=>U(ke=>({...ke,page:Q.target.value}))}),l.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:q.limit,onChange:Q=>U(ke=>({...ke,limit:Q.target.value}))})]}),d.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),Object.values(Ro).map(Q=>l.jsx("th",{className:"text-right","aria-sort":pt?.key===Q?pt.dir==="asc"?"ascending":"descending":"none",children:l.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:()=>Xe(ke=>ke?.key===Q?ke.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[qte[Q],pt?.key===Q?pt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),l.jsx("tbody",{children:ce.map((Q,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:Q.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${ke}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:O,onChange:Q=>C(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Vd()}),l.jsx(be,{type:"button",size:"sm",disabled:re||!Pe?.propertyId||!O.trim(),onClick:Vd,children:re?"Inspecting…":"Inspect URL"})]}),w&&l.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.indexingState??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.verdict??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:_T(w.isMobileFriendly)})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ca(w.crawlTime)})]})]})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:()=>{Kr()},children:V?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:Q=>H(Q.target.value)}),l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:V,onClick:()=>{Kr()},children:"Apply filter"})]}),p.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:p.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:_T(Q.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:ca(Q.inspectedAt)})]},Q.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:g.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:ca(Q.transitionDate)})]},`${Q.url}:${Q.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Pe&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Se(Q=>!Q),children:[l.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 ${nn?"rotate-90":""}`,"aria-hidden":"true",children:l.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"})}),l.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),nn&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),l.jsx("h3",{children:"Pick the Search Console property"})]})}),l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),l.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:j,disabled:se||o.length===0,onChange:Q=>N(Q.target.value),children:o.length===0?l.jsx("option",{value:"",children:se?"Loading properties…":"No properties available"}):o.map(Q=>l.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:se,onClick:()=>{rn(Pe)},children:se?"Refreshing…":"Refresh properties"}),l.jsx(be,{type:"button",size:"sm",disabled:!j||L,onClick:Hd,children:L?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.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:A,onChange:Q=>P(Q.target.value)})]}),l.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:[l.jsx("input",{type:"checkbox",checked:E,onChange:Q=>_(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(be,{type:"button",size:"sm",disabled:Qe.isPending||!Pe.propertyId,onClick:Gd,children:Qe.isPending?"Queueing…":"Queue sync"}),!Pe.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),l.jsx("h3",{children:"Sitemap configuration"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[Pe.sitemapUrl&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Pe.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:X||!Pe.propertyId,onClick:()=>{sx()},children:X?"Loading…":"Browse sitemaps from GSC"}),l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Yn.isPending||!Pe.propertyId,onClick:Vs,children:Yn.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),l.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."}),ze&&ze.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",ze.length,")"]}),ze.map(Q=>{const ke=Q.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ke&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[ke.indexed," / ",ke.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Gt(Q.path),children:"Use"})]})]},Q.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:Pe.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Gt(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ve.trim()&&void Gs()}),l.jsx(be,{type:"button",size:"sm",disabled:$t||!Ve.trim(),onClick:Gs,children:$t?"Saving…":Pe.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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}`}),l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Ni.isPending||!Pe.propertyId,onClick:async()=>{const ke=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Pe.sitemapUrl||void 0;We(null),de(null);try{await Ni.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ke}})}catch{}},children:Ni.isPending?"Queueing…":"Inspect sitemap"})]}),!Pe.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Uj({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.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:l.jsx(m5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.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 Rl=50;function _u(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Dg(e){return e.toLocaleString()}function $_e(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function B_e(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 U_e(e){const t=e.filter(n=>n.kind===yt["backlink-extract"]&&!jk(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function q_e(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 F_e({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,o]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState(null),[m,g]=x.useState(null),[v,w]=x.useState(Date.now()),[b,j]=x.useState(0),[N,O]=x.useState(!0),[C,A]=x.useState(!1),[P,E]=x.useState(null),_=x.useRef(null),z=x.useCallback(async()=>{O(!0),E(null);try{const[se,me,L,M,F]=await Promise.all([c5().catch(()=>null),DQ(e,{excludeCrawlers:!0}).catch(()=>null),IQ(e,{limit:Rl,offset:b,excludeCrawlers:!0}).catch(V=>{if(V instanceof ai&&V.code==="NOT_FOUND")return null;throw V}),MQ(e).catch(()=>[]),NV(e).catch(()=>[])]);d(se),n(me),i(L),o(M);const D=U_e(F);p(D),_.current=D?.id??null}catch(se){E(se instanceof Error?se.message:"Failed to load backlinks")}finally{O(!1)}},[e,b]);x.useEffect(()=>{z()},[z]),x.useEffect(()=>{if(!f)return;const se=f.id;let me=!1;const L=async()=>{try{const F=await ac(se);if(me)return;jk(F.status)?(p(null),g(F),await z()):p(D=>D?.id===F.id?{...D,...F}:D)}catch{}},M=window.setInterval(()=>{L()},3e3);return()=>{me=!0,window.clearInterval(M)}},[f,z]),x.useEffect(()=>{if(!f)return;const se=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(se)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const se=window.setTimeout(()=>g(null),1e4);return()=>window.clearTimeout(se)},[m]);async function I(){A(!0),E(null);try{const se=await LQ(e);p(se),_.current=se.id}catch(se){se instanceof ai&&se.code==="MISSING_DEPENDENCY"?E("DuckDB is not installed. Visit the Backlinks admin page to install it."):E(se instanceof Error?se.message:"Failed to trigger extract")}finally{A(!1)}}const q=x.useMemo(()=>a.slice().sort((se,me)=>se.queriedAt.localeCompare(me.queriedAt)).map(se=>({date:se.queriedAt,linkingDomains:se.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,H=t?.excludedLinkingDomains??0,W=B>Rl,Y=Math.floor(b/Rl)+1,K=Math.max(1,Math.ceil(B/Rl));return x.useEffect(()=>{b>0&&b>=B&&j(0)},[b,B]),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),l.jsx("h2",{children:"Referring domains"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",l.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."]})]})}),P&&l.jsx(Be,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:P})}),f&&l.jsx(Be,{className:"surface-card p-4 mb-4 border-sky-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(y5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),l.jsx(it,{tone:"neutral",children:f.status}),l.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[q_e(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),l.jsxs("span",{className:"sr-only",children:["now=",v]})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",l.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",l.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&l.jsx(Be,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:l.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?l.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):l.jsx(p5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.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?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:Fte(m.error)}):m.status!=="failed"?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(N)return l.jsx(Be,{className:"surface-card p-6",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const se=t!==null&&t.totalLinkingDomains>0,me=m?.status==="failed",L=t!==null&&t.totalLinkingDomains===0&&!me,M=c?.status==="ready",F=c?.status==="failed",D=c&&(c.status==="downloading"||c.status==="querying"||c.status==="queued");return se?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gauge-row",children:[l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:Dg(t.totalLinkingDomains)})}),l.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:Dg(t.totalHosts)})}),l.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:$_e(t.top10HostsShare)})}),l.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),l.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",l.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",B_e(t.queriedAt),H>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{className:"text-zinc-500",children:[H," crawler/proxy domain",H===1?"":"s"," hidden"]})]})]}),q.length>=2&&l.jsxs(Be,{className:"surface-card p-4 mt-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),l.jsx("div",{className:"h-40 mt-2",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(LN,{data:q,margin:{top:8,right:12,bottom:0,left:12},children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:ni[0],stopOpacity:.4}),l.jsx("stop",{offset:"100%",stopColor:ni[0],stopOpacity:0})]})}),l.jsx(Ja,{dataKey:"date",tick:lr,stroke:Cr,tickFormatter:xd}),l.jsx(es,{tick:lr,stroke:Cr,allowDecimals:!1}),l.jsx(Xa,{contentStyle:Vi.contentStyle,labelStyle:Vi.labelStyle,itemStyle:Vi.itemStyle,labelFormatter:vd}),l.jsx(qu,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:ni[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),l.jsxs("div",{className:"mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),W&&l.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Y," of ",K," · ",Dg(B)," total"]})]}),l.jsx(Be,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),l.jsxs("tbody",{children:[U.map(V=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:V.linkingDomain}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Dg(V.numHosts)})]},V.linkingDomain)),U.length===0&&l.jsx("tr",{children:l.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:H>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${H} hidden).`:"No referring domains in this release."})})]})]})}),W&&l.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(V=>Math.max(0,V-Rl)),children:"Previous"}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b+Rl>=B,onClick:()=>j(V=>V+Rl),children:"Next"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:I,children:[l.jsx(zv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(Uj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",l.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:[l.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),l.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"Open admin"})})]})]}):l.jsx(Be,{className:"surface-card p-6",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:l.jsx(g5,{className:"h-5 w-5","aria-hidden":!0})}),l.jsxs("div",{className:"flex-1",children:[!c&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),l.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."}),l.jsx("div",{className:"mt-4",children:l.jsx(be,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"Set up backlinks"})})})]}),D&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",c.status,c.phaseDetail?` — ${c.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),l.jsx("div",{className:"mt-4",children:l.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"View sync status"})})})]}),F&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:c.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),l.jsx("div",{className:"mt-4",children:l.jsx(be,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&!D&&!L&&!me&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:c.release})," is ready but no backlinks have been extracted for"," ",l.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(be,{type:"button",size:"sm",disabled:C||f!==null,onClick:I,children:[l.jsx(uy,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),l.jsxs(Uj,{label:"What does Run extract do?",children:[l.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",l.jsx("span",{className:"text-zinc-200",children:e}),"."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),me&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",l.jsx("code",{className:"text-zinc-300",children:c?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),l.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:l.jsx(be,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})})})]}),L&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",l.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",l.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",l.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),l.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[l.jsx("li",{children:"the domain is newer than the release’s crawl window"}),l.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),l.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),l.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."}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsx(be,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})}),l.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:I,children:[l.jsx(uy,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(Uj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the cached release for ",l.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),l.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 K_e({projectName:e}){const t=ha({queryKey:qe.citationVisibility(e),queryFn:()=>CQ(e),staleTime:d5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-rose-400",children:r instanceof Error?r.message:String(r)})]});if(!n)return null;if(n.status==="no-data")return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:o}=n.summary;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",o," engines",l.jsx(vr,{text:"An engine is ‘citing’ when our domain appears in its grounding source list (the structured citation/search-result attribution it returns alongside the answer). Counts each configured engine that cites the project on at least one tracked query in the latest snapshot per (query × provider)."})]}),l.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",o," engine answers",l.jsx(vr,{text:"An engine is ‘mentioning’ when our brand or domain appears inside the prose of the answer text — independent of whether it’s in the citation list. Models often name-drop from training without citing a fresh page."})]})]}),n.summary.latestRunAt&&l.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),l.jsx(H_e,{data:n}),l.jsx(G_e,{data:n}),n.competitorGaps.length>0&&l.jsx(Y_e,{data:n})]})}function H_e({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[l.jsx(Ig,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),l.jsx(Ig,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),l.jsx(Ig,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),l.jsx(Ig,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Ig({label:e,value:t,helper:n,tone:r}){const i=r==="positive"?"text-emerald-300":r==="positive-dim"?"text-emerald-400/70":r==="caution"?"text-amber-300":r==="negative"?"text-rose-300":"text-zinc-100";return l.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function G_e({data:e}){const t=x.useMemo(()=>{const n=new Set;for(const r of e.byQuery)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byQuery]);return e.byQuery.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):l.jsxs("div",{children:[l.jsx(V_e,{}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),t.map(n=>l.jsx("th",{className:"text-center",children:l.jsx(oc,{provider:n})},n)),l.jsx("th",{className:"text-right",children:"Cite"}),l.jsx("th",{className:"text-right",children:"Ment"})]})}),l.jsx("tbody",{children:e.byQuery.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return l.jsx("td",{className:"text-center",children:i==null?l.jsx(TW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):l.jsx(Q_e,{provider:i})},r)}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.citedCount===n.totalProviders?"text-emerald-300":n.citedCount>0?"text-emerald-400/70":"text-zinc-500",children:[n.citedCount,"/",n.totalProviders]})}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.mentionedCount===n.totalProviders?"text-sky-300":n.mentionedCount>0?"text-sky-400/70":"text-zinc-500",children:[n.mentionedCount,"/",n.totalProviders]})})]},n.queryId))})]})})]})}function V_e(){return l.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(Fu,{active:!0,tone:"cited"}),l.jsx("span",{children:"cited (in sources)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(Fu,{active:!0,tone:"mentioned"}),l.jsx("span",{children:"mentioned (in answer)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(Fu,{active:!1,tone:"cited"}),l.jsx(Fu,{active:!1,tone:"mentioned"}),l.jsx("span",{children:"neither"})]})]})}function Q_e({provider:e}){const t=W_e(e);return l.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[l.jsx(Fu,{active:e.cited,tone:"cited"}),l.jsx(Fu,{active:e.mentioned,tone:"mentioned"})]})}function W_e(e){return e.cited&&e.mentioned?"Cited in sources and mentioned in answer":e.cited?"Cited in sources, not mentioned in answer":e.mentioned?"Mentioned in answer, not in sources":"Not cited and not mentioned"}function Fu({active:e,tone:t}){if(!e)return l.jsx("span",{className:"inline-block h-2 w-2 rounded-full border border-zinc-700/80 bg-transparent","aria-hidden":"true"});const n=t==="cited"?"inline-block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_1px_rgba(16,185,129,0.25)]":"inline-block h-2 w-2 rounded-full bg-sky-400 shadow-[0_0_0_1px_rgba(56,189,248,0.25)]";return l.jsx("span",{className:n,"aria-hidden":"true"})}function Y_e({data:e}){return l.jsxs("div",{className:"mt-4",children:[l.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",l.jsx(vr,{text:"Queries where the project is not cited but a configured competitor is. Each row maps to one (query, engine) pair — the same query may surface for multiple engines."}),l.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Engine"}),l.jsx("th",{children:"Competitors cited"})]})}),l.jsx("tbody",{children:e.competitorGaps.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),l.jsx("td",{children:l.jsx(oc,{provider:t.provider})}),l.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const j9=4;function Z_e(e){return e.length<j9}const X_e={critical:"negative",high:"negative",medium:"caution",low:"neutral"},J_e={positive:"Positive",caution:"Caution",negative:"Negative",neutral:"Neutral"};function Ct(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function qd(e,t=1){return Number.isFinite(e)?`${e.toFixed(t)}%`:"—"}function hO(e){return Number.isFinite(e)?`${(e*100).toFixed(1)}%`:"—"}function wd(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function ePe(e){switch(e){case"up":return"positive";case"down":return"negative";case"flat":return"neutral";case"unknown":return"neutral"}}function tPe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function nPe(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function rPe(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}function iPe(e){return e?e.citationState===Lr.cited?"bg-emerald-500/20 text-emerald-300":e.citationState==="pending"?"bg-amber-500/15 text-amber-300":"bg-zinc-900/40 text-zinc-500":"bg-zinc-900/30 text-zinc-700"}function aPe(e){return e?e.citationState===Lr.cited?"Cited":e.citationState==="pending"?"Pending":"Not cited":"—"}function sPe(e){switch(e){case"High":return"negative";case"Moderate":return"caution";case"Low":return"neutral";case"None":return"neutral"}}function oPe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),a=ha({queryKey:qe.report(e),queryFn:()=>mQ(e)});async function o(){n(!0),i(null);try{await yQ(e)}catch(d){const f=d instanceof ai||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(a.error){const d=a.error instanceof Error?a.error.message:"Failed to load report";return l.jsx("div",{className:"py-8 text-center",children:l.jsx("p",{className:"text-sm text-rose-400",children:d})})}const c=a.data;return c?l.jsxs("div",{children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("p",{className:"eyebrow",children:"AEO Report"}),l.jsx("h1",{className:"page-title",children:c.meta.project.displayName}),l.jsxs("p",{className:"page-subtitle",children:[c.meta.project.canonicalDomain," · ",c.meta.project.country," / ",c.meta.project.language.toUpperCase()," · Generated ",wd(c.meta.generatedAt)]}),r&&l.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(be,{variant:"secondary",size:"sm",onClick:o,disabled:t,children:[l.jsx(zv,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),l.jsx(lPe,{report:c}),l.jsx(cPe,{report:c}),l.jsx(uPe,{report:c}),l.jsx(dPe,{report:c}),l.jsx(fPe,{report:c}),l.jsx(pPe,{report:c}),l.jsx(mPe,{report:c}),l.jsx(gPe,{report:c}),l.jsx(yPe,{report:c}),l.jsx(xPe,{report:c}),l.jsx(wPe,{report:c}),l.jsx(SPe,{report:c}),l.jsx(jPe,{report:c})]}):null}function lPe({report:e}){const t=e.executiveSummary,r=`${t.trend==="up"?"↑ Up":t.trend==="down"?"↓ Down":t.trend==="flat"?"→ Flat":"—"} · ${t.providerCount} provider${t.providerCount===1?"":"s"}`,i=`${t.competitorCount} competitor${t.competitorCount===1?"":"s"} tracked`;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 1",title:"Executive summary",subtitle:"Top-line citation rate with trend versus the prior run, plus the most actionable findings from the latest visibility sweep."}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(_n,{label:"Citation rate",value:qd(t.citationRate,0),tone:ePe(t.trend),subtitle:r}),l.jsx(_n,{label:"Queries tracked",value:Ct(t.queryCount),subtitle:i}),t.gsc&&l.jsx(_n,{label:"GSC clicks",value:Ct(t.gsc.clicks),subtitle:`${Ct(t.gsc.impressions)} imp · ${hO(t.gsc.ctr)} CTR`}),t.ga&&l.jsx(_n,{label:"GA sessions",value:Ct(t.ga.sessions),subtitle:`${Ct(t.ga.users)} users · ${wd(t.ga.periodStart)} → ${wd(t.ga.periodEnd)}`})]}),t.findings.length>0&&l.jsx("div",{className:"mt-5 space-y-2",children:t.findings.map((a,o)=>l.jsxs("div",{className:`insight-card rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-4 ${a.tone==="positive"?"insight-card-positive":a.tone==="caution"?"insight-card-caution":a.tone==="negative"?"insight-card-negative":""}`,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(it,{tone:a.tone,children:J_e[a.tone]}),l.jsx("span",{className:"text-sm font-medium text-zinc-100",children:a.title})]}),l.jsx("p",{className:"text-sm text-zinc-400",children:a.detail})]},o))})]})}function _n({label:e,value:t,tone:n,subtitle:r}){const i=n==="positive"?"text-emerald-400":n==="caution"?"text-amber-400":n==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function cPe({report:e}){const t=e.citationScorecard;return t.providers.length===0||t.queries.length===0?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 2",title:"Citation scorecard",subtitle:"Whether your domain appeared in each AI engine's source list for every tracked keyword in the latest sweep — green = cited, red = not cited, gray = no snapshot."}),l.jsx(Br,{message:"No completed answer-visibility runs yet."})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 2",title:"Citation scorecard",subtitle:"Whether your domain appeared in each AI engine's source list for every tracked keyword in the latest sweep — green = cited, red = not cited, gray = no snapshot."}),l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Provider citation rate"}),l.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(IN,{data:t.providerRates,layout:"vertical",margin:{left:20,right:20,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd,horizontal:!1}),l.jsx(Ja,{type:"number",domain:[0,100],tick:lr,stroke:Cr}),l.jsx(es,{type:"category",dataKey:"provider",tick:lr,stroke:Cr,width:90}),l.jsx(Xa,{...Vi,formatter:(n,r,i)=>{const a=i?.payload;return a?`${a.citationRate}% (${a.citedCount}/${a.totalCount})`:""}}),l.jsx(Sv,{dataKey:"citationRate",fill:ni[0],radius:[0,4,4,0]})]})})}),l.jsx("ul",{className:"mt-2 space-y-0.5 text-[11px] text-zinc-500",children:t.providerRates.map(n=>l.jsxs("li",{children:[l.jsx("span",{className:"font-medium text-zinc-300",children:n.provider}),": ",n.citationRate,"% (",n.citedCount,"/",n.totalCount,")"]},n.provider))})]}),l.jsx("p",{className:"eyebrow mb-2",children:"Query × provider"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),t.providers.map(n=>l.jsx("th",{children:n},n))]})}),l.jsx("tbody",{children:t.queries.map((n,r)=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:n}),t.providers.map((i,a)=>{const o=t.matrix[r]?.[a]??null;return l.jsx("td",{children:l.jsx("span",{className:`inline-flex items-center justify-center rounded-md px-2 py-1 text-[11px] font-semibold ${iPe(o)}`,children:aPe(o)})},i)})]},n))})]})}),l.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Cited = domain in source list · Not cited = absent · Pending = run incomplete · — = no snapshot"})]})}function uPe({report:e}){const t=e.competitorLandscape,n=e.mentionLandscape,r=e.meta.project.canonicalDomain,i=t.competitors.length===0&&t.projectCitationCount===0,a=n.competitors.length===0&&n.projectMentionCount===0;if(i&&a)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 3",title:"Competitor landscape",subtitle:"Where tracked competitors appear in AI answers compared to your domain — both in source citations and in the answer text itself."}),l.jsx(Br,{message:"No competitor data yet. Add competitors and run a visibility sweep."})]});const o=[{label:r,count:t.projectCitationCount,isProject:!0},...t.competitors.map(m=>({label:m.domain,count:m.citationCount,isProject:!1}))],c=[{label:r,count:n.projectMentionCount,isProject:!0},...n.competitors.map(m=>({label:m.domain,count:m.mentionCount,isProject:!1}))],d=o.length>1,f=c.length>1,p=new Map(n.competitors.map(m=>[m.domain,m]));return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 3",title:"Competitor landscape",subtitle:"Where tracked competitors appear in AI answers compared to your domain — both in source citations and in the answer text itself."}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[d&&l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow mb-2",children:"Citations per domain"}),l.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:o.length*32+32},children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(IN,{data:o,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd,horizontal:!1}),l.jsx(Ja,{type:"number",tick:lr,stroke:Cr}),l.jsx(es,{type:"category",dataKey:"label",tick:lr,stroke:Cr,width:140}),l.jsx(Xa,{...Vi}),l.jsx(Sv,{dataKey:"count",radius:[0,4,4,0],children:o.map((m,g)=>l.jsx(xc,{fill:m.isProject?"#3b82f6":ni[(g+1)%ni.length]},g))})]})})})]}),f&&l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow mb-2",children:"Mentions per domain"}),l.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:c.length*32+32},children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(IN,{data:c,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd,horizontal:!1}),l.jsx(Ja,{type:"number",tick:lr,stroke:Cr}),l.jsx(es,{type:"category",dataKey:"label",tick:lr,stroke:Cr,width:140}),l.jsx(Xa,{...Vi}),l.jsx(Sv,{dataKey:"count",radius:[0,4,4,0],children:c.map((m,g)=>l.jsx(xc,{fill:m.isProject?"#3b82f6":ni[(g+1)%ni.length]},g))})]})})})]})]}),l.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Citations = domain in source list · Mentions = brand or domain in answer text — independent signals."}),t.competitors.length===0?l.jsx(Br,{message:"No competitors configured."}):l.jsx("div",{className:"competitor-table-wrap mt-4",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Mentions"}),l.jsx("th",{children:"SOV"}),l.jsx("th",{children:"Cited queries"})]})}),l.jsx("tbody",{children:t.competitors.map(m=>{const g=p.get(m.domain),v=g?.mentionCount??0,w=g?.totalCount??n.totalAnswerSnapshots;return l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:m.domain}),l.jsx("td",{children:l.jsx(it,{tone:sPe(m.pressureLabel),children:m.pressureLabel})}),l.jsxs("td",{children:[m.citationCount," / ",m.totalCount]}),l.jsxs("td",{children:[v," / ",w]}),l.jsxs("td",{children:[m.sharePct,"%"]}),l.jsxs("td",{className:"text-xs text-zinc-400",children:[m.citedQueries.slice(0,5).join(", "),m.citedQueries.length>5?"…":"",m.theirCitedPages.length>0&&l.jsxs("details",{className:"mt-1",children:[l.jsxs("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:[m.theirCitedPages.length," cited URL",m.theirCitedPages.length>1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-1 pl-3",children:m.theirCitedPages.map((b,j)=>l.jsxs("li",{children:[l.jsx("a",{href:b.url,className:"break-all text-blue-400 hover:underline",target:"_blank",rel:"noreferrer",children:b.url}),l.jsx("span",{className:"ml-2 text-zinc-500",children:b.citedFor.join(", ")})]},j))})]})]})]},m.domain)})})]})})]})}function dPe({report:e}){const t=e.aiSourceOrigin;if(t.categories.length===0&&t.topDomains.length===0)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 4",title:"AI citation sources",subtitle:"Every external website AI engines cited as a source for your tracked keywords in the latest sweep — categorized by site type on the left and ranked by frequency on the right. Your own domains are excluded; tracked competitors are flagged."}),l.jsx(Br,{message:"No source data yet. Run a visibility sweep first."})]});const n=t.categories.filter(r=>r.count>0).map(r=>({name:r.label,value:r.count}));return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 4",title:"AI citation sources",subtitle:"Every external website AI engines cited as a source for your tracked keywords in the latest sweep — categorized by site type on the left and ranked by frequency on the right. Your own domains are excluded; tracked competitors are flagged."}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow mb-2",children:"AI source categories"}),n.length===0?l.jsx(Br,{message:"No category data."}):l.jsx("div",{className:"h-64 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(y_e,{children:[l.jsx(x8,{data:n,dataKey:"value",nameKey:"name",innerRadius:45,outerRadius:85,stroke:"none",children:n.map((r,i)=>l.jsx(xc,{fill:ni[i%ni.length]},i))}),l.jsx(Xa,{...Vi}),l.jsx(IC,{wrapperStyle:{fontSize:11,color:"#a1a1aa"}})]})})})]}),l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow mb-2",children:"Top source domains"}),t.topDomains.length===0?l.jsx(Br,{message:"No domains tracked yet."}):l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Tag"})]})}),l.jsx("tbody",{children:t.topDomains.map(r=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell text-xs",children:r.domain}),l.jsx("td",{children:r.count}),l.jsx("td",{children:r.isCompetitor?l.jsx(it,{tone:"negative",children:"Competitor"}):l.jsx(it,{tone:"neutral",children:"External"})})]},r.domain))})]})})]})]})]})}function fPe({report:e}){const t=e.gsc;return t?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 5",title:"GSC performance",subtitle:"Your site's performance in Google's regular (non-AI) search results — top queries, intent breakdown, and the click trend, sourced from Google Search Console for the most recent sync window."}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(_n,{label:"Clicks",value:Ct(t.totalClicks)}),l.jsx(_n,{label:"Impressions",value:Ct(t.totalImpressions)}),l.jsx(_n,{label:"CTR",value:hO(t.ctr)}),l.jsx(_n,{label:"Avg position",value:t.avgPosition.toFixed(1)})]}),t.trend.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Clicks over time"}),l.jsx("div",{className:"h-56 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(fO,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd}),l.jsx(Ja,{dataKey:"date",tick:lr,stroke:Cr,tickFormatter:xd}),l.jsx(es,{tick:lr,stroke:Cr}),l.jsx(Xa,{...Vi,labelFormatter:vd}),l.jsx(nx,{type:"monotone",dataKey:"clicks",stroke:ni[0],strokeWidth:2,dot:!0})]})})})]}),t.topQueries.length>0&&l.jsx(hPe,{rows:t.topQueries}),t.categoryBreakdown.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Query categories"}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.categoryBreakdown.map(n=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[l.jsx("p",{className:"eyebrow-soft",children:n.category}),l.jsxs("p",{className:"text-base font-semibold text-zinc-100",children:[Ct(n.clicks)," clicks"]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:[qd(n.sharePct)," share · ",Ct(n.impressions)," impressions"]})]},n.category))})]}),(t.trackedButNoGsc.length>0||t.gscButNotTracked.length>0)&&l.jsxs("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:[t.trackedButNoGsc.length>0&&l.jsx(u$,{title:"Tracked but no GSC impressions",tone:"caution",items:t.trackedButNoGsc}),t.gscButNotTracked.length>0&&l.jsx(u$,{title:"GSC queries not yet tracked",tone:"neutral",items:t.gscButNotTracked})]})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 5",title:"GSC performance",subtitle:"Your site's performance in Google's regular (non-AI) search results — top queries, intent breakdown, and the click trend, sourced from Google Search Console for the most recent sync window."}),l.jsx(Br,{message:"Google Search Console is not connected for this project."})]})}function hPe({rows:e}){return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Top queries"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Category"}),l.jsx("th",{children:"Clicks"}),l.jsx("th",{children:"Impr."}),l.jsx("th",{children:"CTR"}),l.jsx("th",{children:"Pos."})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:t.query}),l.jsx("td",{className:"text-xs text-zinc-400",children:t.category}),l.jsx("td",{children:Ct(t.clicks)}),l.jsx("td",{children:Ct(t.impressions)}),l.jsx("td",{children:hO(t.ctr)}),l.jsx("td",{children:t.avgPosition.toFixed(1)})]},t.query))})]})})]})}function u$({title:e,items:t,tone:n}){return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"eyebrow",children:e}),l.jsx(it,{tone:n,children:t.length})]}),l.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-400",children:[t.slice(0,8).map(r=>l.jsxs("li",{className:"truncate",children:["· ",r]},r)),t.length>8&&l.jsxs("li",{className:"text-zinc-600",children:["+ ",t.length-8," more"]})]})]})}function pPe({report:e}){const t=e.ga;return t?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 6",title:"GA4 traffic",subtitle:`Total sessions and users on your site between ${wd(t.periodStart)} and ${wd(t.periodEnd)}, with top landing pages and channel breakdown — sourced from Google Analytics 4.`}),l.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-3",children:[l.jsx(_n,{label:"Sessions",value:Ct(t.totalSessions)}),l.jsx(_n,{label:"Users",value:Ct(t.totalUsers)}),l.jsx(_n,{label:"Organic sessions",value:Ct(t.totalOrganicSessions)})]}),t.topLandingPages.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Top landing pages"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Page"}),l.jsx("th",{children:"Sessions"}),l.jsx("th",{children:"Users"}),l.jsx("th",{children:"Organic"})]})}),l.jsx("tbody",{children:t.topLandingPages.slice(0,12).map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),l.jsx("td",{children:Ct(n.sessions)}),l.jsx("td",{children:Ct(n.users)}),l.jsx("td",{children:Ct(n.organicSessions)})]},n.page))})]})})]}),t.channelBreakdown.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Channel breakdown"}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.channelBreakdown.map(n=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[l.jsx("p",{className:"eyebrow-soft",children:n.channel}),l.jsx("p",{className:"text-base font-semibold text-zinc-100",children:Ct(n.sessions)}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:qd(n.sharePct)})]},n.channel))})]})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 6",title:"GA4 traffic",subtitle:"Total sessions and users on your site, with top landing pages and channel breakdown — sourced from Google Analytics 4."}),l.jsx(Br,{message:"Google Analytics 4 is not connected for this project."})]})}function mPe({report:e}){const t=e.socialReferrals;return t?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 7",title:"Social referrals",subtitle:"Sessions on your site sent by social platforms (LinkedIn, Facebook, X, etc.) — paid versus organic split with the top driving campaigns. Sourced from Google Analytics 4."}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(_n,{label:"Total sessions",value:Ct(t.totalSessions)}),l.jsx(_n,{label:"Organic",value:Ct(t.organicSessions)}),l.jsx(_n,{label:"Paid",value:Ct(t.paidSessions)})]}),t.channels.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"By channel"}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.channels.map(n=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[l.jsx("p",{className:"eyebrow-soft",children:n.channelGroup}),l.jsx("p",{className:"text-base font-semibold text-zinc-100",children:Ct(n.sessions)}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:qd(n.sharePct)})]},n.channelGroup))})]}),t.topCampaigns.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Top campaigns"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Source"}),l.jsx("th",{children:"Medium"}),l.jsx("th",{children:"Sessions"})]})}),l.jsx("tbody",{children:t.topCampaigns.map((n,r)=>l.jsxs("tr",{children:[l.jsx("td",{children:n.source}),l.jsx("td",{className:"text-xs text-zinc-400",children:n.medium}),l.jsx("td",{children:Ct(n.sessions)})]},`${n.source}-${n.medium}-${r}`))})]})})]})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 7",title:"Social referrals",subtitle:"Sessions on your site sent by social platforms (LinkedIn, Facebook, X, etc.) — paid versus organic split with the top driving campaigns. Sourced from Google Analytics 4."}),l.jsx(Br,{message:"No social referral data."})]})}function gPe({report:e}){const t=e.aiReferrals;return t?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 8",title:"AI referral traffic",subtitle:"Sessions on your site referred by AI answer engines (ChatGPT, Perplexity, Claude, Copilot, Gemini, etc.) — broken down by referrer with a daily trend and the top landing pages. Sourced from Google Analytics 4."}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsx(_n,{label:"Sessions",value:Ct(t.totalSessions)}),l.jsx(_n,{label:"Users",value:Ct(t.totalUsers)})]}),t.trend.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"AI sessions trend"}),l.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(fO,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd}),l.jsx(Ja,{dataKey:"date",tick:lr,stroke:Cr,tickFormatter:xd}),l.jsx(es,{tick:lr,stroke:Cr}),l.jsx(Xa,{...Vi,labelFormatter:vd}),l.jsx(nx,{type:"monotone",dataKey:"sessions",stroke:ni[0],strokeWidth:2,dot:!1})]})})})]}),t.bySource.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"By source"}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:t.bySource.map(n=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[l.jsx("p",{className:"eyebrow-soft",children:n.source}),l.jsx("p",{className:"text-base font-semibold text-zinc-100",children:Ct(n.sessions)}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:[Ct(n.users)," users · ",qd(n.sharePct)]})]},n.source))})]}),t.topLandingPages.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Top AI landing pages"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Page"}),l.jsx("th",{children:"Sessions"}),l.jsx("th",{children:"Users"})]})}),l.jsx("tbody",{children:t.topLandingPages.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),l.jsx("td",{children:Ct(n.sessions)}),l.jsx("td",{children:Ct(n.users)})]},n.page))})]})})]})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 8",title:"AI referral traffic",subtitle:"Sessions on your site referred by AI answer engines (ChatGPT, Perplexity, Claude, Copilot, Gemini, etc.) — broken down by referrer with a daily trend and the top landing pages. Sourced from Google Analytics 4."}),l.jsx(Br,{message:"No AI referral data."})]})}function yPe({report:e}){const t=e.indexingHealth;if(!t||!t.provider)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 9",title:"Indexing health",subtitle:"What share of your tracked URLs are currently indexed in Google or Bing — connect Google Search Console or Bing Webmaster Tools to populate this section."}),l.jsx(Br,{message:"No indexing data — connect Google Search Console or Bing Webmaster Tools."})]});const n=t.indexedPct>=90?"positive":t.indexedPct>=70?"caution":"negative",r=`What share of your tracked URLs are currently indexed in ${t.provider==="google"?"Google":"Bing"} — sourced from ${t.provider==="google"?"Google Search Console URL Inspection":"Bing Webmaster Tools URL Inspection"}. Pages absent from the index can't be retrieved by AI engines either.`;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 9",title:`Indexing health — ${t.provider}`,subtitle:r}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(_n,{label:"Indexed",value:qd(t.indexedPct,0),tone:n}),l.jsx(_n,{label:"Total pages",value:Ct(t.total)}),l.jsx(_n,{label:"Indexed pages",value:Ct(t.indexed)}),l.jsx(_n,{label:"Not indexed",value:Ct(t.notIndexed)}),l.jsx(vPe,{ih:t})]})]})}function vPe({ih:e}){return e.provider==="google"?l.jsx(_n,{label:"Deindexed",value:Ct(e.deindexed)}):l.jsx(_n,{label:"Unknown",value:Ct(e.unknown)})}function xPe({report:e}){const t=e.citationsTrend;return t.length===0?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of (keyword × provider) pairs in each run where your domain appeared in the source list, with a per-provider breakdown beneath."}),l.jsx(Br,{message:"Run multiple visibility sweeps to see a trend."})]}):Z_e(t)?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of (keyword × provider) pairs in each run where your domain appeared in the source list, with a per-provider breakdown beneath."}),l.jsx(Br,{message:`Establishing baseline (${t.length} of ${j9} runs collected). Trend will appear once more sweeps are recorded.`})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 10",title:"Citations over time",subtitle:"Citation rate across every visibility sweep — the share of (keyword × provider) pairs in each run where your domain appeared in the source list, with a per-provider breakdown beneath."}),l.jsx("div",{className:"h-64 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:l.jsx(Va,{width:"100%",height:"100%",children:l.jsxs(fO,{data:t,margin:{left:8,right:12,top:8,bottom:8},children:[l.jsx(wc,{stroke:yd}),l.jsx(Ja,{dataKey:"date",tick:lr,stroke:Cr,tickFormatter:xd}),l.jsx(es,{tick:lr,stroke:Cr,domain:[0,100],tickFormatter:n=>`${n}%`}),l.jsx(Xa,{...Vi,labelFormatter:vd,formatter:n=>`${n}%`}),l.jsx(nx,{type:"monotone",dataKey:"citationRate",stroke:ni[0],strokeWidth:2,dot:!0})]})})}),l.jsx(bPe,{trend:t})]})}function bPe({trend:e}){return e.length===0?null:l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"Run-by-run breakdown"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Run"}),l.jsx("th",{children:"Overall rate"}),l.jsx("th",{children:"Per-provider rates"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:wd(t.date)}),l.jsxs("td",{children:[t.citationRate,"%"]}),l.jsx("td",{className:"text-xs text-zinc-400",children:t.providerRates.map(n=>`${n.provider}: ${n.citationRate}%`).join(" · ")})]},t.runId))})]})})]})}function wPe({report:e}){return e.insights.length===0?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 11",title:"Insights & alerts",subtitle:"Regressions (citations lost), gains (citations won), and opportunities surfaced by the intelligence engine across the most recent sweeps — ordered by severity and recurrence."}),l.jsx(Br,{message:"No active insights — everything looks stable."})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 11",title:"Insights & alerts",subtitle:"Regressions (citations lost), gains (citations won), and opportunities surfaced by the intelligence engine across the most recent sweeps — ordered by severity and recurrence."}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Severity"}),l.jsx("th",{children:"Title"}),l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Provider"}),l.jsx("th",{children:"Recommendation"})]})}),l.jsx("tbody",{children:e.insights.map(t=>l.jsxs("tr",{children:[l.jsxs("td",{children:[l.jsx(it,{tone:X_e[t.severity],children:tPe(t.severity)}),t.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",t.instanceCount]})]}),l.jsx("td",{className:"evidence-query-cell",children:t.title}),l.jsx("td",{className:"text-xs text-zinc-400",children:t.query}),l.jsx("td",{className:"text-xs text-zinc-400",children:t.provider}),l.jsx("td",{className:"text-xs text-zinc-400",children:t.recommendation??"—"})]},t.id))})]})})]})}function SPe({report:e}){if(e.contentOpportunities.length===0)return null;const t=e.meta.project.canonicalDomain;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 12",title:"Content opportunities",subtitle:"Queries where you have search demand or competitor citation pressure but aren't winning AI citations. Each row carries a suggested action (create / refresh / expand / add-schema). Top 10 shown."}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Action"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Our page"}),l.jsx("th",{children:"Winning competitor"}),l.jsx("th",{children:"Demand"}),l.jsx("th",{children:"Confidence"})]})}),l.jsx("tbody",{children:e.contentOpportunities.slice(0,10).map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:n.query}),l.jsx("td",{children:l.jsx(it,{tone:"neutral",children:rPe(n.action)})}),l.jsx("td",{children:Math.round(n.score)}),l.jsx("td",{className:"text-xs",children:n.ourBestPage?l.jsx("a",{href:Dte(n.ourBestPage.url,t),target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline break-all",children:n.ourBestPage.url}):l.jsx("span",{className:"text-zinc-600",children:"—"})}),l.jsx("td",{className:"text-xs",children:n.winningCompetitor?l.jsx("a",{href:n.winningCompetitor.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:n.winningCompetitor.domain}):l.jsx("span",{className:"text-zinc-600",children:"—"})}),l.jsx("td",{children:l.jsx(it,{tone:"neutral",children:n.demandSource})}),l.jsx("td",{children:l.jsx(it,{tone:"neutral",children:n.actionConfidence})})]},n.targetRef))})]})})]})}function jPe({report:e}){return e.recommendedNextSteps.length===0?l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 13",title:"Recommended next steps",subtitle:"Action items bucketed by horizon (immediate, short-term, medium-term), drawn from open insights and the highest-ranked content opportunities."}),l.jsx(Br,{message:"No prioritized actions yet."})]}):l.jsxs("section",{className:"page-section-divider",children:[l.jsx(cn,{eyebrow:"Section 13",title:"Recommended next steps",subtitle:"Action items bucketed by horizon (immediate, short-term, medium-term), drawn from open insights and the highest-ranked content opportunities."}),l.jsx("div",{className:"grid gap-3 lg:grid-cols-3",children:["immediate","short-term","medium-term"].map(t=>{const n=e.recommendedNextSteps.filter(i=>i.horizon===t);if(n.length===0)return null;const r=t==="immediate"?"negative":t==="short-term"?"caution":"neutral";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsx(it,{tone:r,children:nPe(t)}),l.jsx("ul",{className:"mt-3 space-y-3",children:n.map((i,a)=>l.jsxs("li",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:i.title}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.rationale})]},a))})]},t)})})]})}function cn({eyebrow:e,title:t,subtitle:n}){return l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("h2",{className:"page-title",children:t}),n&&l.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function Br({message:e}){return l.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function NPe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,o]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,g]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[b,j]=x.useState(e.language),[N,O]=x.useState(e.ownedDomains??[]),[C,A]=x.useState(""),[P,E]=x.useState(null),[_,z]=x.useState(!1),[I,q]=x.useState(!1),[U,B]=x.useState(""),[H,W]=x.useState(""),[Y,K]=x.useState(""),[J,se]=x.useState(""),[me,L]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),g(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]))},[e,r]);function M(){i(!1),d(null),p(e.displayName),g(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]),A("")}function F(){const X=C.trim();X&&(N.includes(X)||O([...N,X]),A(""))}function D(X){O(N.filter(Ke=>Ke!==X))}async function V(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:N,country:v.trim(),language:b.trim()}),i(!1),vt({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 oe(){const X=U.trim(),Ke=H.trim(),ze=Y.trim(),at=J.trim();if(!(!X||!Ke||!ze||!at)){z(!0),E(null);try{const Ve={label:X,city:Ke,region:ze,country:at};me.trim()&&(Ve.timezone=me.trim()),await _V(e.name,Ve),n(),B(""),W(""),K(""),se(""),L(""),q(!1),vt({title:"Location added",detail:`${X} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${X}`,dedupeMode:"drop"})}catch(Ve){E(Ve instanceof Error?Ve.message:"Failed to add location")}finally{z(!1)}}}async function re(X){z(!0),E(null);try{await PV(e.name,X),n(),vt({title:"Location removed",detail:`${X} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${X}`,dedupeMode:"drop"})}catch(Ke){E(Ke instanceof Error?Ke.message:"Failed to remove location")}finally{z(!1)}}async function Ce(X){z(!0),E(null);try{await TV(e.name,X),n(),vt({title:"Default location updated",detail:`${X} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ke){E(Ke instanceof Error?Ke.message:"Failed to set default location")}finally{z(!1)}}const je=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(N)!==JSON.stringify(e.ownedDomains??[]),ee="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",pe="block text-xs font-medium text-zinc-400 mb-1",Ee=U.trim()&&H.trim()&&Y.trim()&&J.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!r&&l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Display name"}),l.jsx("input",{className:ee,type:"text",value:f,onChange:X=>p(X.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Canonical domain"}),l.jsx("input",{className:ee,type:"text",value:m,onChange:X=>g(X.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Country"}),l.jsx("input",{className:ee,type:"text",value:v,onChange:X=>w(X.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Language"}),l.jsx("input",{className:ee,type:"text",value:b,onChange:X=>j(X.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:N.map(X=>l.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,l.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))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:X=>A(X.target.value),onKeyDown:X=>X.key==="Enter"&&(X.preventDefault(),F())}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:F,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(be,{type:"button",disabled:a||!je||!f.trim()||!m.trim(),onClick:V,children:a?"Saving...":"Save changes"}),l.jsx(be,{type:"button",variant:"outline",disabled:a,onClick:M,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(X=>l.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))}):l.jsx("span",{className:"text-zinc-500",children:"—"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[P&&l.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[P,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>E(null),children:"×"})]}),(e.locations??[]).length>0?l.jsxs("table",{className:"w-full text-xs mb-2",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-zinc-600",children:[l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),l.jsx("th",{className:"pb-1"})]})}),l.jsx("tbody",{children:e.locations.map(X=>l.jsxs("tr",{className:"border-t border-zinc-800/30",children:[l.jsx("td",{className:"py-1.5 pr-3",children:l.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?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:X.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:X.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[X.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:_,onClick:()=>Ce(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"}),l.jsx("button",{type:"button",disabled:_,onClick:()=>re(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))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),I?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ee,type:"text",value:U,onChange:X=>B(X.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ee,type:"text",value:H,onChange:X=>W(X.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ee,type:"text",value:Y,onChange:X=>K(X.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ee,type:"text",value:J,onChange:X=>se(X.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ee,type:"text",value:me,onChange:X=>L(X.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(be,{type:"button",size:"sm",disabled:_||!Ee,onClick:oe,children:_?"Adding...":"Add location"}),l.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{q(!1),E(null)},children:"Cancel"})]})]}):l.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>q(!0),children:"+ Add location"})]})]})]})})})]})}const kPe=[{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"}],d$=["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 CPe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState("daily"),[c,d]=x.useState(6),[f,p]=x.useState(""),[m,g]=x.useState("UTC"),[v,w]=x.useState(!1),[b,j]=x.useState(""),[N,O]=x.useState(!1),[C,A]=x.useState(!1),[P,E]=x.useState(null);x.useEffect(()=>{BV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const U=Gte(t.preset??null,t.cronExpr);o(U.freq),d(U.hour),p(U.customCron);const B=d$.includes(t.timezone);g(B?t.timezone:"Other"),w(!B),j(B?"":t.timezone)}else o("daily"),d(6),p(""),g("UTC"),w(!1),j("");E(null),i(!0)},z=async()=>{O(!0),E(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=Hte(a,c);const H=await W2(e,B);n(H),i(!1),vt({title:"Schedule saved",detail:Rw(H.preset??null,H.cronExpr,H.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){E(U instanceof Error?U.message:"Failed to save schedule")}finally{O(!1)}},I=async()=>{if(!(!t||t==="loading")){O(!0),E(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await W2(e,U);n(B),vt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:Rw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){E(U instanceof Error?U.message:"Failed to update schedule")}finally{O(!1)}}},q=async()=>{A(!0),E(null);try{await UV(e),n(null),i(!1),vt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){E(U instanceof Error?U.message:"Failed to remove schedule")}finally{A(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&l.jsx(Be,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&l.jsxs(Be,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Rw(t.preset??null,t.cronExpr,t.timezone)}),l.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",l.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(it,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:N,onClick:I,children:t.enabled?"Pause":"Resume"}),l.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:q,children:C?"Removing...":"Remove"})]})]}),P&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),r&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.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:U=>o(U.target.value),children:kPe.map(U=>l.jsx("option",{value:U.value,children:U.label},U.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:a==="twice-daily"||a==="custom",onChange:U=>d(parseInt(U.target.value)),children:Array.from({length:24},(U,B)=>l.jsx("option",{value:B,children:f1(B)},B))})]})]}),a==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.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:U=>p(U.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.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:U=>{U.target.value==="Other"?(w(!0),g("Other")):(w(!1),g(U.target.value))},children:[d$.map(U=>l.jsx("option",{value:U,children:U},U)),l.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&l.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:b,onChange:U=>j(U.target.value)})]}),P&&l.jsx("p",{className:"text-rose-400 text-sm",children:P}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),E(null)},children:"Cancel"}),l.jsx(be,{type:"button",size:"sm",disabled:N||a==="custom"&&!f.trim(),onClick:z,children:N?"Saving...":"Save schedule"})]})]})]})}const APe=[{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 OPe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState(""),[c,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,g]=x.useState(null),[v,w]=x.useState({}),[b,j]=x.useState(new Set);x.useEffect(()=>{qV(e).then(n).catch(()=>n([]))},[e]);const N=P=>{d(E=>E.includes(P)?E.filter(_=>_!==P):[...E,P])},O=async()=>{if(!(!a.trim()||c.length===0)){p(!0),g(null);try{const P=await FV(e,{channel:"webhook",url:a.trim(),events:c});n(E=>E==="loading"?[P]:[...E,P]),o(""),d(["citation.lost","citation.gained"]),i(!1),vt({title:"Webhook added",detail:`Notifications will be sent to ${P.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(P){g(P instanceof Error?P.message:"Failed to add webhook")}finally{p(!1)}}},C=async P=>{if(!b.has(P)){j(E=>new Set(E).add(P));try{await KV(e,P),n(E=>E==="loading"?E:E.filter(_=>_.id!==P)),vt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${P}`,dedupeMode:"drop"})}catch(E){g(E instanceof Error?E.message:"Failed to remove webhook")}finally{j(E=>{const _=new Set(E);return _.delete(P),_})}}},A=async P=>{w(E=>({...E,[P]:{state:"testing"}}));try{const E=await HV(e,P);w(_=>({..._,[P]:{state:E.ok?"ok":"fail",status:E.status}})),E.ok&&vt({title:"Test notification sent",detail:`Webhook returned status ${E.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${P}`,dedupeMode:"replace"})}catch{w(E=>({...E,[P]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),g(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.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:P=>o(P.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:APe.map(P=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(P.value),onChange:()=>N(P.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:P.label})]},P.value))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm",children:m}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),g(null)},children:"Cancel"}),l.jsx(be,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:O,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&l.jsx(Be,{className:"surface-card compact-card",children:l.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&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Endpoint"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:P.urlHost,children:P.urlDisplay??P.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:P.events.map(E=>l.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:E.replace("."," ")},E))})}),l.jsx("td",{children:l.jsx(it,{tone:P.enabled?"positive":"neutral",children:P.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[P.id]&&(()=>{const E=v[P.id],_=E.state==="testing"?"Sending…":E.state==="ok"?`Delivered${E.status?` (${E.status})`:""}`:`Failed${E.status?` (${E.status})`:""}`;return l.jsx(it,{tone:E.state==="ok"?"positive":E.state==="fail"?"negative":"neutral",children:_})})(),l.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:v[P.id]?.state==="testing",onClick:()=>A(P.id),children:"Test"}),l.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:b.has(P.id),onClick:()=>C(P.id),children:b.has(P.id)?"Removing…":"Remove"})]})})]},P.id))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function EPe({projectName:e,refreshNonce:t}){const n=ji(),[r,i]=x.useState(null),[a,o]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState([]),[m,g]=x.useState([]),[v,w]=x.useState(null),[b,j]=x.useState(""),[N,O]=x.useState(""),[C,A]=x.useState(""),[P,E]=x.useState(!0),[_,z]=x.useState(!1),[I,q]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{H()},[e,t]);async function H(){E(!0),q(null);try{const M=await n.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>a5(e),staleTime:Nr});if(i(M),M.connected){const[F,D,V,oe]=await Promise.all([n.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>ck(e).catch(()=>null),staleTime:Nr}),n.fetchQuery({queryKey:qe.bing.inspections(e),queryFn:()=>s5(e).catch(()=>[]),staleTime:Nr}),n.fetchQuery({queryKey:qe.bing.performance(e),queryFn:()=>hQ(e).catch(()=>[]),staleTime:Nr}),M.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:qe.bing.sites(e),queryFn:()=>dQ(e).then(re=>re.sites).catch(()=>[]),staleTime:Nr})]);d(F),p(D),g(V),o(oe)}else d(null),p([]),g([]),o([])}catch(M){q(M instanceof Error?M.message:"Failed to load Bing data")}finally{E(!1)}}async function W(){if(N.trim()){q(null);try{const M=await cQ(e,N.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),O(""),M.availableSites.length>0&&o(M.availableSites),await H()}catch(M){q(M instanceof Error?M.message:"Failed to connect")}}}async function Y(){try{await uQ(e),await n.invalidateQueries({queryKey:qe.bing.project(e)}),i(null),o([]),d(null),p([]),g([]),w(null),A(""),q(null)}catch(M){q(M instanceof Error?M.message:"Failed to disconnect")}}async function K(){if(C)try{await fQ(e,C),await n.invalidateQueries({queryKey:qe.bing.project(e)}),await H()}catch(M){q(M instanceof Error?M.message:"Failed to set site")}}async function J(){if(b.trim())try{const M=await o5(e,b.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),w(M),p(F=>[M,...F])}catch(M){q(M instanceof Error?M.message:"Inspection failed")}}async function se(M){z(!0),q(null);try{const F=await X2(e,{urls:[M]}),{succeeded:D,failed:V,total:oe}=F.summary;vt({title:"Bing submission requested",detail:V===0?`${D} URL submitted to Bing.`:`${D}/${oe} submitted successfully, ${V} failed.`,tone:V===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}catch(F){const D=F instanceof Error?F.message:"Submission failed";q(D),vt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}finally{z(!1)}}async function me(){z(!0),q(null),vt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const M=await X2(e,{allUnindexed:!0}),{succeeded:F,failed:D,total:V}=M.summary;vt({title:"Bing submissions requested",detail:D===0?`${F}/${V} URL${V!==1?"s":""} submitted to Bing.`:`${F}/${V} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(M){const F=M instanceof Error?M.message:"Batch submission failed";q(F),vt({title:"Bing submissions failed",detail:F,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{z(!1)}}if(P)return l.jsx(Be,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(it,{tone:"caution",children:"Not connected"})]}),l.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),l.jsxs("div",{className:"mt-3",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:N,onChange:M=>O(M.target.value),onKeyDown:M=>M.key==="Enter"&&W()}),l.jsx(be,{size:"sm",disabled:!N.trim(),onClick:W,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.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"})]})]}),I&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:I})]});if(!r.siteUrl)return l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(it,{tone:"positive",children:"Connected"}),l.jsx(be,{size:"sm",variant:"ghost",onClick:Y,children:"Disconnect"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.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."})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ca(r.updatedAt):"—"})]})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:C,onChange:M=>A(M.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(M=>l.jsxs("option",{value:M.url,children:[M.url,M.verified?" (verified)":""]},M.url))]}),l.jsx(be,{size:"sm",disabled:!C,onClick:K,children:"Set Site"})]}):l.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."})]})]}),I&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:I})]});const L=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(it,{tone:"positive",children:"Connected"}),l.jsx(be,{size:"sm",variant:"ghost",onClick:Y,children:"Disconnect"})]})]}),I&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:I}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",l.jsx("code",{children:r.siteUrl}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ca(r.updatedAt):"—"})]})]})]})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index monitoring"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ca(c.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:L.map(M=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===M.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(M.key),children:M.label},M.key))}),U==="coverage"&&c&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[l.jsx(gg,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),l.jsx(gg,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),l.jsx(gg,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),l.jsx(gg,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),l.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:me,children:_?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(M=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>se(M.url),children:"Submit"})})]},M.id))})]})})]}),(c.unknown??[]).length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),l.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:me,children:_?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:(c.unknown??[]).map(M=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?ca(M.lastCrawledDate):"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>se(M.url),children:"Submit"})})]},M.id))})]})})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(M=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?ca(M.lastCrawledDate):"—"})]},M.id))})]})})]})]}),U==="coverage"&&!c&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:b,onChange:M=>j(M.target.value),onKeyDown:M=>M.key==="Enter"&&J()}),l.jsx(be,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&l.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[l.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(M=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(it,{tone:M.inIndex?"positive":"negative",children:M.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ca(M.inspectedAt)})]},M.id))})]})})]}),U==="performance"&&l.jsx("div",{className:"mt-4",children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Xm[Ro.Clicks]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Xm[Ro.Impressions]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Xm[Ro.CTR]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Xm[Ro.Position]})]})}),l.jsx("tbody",{children:m.map((M,F)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:M.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(M.ctr)?M.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.averagePosition.toFixed(1)})]},F))})]})})})]})]})}function _Pe({projectName:e}){const t=ji(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[o,c]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,g]=x.useState(!1),[v,w]=x.useState(null),[b,j]=x.useState(null),[N,O]=x.useState(!1),[C,A]=x.useState(null),[P,E]=x.useState(null),[_,z]=x.useState(0);async function I(F=!1){F||a(!0),f(null);try{const[D,V,oe]=await Promise.all([ok().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>r5(e).catch(()=>[]),staleTime:Nr}),t.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>a5(e).catch(()=>null),staleTime:Nr})]),re=V.find(ee=>ee.connectionType==="gsc")??null;g(!!D?.google?.configured),O(!!D?.bing?.configured),w(re),A(oe);const[Ce,je]=await Promise.all([re?t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>lk(e).catch(()=>null),staleTime:Nr}):Promise.resolve(null),oe?.connected?t.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>ck(e).catch(()=>null),staleTime:Nr}):Promise.resolve(null)]);j(Ce),E(je)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function q(){if(o!=="idle")return;p.current?.abort();const F=new AbortController;p.current=F;const D=F.signal;c("syncing"),f(null);const V=[];try{async function oe(){if(!v)return;const ee=await i5(e);if(!ee?.id)return;const pe=2e3,X=Date.now()+12e4;for(;Date.now()<X;){if(D.aborted||(await new Promise(ze=>setTimeout(ze,pe)),D.aborted))return;const Ke=await ac(ee.id).catch(()=>null);if(!Ke)break;if(["completed","failed","cancelled"].includes(Ke.status)){Ke.status!=="completed"&&V.push(`Google sync ${Ke.status}`);break}}}const re=10;async function Ce(){if(!C?.connected)return;const ee=await s5(e).catch(()=>[]),pe=[...new Set(ee.map(Ee=>Ee.url))];if(pe.length!==0)for(let Ee=0;Ee<pe.length;Ee+=re){if(D.aborted)return;const X=pe.slice(Ee,Ee+re),ze=(await Promise.allSettled(X.map(at=>o5(e,at)))).filter(at=>at.status==="rejected").length;ze>0&&V.push(`${ze} Bing inspection(s) failed`)}}const je=await Promise.allSettled([oe(),Ce()]);for(const ee of je)ee.status==="rejected"&&V.push(ee.reason instanceof Error?ee.reason.message:"Sync failed");if(D.aborted)return;c("reloading"),await Promise.all([t.invalidateQueries({queryKey:qe.gsc.project(e)}),t.invalidateQueries({queryKey:qe.bing.project(e)})]),await I(!0),z(ee=>ee+1),V.length>0&&f(`Partial refresh: ${V.join("; ")}`)}catch(oe){D.aborted||f(oe instanceof Error?oe.message:"Refresh failed")}finally{D.aborted||c("idle")}}x.useEffect(()=>(I(),()=>{p.current?.abort()}),[e]);const U=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",H=b?`${b.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",W=b?`${b.summary.notIndexed} not indexed${b.summary.deindexed>0?` · ${b.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Y=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,K=C?.connected?"positive":N?"caution":"negative",J=C?.connected?"Connected":N?"Ready to connect":"Needs setup",se=P?`${P.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",me=P?P.summary.notIndexed+(P.summary.unknown??0):0,L=P?`${me} not in index`:C?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",M=P?.lastInspectedAt??C?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),l.jsx("h2",{children:"Search Engine Intelligence"}),l.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."})]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:i||o!=="idle",onClick:()=>{q()},children:i?"Loading…":o==="syncing"?"Refreshing Google & Bing…":o==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&l.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:d}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsx(uR,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":U,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":H,note:i?"Loading overview…":W,updatedAt:Y,active:n==="google",onClick:()=>r("google")}),l.jsx(uR,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":J,tone:i?"neutral":K,targetLabel:"Selected site",targetValue:C?.siteUrl??"No site selected",coverageValue:i?"Loading…":se,note:i?"Loading overview…":L,updatedAt:M,active:n==="bing",onClick:()=>r("bing")})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([F,D])=>l.jsx("button",{type:"button",role:"tab","aria-selected":n===F,className:`project-subnav-link ${n===F?"project-subnav-link-active":""}`,onClick:()=>r(F),children:D},F))}),n==="google"&&l.jsx(L_e,{projectName:e}),n==="bing"&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),l.jsx("h2",{children:"Bing Webmaster Tools"})]})}),l.jsx(EPe,{projectName:e,refreshNonce:_})]})]})}function PPe({insights:e}){const{openEvidence:t}=kd(),[n,r]=x.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&l.jsx(Xh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),l.jsx(it,{tone:i.tone,children:i.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,d)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(L1,{state:c.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.query}),l.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&l.jsx(oc,{provider:c.provider})})]}),c.evidenceId&&l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Ep({tab:e}){const{projectId:t}=_v({from:"/projects/$projectId"}),n=Zo(),{dashboard:r,isLoading:i,refetch:a}=Oc();if(!r||i)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-48"}),l.jsx("div",{className:"skeleton-text-sm w-32"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(Se=>l.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[l.jsx("div",{className:"skeleton-circle size-20"}),l.jsx("div",{className:"skeleton-text w-16 mt-3"})]},Se))}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(Se=>l.jsx("div",{className:"skeleton-text-sm w-full"},Se))})]})]});const o=tae(r,t),[c,d]=x.useState(!1),[f,p]=x.useState(!1),[m,g]=x.useState(!1),[v,w]=x.useState(""),[b,j]=x.useState(!1),[N,O]=x.useState(!1),[C,A]=x.useState(""),[P,E]=x.useState(!1),[_,z]=x.useState(!1),[I,q]=x.useState(""),[U,B]=x.useState(!1),[H,W]=x.useState(void 0),[Y,K]=x.useState(!1),[J,se]=x.useState(null),[me,L]=x.useState(!1),M=o?.visibilityEvidence??[],F=o?.project.name??"",D=o?.project.displayName||o?.project.name||F,V=S9(),oe=(o?.recentRuns??[]).some(Se=>Se.kind===yt["answer-visibility"]&&(Se.status===Kt.running||Se.status===Kt.queued)),re=x.useMemo(()=>new Set(M.map(Se=>Se.location??"")),[M]),Ce=re.has(""),je=x.useMemo(()=>[...re].filter(Boolean),[re]);x.useEffect(()=>{if(H===void 0||H===""||!F){se(null),L(!1);return}L(!0),t5(F,H).then(Se=>{se(Se),L(!1)}).catch(()=>{se(null),L(!1)})},[H,F]);const ee=x.useMemo(()=>{if(!J)return null;const Se=new Map;for(const Ze of J){for(const[Rt,pt]of Object.entries(Ze.providerRuns??{}))Se.set(`${Ze.query}::${Rt}`,pt.map(Xe=>({runId:Xe.runId,citationState:Xe.citationState,createdAt:Xe.createdAt,answerMentioned:Xe.answerMentioned,visibilityState:Xe.visibilityState,visibilityTransition:Xe.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&Se.set(`${Ze.query}::`,Ze.runs.map(Rt=>({runId:Rt.runId,citationState:Rt.citationState,createdAt:Rt.createdAt,answerMentioned:Rt.answerMentioned,visibilityState:Rt.visibilityState,visibilityTransition:Rt.visibilityTransition})))}return Se},[J]),pe=x.useMemo(()=>{const Se=H!==void 0?M.filter(Ze=>H===""?!Ze.location:Ze.location===H):M;return ee?Se.map(Ze=>{const Rt=ee.get(`${Ze.query}::${Ze.provider}`)??ee.get(`${Ze.query}::`);return Rt?{...Ze,runHistory:Rt}:Ze}):Se},[M,H,ee]);if(!o)return l.jsx("div",{className:"page-container",children:l.jsxs(Be,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(be,{asChild:!0,children:l.jsx(Xt,{to:"/",children:"Return to overview"})})]})});async function Ee(){try{await V.mutateAsync({projectName:F,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function X(){p(!0);try{await zV(F),vt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${F}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(Se){console.error("Failed to delete project:",Se)}finally{p(!1)}}async function Ke(){try{const Se=await RV(F),Ze=typeof Se=="string"?Se:JSON.stringify(Se,null,2),Rt=new Blob([Ze],{type:"text/yaml"}),pt=URL.createObjectURL(Rt),Xe=document.createElement("a");Xe.href=pt,Xe.download=`${F}.yaml`,Xe.click()}catch(Se){vt({title:"Export failed",detail:Se instanceof Error?Se.message:"Could not export project YAML.",tone:"negative"})}}async function ze(){const Se=v.split(`
|
|
293
|
-
`).map(Ze=>Ze.trim()).filter(Boolean);if(Se.length!==0){j(!0);try{await AV(F,Se),a(),w(""),g(!1)}finally{j(!1)}}}async function at(){const Se=C.trim();if(Se){E(!0);try{const Rt=(await e5(F)).map(Xe=>Xe.domain),pt=[...new Set([...Rt,Se])];await n5(F,pt),a(),A(""),O(!1)}finally{E(!1)}}}async function Ve(){const Se=I.trim();if(Se){B(!0);try{const Ze=o?.project.ownedDomains??[];await Q2(F,[...Ze,Se]),a(),q(""),z(!1)}finally{B(!1)}}}async function Gt(Se){B(!0);try{const Ze=o?.project.ownedDomains??[];await Q2(F,Ze.filter(Rt=>Rt!==Se)),a()}finally{B(!1)}}async function $t(Se,Ze){await OV(Se,Ze),a()}const dn=Se=>!Number.isNaN(Number.parseInt(Se,10)),nn=[{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:"report",label:"Report",href:`/projects/${o.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return l.jsxs("div",{className:"page-container",children:[c?l.jsxs(Be,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(be,{type:"button",variant:"destructive",disabled:f,onClick:X,children:f?"Deleting...":"Yes, delete project"}),l.jsx(be,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),l.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!_&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>z(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:o.project.country}),l.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(Se=>l.jsx("span",{className:"tag",children:Se},Se))]}),((o.project.ownedDomains??[]).length>0||_)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(Se=>l.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:[Se,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Gt(Se),"aria-label":`Remove ${Se}`,children:"×"})]},Se)),_?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.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:Se=>q(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&Ve(),autoFocus:!0}),l.jsx(be,{type:"button",size:"sm",disabled:!I.trim()||U,onClick:Ve,children:U?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),q("")},children:"Cancel"})]}):l.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>z(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:Ke,"aria-label":"Export project as YAML",children:l.jsx(zv,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:l.jsx(x5,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(be,{type:"button",disabled:V.isPending||oe,onClick:Ee,children:V.isPending?"Starting…":oe?"Sweep running…":"Run now"})]})]})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:nn.map(Se=>l.jsx(Xt,{to:Se.href,className:`project-subnav-link ${Se.key===e?"project-subnav-link-active":""}`,"aria-current":Se.key===e?"page":void 0,children:Se.label},Se.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(Vde,{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:dn(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",l.jsx(vr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.gapQueries.value}),l.jsxs("span",{className:"text-zinc-600",children:[" / ",o.queryCounts.total]})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapQueries.tone}`,style:{width:o.gapQueries.progress!==void 0?`${o.gapQueries.progress*100}%`:"0%"}})}),l.jsx("p",{className:"metric-card-detail",children:o.gapQueries.delta}),l.jsx("p",{className:"metric-card-sub",children:o.gapQueries.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",l.jsx(vr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),l.jsx("span",{className:"text-zinc-600",children:"%"})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),l.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),l.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",l.jsx(vr,{text:"Query-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?l.jsxs("div",{className:"metric-card-movement",children:[l.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),l.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),l.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):l.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),l.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":""})]})]}),l.jsx(K_e,{projectName:o.project.name}),o.providerScores.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),l.jsxs("h2",{children:["Visibility by model ",l.jsx(vr,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked queries. Switching models can significantly affect citation rates."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited queries"})]})}),l.jsx("tbody",{children:o.providerScores.map(Se=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(oc,{provider:Se.provider}),Se.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:Se.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${Se.score>=70?"text-emerald-400":Se.score>=40?"text-amber-400":"text-rose-400"}`,children:[Se.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[Se.cited," of ",Se.total]})]},`${Se.provider}::${Se.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(PPe,{insights:o.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Query citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(Se=>Se.query)).size," queries tracked"]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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 queries, one per line",value:v,onChange:Se=>w(Se.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
-
`).filter(Se=>Se.trim()).length," queries"]}),l.jsx(be,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:ze,children:b?"Adding...":"Add queries"})]})]}),o.project.locations&&o.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${H===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":H===void 0,onClick:()=>{W(void 0)},children:"All locations"}),o.project.locations.map(Se=>re.has(Se.label)&&l.jsx("button",{className:`filter-chip ${H===Se.label?"filter-chip-active":""}`,type:"button","aria-pressed":H===Se.label,onClick:()=>{W(Se.label),K(!1)},children:Se.label},Se.label)),Ce&&l.jsx("button",{className:`filter-chip ${H===""?"filter-chip-active":""}`,type:"button","aria-pressed":H==="",onClick:()=>{W(""),K(!1)},children:"No location"}),je.length>1&&H===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${Y?"filter-chip-active":""}`,type:"button","aria-pressed":Y,onClick:()=>K(Se=>!Se),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(Yde,{evidence:pe})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!N),children:N?"Cancel":"+ Add competitor"})]})]}),N&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:C,onChange:Se=>A(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&at()}),l.jsx(be,{type:"button",size:"sm",disabled:!C.trim()||P,onClick:at,children:P?"Adding...":"Add"})]}),l.jsx(Zde,{competitors:o.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:o.recentRuns.map(Se=>l.jsx(VB,{run:Se},Se.id))})]}),l.jsx(NPe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:$t,onRefresh:()=>{a()}}),l.jsx(CPe,{projectName:o.project.name}),l.jsx(OPe,{projectName:o.project.name})]}):e==="report"?l.jsx(oPe,{projectName:o.project.name}):e==="traffic"?l.jsx(j_e,{projectName:o.project.name}):e==="inbound"?l.jsx(F_e,{projectName:o.project.name}):l.jsx(_Pe,{projectName:o.project.name})]})}function TPe(){const{dashboard:e,isLoading:t}=Oc(),n=z_e();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-20"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 space-y-1.5",children:[l.jsx("div",{className:"skeleton-text w-40"}),l.jsx("div",{className:"skeleton-text-sm w-56"})]}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Runs"}),l.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),l.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>l.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Lv(d)},d))}),l.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>l.jsx(VB,{run:d},d.id)):l.jsxs(Be,{className:"surface-card empty-card",children:[l.jsx("h2",{children:"No runs match this filter"}),l.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function zPe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(""),[N,O]=x.useState(!1),[C,A]=x.useState(null),[P,E]=x.useState(!1),_=i?c.trim().length>0:a.trim().length>0;async function z(){if(_){O(!0),A(null),E(!1);try{const q=Y=>{const K=parseInt(Y.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},U={},B=q(m);B!==void 0&&(U.maxConcurrency=B);const H=q(v);H!==void 0&&(U.maxRequestsPerMinute=H);const W=q(b);W!==void 0&&(U.maxRequestsPerDay=W),await LV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),o(""),d(""),p(""),g(""),w(""),j(""),E(!0),vt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(q){A(q instanceof Error?q.message:"Failed to update provider")}finally{O(!1)}}}const I=n??"Use default model";return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),l.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:q=>d(q.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&l.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 ","↗"]})]}),l.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)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),l.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)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),l.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[l.jsxs("div",{children:[l.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=>g(q.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),l.jsxs("div",{children:[l.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)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.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:b,onChange:q=>j(q.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),P&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(be,{type:"button",size:"sm",disabled:!_||N,onClick:z,children:N?"Saving...":"Save"})]})}function RPe({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,o]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function g(){if(m){o(!0),d(null),p(!1);try{await $V({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),vt({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 l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.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 ","↗"]})]}),l.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)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.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)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&l.jsx("p",{className:"text-xs text-rose-400",children:c}),f&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(be,{type:"button",size:"sm",disabled:!m||a,onClick:g,children:a?"Saving...":"Save Google OAuth app"})]})}function DPe(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[o,c]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{Y2().then(t).catch(g=>{const v=g instanceof Error?g.message:String(g);v.includes("501")||r(v)})},[]),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),l.jsx("h2",{children:"ChatGPT (CDP)"})]}),l.jsx(it,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(g=>l.jsxs("span",{className:"mr-2",children:[g.name,": ",g.alive?"● alive":"○ idle"]},g.name))})]})]}),l.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"}),l.jsx("div",{className:"mt-2",children:l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async g=>{g.preventDefault(),m(!0);try{await lQ(o,parseInt(d,10)||9222);const v=await Y2().catch(()=>null);v&&t(v),a(!1),vt({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:[l.jsxs("div",{className:"flex gap-2",children:[l.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:g=>c(g.target.value),"aria-label":"CDP host"}),l.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:g=>f(g.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(be,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const IPe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function MPe(){const e=ep(),{dashboard:t}=Oc(),n=t?.settings??e?.dashboard?.settings,a=Gv(!e,e?.health).data??e?.health??IPe,[o,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(""),[w,b]=x.useState(!1),[j,N]=x.useState(null),[O,C]=x.useState(!1);return n?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(A=>l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:A.displayName??A.name})]}),l.jsx(it,{tone:A.state==="ready"?"positive":"caution",children:A.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:A.model})]}),A.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:A.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[A.quota.maxRequestsPerMinute,"/min · ",A.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:A.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>c(o===A.name?null:A.name),children:o===A.name?"Cancel":A.state==="ready"?A.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===A.name&&l.jsx(zPe,{providerName:A.name,keyUrl:A.keyUrl,modelHint:A.modelHint,onSaved:()=>{c(null)}})]},A.name)),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),l.jsx("h2",{children:"Search Console OAuth"})]}),l.jsx(it,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),l.jsx("div",{className:"mt-2",children:l.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&&l.jsx(RPe,{onSaved:()=>{f(!1)}})]}),l.jsxs(Be,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),l.jsx("h2",{children:"Webmaster Tools"})]}),l.jsx(it,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.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"})]}),l.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:g,onChange:A=>v(A.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&l.jsx("p",{className:"text-xs text-rose-400",children:j}),O&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(be,{type:"button",size:"sm",disabled:!g.trim()||w,onClick:async()=>{if(g.trim()){b(!0),N(null),C(!1);try{await pQ(g.trim()),v(""),C(!0),m(!1),vt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(A){N(A instanceof Error?A.message:"Failed to update Bing API key")}finally{b(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),l.jsx(DPe,{}),l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),l.jsx("h2",{children:"API and worker"})]})}),l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"API"}),l.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),l.jsx(it,{tone:vy(a.apiStatus),title:Ho(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"Worker"}),l.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),l.jsx(it,{tone:vy(a.workerStatus),title:Ho(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(Be,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(A=>l.jsx("li",{children:A},A))}),l.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const LPe=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function $Pe({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return l.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),l.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function BPe(){const e=ep(),{dashboard:t,isLoading:n,refetch:r}=Oc(),i=t??e?.dashboard;if(!i||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-24"}),l.jsx("div",{className:"skeleton-text-sm w-80"})]}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-32"}),l.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(fe=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1 flex-1",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},fe))})]})]});const a=i.settings,d=Gv(!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=Xte(i.setup,d,a),p=Zo(),[m,g]=x.useState(0),[v,w]=x.useState(""),[b,j]=x.useState(""),[N,O]=x.useState(""),[C,A]=x.useState("US"),[P,E]=x.useState("en"),[_,z]=x.useState(!1),[I,q]=x.useState(null),[U,B]=x.useState(null),[H,W]=x.useState(null),[Y,K]=x.useState(!1),[J,se]=x.useState(""),[me,L]=x.useState(!1),[M,F]=x.useState(null),[D,V]=x.useState(!1),oe=a.providerStatuses.filter(fe=>fe.state==="ready"),[re,Ce]=x.useState(oe[0]?.name??""),[je,ee]=x.useState(5),[pe,Ee]=x.useState(!1),[X,Ke]=x.useState(null),[ze,at]=x.useState(""),[Ve,Gt]=x.useState(!1),[$t,dn]=x.useState(null),[nn,Se]=x.useState(!1),[Ze,Rt]=x.useState(!1),[pt,Xe]=x.useState(!1),ce=S9(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Me=J.split(`
|
|
295
|
-
`).map(fe=>fe.trim()).filter(Boolean),Ge=ze.split(`
|
|
296
|
-
`).map(fe=>fe.trim()).filter(Boolean),ht=f.healthChecks.some(fe=>fe.id==="api"&&fe.state==="ready"),yn=async()=>{if(!(!Ne||!N)){K(!0),W(null);try{const fe=await Tv(Ne,{displayName:b||v,canonicalDomain:N,country:C,language:P,autoExtractBacklinks:_});q(Ne),B(fe.id),vt({title:"Project created",detail:`${fe.displayName||fe.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${fe.name}`,dedupeMode:"drop"}),r(),g(2)}catch(fe){W(fe instanceof Error?fe.message:"Failed to create project")}finally{K(!1)}}},Tn=async()=>{if(!I)return;const fe=Me;if(fe.length!==0){V(!0),F(null);try{await CV(I,fe),L(!0),r(),g(3)}catch(Qe){F(Qe instanceof Error?Qe.message:"Failed to save queries")}finally{V(!1)}}},vn=async()=>{if(!(!I||!re)){Ee(!0),Ke(null);try{const fe=await GV(I,re,je);if(fe.queries.length>0){const Qe=J?J.trimEnd()+`
|
|
297
|
-
`+fe.queries.join(`
|
|
298
|
-
`):fe.queries.join(`
|
|
299
|
-
`);se(Qe)}}catch(fe){Ke(fe instanceof Error?fe.message:"Failed to generate queries")}finally{Ee(!1)}}},We=async()=>{if(!I)return;const fe=Ge;if(fe.length!==0){Se(!0),dn(null);try{await n5(I,fe),Gt(!0),r(),g(4)}catch(Qe){dn(Qe instanceof Error?Qe.message:"Failed to save competitors")}finally{Se(!1)}}},Vt=async()=>{if(I){Xe(!0);try{await ce.mutateAsync({projectName:I,projectLabel:b||v||I,sourceAction:"setup-launch"}),Rt(!0),r()}catch{}finally{Xe(!1)}}},de=()=>g(fe=>Math.max(0,fe-1)),Pe=(()=>{switch(m){case 0:return l.jsxs(Be,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:f.healthChecks.map(fe=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:fe.label}),l.jsx("p",{className:"supporting-copy",children:fe.detail}),fe.id==="provider"&&fe.state!=="ready"&&l.jsx(Xt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(it,{tone:fe.state==="ready"?"positive":"caution",title:fe.id==="api"?Ho(d.apiStatus):fe.id==="worker"?Ho(d.workerStatus):fe.detail,children:fe.state==="ready"?"Ready":"Attention"})]},fe.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(be,{type:"button",disabled:!ht,onClick:()=>g(1),children:"Continue"})]})]});case 1:return l.jsxs(Be,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),l.jsx("h2",{children:"Create project"})]}),I?l.jsx(it,{tone:"positive",children:"Created"}):null]}),I?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"text-zinc-300",children:["Project ",l.jsx("span",{className:"text-zinc-100 font-medium",children:I})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",onClick:()=>g(2),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),l.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:fe=>w(fe.target.value)}),Ne&&Ne!==v?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ne]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:fe=>j(fe.target.value)})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),l.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:N,onChange:fe=>O(fe.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),l.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:fe=>A(fe.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),l.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:fe=>E(fe.target.value.toLowerCase())})]})]}),l.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:[l.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:fe=>z(fe.target.checked)}),l.jsxs("span",{className:"flex-1",children:[l.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),l.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."," ",l.jsx(Xt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),H?l.jsx("p",{className:"text-rose-400 text-sm",children:H}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",disabled:!Ne||!N||Y,onClick:yn,children:Y?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(Be,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add queries"})]}),me?l.jsxs(it,{tone:"positive",children:[Me.length," saved"]}):l.jsxs(it,{tone:"neutral",children:[Me.length," quer",Me.length!==1?"ies":"y"]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),me?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Me.map(fe=>l.jsx("li",{children:fe},fe))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",onClick:()=>g(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[oe.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:fe=>Ce(fe.target.value),children:oe.map(fe=>l.jsxs("option",{value:fe.name,children:[fe.displayName??fe.name,fe.model?` (${fe.model})`:""]},fe.name))})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),l.jsx("select",{id:"gen-count",className:"setup-input",value:je,onChange:fe=>ee(Number(fe.target.value)),children:[3,5,10,15,20].map(fe=>l.jsx("option",{value:fe,children:fe},fe))})]}),l.jsx(be,{type:"button",variant:"outline",disabled:pe||!re,onClick:vn,children:pe?"Analyzing site...":"Generate"})]}),X?l.jsx("p",{className:"text-rose-400 text-sm",children:X}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),l.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
300
|
-
best invisalign downtown brooklyn
|
|
301
|
-
pediatric dentist brooklyn heights`,value:J,onChange:fe=>se(fe.target.value)})]}),M?l.jsx("p",{className:"text-rose-400 text-sm",children:M}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",disabled:Me.length===0||D,onClick:Tn,children:D?"Saving...":`Save ${Me.length} quer${Me.length!==1?"ies":"y"}`})]})]})]});case 3:return l.jsxs(Be,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),l.jsx("h2",{children:"Add competitors"})]}),Ve?l.jsx(it,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ve?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Ge.map(fe=>l.jsx("li",{children:fe},fe))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",onClick:()=>g(4),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),l.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
-
competitor2.com`,value:ze,onChange:fe=>at(fe.target.value)})]}),$t?l.jsx("p",{className:"text-rose-400 text-sm",children:$t}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(be,{type:"button",variant:"outline",onClick:()=>g(4),children:"Skip"}),l.jsx(be,{type:"button",disabled:Ge.length===0||nn,onClick:We,children:nn?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(Be,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),l.jsx("h2",{children:"Launch first run"})]}),Ze?l.jsx(it,{tone:"positive",children:"Queued"}):null]}),Ze?l.jsxs("div",{className:"compact-stack",children:[l.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(be,{type:"button",onClick:()=>p({to:U?`/projects/${U}`:"/"}),children:"Open project"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",l.jsx("span",{className:"text-zinc-100 font-medium",children:I}),"."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(be,{type:"button",disabled:pt,onClick:Vt,children:pt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),l.jsx($Pe,{current:m,labels:LPe}),l.jsx("section",{className:"setup-wizard",children:Pe})]})}function Pu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.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:l.jsx(m5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.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 UPe="https://commoncrawl.org/web-graphs";function qj(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 Mg(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 Fj(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function qPe(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[o,c]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[g,v]=x.useState(!1),[w,b]=x.useState(!1),[j,N]=x.useState(""),[O,C]=x.useState(!1),[A,P]=x.useState(null),[E,_]=x.useState(null),z=x.useCallback(async()=>{m(!0),P(null);try{const[H,W,Y,K,J]=await Promise.all([OQ(),c5().catch(()=>null),_Q().catch(()=>[]),TQ().catch(()=>[]),zQ().catch(()=>null)]);t(H),r(W),a(Y),c(K),f(J)}catch(H){P(H instanceof Error?H.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{z()},[z]);async function I(){v(!0),P(null),_(null);try{const H=await EQ();_(H.alreadyPresent?`DuckDB already installed (${H.version}).`:`Installed DuckDB ${H.version}.`),await z()}catch(H){P(H instanceof Error?H.message:"Failed to install DuckDB")}finally{v(!1)}}async function q(){const H=j.trim()||void 0;b(!0),P(null),_(null);try{const W=await PQ(H);_(H?`Queued sync for ${W.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${W.release}. Download + query runs in the background.`),N(""),C(!1),await z()}catch(W){W instanceof ai&&W.code==="MISSING_DEPENDENCY"?P("DuckDB is not installed. Install it first."):P(W instanceof Error?W.message:"Failed to trigger sync")}finally{b(!1)}}async function U(H){P(null),_(null);try{await RQ(H),_(`Pruned cached release ${H}.`),await z()}catch(W){P(W instanceof Error?W.message:"Failed to prune release")}}const B=n?.status==="ready"&&o.every(H=>H.release!==n.release);return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Backlinks"}),l.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."})]})}),l.jsx(Be,{className:"surface-card p-4 mb-6 border-amber-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(dy,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),l.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),l.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),l.jsx("h2",{children:"How it works"})]})}),l.jsxs(Be,{className:"surface-card p-5",children:[l.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"," ",l.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),l.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.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 ",l.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.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."]})]})]})]})]}),A&&l.jsx(Be,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:A})}),E&&l.jsx(Be,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:l.jsx("p",{className:"text-sm text-emerald-300",children:E})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",l.jsxs(Pu,{label:"Why DuckDB?",children:[l.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."}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",l.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."]}),l.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",l.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?l.jsx(it,{tone:"positive",children:"Installed"}):l.jsx(it,{tone:"caution",children:"Not installed"})]}),l.jsx(Be,{className:"surface-card p-5",children:p?l.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(p5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(oW,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.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."}),l.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&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),l.jsx("div",{className:"mt-3",children:l.jsxs(be,{type:"button",size:"sm",disabled:g,onClick:I,children:[l.jsx(zv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),g?"Installing…":"Install DuckDB"]})})]})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",l.jsx(Pu,{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&&l.jsx(it,{tone:Fj(n.status),children:n.status})]}),l.jsxs(Be,{className:"surface-card p-5",children:[l.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",l.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?l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("p",{className:"text-zinc-200",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&l.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",l.jsx(Pu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:Mg(n.downloadStartedAt??n.createdAt)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:Mg(n.queryFinishedAt)})]})]}),n.error&&l.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&l.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(dy,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),l.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"," ",l.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."]})]})]})}),l.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?l.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[l.jsx("code",{className:"text-zinc-100",children:d.release}),l.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",qj(d.vertexBytes),", edges ",qj(d.edgesBytes)]})]}):l.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."}),l.jsxs("a",{href:UPe,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",l.jsx(pW,{className:"h-3 w-3","aria-hidden":!0})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs(be,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:q,children:[l.jsx(uy,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),l.jsxs(Pu,{label:"What does Run sync do?",children:[l.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",l.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."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",l.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",l.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),O?l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.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:H=>N(H.target.value),disabled:w,autoFocus:!0}),l.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(""),C(!1)},disabled:w,children:"Cancel"})]}):l.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:()=>C(!0),disabled:w,children:"Use a different release →"})]}),!e?.duckdbInstalled&&l.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",l.jsxs(Pu,{label:"What is this?",children:[l.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),l.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 ",l.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),l.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."}),l.jsx(Be,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),l.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),l.jsxs("tbody",{children:[o.map(H=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:H.release})}),l.jsx("td",{className:"px-4 py-2",children:H.syncStatus?l.jsx(it,{tone:Fj(H.syncStatus),children:H.syncStatus}):l.jsx("span",{className:"text-zinc-600",children:"—"})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:qj(H.bytes)}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Mg(H.lastUsedAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>U(H.release),children:[l.jsx(x5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),l.jsx(Pu,{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)."})]})})]},H.release)),o.length===0&&l.jsx("tr",{children:l.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&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h2",{children:"Past release syncs"})]})}),l.jsx(Be,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),l.jsx("tbody",{children:i.map(H=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:H.release})}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(it,{tone:Fj(H.status),children:H.status})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:H.projectsProcessed??"—"}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:H.domainsDiscovered??"—"}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Mg(H.queryFinishedAt??H.updatedAt)})]},H.id))})]})})]})]})}function FPe(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(Be,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(be,{asChild:!0,children:l.jsx(Xt,{to:"/",children:"Return to overview"})})]})})})}function KPe(){return l.jsx(Pue,{children:l.jsx(_ue,{})})}const Qi=aV()({component:KPe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),HPe=si({getParentRoute:()=>Qi,path:"/",component:Rue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length===0)throw YN({to:"/setup"})}}),GPe=si({getParentRoute:()=>Qi,path:"/projects",component:Gde}),Fd=si({getParentRoute:()=>Qi,path:"/projects/$projectId",component:()=>l.jsx(ak,{})}),VPe=si({getParentRoute:()=>Fd,path:"/",component:()=>l.jsx(Ep,{tab:"overview"})}),QPe=si({getParentRoute:()=>Fd,path:"/search-console",component:()=>l.jsx(Ep,{tab:"search-console"})}),WPe=si({getParentRoute:()=>Fd,path:"/report",component:()=>l.jsx(Ep,{tab:"report"})}),YPe=si({getParentRoute:()=>Fd,path:"/traffic",component:()=>l.jsx(Ep,{tab:"traffic"})}),ZPe=si({getParentRoute:()=>Fd,path:"/inbound",component:()=>l.jsx(Ep,{tab:"inbound"})}),XPe=si({getParentRoute:()=>Qi,path:"/runs",component:TPe}),JPe=si({getParentRoute:()=>Qi,path:"/settings",component:MPe,beforeLoad:({context:e})=>{}}),e2e=si({getParentRoute:()=>Qi,path:"/setup",component:BPe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length>0)throw YN({to:"/"})}}),t2e=si({getParentRoute:()=>Qi,path:"/backlinks",component:qPe}),n2e=si({getParentRoute:()=>Qi,path:"*",component:FPe}),r2e=Qi.addChildren([HPe,GPe,Fd.addChildren([VPe,QPe,WPe,YPe,ZPe]),XPe,JPe,e2e,t2e,n2e]);function i2e(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const f$=i2e(),a2e=f$==="/"?"":f$.replace(/\/$/,"");function s2e(e,t){return mV({routeTree:r2e,basepath:a2e||"/",context:{queryClient:e},...t?.initialEntries})}const N9=GQ(),o2e=s2e(N9),k9=document.getElementById("root");if(!k9)throw new Error("Expected #root element for web app bootstrap.");function l2e(){const[e,t]=x.useState(V2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[o,c]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(V2())return;let g=!1;return DV().then(v=>{g||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{g||(c(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{g=!0}},[]);const p=async g=>{if(g.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}f(!0),c(null);try{if(!(await IV(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),t("ready")}catch(v){c(v instanceof ai||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async g=>{if(g.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await MV(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(v){c(v instanceof ai||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?l.jsx(h7,{client:N9,children:l.jsx(vV,{router:o2e})}):l.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:l.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:l.jsx(Be,{className:"surface-card w-full",children:e==="checking"?l.jsx(Hg,{className:"py-8",children:l.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?l.jsxs(l.Fragment,{children:[l.jsxs(E1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),l.jsx(_1,{children:"Create a dashboard password"}),l.jsx(P1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),l.jsx(Hg,{children:l.jsxs("form",{className:"space-y-4",onSubmit:p,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.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:g=>r(g.target.value),placeholder:"At least 8 characters"})]}),l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),l.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:g=>a(g.target.value),placeholder:"Re-enter password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(be,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs(E1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),l.jsx(_1,{children:"Sign in to Canonry"}),l.jsx(P1,{children:"Enter your dashboard password to continue."})]}),l.jsx(Hg,{children:l.jsxs("form",{className:"space-y-4",onSubmit:m,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.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:g=>r(g.target.value),placeholder:"Dashboard password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(be,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}qH.createRoot(k9).render(l.jsx(x.StrictMode,{children:l.jsx(l2e,{})}));
|