@ainyc/canonry 3.2.0 → 3.2.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.
@@ -0,0 +1,302 @@
1
+ function f9(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 Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xb={exports:{}},ef={};var kE;function h9(){if(kE)return ef;kE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return ef.Fragment=t,ef.jsx=n,ef.jsxs=n,ef}var CE;function p9(){return CE||(CE=1,xb.exports=h9()),xb.exports}var l=p9(),bb={exports:{}},tt={};var _E;function m9(){if(_E)return tt;_E=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function k(I,q,R){this.props=I,this.context=q,this.refs=j,this.updater=R||w}k.prototype.isReactComponent={},k.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,q,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=k.prototype;function _(I,q,R){this.props=I,this.context=q,this.refs=j,this.updater=R||w}var C=_.prototype=new O;C.constructor=_,S(C,k.prototype),C.isPureReactComponent=!0;var T=Array.isArray;function E(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(I,q,R){var G=R.ref;return{$$typeof:e,type:I,key:q,ref:G!==void 0?G:null,props:R}}function F(I,q){return $(I.type,q,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(R){return q[R]})}var V=/\/+/g;function ee(I,q){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):q.toString(36)}function Q(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(E,E):(I.status="pending",I.then(function(q){I.status==="pending"&&(I.status="fulfilled",I.value=q)},function(q){I.status==="pending"&&(I.status="rejected",I.reason=q)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function K(I,q,R,G,ie){var ne=typeof I;(ne==="undefined"||ne==="boolean")&&(I=null);var Ce=!1;if(I===null)Ce=!0;else switch(ne){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(I.$$typeof){case e:case t:Ce=!0;break;case p:return Ce=I._init,K(Ce(I._payload),q,R,G,ie)}}if(Ce)return ie=ie(I),Ce=G===""?"."+ee(I,0):G,T(ie)?(R="",Ce!=null&&(R=Ce.replace(V,"$&/")+"/"),K(ie,q,R,"",function(pe){return pe})):ie!=null&&(U(ie)&&(ie=F(ie,R+(ie.key==null||I&&I.key===ie.key?"":(""+ie.key).replace(V,"$&/")+"/")+Ce)),q.push(ie)),1;Ce=0;var Se=G===""?".":G+":";if(T(I))for(var J=0;J<I.length;J++)G=I[J],ne=Se+ee(G,J),Ce+=K(G,q,R,ne,ie);else if(J=v(I),typeof J=="function")for(I=J.call(I),J=0;!(G=I.next()).done;)G=G.value,ne=Se+ee(G,J++),Ce+=K(G,q,R,ne,ie);else if(ne==="object"){if(typeof I.then=="function")return K(Q(I),q,R,G,ie);throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function te(I,q,R){if(I==null)return I;var G=[],ie=0;return K(I,G,"","",function(ne){return q.call(R,ne,ie++)}),G}function le(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(R){(I._status===0||I._status===-1)&&(I._status=1,I._result=R)},function(R){(I._status===0||I._status===-1)&&(I._status=2,I._result=R)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var je=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},L={map:te,forEach:function(I,q,R){te(I,function(){q.apply(this,arguments)},R)},count:function(I){var q=0;return te(I,function(){q++}),q},toArray:function(I){return te(I,function(q){return q})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return tt.Activity=m,tt.Children=L,tt.Component=k,tt.Fragment=n,tt.Profiler=i,tt.PureComponent=_,tt.StrictMode=r,tt.Suspense=d,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,tt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return A.H.useMemoCache(I)}},tt.cache=function(I){return function(){return I.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(I,q,R){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var G=S({},I.props),ie=I.key;if(q!=null)for(ne in q.key!==void 0&&(ie=""+q.key),q)!P.call(q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&q.ref===void 0||(G[ne]=q[ne]);var ne=arguments.length-2;if(ne===1)G.children=R;else if(1<ne){for(var Ce=Array(ne),Se=0;Se<ne;Se++)Ce[Se]=arguments[Se+2];G.children=Ce}return $(I.type,ie,G)},tt.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},tt.createElement=function(I,q,R){var G,ie={},ne=null;if(q!=null)for(G in q.key!==void 0&&(ne=""+q.key),q)P.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ie[G]=q[G]);var Ce=arguments.length-2;if(Ce===1)ie.children=R;else if(1<Ce){for(var Se=Array(Ce),J=0;J<Ce;J++)Se[J]=arguments[J+2];ie.children=Se}if(I&&I.defaultProps)for(G in Ce=I.defaultProps,Ce)ie[G]===void 0&&(ie[G]=Ce[G]);return $(I,ne,ie)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(I){return{$$typeof:u,render:I}},tt.isValidElement=U,tt.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:le}},tt.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},tt.startTransition=function(I){var q=A.T,R={};A.T=R;try{var G=I(),ie=A.S;ie!==null&&ie(R,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(E,je)}catch(ne){je(ne)}finally{q!==null&&R.types!==null&&(q.types=R.types),A.T=q}},tt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},tt.use=function(I){return A.H.use(I)},tt.useActionState=function(I,q,R){return A.H.useActionState(I,q,R)},tt.useCallback=function(I,q){return A.H.useCallback(I,q)},tt.useContext=function(I){return A.H.useContext(I)},tt.useDebugValue=function(){},tt.useDeferredValue=function(I,q){return A.H.useDeferredValue(I,q)},tt.useEffect=function(I,q){return A.H.useEffect(I,q)},tt.useEffectEvent=function(I){return A.H.useEffectEvent(I)},tt.useId=function(){return A.H.useId()},tt.useImperativeHandle=function(I,q,R){return A.H.useImperativeHandle(I,q,R)},tt.useInsertionEffect=function(I,q){return A.H.useInsertionEffect(I,q)},tt.useLayoutEffect=function(I,q){return A.H.useLayoutEffect(I,q)},tt.useMemo=function(I,q){return A.H.useMemo(I,q)},tt.useOptimistic=function(I,q){return A.H.useOptimistic(I,q)},tt.useReducer=function(I,q,R){return A.H.useReducer(I,q,R)},tt.useRef=function(I){return A.H.useRef(I)},tt.useState=function(I){return A.H.useState(I)},tt.useSyncExternalStore=function(I,q,R){return A.H.useSyncExternalStore(I,q,R)},tt.useTransition=function(){return A.H.useTransition()},tt.version="19.2.4",tt}var AE;function qu(){return AE||(AE=1,bb.exports=m9()),bb.exports}var x=qu();const Vi=Ta(x),Fy=f9({__proto__:null,default:Vi},[x]);var wb={exports:{}},tf={},Sb={exports:{}},jb={};var OE;function g9(){return OE||(OE=1,(function(e){function t(K,te){var le=K.length;K.push(te);e:for(;0<le;){var je=le-1>>>1,L=K[je];if(0<i(L,te))K[je]=te,K[le]=L,le=je;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var te=K[0],le=K.pop();if(le!==te){K[0]=le;e:for(var je=0,L=K.length,I=L>>>1;je<I;){var q=2*(je+1)-1,R=K[q],G=q+1,ie=K[G];if(0>i(R,le))G<L&&0>i(ie,R)?(K[je]=ie,K[G]=le,je=G):(K[je]=R,K[q]=le,je=q);else if(G<L&&0>i(ie,le))K[je]=ie,K[G]=le,je=G;else break e}}return te}function i(K,te){var le=K.sortIndex-te.sortIndex;return le!==0?le:K.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],f=[],p=1,m=null,y=3,v=!1,w=!1,S=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(K){for(var te=n(f);te!==null;){if(te.callback===null)r(f);else if(te.startTime<=K)r(f),te.sortIndex=te.expirationTime,t(d,te);else break;te=n(f)}}function T(K){if(S=!1,C(K),!w)if(n(d)!==null)w=!0,E||(E=!0,B());else{var te=n(f);te!==null&&Q(T,te.startTime-K)}}var E=!1,A=-1,P=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<P)}function U(){if(j=!1,E){var K=e.unstable_now();$=K;var te=!0;try{e:{w=!1,S&&(S=!1,O(A),A=-1),v=!0;var le=y;try{t:{for(C(K),m=n(d);m!==null&&!(m.expirationTime>K&&F());){var je=m.callback;if(typeof je=="function"){m.callback=null,y=m.priorityLevel;var L=je(m.expirationTime<=K);if(K=e.unstable_now(),typeof L=="function"){m.callback=L,C(K),te=!0;break t}m===n(d)&&r(d),C(K)}else r(d);m=n(d)}if(m!==null)te=!0;else{var I=n(f);I!==null&&Q(T,I.startTime-K),te=!1}}break e}finally{m=null,y=le,v=!1}te=void 0}}finally{te?B():E=!1}}}var B;if(typeof _=="function")B=function(){_(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ee=V.port2;V.port1.onmessage=U,B=function(){ee.postMessage(null)}}else B=function(){k(U,0)};function Q(K,te){A=k(function(){K(e.unstable_now())},te)}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"):P=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var te=3;break;default:te=y}var le=y;y=te;try{return K()}finally{y=le}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(K,te){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var le=y;y=K;try{return te()}finally{y=le}},e.unstable_scheduleCallback=function(K,te,le){var je=e.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?je+le:je):le=je,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=le+L,K={id:p++,callback:te,priorityLevel:K,startTime:le,expirationTime:L,sortIndex:-1},le>je?(K.sortIndex=le,t(f,K),n(d)===null&&K===n(f)&&(S?(O(A),A=-1):S=!0,Q(T,le-je))):(K.sortIndex=L,t(d,K),w||v||(w=!0,E||(E=!0,B()))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var te=y;return function(){var le=y;y=te;try{return K.apply(this,arguments)}finally{y=le}}}})(jb)),jb}var EE;function y9(){return EE||(EE=1,Sb.exports=g9()),Sb.exports}var Nb={exports:{}},sr={};var zE;function v9(){if(zE)return sr;zE=1;var e=qu();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return sr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,sr.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)},sr.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()}},sr.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))},sr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},sr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},sr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},sr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},sr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},sr.requestFormReset=function(d){r.d.r(d)},sr.unstable_batchedUpdates=function(d,f){return d(f)},sr.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},sr.useFormStatus=function(){return o.H.useHostTransitionStatus()},sr.version="19.2.4",sr}var TE;function lI(){if(TE)return Nb.exports;TE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Nb.exports=v9(),Nb.exports}var PE;function x9(){if(PE)return tf;PE=1;var e=y9(),t=qu(),n=lI();function r(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+c+" 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 c=s,h=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(h=c.return),s=c.return;while(s)}return c.tag===3?h:null}function o(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function u(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var c=s.alternate;if(!c){if(c=a(s),c===null)throw Error(r(188));return c!==s?null:s}for(var h=s,g=c;;){var b=h.return;if(b===null)break;var N=b.alternate;if(N===null){if(g=b.return,g!==null){h=g;continue}break}if(b.child===N.child){for(N=b.child;N;){if(N===h)return d(b),s;if(N===g)return d(b),c;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=b,g=N;else{for(var z=!1,M=b.child;M;){if(M===h){z=!0,h=b,g=N;break}if(M===g){z=!0,g=b,h=N;break}M=M.sibling}if(!z){for(M=N.child;M;){if(M===h){z=!0,h=N,g=b;break}if(M===g){z=!0,g=N,h=b;break}M=M.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:c}function p(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=p(s),c!==null)return c;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=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 V=Symbol.for("react.client.reference");function ee(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case E:return"SuspenseList";case $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case _:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case C:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return c=s.displayName||null,c!==null?c:ee(s.type)||"Memo";case P:c=s._payload,s=s._init;try{return ee(s(c))}catch{}}return null}var Q=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},je=[],L=-1;function I(s){return{current:s}}function q(s){0>L||(s.current=je[L],je[L]=null,L--)}function R(s,c){L++,je[L]=s.current,s.current=c}var G=I(null),ie=I(null),ne=I(null),Ce=I(null);function Se(s,c){switch(R(ne,c),R(ie,s),R(G,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?ZO(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=ZO(c),s=YO(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}q(G),R(G,s)}function J(){q(G),q(ie),q(ne)}function pe(s){s.memoizedState!==null&&R(Ce,s);var c=G.current,h=YO(c,s.type);c!==h&&(R(ie,s),R(G,h))}function Oe(s){ie.current===s&&(q(G),q(ie)),Ce.current===s&&(q(Ce),Wd._currentValue=le)}var W,Fe;function Te(s){if(W===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);W=c&&c[1]||"",Fe=-1<h.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+W+s+Fe}var it=!1;function Ze(s,c){if(!s||it)return"";it=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ue){var se=ue}Reflect.construct(s,[],be)}else{try{be.call()}catch(ue){se=ue}s.call(be.prototype)}}else{try{throw Error()}catch(ue){se=ue}(be=s())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ue){if(ue&&se&&typeof ue.stack=="string")return[ue.stack,se.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),z=N[0],M=N[1];if(z&&M){var H=z.split(`
4
+ `),ae=M.split(`
5
+ `);for(b=g=0;g<H.length&&!H[g].includes("DetermineComponentFrameRoot");)g++;for(;b<ae.length&&!ae[b].includes("DetermineComponentFrameRoot");)b++;if(g===H.length||b===ae.length)for(g=H.length-1,b=ae.length-1;1<=g&&0<=b&&H[g]!==ae[b];)b--;for(;1<=g&&0<=b;g--,b--)if(H[g]!==ae[b]){if(g!==1||b!==1)do if(g--,b--,0>b||H[g]!==ae[b]){var me=`
6
+ `+H[g].replace(" at new "," at ");return s.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",s.displayName)),me}while(1<=g&&0<=b);break}}}finally{it=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Te(h):""}function Lt(s,c){switch(s.tag){case 26:case 27:case 5:return Te(s.type);case 16:return Te("Lazy");case 13:return s.child!==c&&c!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Ze(s.type,!1);case 11:return Ze(s.type.render,!1);case 1:return Ze(s.type,!0);case 31:return Te("Activity");default:return""}}function Rt(s){try{var c="",h=null;do c+=Lt(s,h),h=s,s=s.return;while(s);return c}catch(g){return`
7
+ Error generating stack: `+g.message+`
8
+ `+g.stack}}var en=Object.prototype.hasOwnProperty,we=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,ot=e.unstable_shouldYield,Fn=e.unstable_requestPaint,et=e.unstable_now,St=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,ht=e.unstable_IdlePriority,on=e.log,xn=e.unstable_setDisableYieldValue,ln=null,Ye=null;function $t(s){if(typeof on=="function"&&xn(s),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(ln,s)}catch{}}var de=Math.clz32?Math.clz32:Ve,ze=Math.log,fe=Math.LN2;function Ve(s){return s>>>=0,s===0?32:31-(ze(s)/fe|0)|0}var Dn=256,ai=262144,Yt=4194304;function bn(s){var c=s&42;if(c!==0)return c;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 _r(s,c,h){var g=s.pendingLanes;if(g===0)return 0;var b=0,N=s.suspendedLanes,z=s.pingedLanes;s=s.warmLanes;var M=g&134217727;return M!==0?(g=M&~N,g!==0?b=bn(g):(z&=M,z!==0?b=bn(z):h||(h=M&~s,h!==0&&(b=bn(h))))):(M=g&~N,M!==0?b=bn(M):z!==0?b=bn(z):h||(h=g&~s,h!==0&&(b=bn(h)))),b===0?0:c!==0&&c!==b&&(c&N)===0&&(N=b&-b,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:b}function Li(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function ia(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Yh(){var s=Yt;return Yt<<=1,(Yt&62914560)===0&&(Yt=4194304),s}function js(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Ns(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function d0(s,c,h,g,b,N){var z=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var M=s.entanglements,H=s.expirationTimes,ae=s.hiddenUpdates;for(h=z&~h;0<h;){var me=31-de(h),be=1<<me;M[me]=0,H[me]=-1;var se=ae[me];if(se!==null)for(ae[me]=null,me=0;me<se.length;me++){var ue=se[me];ue!==null&&(ue.lane&=-536870913)}h&=~be}g!==0&&cd(s,g,0),N!==0&&b===0&&s.tag!==0&&(s.suspendedLanes|=N&~(z&~c))}function cd(s,c,h){s.pendingLanes|=c,s.suspendedLanes&=~c;var g=31-de(c);s.entangledLanes|=c,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function Wh(s,c){var h=s.entangledLanes|=c;for(s=s.entanglements;h;){var g=31-de(h),b=1<<g;b&c|s[g]&c&&(s[g]|=c),h&=~b}}function Qh(s,c){var h=c&-c;return h=(h&42)!==0?1:ud(h),(h&(s.suspendedLanes|c))!==0?0:h}function ud(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 dd(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function fd(){var s=te.p;return s!==0?s:(s=window.event,s===void 0?32:vE(s.type))}function Z(s,c){var h=te.p;try{return te.p=s,c()}finally{te.p=h}}var ke=Math.random().toString(36).slice(2),Xe="__reactFiber$"+ke,jt="__reactProps$"+ke,wn="__reactContainer$"+ke,aa="__reactEvents$"+ke,Ia="__reactListeners$"+ke,ks="__reactHandles$"+ke,gr="__reactResources$"+ke,Mo="__reactMarker$"+ke;function sa(s){delete s[Xe],delete s[jt],delete s[aa],delete s[Ia],delete s[ks]}function si(s){var c=s[Xe];if(c)return c;for(var h=s.parentNode;h;){if(c=h[wn]||h[Xe]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(s=nE(s);s!==null;){if(h=s[Xe])return h;s=nE(s)}return c}s=h,h=s.parentNode}return null}function $i(s){if(s=s[Xe]||s[wn]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Cs(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function _s(s){var c=s[gr];return c||(c=s[gr]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function cn(s){s[Mo]=!0}var Io=new Set,Xh={};function La(s,c){dt(s,c),dt(s+"Capture",c)}function dt(s,c){for(Xh[s]=c,s=0;s<c.length;s++)Io.add(c[s])}var Bt=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]*$"),Ar={},Bi={};function ac(s){return en.call(Bi,s)?!0:en.call(Ar,s)?!1:Bt.test(s)?Bi[s]=!0:(Ar[s]=!0,!1)}function Lo(s,c,h){if(ac(c))if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+h)}}function Jh(s,c,h){if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+h)}}function $a(s,c,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(c,h,""+g)}}function oi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function BC(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function aq(s,c,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,N=g.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return b.call(this)},set:function(z){h=""+z,N.call(this,z)}}),Object.defineProperty(s,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function f0(s){if(!s._valueTracker){var c=BC(s)?"checked":"value";s._valueTracker=aq(s,c,""+s[c])}}function UC(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return s&&(g=BC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(c.setValue(s),!0):!1}function ep(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 sq=/[\n"\\]/g;function li(s){return s.replace(sq,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function h0(s,c,h,g,b,N,z,M){s.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.type=z:s.removeAttribute("type"),c!=null?z==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+oi(c)):s.value!==""+oi(c)&&(s.value=""+oi(c)):z!=="submit"&&z!=="reset"||s.removeAttribute("value"),c!=null?p0(s,z,oi(c)):h!=null?p0(s,z,oi(h)):g!=null&&s.removeAttribute("value"),b==null&&N!=null&&(s.defaultChecked=!!N),b!=null&&(s.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+oi(M):s.removeAttribute("name")}function qC(s,c,h,g,b,N,z,M){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),c!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||c!=null)){f0(s);return}h=h!=null?""+oi(h):"",c=c!=null?""+oi(c):h,M||c===s.value||(s.value=c),s.defaultValue=c}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=M?s.checked:!!g,s.defaultChecked=!!g,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(s.name=z),f0(s)}function p0(s,c,h){c==="number"&&ep(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function sc(s,c,h,g){if(s=s.options,c){c={};for(var b=0;b<h.length;b++)c["$"+h[b]]=!0;for(h=0;h<s.length;h++)b=c.hasOwnProperty("$"+s[h].value),s[h].selected!==b&&(s[h].selected=b),b&&g&&(s[h].defaultSelected=!0)}else{for(h=""+oi(h),c=null,b=0;b<s.length;b++){if(s[b].value===h){s[b].selected=!0,g&&(s[b].defaultSelected=!0);return}c!==null||s[b].disabled||(c=s[b])}c!==null&&(c.selected=!0)}}function FC(s,c,h){if(c!=null&&(c=""+oi(c),c!==s.value&&(s.value=c),h==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=h!=null?""+oi(h):""}function KC(s,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(r(92));if(Q(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),c=h}h=oi(c),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),f0(s)}function oc(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var oq=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 HC(s,c,h){var g=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":g?s.setProperty(c,h):typeof h!="number"||h===0||oq.has(c)?c==="float"?s.cssFloat=h:s[c]=(""+h).trim():s[c]=h+"px"}function GC(s,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var b in c)g=c[b],c.hasOwnProperty(b)&&h[b]!==g&&HC(s,b,g)}else for(var N in c)c.hasOwnProperty(N)&&HC(s,N,c[N])}function m0(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 lq=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"]]),cq=/^[\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 tp(s){return cq.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ba(){}var g0=null;function y0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var lc=null,cc=null;function VC(s){var c=$i(s);if(c&&(s=c.stateNode)){var h=s[jt]||null;e:switch(s=c.stateNode,c.type){case"input":if(h0(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+li(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==s&&g.form===s.form){var b=g[jt]||null;if(!b)throw Error(r(90));h0(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===s.form&&UC(g)}break e;case"textarea":FC(s,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&sc(s,!!h.multiple,c,!1)}}}var v0=!1;function ZC(s,c,h){if(v0)return s(c,h);v0=!0;try{var g=s(c);return g}finally{if(v0=!1,(lc!==null||cc!==null)&&(qp(),lc&&(c=lc,s=cc,cc=lc=null,VC(c),s)))for(c=0;c<s.length;c++)VC(s[c])}}function hd(s,c){var h=s.stateNode;if(h===null)return null;var g=h[jt]||null;if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x0=!1;if(Ua)try{var pd={};Object.defineProperty(pd,"passive",{get:function(){x0=!0}}),window.addEventListener("test",pd,pd),window.removeEventListener("test",pd,pd)}catch{x0=!1}var As=null,b0=null,np=null;function YC(){if(np)return np;var s,c=b0,h=c.length,g,b="value"in As?As.value:As.textContent,N=b.length;for(s=0;s<h&&c[s]===b[s];s++);var z=h-s;for(g=1;g<=z&&c[h-g]===b[N-g];g++);return np=b.slice(s,1<g?1-g:void 0)}function rp(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function ip(){return!0}function WC(){return!1}function Or(s){function c(h,g,b,N,z){this._reactName=h,this._targetInst=b,this.type=g,this.nativeEvent=N,this.target=z,this.currentTarget=null;for(var M in s)s.hasOwnProperty(M)&&(h=s[M],this[M]=h?h(N):N[M]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?ip:WC,this.isPropagationStopped=WC,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=ip)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=ip)},persist:function(){},isPersistent:ip}),c}var $o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ap=Or($o),md=m({},$o,{view:0,detail:0}),uq=Or(md),w0,S0,gd,sp=m({},md,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:N0,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!==gd&&(gd&&s.type==="mousemove"?(w0=s.screenX-gd.screenX,S0=s.screenY-gd.screenY):S0=w0=0,gd=s),w0)},movementY:function(s){return"movementY"in s?s.movementY:S0}}),QC=Or(sp),dq=m({},sp,{dataTransfer:0}),fq=Or(dq),hq=m({},md,{relatedTarget:0}),j0=Or(hq),pq=m({},$o,{animationName:0,elapsedTime:0,pseudoElement:0}),mq=Or(pq),gq=m({},$o,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),yq=Or(gq),vq=m({},$o,{data:0}),XC=Or(vq),xq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bq={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"},wq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sq(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=wq[s])?!!c[s]:!1}function N0(){return Sq}var jq=m({},md,{key:function(s){if(s.key){var c=xq[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=rp(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?bq[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:N0,charCode:function(s){return s.type==="keypress"?rp(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?rp(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),Nq=Or(jq),kq=m({},sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),JC=Or(kq),Cq=m({},md,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:N0}),_q=Or(Cq),Aq=m({},$o,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oq=Or(Aq),Eq=m({},sp,{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}),zq=Or(Eq),Tq=m({},$o,{newState:0,oldState:0}),Pq=Or(Tq),Rq=[9,13,27,32],k0=Ua&&"CompositionEvent"in window,yd=null;Ua&&"documentMode"in document&&(yd=document.documentMode);var Dq=Ua&&"TextEvent"in window&&!yd,e_=Ua&&(!k0||yd&&8<yd&&11>=yd),t_=" ",n_=!1;function r_(s,c){switch(s){case"keyup":return Rq.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var uc=!1;function Mq(s,c){switch(s){case"compositionend":return i_(c);case"keypress":return c.which!==32?null:(n_=!0,t_);case"textInput":return s=c.data,s===t_&&n_?null:s;default:return null}}function Iq(s,c){if(uc)return s==="compositionend"||!k0&&r_(s,c)?(s=YC(),np=b0=As=null,uc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return e_&&c.locale!=="ko"?null:c.data;default:return null}}var Lq={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 a_(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!Lq[s.type]:c==="textarea"}function s_(s,c,h,g){lc?cc?cc.push(g):cc=[g]:lc=g,c=Yp(c,"onChange"),0<c.length&&(h=new ap("onChange","change",null,h,g),s.push({event:h,listeners:c}))}var vd=null,xd=null;function $q(s){qO(s,0)}function op(s){var c=Cs(s);if(UC(c))return s}function o_(s,c){if(s==="change")return c}var l_=!1;if(Ua){var C0;if(Ua){var _0="oninput"in document;if(!_0){var c_=document.createElement("div");c_.setAttribute("oninput","return;"),_0=typeof c_.oninput=="function"}C0=_0}else C0=!1;l_=C0&&(!document.documentMode||9<document.documentMode)}function u_(){vd&&(vd.detachEvent("onpropertychange",d_),xd=vd=null)}function d_(s){if(s.propertyName==="value"&&op(xd)){var c=[];s_(c,xd,s,y0(s)),ZC($q,c)}}function Bq(s,c,h){s==="focusin"?(u_(),vd=c,xd=h,vd.attachEvent("onpropertychange",d_)):s==="focusout"&&u_()}function Uq(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return op(xd)}function qq(s,c){if(s==="click")return op(c)}function Fq(s,c){if(s==="input"||s==="change")return op(c)}function Kq(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Hr=typeof Object.is=="function"?Object.is:Kq;function bd(s,c){if(Hr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var h=Object.keys(s),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var b=h[g];if(!en.call(c,b)||!Hr(s[b],c[b]))return!1}return!0}function f_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function h_(s,c){var h=f_(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=c&&g>=c)return{node:h,offset:c-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=f_(h)}}function p_(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?p_(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function m_(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=ep(s.document);c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=ep(s.document)}return c}function A0(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var Hq=Ua&&"documentMode"in document&&11>=document.documentMode,dc=null,O0=null,wd=null,E0=!1;function g_(s,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;E0||dc==null||dc!==ep(g)||(g=dc,"selectionStart"in g&&A0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),wd&&bd(wd,g)||(wd=g,g=Yp(O0,"onSelect"),0<g.length&&(c=new ap("onSelect","select",null,c,h),s.push({event:c,listeners:g}),c.target=dc)))}function Bo(s,c){var h={};return h[s.toLowerCase()]=c.toLowerCase(),h["Webkit"+s]="webkit"+c,h["Moz"+s]="moz"+c,h}var fc={animationend:Bo("Animation","AnimationEnd"),animationiteration:Bo("Animation","AnimationIteration"),animationstart:Bo("Animation","AnimationStart"),transitionrun:Bo("Transition","TransitionRun"),transitionstart:Bo("Transition","TransitionStart"),transitioncancel:Bo("Transition","TransitionCancel"),transitionend:Bo("Transition","TransitionEnd")},z0={},y_={};Ua&&(y_=document.createElement("div").style,"AnimationEvent"in window||(delete fc.animationend.animation,delete fc.animationiteration.animation,delete fc.animationstart.animation),"TransitionEvent"in window||delete fc.transitionend.transition);function Uo(s){if(z0[s])return z0[s];if(!fc[s])return s;var c=fc[s],h;for(h in c)if(c.hasOwnProperty(h)&&h in y_)return z0[s]=c[h];return s}var v_=Uo("animationend"),x_=Uo("animationiteration"),b_=Uo("animationstart"),Gq=Uo("transitionrun"),Vq=Uo("transitionstart"),Zq=Uo("transitioncancel"),w_=Uo("transitionend"),S_=new Map,T0="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(" ");T0.push("scrollEnd");function Ui(s,c){S_.set(s,c),La(c,[s])}var lp=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=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(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ci=[],hc=0,P0=0;function cp(){for(var s=hc,c=P0=hc=0;c<s;){var h=ci[c];ci[c++]=null;var g=ci[c];ci[c++]=null;var b=ci[c];ci[c++]=null;var N=ci[c];if(ci[c++]=null,g!==null&&b!==null){var z=g.pending;z===null?b.next=b:(b.next=z.next,z.next=b),g.pending=b}N!==0&&j_(h,b,N)}}function up(s,c,h,g){ci[hc++]=s,ci[hc++]=c,ci[hc++]=h,ci[hc++]=g,P0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function R0(s,c,h,g){return up(s,c,h,g),dp(s)}function qo(s,c){return up(s,null,null,c),dp(s)}function j_(s,c,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var b=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(b=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,b&&c!==null&&(b=31-de(h),s=N.hiddenUpdates,g=s[b],g===null?s[b]=[c]:g.push(c),c.lane=h|536870912),N):null}function dp(s){if(50<Fd)throw Fd=0,Fx=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var pc={};function Yq(s,c,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(s,c,h,g){return new Yq(s,c,h,g)}function D0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function qa(s,c){var h=s.alternate;return h===null?(h=Gr(s.tag,c,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=c,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,c=s.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function N_(s,c){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=c,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,c=h.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function fp(s,c,h,g,b,N){var z=0;if(g=s,typeof s=="function")D0(s)&&(z=1);else if(typeof s=="string")z=e9(s,h,G.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=Gr(31,h,c,b),s.elementType=$,s.lanes=N,s;case S:return Fo(h.children,b,N,c);case j:z=8,b|=24;break;case k:return s=Gr(12,h,c,b|2),s.elementType=k,s.lanes=N,s;case T:return s=Gr(13,h,c,b),s.elementType=T,s.lanes=N,s;case E:return s=Gr(19,h,c,b),s.elementType=E,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:z=10;break e;case O:z=9;break e;case C:z=11;break e;case A:z=14;break e;case P:z=16,g=null;break e}z=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return c=Gr(z,h,c,b),c.elementType=s,c.type=g,c.lanes=N,c}function Fo(s,c,h,g){return s=Gr(7,s,g,c),s.lanes=h,s}function M0(s,c,h){return s=Gr(6,s,null,c),s.lanes=h,s}function k_(s){var c=Gr(18,null,null,0);return c.stateNode=s,c}function I0(s,c,h){return c=Gr(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var C_=new WeakMap;function ui(s,c){if(typeof s=="object"&&s!==null){var h=C_.get(s);return h!==void 0?h:(c={value:s,source:c,stack:Rt(c)},C_.set(s,c),c)}return{value:s,source:c,stack:Rt(c)}}var mc=[],gc=0,hp=null,Sd=0,di=[],fi=0,Os=null,oa=1,la="";function Fa(s,c){mc[gc++]=Sd,mc[gc++]=hp,hp=s,Sd=c}function __(s,c,h){di[fi++]=oa,di[fi++]=la,di[fi++]=Os,Os=s;var g=oa;s=la;var b=32-de(g)-1;g&=~(1<<b),h+=1;var N=32-de(c)+b;if(30<N){var z=b-b%5;N=(g&(1<<z)-1).toString(32),g>>=z,b-=z,oa=1<<32-de(c)+b|h<<b|g,la=N+s}else oa=1<<N|h<<b|g,la=s}function L0(s){s.return!==null&&(Fa(s,1),__(s,1,0))}function $0(s){for(;s===hp;)hp=mc[--gc],mc[gc]=null,Sd=mc[--gc],mc[gc]=null;for(;s===Os;)Os=di[--fi],di[fi]=null,la=di[--fi],di[fi]=null,oa=di[--fi],di[fi]=null}function A_(s,c){di[fi++]=oa,di[fi++]=la,di[fi++]=Os,oa=c.id,la=c.overflow,Os=s}var Wn=null,Wt=null,xt=!1,Es=null,hi=!1,B0=Error(r(519));function zs(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jd(ui(c,s)),B0}function O_(s){var c=s.stateNode,h=s.type,g=s.memoizedProps;switch(c[Xe]=s,c[jt]=g,h){case"dialog":mt("cancel",c),mt("close",c);break;case"iframe":case"object":case"embed":mt("load",c);break;case"video":case"audio":for(h=0;h<Hd.length;h++)mt(Hd[h],c);break;case"source":mt("error",c);break;case"img":case"image":case"link":mt("error",c),mt("load",c);break;case"details":mt("toggle",c);break;case"input":mt("invalid",c),qC(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":mt("invalid",c);break;case"textarea":mt("invalid",c),KC(c,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||g.suppressHydrationWarning===!0||GO(c.textContent,h)?(g.popover!=null&&(mt("beforetoggle",c),mt("toggle",c)),g.onScroll!=null&&mt("scroll",c),g.onScrollEnd!=null&&mt("scrollend",c),g.onClick!=null&&(c.onclick=Ba),c=!0):c=!1,c||zs(s,!0)}function E_(s){for(Wn=s.return;Wn;)switch(Wn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:Wn=Wn.return}}function yc(s){if(s!==Wn)return!1;if(!xt)return E_(s),xt=!0,!1;var c=s.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||ib(s.type,s.memoizedProps)),h=!h),h&&Wt&&zs(s),E_(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Wt=tE(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Wt=tE(s)}else c===27?(c=Wt,Hs(s.type)?(s=cb,cb=null,Wt=s):Wt=c):Wt=Wn?mi(s.stateNode.nextSibling):null;return!0}function Ko(){Wt=Wn=null,xt=!1}function U0(){var s=Es;return s!==null&&(Pr===null?Pr=s:Pr.push.apply(Pr,s),Es=null),s}function jd(s){Es===null?Es=[s]:Es.push(s)}var q0=I(null),Ho=null,Ka=null;function Ts(s,c,h){R(q0,c._currentValue),c._currentValue=h}function Ha(s){s._currentValue=q0.current,q(q0)}function F0(s,c,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),s===h)break;s=s.return}}function K0(s,c,h,g){var b=s.child;for(b!==null&&(b.return=s);b!==null;){var N=b.dependencies;if(N!==null){var z=b.child;N=N.firstContext;e:for(;N!==null;){var M=N;N=b;for(var H=0;H<c.length;H++)if(M.context===c[H]){N.lanes|=h,M=N.alternate,M!==null&&(M.lanes|=h),F0(N.return,h,s),g||(z=null);break e}N=M.next}}else if(b.tag===18){if(z=b.return,z===null)throw Error(r(341));z.lanes|=h,N=z.alternate,N!==null&&(N.lanes|=h),F0(z,h,s),z=null}else z=b.child;if(z!==null)z.return=b;else for(z=b;z!==null;){if(z===s){z=null;break}if(b=z.sibling,b!==null){b.return=z.return,z=b;break}z=z.return}b=z}}function vc(s,c,h,g){s=null;for(var b=c,N=!1;b!==null;){if(!N){if((b.flags&524288)!==0)N=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var z=b.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var M=b.type;Hr(b.pendingProps.value,z.value)||(s!==null?s.push(M):s=[M])}}else if(b===Ce.current){if(z=b.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(s!==null?s.push(Wd):s=[Wd])}b=b.return}s!==null&&K0(c,s,h,g),c.flags|=262144}function pp(s){for(s=s.firstContext;s!==null;){if(!Hr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Go(s){Ho=s,Ka=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Qn(s){return z_(Ho,s)}function mp(s,c){return Ho===null&&Go(s),z_(s,c)}function z_(s,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},Ka===null){if(s===null)throw Error(r(308));Ka=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else Ka=Ka.next=c;return h}var Wq=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){c.aborted=!0,s.forEach(function(h){return h()})}},Qq=e.unstable_scheduleCallback,Xq=e.unstable_NormalPriority,_n={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function H0(){return{controller:new Wq,data:new Map,refCount:0}}function Nd(s){s.refCount--,s.refCount===0&&Qq(Xq,function(){s.controller.abort()})}var kd=null,G0=0,xc=0,bc=null;function Jq(s,c){if(kd===null){var h=kd=[];G0=0,xc=Yx(),bc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return G0++,c.then(T_,T_),c}function T_(){if(--G0===0&&kd!==null){bc!==null&&(bc.status="fulfilled");var s=kd;kd=null,xc=0,bc=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function eF(s,c){var h=[],g={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return s.then(function(){g.status="fulfilled",g.value=c;for(var b=0;b<h.length;b++)(0,h[b])(c)},function(b){for(g.status="rejected",g.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),g}var P_=K.S;K.S=function(s,c){gO=et(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&Jq(s,c),P_!==null&&P_(s,c)};var Vo=I(null);function V0(){var s=Vo.current;return s!==null?s:Ut.pooledCache}function gp(s,c){c===null?R(Vo,Vo.current):R(Vo,c.pool)}function R_(){var s=V0();return s===null?null:{parent:_n._currentValue,pool:s}}var wc=Error(r(460)),Z0=Error(r(474)),yp=Error(r(542)),vp={then:function(){}};function D_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function M_(s,c,h){switch(h=s[h],h===void 0?s.push(c):h!==c&&(c.then(Ba,Ba),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,L_(s),s;default:if(typeof c.status=="string")c.then(Ba,Ba);else{if(s=Ut,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(g){if(c.status==="pending"){var b=c;b.status="fulfilled",b.value=g}},function(g){if(c.status==="pending"){var b=c;b.status="rejected",b.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,L_(s),s}throw Yo=c,wc}}function Zo(s){try{var c=s._init;return c(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Yo=h,wc):h}}var Yo=null;function I_(){if(Yo===null)throw Error(r(459));var s=Yo;return Yo=null,s}function L_(s){if(s===wc||s===yp)throw Error(r(483))}var Sc=null,Cd=0;function xp(s){var c=Cd;return Cd+=1,Sc===null&&(Sc=[]),M_(Sc,s,c)}function _d(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function bp(s,c){throw c.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function $_(s){function c(X,Y){if(s){var re=X.deletions;re===null?(X.deletions=[Y],X.flags|=16):re.push(Y)}}function h(X,Y){if(!s)return null;for(;Y!==null;)c(X,Y),Y=Y.sibling;return null}function g(X){for(var Y=new Map;X!==null;)X.key!==null?Y.set(X.key,X):Y.set(X.index,X),X=X.sibling;return Y}function b(X,Y){return X=qa(X,Y),X.index=0,X.sibling=null,X}function N(X,Y,re){return X.index=re,s?(re=X.alternate,re!==null?(re=re.index,re<Y?(X.flags|=67108866,Y):re):(X.flags|=67108866,Y)):(X.flags|=1048576,Y)}function z(X){return s&&X.alternate===null&&(X.flags|=67108866),X}function M(X,Y,re,ve){return Y===null||Y.tag!==6?(Y=M0(re,X.mode,ve),Y.return=X,Y):(Y=b(Y,re),Y.return=X,Y)}function H(X,Y,re,ve){var Ke=re.type;return Ke===S?me(X,Y,re.props.children,ve,re.key):Y!==null&&(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&Zo(Ke)===Y.type)?(Y=b(Y,re.props),_d(Y,re),Y.return=X,Y):(Y=fp(re.type,re.key,re.props,null,X.mode,ve),_d(Y,re),Y.return=X,Y)}function ae(X,Y,re,ve){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=I0(re,X.mode,ve),Y.return=X,Y):(Y=b(Y,re.children||[]),Y.return=X,Y)}function me(X,Y,re,ve,Ke){return Y===null||Y.tag!==7?(Y=Fo(re,X.mode,ve,Ke),Y.return=X,Y):(Y=b(Y,re),Y.return=X,Y)}function be(X,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=M0(""+Y,X.mode,re),Y.return=X,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return re=fp(Y.type,Y.key,Y.props,null,X.mode,re),_d(re,Y),re.return=X,re;case w:return Y=I0(Y,X.mode,re),Y.return=X,Y;case P:return Y=Zo(Y),be(X,Y,re)}if(Q(Y)||B(Y))return Y=Fo(Y,X.mode,re,null),Y.return=X,Y;if(typeof Y.then=="function")return be(X,xp(Y),re);if(Y.$$typeof===_)return be(X,mp(X,Y),re);bp(X,Y)}return null}function se(X,Y,re,ve){var Ke=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ke!==null?null:M(X,Y,""+re,ve);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===Ke?H(X,Y,re,ve):null;case w:return re.key===Ke?ae(X,Y,re,ve):null;case P:return re=Zo(re),se(X,Y,re,ve)}if(Q(re)||B(re))return Ke!==null?null:me(X,Y,re,ve,null);if(typeof re.then=="function")return se(X,Y,xp(re),ve);if(re.$$typeof===_)return se(X,Y,mp(X,re),ve);bp(X,re)}return null}function ue(X,Y,re,ve,Ke){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return X=X.get(re)||null,M(Y,X,""+ve,Ke);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return X=X.get(ve.key===null?re:ve.key)||null,H(Y,X,ve,Ke);case w:return X=X.get(ve.key===null?re:ve.key)||null,ae(Y,X,ve,Ke);case P:return ve=Zo(ve),ue(X,Y,re,ve,Ke)}if(Q(ve)||B(ve))return X=X.get(re)||null,me(Y,X,ve,Ke,null);if(typeof ve.then=="function")return ue(X,Y,re,xp(ve),Ke);if(ve.$$typeof===_)return ue(X,Y,re,mp(Y,ve),Ke);bp(Y,ve)}return null}function Re(X,Y,re,ve){for(var Ke=null,kt=null,Be=Y,lt=Y=0,vt=null;Be!==null&&lt<re.length;lt++){Be.index>lt?(vt=Be,Be=null):vt=Be.sibling;var Ct=se(X,Be,re[lt],ve);if(Ct===null){Be===null&&(Be=vt);break}s&&Be&&Ct.alternate===null&&c(X,Be),Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct,Be=vt}if(lt===re.length)return h(X,Be),xt&&Fa(X,lt),Ke;if(Be===null){for(;lt<re.length;lt++)Be=be(X,re[lt],ve),Be!==null&&(Y=N(Be,Y,lt),kt===null?Ke=Be:kt.sibling=Be,kt=Be);return xt&&Fa(X,lt),Ke}for(Be=g(Be);lt<re.length;lt++)vt=ue(Be,X,lt,re[lt],ve),vt!==null&&(s&&vt.alternate!==null&&Be.delete(vt.key===null?lt:vt.key),Y=N(vt,Y,lt),kt===null?Ke=vt:kt.sibling=vt,kt=vt);return s&&Be.forEach(function(Ws){return c(X,Ws)}),xt&&Fa(X,lt),Ke}function We(X,Y,re,ve){if(re==null)throw Error(r(151));for(var Ke=null,kt=null,Be=Y,lt=Y=0,vt=null,Ct=re.next();Be!==null&&!Ct.done;lt++,Ct=re.next()){Be.index>lt?(vt=Be,Be=null):vt=Be.sibling;var Ws=se(X,Be,Ct.value,ve);if(Ws===null){Be===null&&(Be=vt);break}s&&Be&&Ws.alternate===null&&c(X,Be),Y=N(Ws,Y,lt),kt===null?Ke=Ws:kt.sibling=Ws,kt=Ws,Be=vt}if(Ct.done)return h(X,Be),xt&&Fa(X,lt),Ke;if(Be===null){for(;!Ct.done;lt++,Ct=re.next())Ct=be(X,Ct.value,ve),Ct!==null&&(Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return xt&&Fa(X,lt),Ke}for(Be=g(Be);!Ct.done;lt++,Ct=re.next())Ct=ue(Be,X,lt,Ct.value,ve),Ct!==null&&(s&&Ct.alternate!==null&&Be.delete(Ct.key===null?lt:Ct.key),Y=N(Ct,Y,lt),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return s&&Be.forEach(function(d9){return c(X,d9)}),xt&&Fa(X,lt),Ke}function It(X,Y,re,ve){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var Ke=re.key;Y!==null;){if(Y.key===Ke){if(Ke=re.type,Ke===S){if(Y.tag===7){h(X,Y.sibling),ve=b(Y,re.props.children),ve.return=X,X=ve;break e}}else if(Y.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&Zo(Ke)===Y.type){h(X,Y.sibling),ve=b(Y,re.props),_d(ve,re),ve.return=X,X=ve;break e}h(X,Y);break}else c(X,Y);Y=Y.sibling}re.type===S?(ve=Fo(re.props.children,X.mode,ve,re.key),ve.return=X,X=ve):(ve=fp(re.type,re.key,re.props,null,X.mode,ve),_d(ve,re),ve.return=X,X=ve)}return z(X);case w:e:{for(Ke=re.key;Y!==null;){if(Y.key===Ke)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){h(X,Y.sibling),ve=b(Y,re.children||[]),ve.return=X,X=ve;break e}else{h(X,Y);break}else c(X,Y);Y=Y.sibling}ve=I0(re,X.mode,ve),ve.return=X,X=ve}return z(X);case P:return re=Zo(re),It(X,Y,re,ve)}if(Q(re))return Re(X,Y,re,ve);if(B(re)){if(Ke=B(re),typeof Ke!="function")throw Error(r(150));return re=Ke.call(re),We(X,Y,re,ve)}if(typeof re.then=="function")return It(X,Y,xp(re),ve);if(re.$$typeof===_)return It(X,Y,mp(X,re),ve);bp(X,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Y!==null&&Y.tag===6?(h(X,Y.sibling),ve=b(Y,re),ve.return=X,X=ve):(h(X,Y),ve=M0(re,X.mode,ve),ve.return=X,X=ve),z(X)):h(X,Y)}return function(X,Y,re,ve){try{Cd=0;var Ke=It(X,Y,re,ve);return Sc=null,Ke}catch(Be){if(Be===wc||Be===yp)throw Be;var kt=Gr(29,Be,null,X.mode);return kt.lanes=ve,kt.return=X,kt}}}var Wo=$_(!0),B_=$_(!1),Ps=!1;function Y0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function W0(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Rs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ds(s,c,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(At&2)!==0){var b=g.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),g.pending=c,c=dp(s),j_(s,null,h),c}return up(s,g,c,h),dp(s)}function Ad(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Wh(s,h)}}function Q0(s,c){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var b=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?b=N=z:N=N.next=z,h=h.next}while(h!==null);N===null?b=N=c:N=N.next=c}else b=N=c;h={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var X0=!1;function Od(){if(X0){var s=bc;if(s!==null)throw s}}function Ed(s,c,h,g){X0=!1;var b=s.updateQueue;Ps=!1;var N=b.firstBaseUpdate,z=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var H=M,ae=H.next;H.next=null,z===null?N=ae:z.next=ae,z=H;var me=s.alternate;me!==null&&(me=me.updateQueue,M=me.lastBaseUpdate,M!==z&&(M===null?me.firstBaseUpdate=ae:M.next=ae,me.lastBaseUpdate=H))}if(N!==null){var be=b.baseState;z=0,me=ae=H=null,M=N;do{var se=M.lane&-536870913,ue=se!==M.lane;if(ue?(yt&se)===se:(g&se)===se){se!==0&&se===xc&&(X0=!0),me!==null&&(me=me.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=s,We=M;se=c;var It=h;switch(We.tag){case 1:if(Re=We.payload,typeof Re=="function"){be=Re.call(It,be,se);break e}be=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=We.payload,se=typeof Re=="function"?Re.call(It,be,se):Re,se==null)break e;be=m({},be,se);break e;case 2:Ps=!0}}se=M.callback,se!==null&&(s.flags|=64,ue&&(s.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[se]:ue.push(se))}else ue={lane:se,tag:M.tag,payload:M.payload,callback:M.callback,next:null},me===null?(ae=me=ue,H=be):me=me.next=ue,z|=se;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;ue=M,M=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);me===null&&(H=be),b.baseState=H,b.firstBaseUpdate=ae,b.lastBaseUpdate=me,N===null&&(b.shared.lanes=0),Bs|=z,s.lanes=z,s.memoizedState=be}}function U_(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function q_(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)U_(h[s],c)}var jc=I(null),wp=I(0);function F_(s,c){s=es,R(wp,s),R(jc,c),es=s|c.baseLanes}function J0(){R(wp,es),R(jc,jc.current)}function ex(){es=wp.current,q(jc),q(wp)}var Vr=I(null),pi=null;function Ms(s){var c=s.alternate;R(Sn,Sn.current&1),R(Vr,s),pi===null&&(c===null||jc.current!==null||c.memoizedState!==null)&&(pi=s)}function tx(s){R(Sn,Sn.current),R(Vr,s),pi===null&&(pi=s)}function K_(s){s.tag===22?(R(Sn,Sn.current),R(Vr,s),pi===null&&(pi=s)):Is()}function Is(){R(Sn,Sn.current),R(Vr,Vr.current)}function Zr(s){q(Vr),pi===s&&(pi=null),q(Sn)}var Sn=I(0);function Sp(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||ob(h)||lb(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Ga=0,at=null,Dt=null,An=null,jp=!1,Nc=!1,Qo=!1,Np=0,zd=0,kc=null,tF=0;function pn(){throw Error(r(321))}function nx(s,c){if(c===null)return!1;for(var h=0;h<c.length&&h<s.length;h++)if(!Hr(s[h],c[h]))return!1;return!0}function rx(s,c,h,g,b,N){return Ga=N,at=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,K.H=s===null||s.memoizedState===null?_A:vx,Qo=!1,N=h(g,b),Qo=!1,Nc&&(N=G_(c,h,g,b)),H_(s),N}function H_(s){K.H=Rd;var c=Dt!==null&&Dt.next!==null;if(Ga=0,An=Dt=at=null,jp=!1,zd=0,kc=null,c)throw Error(r(300));s===null||On||(s=s.dependencies,s!==null&&pp(s)&&(On=!0))}function G_(s,c,h,g){at=s;var b=0;do{if(Nc&&(kc=null),zd=0,Nc=!1,25<=b)throw Error(r(301));if(b+=1,An=Dt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}K.H=AA,N=c(h,g)}while(Nc);return N}function nF(){var s=K.H,c=s.useState()[0];return c=typeof c.then=="function"?Td(c):c,s=s.useState()[0],(Dt!==null?Dt.memoizedState:null)!==s&&(at.flags|=1024),c}function ix(){var s=Np!==0;return Np=0,s}function ax(s,c,h){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~h}function sx(s){if(jp){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}jp=!1}Ga=0,An=Dt=at=null,Nc=!1,zd=Np=0,kc=null}function yr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?at.memoizedState=An=s:An=An.next=s,An}function jn(){if(Dt===null){var s=at.alternate;s=s!==null?s.memoizedState:null}else s=Dt.next;var c=An===null?at.memoizedState:An.next;if(c!==null)An=c,Dt=s;else{if(s===null)throw at.alternate===null?Error(r(467)):Error(r(310));Dt=s,s={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},An===null?at.memoizedState=An=s:An=An.next=s}return An}function kp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Td(s){var c=zd;return zd+=1,kc===null&&(kc=[]),s=M_(kc,s,c),c=at,(An===null?c.memoizedState:An.next)===null&&(c=c.alternate,K.H=c===null||c.memoizedState===null?_A:vx),s}function Cp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Td(s);if(s.$$typeof===_)return Qn(s)}throw Error(r(438,String(s)))}function ox(s){var c=null,h=at.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var g=at.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(b){return b.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=kp(),at.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(s),g=0;g<s;g++)h[g]=F;return c.index++,h}function Va(s,c){return typeof c=="function"?c(s):c}function _p(s){var c=jn();return lx(c,Dt,s)}function lx(s,c,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var b=s.baseQueue,N=g.pending;if(N!==null){if(b!==null){var z=b.next;b.next=N.next,N.next=z}c.baseQueue=b=N,g.pending=null}if(N=s.baseState,b===null)s.memoizedState=N;else{c=b.next;var M=z=null,H=null,ae=c,me=!1;do{var be=ae.lane&-536870913;if(be!==ae.lane?(yt&be)===be:(Ga&be)===be){var se=ae.revertLane;if(se===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),be===xc&&(me=!0);else if((Ga&se)===se){ae=ae.next,se===xc&&(me=!0);continue}else be={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},H===null?(M=H=be,z=N):H=H.next=be,at.lanes|=se,Bs|=se;be=ae.action,Qo&&h(N,be),N=ae.hasEagerState?ae.eagerState:h(N,be)}else se={lane:be,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},H===null?(M=H=se,z=N):H=H.next=se,at.lanes|=be,Bs|=be;ae=ae.next}while(ae!==null&&ae!==c);if(H===null?z=N:H.next=M,!Hr(N,s.memoizedState)&&(On=!0,me&&(h=bc,h!==null)))throw h;s.memoizedState=N,s.baseState=z,s.baseQueue=H,g.lastRenderedState=N}return b===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function cx(s){var c=jn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,b=h.pending,N=c.memoizedState;if(b!==null){h.pending=null;var z=b=b.next;do N=s(N,z.action),z=z.next;while(z!==b);Hr(N,c.memoizedState)||(On=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,g]}function V_(s,c,h){var g=at,b=jn(),N=xt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var z=!Hr((Dt||b).memoizedState,h);if(z&&(b.memoizedState=h,On=!0),b=b.queue,fx(W_.bind(null,g,b,s),[s]),b.getSnapshot!==c||z||An!==null&&An.memoizedState.tag&1){if(g.flags|=2048,Cc(9,{destroy:void 0},Y_.bind(null,g,b,h,c),null),Ut===null)throw Error(r(349));N||(Ga&127)!==0||Z_(g,c,h)}return h}function Z_(s,c,h){s.flags|=16384,s={getSnapshot:c,value:h},c=at.updateQueue,c===null?(c=kp(),at.updateQueue=c,c.stores=[s]):(h=c.stores,h===null?c.stores=[s]:h.push(s))}function Y_(s,c,h,g){c.value=h,c.getSnapshot=g,Q_(c)&&X_(s)}function W_(s,c,h){return h(function(){Q_(c)&&X_(s)})}function Q_(s){var c=s.getSnapshot;s=s.value;try{var h=c();return!Hr(s,h)}catch{return!0}}function X_(s){var c=qo(s,2);c!==null&&Rr(c,s,2)}function ux(s){var c=yr();if(typeof s=="function"){var h=s;if(s=h(),Qo){$t(!0);try{h()}finally{$t(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:s},c}function J_(s,c,h,g){return s.baseState=h,lx(s,Dt,typeof g=="function"?g:Va)}function rF(s,c,h,g,b){if(Ep(s))throw Error(r(485));if(s=c.action,s!==null){var N={payload:b,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){N.listeners.push(z)}};K.T!==null?h(!0):N.isTransition=!1,g(N),h=c.pending,h===null?(N.next=c.pending=N,eA(c,N)):(N.next=h.next,c.pending=h.next=N)}}function eA(s,c){var h=c.action,g=c.payload,b=s.state;if(c.isTransition){var N=K.T,z={};K.T=z;try{var M=h(b,g),H=K.S;H!==null&&H(z,M),tA(s,c,M)}catch(ae){dx(s,c,ae)}finally{N!==null&&z.types!==null&&(N.types=z.types),K.T=N}}else try{N=h(b,g),tA(s,c,N)}catch(ae){dx(s,c,ae)}}function tA(s,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){nA(s,c,g)},function(g){return dx(s,c,g)}):nA(s,c,h)}function nA(s,c,h){c.status="fulfilled",c.value=h,rA(c),s.state=h,c=s.pending,c!==null&&(h=c.next,h===c?s.pending=null:(h=h.next,c.next=h,eA(s,h)))}function dx(s,c,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,rA(c),c=c.next;while(c!==g)}s.action=null}function rA(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function iA(s,c){return c}function aA(s,c){if(xt){var h=Ut.formState;if(h!==null){e:{var g=at;if(xt){if(Wt){t:{for(var b=Wt,N=hi;b.nodeType!==8;){if(!N){b=null;break t}if(b=mi(b.nextSibling),b===null){b=null;break t}}N=b.data,b=N==="F!"||N==="F"?b:null}if(b){Wt=mi(b.nextSibling),g=b.data==="F!";break e}}zs(g)}g=!1}g&&(c=h[0])}}return h=yr(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iA,lastRenderedState:c},h.queue=g,h=NA.bind(null,at,g),g.dispatch=h,g=ux(!1),N=yx.bind(null,at,!1,g.queue),g=yr(),b={state:c,dispatch:null,action:s,pending:null},g.queue=b,h=rF.bind(null,at,b,N,h),b.dispatch=h,g.memoizedState=s,[c,h,!1]}function sA(s){var c=jn();return oA(c,Dt,s)}function oA(s,c,h){if(c=lx(s,c,iA)[0],s=_p(Va)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=Td(c)}catch(z){throw z===wc?yp:z}else g=c;c=jn();var b=c.queue,N=b.dispatch;return h!==c.memoizedState&&(at.flags|=2048,Cc(9,{destroy:void 0},iF.bind(null,b,h),null)),[g,N,s]}function iF(s,c){s.action=c}function lA(s){var c=jn(),h=Dt;if(h!==null)return oA(c,h,s);jn(),c=c.memoizedState,h=jn();var g=h.queue.dispatch;return h.memoizedState=s,[c,g,!1]}function Cc(s,c,h,g){return s={tag:s,create:h,deps:g,inst:c,next:null},c=at.updateQueue,c===null&&(c=kp(),at.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,c.lastEffect=s),s}function cA(){return jn().memoizedState}function Ap(s,c,h,g){var b=yr();at.flags|=s,b.memoizedState=Cc(1|c,{destroy:void 0},h,g===void 0?null:g)}function Op(s,c,h,g){var b=jn();g=g===void 0?null:g;var N=b.memoizedState.inst;Dt!==null&&g!==null&&nx(g,Dt.memoizedState.deps)?b.memoizedState=Cc(c,N,h,g):(at.flags|=s,b.memoizedState=Cc(1|c,N,h,g))}function uA(s,c){Ap(8390656,8,s,c)}function fx(s,c){Op(2048,8,s,c)}function aF(s){at.flags|=4;var c=at.updateQueue;if(c===null)c=kp(),at.updateQueue=c,c.events=[s];else{var h=c.events;h===null?c.events=[s]:h.push(s)}}function dA(s){var c=jn().memoizedState;return aF({ref:c,nextImpl:s}),function(){if((At&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function fA(s,c){return Op(4,2,s,c)}function hA(s,c){return Op(4,4,s,c)}function pA(s,c){if(typeof c=="function"){s=s();var h=c(s);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function mA(s,c,h){h=h!=null?h.concat([s]):null,Op(4,4,pA.bind(null,c,s),h)}function hx(){}function gA(s,c){var h=jn();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&nx(c,g[1])?g[0]:(h.memoizedState=[s,c],s)}function yA(s,c){var h=jn();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&nx(c,g[1]))return g[0];if(g=s(),Qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,c],g}function px(s,c,h){return h===void 0||(Ga&1073741824)!==0&&(yt&261930)===0?s.memoizedState=c:(s.memoizedState=h,s=vO(),at.lanes|=s,Bs|=s,h)}function vA(s,c,h,g){return Hr(h,c)?h:jc.current!==null?(s=px(s,h,g),Hr(s,c)||(On=!0),s):(Ga&42)===0||(Ga&1073741824)!==0&&(yt&261930)===0?(On=!0,s.memoizedState=h):(s=vO(),at.lanes|=s,Bs|=s,c)}function xA(s,c,h,g,b){var N=te.p;te.p=N!==0&&8>N?N:8;var z=K.T,M={};K.T=M,yx(s,!1,c,h);try{var H=b(),ae=K.S;if(ae!==null&&ae(M,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var me=eF(H,g);Pd(s,c,me,Qr(s))}else Pd(s,c,g,Qr(s))}catch(be){Pd(s,c,{then:function(){},status:"rejected",reason:be},Qr())}finally{te.p=N,z!==null&&M.types!==null&&(z.types=M.types),K.T=z}}function sF(){}function mx(s,c,h,g){if(s.tag!==5)throw Error(r(476));var b=bA(s).queue;xA(s,b,c,le,h===null?sF:function(){return wA(s),h(g)})}function bA(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:le},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function wA(s){var c=bA(s);c.next===null&&(c=s.alternate.memoizedState),Pd(s,c.next.queue,{},Qr())}function gx(){return Qn(Wd)}function SA(){return jn().memoizedState}function jA(){return jn().memoizedState}function oF(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=Qr();s=Rs(h);var g=Ds(c,s,h);g!==null&&(Rr(g,c,h),Ad(g,c,h)),c={cache:H0()},s.payload=c;return}c=c.return}}function lF(s,c,h){var g=Qr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Ep(s)?kA(c,h):(h=R0(s,c,h,g),h!==null&&(Rr(h,s,g),CA(h,c,g)))}function NA(s,c,h){var g=Qr();Pd(s,c,h,g)}function Pd(s,c,h,g){var b={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Ep(s))kA(c,b);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var z=c.lastRenderedState,M=N(z,h);if(b.hasEagerState=!0,b.eagerState=M,Hr(M,z))return up(s,c,b,0),Ut===null&&cp(),!1}catch{}if(h=R0(s,c,b,g),h!==null)return Rr(h,s,g),CA(h,c,g),!0}return!1}function yx(s,c,h,g){if(g={lane:2,revertLane:Yx(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Ep(s)){if(c)throw Error(r(479))}else c=R0(s,h,g,2),c!==null&&Rr(c,s,2)}function Ep(s){var c=s.alternate;return s===at||c!==null&&c===at}function kA(s,c){Nc=jp=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function CA(s,c,h){if((h&4194048)!==0){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Wh(s,h)}}var Rd={readContext:Qn,use:Cp,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};Rd.useEffectEvent=pn;var _A={readContext:Qn,use:Cp,useCallback:function(s,c){return yr().memoizedState=[s,c===void 0?null:c],s},useContext:Qn,useEffect:uA,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,Ap(4194308,4,pA.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Ap(4194308,4,s,c)},useInsertionEffect:function(s,c){Ap(4,2,s,c)},useMemo:function(s,c){var h=yr();c=c===void 0?null:c;var g=s();if(Qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,c],g},useReducer:function(s,c,h){var g=yr();if(h!==void 0){var b=h(c);if(Qo){$t(!0);try{h(c)}finally{$t(!1)}}}else b=c;return g.memoizedState=g.baseState=b,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:b},g.queue=s,s=s.dispatch=lF.bind(null,at,s),[g.memoizedState,s]},useRef:function(s){var c=yr();return s={current:s},c.memoizedState=s},useState:function(s){s=ux(s);var c=s.queue,h=NA.bind(null,at,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:hx,useDeferredValue:function(s,c){var h=yr();return px(h,s,c)},useTransition:function(){var s=ux(!1);return s=xA.bind(null,at,s.queue,!0,!1),yr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var g=at,b=yr();if(xt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Ut===null)throw Error(r(349));(yt&127)!==0||Z_(g,c,h)}b.memoizedState=h;var N={value:h,getSnapshot:c};return b.queue=N,uA(W_.bind(null,g,N,s),[s]),g.flags|=2048,Cc(9,{destroy:void 0},Y_.bind(null,g,N,h,c),null),h},useId:function(){var s=yr(),c=Ut.identifierPrefix;if(xt){var h=la,g=oa;h=(g&~(1<<32-de(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Np++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=tF++,c="_"+c+"r_"+h.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:gx,useFormState:aA,useActionState:aA,useOptimistic:function(s){var c=yr();c.memoizedState=c.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=yx.bind(null,at,!0,h),h.dispatch=c,[s,c]},useMemoCache:ox,useCacheRefresh:function(){return yr().memoizedState=oF.bind(null,at)},useEffectEvent:function(s){var c=yr(),h={impl:s};return c.memoizedState=h,function(){if((At&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},vx={readContext:Qn,use:Cp,useCallback:gA,useContext:Qn,useEffect:fx,useImperativeHandle:mA,useInsertionEffect:fA,useLayoutEffect:hA,useMemo:yA,useReducer:_p,useRef:cA,useState:function(){return _p(Va)},useDebugValue:hx,useDeferredValue:function(s,c){var h=jn();return vA(h,Dt.memoizedState,s,c)},useTransition:function(){var s=_p(Va)[0],c=jn().memoizedState;return[typeof s=="boolean"?s:Td(s),c]},useSyncExternalStore:V_,useId:SA,useHostTransitionStatus:gx,useFormState:sA,useActionState:sA,useOptimistic:function(s,c){var h=jn();return J_(h,Dt,s,c)},useMemoCache:ox,useCacheRefresh:jA};vx.useEffectEvent=dA;var AA={readContext:Qn,use:Cp,useCallback:gA,useContext:Qn,useEffect:fx,useImperativeHandle:mA,useInsertionEffect:fA,useLayoutEffect:hA,useMemo:yA,useReducer:cx,useRef:cA,useState:function(){return cx(Va)},useDebugValue:hx,useDeferredValue:function(s,c){var h=jn();return Dt===null?px(h,s,c):vA(h,Dt.memoizedState,s,c)},useTransition:function(){var s=cx(Va)[0],c=jn().memoizedState;return[typeof s=="boolean"?s:Td(s),c]},useSyncExternalStore:V_,useId:SA,useHostTransitionStatus:gx,useFormState:lA,useActionState:lA,useOptimistic:function(s,c){var h=jn();return Dt!==null?J_(h,Dt,s,c):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:ox,useCacheRefresh:jA};AA.useEffectEvent=dA;function xx(s,c,h,g){c=s.memoizedState,h=h(g,c),h=h==null?c:m({},c,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var bx={enqueueSetState:function(s,c,h){s=s._reactInternals;var g=Qr(),b=Rs(g);b.payload=c,h!=null&&(b.callback=h),c=Ds(s,b,g),c!==null&&(Rr(c,s,g),Ad(c,s,g))},enqueueReplaceState:function(s,c,h){s=s._reactInternals;var g=Qr(),b=Rs(g);b.tag=1,b.payload=c,h!=null&&(b.callback=h),c=Ds(s,b,g),c!==null&&(Rr(c,s,g),Ad(c,s,g))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var h=Qr(),g=Rs(h);g.tag=2,c!=null&&(g.callback=c),c=Ds(s,g,h),c!==null&&(Rr(c,s,h),Ad(c,s,h))}};function OA(s,c,h,g,b,N,z){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,z):c.prototype&&c.prototype.isPureReactComponent?!bd(h,g)||!bd(b,N):!0}function EA(s,c,h,g){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==s&&bx.enqueueReplaceState(c,c.state,null)}function Xo(s,c){var h=c;if("ref"in c){h={};for(var g in c)g!=="ref"&&(h[g]=c[g])}if(s=s.defaultProps){h===c&&(h=m({},h));for(var b in s)h[b]===void 0&&(h[b]=s[b])}return h}function zA(s){lp(s)}function TA(s){console.error(s)}function PA(s){lp(s)}function zp(s,c){try{var h=s.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function RA(s,c,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function wx(s,c,h){return h=Rs(h),h.tag=3,h.payload={element:null},h.callback=function(){zp(s,c)},h}function DA(s){return s=Rs(s),s.tag=3,s}function MA(s,c,h,g){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var N=g.value;s.payload=function(){return b(N)},s.callback=function(){RA(c,h,g)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(s.callback=function(){RA(c,h,g),typeof b!="function"&&(Us===null?Us=new Set([this]):Us.add(this));var M=g.stack;this.componentDidCatch(g.value,{componentStack:M!==null?M:""})})}function cF(s,c,h,g,b){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=h.alternate,c!==null&&vc(c,h,b,!0),h=Vr.current,h!==null){switch(h.tag){case 31:case 13:return pi===null?Fp():h.alternate===null&&mn===0&&(mn=3),h.flags&=-257,h.flags|=65536,h.lanes=b,g===vp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),Gx(s,g,b)),!1;case 22:return h.flags|=65536,g===vp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([g]):h.add(g)),Gx(s,g,b)),!1}throw Error(r(435,h.tag))}return Gx(s,g,b),Fp(),!1}if(xt)return c=Vr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=b,g!==B0&&(s=Error(r(422),{cause:g}),jd(ui(s,h)))):(g!==B0&&(c=Error(r(423),{cause:g}),jd(ui(c,h))),s=s.current.alternate,s.flags|=65536,b&=-b,s.lanes|=b,g=ui(g,h),b=wx(s.stateNode,g,b),Q0(s,b),mn!==4&&(mn=2)),!1;var N=Error(r(520),{cause:g});if(N=ui(N,h),qd===null?qd=[N]:qd.push(N),mn!==4&&(mn=2),c===null)return!0;g=ui(g,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,s=b&-b,h.lanes|=s,s=wx(h.stateNode,g,s),Q0(h,s),!1;case 1:if(c=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Us===null||!Us.has(N))))return h.flags|=65536,b&=-b,h.lanes|=b,b=DA(b),MA(b,s,h,g),Q0(h,b),!1}h=h.return}while(h!==null);return!1}var Sx=Error(r(461)),On=!1;function Xn(s,c,h,g){c.child=s===null?B_(c,null,h,g):Wo(c,s.child,h,g)}function IA(s,c,h,g,b){h=h.render;var N=c.ref;if("ref"in g){var z={};for(var M in g)M!=="ref"&&(z[M]=g[M])}else z=g;return Go(c),g=rx(s,c,h,z,N,b),M=ix(),s!==null&&!On?(ax(s,c,b),Za(s,c,b)):(xt&&M&&L0(c),c.flags|=1,Xn(s,c,g,b),c.child)}function LA(s,c,h,g,b){if(s===null){var N=h.type;return typeof N=="function"&&!D0(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,$A(s,c,N,g,b)):(s=fp(h.type,null,g,c,c.mode,b),s.ref=c.ref,s.return=c,c.child=s)}if(N=s.child,!Ex(s,b)){var z=N.memoizedProps;if(h=h.compare,h=h!==null?h:bd,h(z,g)&&s.ref===c.ref)return Za(s,c,b)}return c.flags|=1,s=qa(N,g),s.ref=c.ref,s.return=c,c.child=s}function $A(s,c,h,g,b){if(s!==null){var N=s.memoizedProps;if(bd(N,g)&&s.ref===c.ref)if(On=!1,c.pendingProps=g=N,Ex(s,b))(s.flags&131072)!==0&&(On=!0);else return c.lanes=s.lanes,Za(s,c,b)}return jx(s,c,h,g,b)}function BA(s,c,h,g){var b=g.children,N=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=c.child=s.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~N}else g=0,c.child=null;return UA(s,c,N,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&gp(c,N!==null?N.cachePool:null),N!==null?F_(c,N):J0(),K_(c);else return g=c.lanes=536870912,UA(s,c,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(gp(c,N.cachePool),F_(c,N),Is(),c.memoizedState=null):(s!==null&&gp(c,null),J0(),Is());return Xn(s,c,b,h),c.child}function Dd(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function UA(s,c,h,g,b){var N=V0();return N=N===null?null:{parent:_n._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},s!==null&&gp(c,null),J0(),K_(c),s!==null&&vc(s,c,g,!0),c.childLanes=b,null}function Tp(s,c){return c=Rp({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function qA(s,c,h){return Wo(c,s.child,null,h),s=Tp(c,c.pendingProps),s.flags|=2,Zr(c),c.memoizedState=null,s}function uF(s,c,h){var g=c.pendingProps,b=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(xt){if(g.mode==="hidden")return s=Tp(c,g),c.lanes=536870912,Dd(null,s);if(tx(c),(s=Wt)?(s=eE(s,hi),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Os!==null?{id:oa,overflow:la}:null,retryLane:536870912,hydrationErrors:null},h=k_(s),h.return=c,c.child=h,Wn=c,Wt=null)):s=null,s===null)throw zs(c);return c.lanes=536870912,null}return Tp(c,g)}var N=s.memoizedState;if(N!==null){var z=N.dehydrated;if(tx(c),b)if(c.flags&256)c.flags&=-257,c=qA(s,c,h);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(On||vc(s,c,h,!1),b=(h&s.childLanes)!==0,On||b){if(g=Ut,g!==null&&(z=Qh(g,h),z!==0&&z!==N.retryLane))throw N.retryLane=z,qo(s,z),Rr(g,s,z),Sx;Fp(),c=qA(s,c,h)}else s=N.treeContext,Wt=mi(z.nextSibling),Wn=c,xt=!0,Es=null,hi=!1,s!==null&&A_(c,s),c=Tp(c,g),c.flags|=4096;return c}return s=qa(s.child,{mode:g.mode,children:g.children}),s.ref=c.ref,c.child=s,s.return=c,s}function Pp(s,c){var h=c.ref;if(h===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(c.flags|=4194816)}}function jx(s,c,h,g,b){return Go(c),h=rx(s,c,h,g,void 0,b),g=ix(),s!==null&&!On?(ax(s,c,b),Za(s,c,b)):(xt&&g&&L0(c),c.flags|=1,Xn(s,c,h,b),c.child)}function FA(s,c,h,g,b,N){return Go(c),c.updateQueue=null,h=G_(c,g,h,b),H_(s),g=ix(),s!==null&&!On?(ax(s,c,N),Za(s,c,N)):(xt&&g&&L0(c),c.flags|=1,Xn(s,c,h,N),c.child)}function KA(s,c,h,g,b){if(Go(c),c.stateNode===null){var N=pc,z=h.contextType;typeof z=="object"&&z!==null&&(N=Qn(z)),N=new h(g,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=bx,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=g,N.state=c.memoizedState,N.refs={},Y0(c),z=h.contextType,N.context=typeof z=="object"&&z!==null?Qn(z):pc,N.state=c.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(xx(c,h,z,g),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),z!==N.state&&bx.enqueueReplaceState(N,N.state,null),Ed(c,g,N,b),Od(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(s===null){N=c.stateNode;var M=c.memoizedProps,H=Xo(h,M);N.props=H;var ae=N.context,me=h.contextType;z=pc,typeof me=="object"&&me!==null&&(z=Qn(me));var be=h.getDerivedStateFromProps;me=typeof be=="function"||typeof N.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M||ae!==z)&&EA(c,N,g,z),Ps=!1;var se=c.memoizedState;N.state=se,Ed(c,g,N,b),Od(),ae=c.memoizedState,M||se!==ae||Ps?(typeof be=="function"&&(xx(c,h,be,g),ae=c.memoizedState),(H=Ps||OA(c,h,H,g,se,ae,z))?(me||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=ae),N.props=g,N.state=ae,N.context=z,g=H):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{N=c.stateNode,W0(s,c),z=c.memoizedProps,me=Xo(h,z),N.props=me,be=c.pendingProps,se=N.context,ae=h.contextType,H=pc,typeof ae=="object"&&ae!==null&&(H=Qn(ae)),M=h.getDerivedStateFromProps,(ae=typeof M=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(z!==be||se!==H)&&EA(c,N,g,H),Ps=!1,se=c.memoizedState,N.state=se,Ed(c,g,N,b),Od();var ue=c.memoizedState;z!==be||se!==ue||Ps||s!==null&&s.dependencies!==null&&pp(s.dependencies)?(typeof M=="function"&&(xx(c,h,M,g),ue=c.memoizedState),(me=Ps||OA(c,h,me,g,se,ue,H)||s!==null&&s.dependencies!==null&&pp(s.dependencies))?(ae||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,ue,H),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,ue,H)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&se===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&se===s.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=ue),N.props=g,N.state=ue,N.context=H,g=me):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&se===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&se===s.memoizedState||(c.flags|=1024),g=!1)}return N=g,Pp(s,c),g=(c.flags&128)!==0,N||g?(N=c.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,s!==null&&g?(c.child=Wo(c,s.child,null,b),c.child=Wo(c,null,h,b)):Xn(s,c,h,b),c.memoizedState=N.state,s=c.child):s=Za(s,c,b),s}function HA(s,c,h,g){return Ko(),c.flags|=256,Xn(s,c,h,g),c.child}var Nx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kx(s){return{baseLanes:s,cachePool:R_()}}function Cx(s,c,h){return s=s!==null?s.childLanes&~h:0,c&&(s|=Wr),s}function GA(s,c,h){var g=c.pendingProps,b=!1,N=(c.flags&128)!==0,z;if((z=N)||(z=s!==null&&s.memoizedState===null?!1:(Sn.current&2)!==0),z&&(b=!0,c.flags&=-129),z=(c.flags&32)!==0,c.flags&=-33,s===null){if(xt){if(b?Ms(c):Is(),(s=Wt)?(s=eE(s,hi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Os!==null?{id:oa,overflow:la}:null,retryLane:536870912,hydrationErrors:null},h=k_(s),h.return=c,c.child=h,Wn=c,Wt=null)):s=null,s===null)throw zs(c);return lb(s)?c.lanes=32:c.lanes=536870912,null}var M=g.children;return g=g.fallback,b?(Is(),b=c.mode,M=Rp({mode:"hidden",children:M},b),g=Fo(g,b,h,null),M.return=c,g.return=c,M.sibling=g,c.child=M,g=c.child,g.memoizedState=kx(h),g.childLanes=Cx(s,z,h),c.memoizedState=Nx,Dd(null,g)):(Ms(c),_x(c,M))}var H=s.memoizedState;if(H!==null&&(M=H.dehydrated,M!==null)){if(N)c.flags&256?(Ms(c),c.flags&=-257,c=Ax(s,c,h)):c.memoizedState!==null?(Is(),c.child=s.child,c.flags|=128,c=null):(Is(),M=g.fallback,b=c.mode,g=Rp({mode:"visible",children:g.children},b),M=Fo(M,b,h,null),M.flags|=2,g.return=c,M.return=c,g.sibling=M,c.child=g,Wo(c,s.child,null,h),g=c.child,g.memoizedState=kx(h),g.childLanes=Cx(s,z,h),c.memoizedState=Nx,c=Dd(null,g));else if(Ms(c),lb(M)){if(z=M.nextSibling&&M.nextSibling.dataset,z)var ae=z.dgst;z=ae,g=Error(r(419)),g.stack="",g.digest=z,jd({value:g,source:null,stack:null}),c=Ax(s,c,h)}else if(On||vc(s,c,h,!1),z=(h&s.childLanes)!==0,On||z){if(z=Ut,z!==null&&(g=Qh(z,h),g!==0&&g!==H.retryLane))throw H.retryLane=g,qo(s,g),Rr(z,s,g),Sx;ob(M)||Fp(),c=Ax(s,c,h)}else ob(M)?(c.flags|=192,c.child=s.child,c=null):(s=H.treeContext,Wt=mi(M.nextSibling),Wn=c,xt=!0,Es=null,hi=!1,s!==null&&A_(c,s),c=_x(c,g.children),c.flags|=4096);return c}return b?(Is(),M=g.fallback,b=c.mode,H=s.child,ae=H.sibling,g=qa(H,{mode:"hidden",children:g.children}),g.subtreeFlags=H.subtreeFlags&65011712,ae!==null?M=qa(ae,M):(M=Fo(M,b,h,null),M.flags|=2),M.return=c,g.return=c,g.sibling=M,c.child=g,Dd(null,g),g=c.child,M=s.child.memoizedState,M===null?M=kx(h):(b=M.cachePool,b!==null?(H=_n._currentValue,b=b.parent!==H?{parent:H,pool:H}:b):b=R_(),M={baseLanes:M.baseLanes|h,cachePool:b}),g.memoizedState=M,g.childLanes=Cx(s,z,h),c.memoizedState=Nx,Dd(s.child,g)):(Ms(c),h=s.child,s=h.sibling,h=qa(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,s!==null&&(z=c.deletions,z===null?(c.deletions=[s],c.flags|=16):z.push(s)),c.child=h,c.memoizedState=null,h)}function _x(s,c){return c=Rp({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Rp(s,c){return s=Gr(22,s,null,c),s.lanes=0,s}function Ax(s,c,h){return Wo(c,s.child,null,h),s=_x(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function VA(s,c,h){s.lanes|=c;var g=s.alternate;g!==null&&(g.lanes|=c),F0(s.return,c,h)}function Ox(s,c,h,g,b,N){var z=s.memoizedState;z===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:b,treeForkCount:N}:(z.isBackwards=c,z.rendering=null,z.renderingStartTime=0,z.last=g,z.tail=h,z.tailMode=b,z.treeForkCount=N)}function ZA(s,c,h){var g=c.pendingProps,b=g.revealOrder,N=g.tail;g=g.children;var z=Sn.current,M=(z&2)!==0;if(M?(z=z&1|2,c.flags|=128):z&=1,R(Sn,z),Xn(s,c,g,h),g=xt?Sd:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&VA(s,h,c);else if(s.tag===19)VA(s,h,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(b){case"forwards":for(h=c.child,b=null;h!==null;)s=h.alternate,s!==null&&Sp(s)===null&&(b=h),h=h.sibling;h=b,h===null?(b=c.child,c.child=null):(b=h.sibling,h.sibling=null),Ox(c,!1,b,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=c.child,c.child=null;b!==null;){if(s=b.alternate,s!==null&&Sp(s)===null){c.child=b;break}s=b.sibling,b.sibling=h,h=b,b=s}Ox(c,!0,h,null,N,g);break;case"together":Ox(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function Za(s,c,h){if(s!==null&&(c.dependencies=s.dependencies),Bs|=c.lanes,(h&c.childLanes)===0)if(s!==null){if(vc(s,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,h=qa(s,s.pendingProps),c.child=h,h.return=c;s.sibling!==null;)s=s.sibling,h=h.sibling=qa(s,s.pendingProps),h.return=c;h.sibling=null}return c.child}function Ex(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&pp(s)))}function dF(s,c,h){switch(c.tag){case 3:Se(c,c.stateNode.containerInfo),Ts(c,_n,s.memoizedState.cache),Ko();break;case 27:case 5:pe(c);break;case 4:Se(c,c.stateNode.containerInfo);break;case 10:Ts(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,tx(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Ms(c),c.flags|=128,null):(h&c.child.childLanes)!==0?GA(s,c,h):(Ms(c),s=Za(s,c,h),s!==null?s.sibling:null);Ms(c);break;case 19:var b=(s.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(vc(s,c,h,!1),g=(h&c.childLanes)!==0),b){if(g)return ZA(s,c,h);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),R(Sn,Sn.current),g)break;return null;case 22:return c.lanes=0,BA(s,c,h,c.pendingProps);case 24:Ts(c,_n,s.memoizedState.cache)}return Za(s,c,h)}function YA(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps)On=!0;else{if(!Ex(s,h)&&(c.flags&128)===0)return On=!1,dF(s,c,h);On=(s.flags&131072)!==0}else On=!1,xt&&(c.flags&1048576)!==0&&__(c,Sd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(s=Zo(c.elementType),c.type=s,typeof s=="function")D0(s)?(g=Xo(s,g),c.tag=1,c=KA(null,c,s,g,h)):(c.tag=0,c=jx(null,c,s,g,h));else{if(s!=null){var b=s.$$typeof;if(b===C){c.tag=11,c=IA(null,c,s,g,h);break e}else if(b===A){c.tag=14,c=LA(null,c,s,g,h);break e}}throw c=ee(s)||s,Error(r(306,c,""))}}return c;case 0:return jx(s,c,c.type,c.pendingProps,h);case 1:return g=c.type,b=Xo(g,c.pendingProps),KA(s,c,g,b,h);case 3:e:{if(Se(c,c.stateNode.containerInfo),s===null)throw Error(r(387));g=c.pendingProps;var N=c.memoizedState;b=N.element,W0(s,c),Ed(c,g,null,h);var z=c.memoizedState;if(g=z.cache,Ts(c,_n,g),g!==N.cache&&K0(c,[_n],h,!0),Od(),g=z.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:z.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=HA(s,c,g,h);break e}else if(g!==b){b=ui(Error(r(424)),c),jd(b),c=HA(s,c,g,h);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Wt=mi(s.firstChild),Wn=c,xt=!0,Es=null,hi=!0,h=B_(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Ko(),g===b){c=Za(s,c,h);break e}Xn(s,c,g,h)}c=c.child}return c;case 26:return Pp(s,c),s===null?(h=sE(c.type,null,c.pendingProps,null))?c.memoizedState=h:xt||(h=c.type,s=c.pendingProps,g=Wp(ne.current).createElement(h),g[Xe]=c,g[jt]=s,Jn(g,h,s),cn(g),c.stateNode=g):c.memoizedState=sE(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return pe(c),s===null&&xt&&(g=c.stateNode=rE(c.type,c.pendingProps,ne.current),Wn=c,hi=!0,b=Wt,Hs(c.type)?(cb=b,Wt=mi(g.firstChild)):Wt=b),Xn(s,c,c.pendingProps.children,h),Pp(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&xt&&((b=g=Wt)&&(g=UF(g,c.type,c.pendingProps,hi),g!==null?(c.stateNode=g,Wn=c,Wt=mi(g.firstChild),hi=!1,b=!0):b=!1),b||zs(c)),pe(c),b=c.type,N=c.pendingProps,z=s!==null?s.memoizedProps:null,g=N.children,ib(b,N)?g=null:z!==null&&ib(b,z)&&(c.flags|=32),c.memoizedState!==null&&(b=rx(s,c,nF,null,null,h),Wd._currentValue=b),Pp(s,c),Xn(s,c,g,h),c.child;case 6:return s===null&&xt&&((s=h=Wt)&&(h=qF(h,c.pendingProps,hi),h!==null?(c.stateNode=h,Wn=c,Wt=null,s=!0):s=!1),s||zs(c)),null;case 13:return GA(s,c,h);case 4:return Se(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=Wo(c,null,g,h):Xn(s,c,g,h),c.child;case 11:return IA(s,c,c.type,c.pendingProps,h);case 7:return Xn(s,c,c.pendingProps,h),c.child;case 8:return Xn(s,c,c.pendingProps.children,h),c.child;case 12:return Xn(s,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,Ts(c,c.type,g.value),Xn(s,c,g.children,h),c.child;case 9:return b=c.type._context,g=c.pendingProps.children,Go(c),b=Qn(b),g=g(b),c.flags|=1,Xn(s,c,g,h),c.child;case 14:return LA(s,c,c.type,c.pendingProps,h);case 15:return $A(s,c,c.type,c.pendingProps,h);case 19:return ZA(s,c,h);case 31:return uF(s,c,h);case 22:return BA(s,c,h,c.pendingProps);case 24:return Go(c),g=Qn(_n),s===null?(b=V0(),b===null&&(b=Ut,N=H0(),b.pooledCache=N,N.refCount++,N!==null&&(b.pooledCacheLanes|=h),b=N),c.memoizedState={parent:g,cache:b},Y0(c),Ts(c,_n,b)):((s.lanes&h)!==0&&(W0(s,c),Ed(c,null,null,h),Od()),b=s.memoizedState,N=c.memoizedState,b.parent!==g?(b={parent:g,cache:g},c.memoizedState=b,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=b),Ts(c,_n,g)):(g=N.cache,Ts(c,_n,g),g!==b.cache&&K0(c,[_n],h,!0))),Xn(s,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Ya(s){s.flags|=4}function zx(s,c,h,g,b){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(b&335544128)===b)if(s.stateNode.complete)s.flags|=8192;else if(SO())s.flags|=8192;else throw Yo=vp,Z0}else s.flags&=-16777217}function WA(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!dE(c))if(SO())s.flags|=8192;else throw Yo=vp,Z0}function Dp(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?Yh():536870912,s.lanes|=c,Ec|=c)}function Md(s,c){if(!xt)switch(s.tailMode){case"hidden":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Qt(s){var c=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(c)for(var b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=g,s.childLanes=h,c}function fF(s,c,h){var g=c.pendingProps;switch($0(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(c),null;case 1:return Qt(c),null;case 3:return h=c.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Ha(_n),J(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(yc(c)?Ya(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,U0())),Qt(c),null;case 26:var b=c.type,N=c.memoizedState;return s===null?(Ya(c),N!==null?(Qt(c),WA(c,N)):(Qt(c),zx(c,b,null,g,h))):N?N!==s.memoizedState?(Ya(c),Qt(c),WA(c,N)):(Qt(c),c.flags&=-16777217):(s=s.memoizedProps,s!==g&&Ya(c),Qt(c),zx(c,b,s,g,h)),null;case 27:if(Oe(c),h=ne.current,b=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Ya(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Qt(c),null}s=G.current,yc(c)?O_(c):(s=rE(b,g,h),c.stateNode=s,Ya(c))}return Qt(c),null;case 5:if(Oe(c),b=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Ya(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Qt(c),null}if(N=G.current,yc(c))O_(c);else{var z=Wp(ne.current);switch(N){case 1:N=z.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:N=z.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":N=z.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":N=z.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":N=z.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?z.createElement("select",{is:g.is}):z.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?z.createElement(b,{is:g.is}):z.createElement(b)}}N[Xe]=c,N[jt]=g;e:for(z=c.child;z!==null;){if(z.tag===5||z.tag===6)N.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===c)break e;for(;z.sibling===null;){if(z.return===null||z.return===c)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}c.stateNode=N;e:switch(Jn(N,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ya(c)}}return Qt(c),zx(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==g&&Ya(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(s=ne.current,yc(c)){if(s=c.stateNode,h=c.memoizedProps,g=null,b=Wn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}s[Xe]=c,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||GO(s.nodeValue,h)),s||zs(c,!0)}else s=Wp(s).createTextNode(g),s[Xe]=c,c.stateNode=s}return Qt(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(g=yc(c),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Xe]=c}else Ko(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Qt(c),s=!1}else h=U0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(Zr(c),c):(Zr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Qt(c),null;case 13:if(g=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(b=yc(c),g!==null&&g.dehydrated!==null){if(s===null){if(!b)throw Error(r(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Xe]=c}else Ko(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Qt(c),b=!1}else b=U0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=b),b=!0;if(!b)return c.flags&256?(Zr(c),c):(Zr(c),null)}return Zr(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=c.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==b&&(g.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Dp(c,c.updateQueue),Qt(c),null);case 4:return J(),s===null&&Jx(c.stateNode.containerInfo),Qt(c),null;case 10:return Ha(c.type),Qt(c),null;case 19:if(q(Sn),g=c.memoizedState,g===null)return Qt(c),null;if(b=(c.flags&128)!==0,N=g.rendering,N===null)if(b)Md(g,!1);else{if(mn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(N=Sp(s),N!==null){for(c.flags|=128,Md(g,!1),s=N.updateQueue,c.updateQueue=s,Dp(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)N_(h,s),h=h.sibling;return R(Sn,Sn.current&1|2),xt&&Fa(c,g.treeForkCount),c.child}s=s.sibling}g.tail!==null&&et()>Bp&&(c.flags|=128,b=!0,Md(g,!1),c.lanes=4194304)}else{if(!b)if(s=Sp(N),s!==null){if(c.flags|=128,b=!0,s=s.updateQueue,c.updateQueue=s,Dp(c,s),Md(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!xt)return Qt(c),null}else 2*et()-g.renderingStartTime>Bp&&h!==536870912&&(c.flags|=128,b=!0,Md(g,!1),c.lanes=4194304);g.isBackwards?(N.sibling=c.child,c.child=N):(s=g.last,s!==null?s.sibling=N:c.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=et(),s.sibling=null,h=Sn.current,R(Sn,b?h&1|2:h&1),xt&&Fa(c,g.treeForkCount),s):(Qt(c),null);case 22:case 23:return Zr(c),ex(),g=c.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(h&536870912)!==0&&(c.flags&128)===0&&(Qt(c),c.subtreeFlags&6&&(c.flags|=8192)):Qt(c),h=c.updateQueue,h!==null&&Dp(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048),s!==null&&q(Vo),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Ha(_n),Qt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function hF(s,c){switch($0(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ha(_n),J(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Oe(c),null;case 31:if(c.memoizedState!==null){if(Zr(c),c.alternate===null)throw Error(r(340));Ko()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Zr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ko()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return q(Sn),null;case 4:return J(),null;case 10:return Ha(c.type),null;case 22:case 23:return Zr(c),ex(),s!==null&&q(Vo),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Ha(_n),null;case 25:return null;default:return null}}function QA(s,c){switch($0(c),c.tag){case 3:Ha(_n),J();break;case 26:case 27:case 5:Oe(c);break;case 4:J();break;case 31:c.memoizedState!==null&&Zr(c);break;case 13:Zr(c);break;case 19:q(Sn);break;case 10:Ha(c.type);break;case 22:case 23:Zr(c),ex(),s!==null&&q(Vo);break;case 24:Ha(_n)}}function Id(s,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var b=g.next;h=b;do{if((h.tag&s)===s){g=void 0;var N=h.create,z=h.inst;g=N(),z.destroy=g}h=h.next}while(h!==b)}}catch(M){Pt(c,c.return,M)}}function Ls(s,c,h){try{var g=c.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var N=b.next;g=N;do{if((g.tag&s)===s){var z=g.inst,M=z.destroy;if(M!==void 0){z.destroy=void 0,b=c;var H=h,ae=M;try{ae()}catch(me){Pt(b,H,me)}}}g=g.next}while(g!==N)}}catch(me){Pt(c,c.return,me)}}function XA(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{q_(c,h)}catch(g){Pt(s,s.return,g)}}}function JA(s,c,h){h.props=Xo(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Pt(s,c,g)}}function Ld(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(b){Pt(s,c,b)}}function ca(s,c){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(b){Pt(s,c,b)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){Pt(s,c,b)}else h.current=null}function eO(s){var c=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(b){Pt(s,s.return,b)}}function Tx(s,c,h){try{var g=s.stateNode;DF(g,s.type,h,c),g[jt]=c}catch(b){Pt(s,s.return,b)}}function tO(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Hs(s.type)||s.tag===4}function Px(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||tO(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&&Hs(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 Rx(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(s),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=Ba));else if(g!==4&&(g===27&&Hs(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(Rx(s,c,h),s=s.sibling;s!==null;)Rx(s,c,h),s=s.sibling}function Mp(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(g!==4&&(g===27&&Hs(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Mp(s,c,h),s=s.sibling;s!==null;)Mp(s,c,h),s=s.sibling}function nO(s){var c=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,b=c.attributes;b.length;)c.removeAttributeNode(b[0]);Jn(c,g,h),c[Xe]=s,c[jt]=h}catch(N){Pt(s,s.return,N)}}var Wa=!1,En=!1,Dx=!1,rO=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function pF(s,c){if(s=s.containerInfo,nb=rm,s=m_(s),A0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var b=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var z=0,M=-1,H=-1,ae=0,me=0,be=s,se=null;t:for(;;){for(var ue;be!==h||b!==0&&be.nodeType!==3||(M=z+b),be!==N||g!==0&&be.nodeType!==3||(H=z+g),be.nodeType===3&&(z+=be.nodeValue.length),(ue=be.firstChild)!==null;)se=be,be=ue;for(;;){if(be===s)break t;if(se===h&&++ae===b&&(M=z),se===N&&++me===g&&(H=z),(ue=be.nextSibling)!==null)break;be=se,se=be.parentNode}be=ue}h=M===-1||H===-1?null:{start:M,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;for(rb={focusedElem:s,selectionRange:h},rm=!1,Kn=c;Kn!==null;)if(c=Kn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Kn=s;else for(;Kn!==null;){switch(c=Kn,N=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)b=s[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=c,b=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Re=Xo(h.type,b);s=g.getSnapshotBeforeUpdate(Re,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(We){Pt(h,h.return,We)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,h=s.nodeType,h===9)sb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":sb(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=c.sibling,s!==null){s.return=c.return,Kn=s;break}Kn=c.return}}function iO(s,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Xa(s,h),g&4&&Id(5,h);break;case 1:if(Xa(s,h),g&4)if(s=h.stateNode,c===null)try{s.componentDidMount()}catch(z){Pt(h,h.return,z)}else{var b=Xo(h.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(b,c,s.__reactInternalSnapshotBeforeUpdate)}catch(z){Pt(h,h.return,z)}}g&64&&XA(h),g&512&&Ld(h,h.return);break;case 3:if(Xa(s,h),g&64&&(s=h.updateQueue,s!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{q_(s,c)}catch(z){Pt(h,h.return,z)}}break;case 27:c===null&&g&4&&nO(h);case 26:case 5:Xa(s,h),c===null&&g&4&&eO(h),g&512&&Ld(h,h.return);break;case 12:Xa(s,h);break;case 31:Xa(s,h),g&4&&oO(s,h);break;case 13:Xa(s,h),g&4&&lO(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=jF.bind(null,h),FF(s,h))));break;case 22:if(g=h.memoizedState!==null||Wa,!g){c=c!==null&&c.memoizedState!==null||En,b=Wa;var N=En;Wa=g,(En=c)&&!N?Ja(s,h,(h.subtreeFlags&8772)!==0):Xa(s,h),Wa=b,En=N}break;case 30:break;default:Xa(s,h)}}function aO(s){var c=s.alternate;c!==null&&(s.alternate=null,aO(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&sa(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var tn=null,Er=!1;function Qa(s,c,h){for(h=h.child;h!==null;)sO(s,c,h),h=h.sibling}function sO(s,c,h){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(ln,h)}catch{}switch(h.tag){case 26:En||ca(h,c),Qa(s,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:En||ca(h,c);var g=tn,b=Er;Hs(h.type)&&(tn=h.stateNode,Er=!1),Qa(s,c,h),Vd(h.stateNode),tn=g,Er=b;break;case 5:En||ca(h,c);case 6:if(g=tn,b=Er,tn=null,Qa(s,c,h),tn=g,Er=b,tn!==null)if(Er)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(h.stateNode)}catch(N){Pt(h,c,N)}else try{tn.removeChild(h.stateNode)}catch(N){Pt(h,c,N)}break;case 18:tn!==null&&(Er?(s=tn,XO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),Lc(s)):XO(tn,h.stateNode));break;case 4:g=tn,b=Er,tn=h.stateNode.containerInfo,Er=!0,Qa(s,c,h),tn=g,Er=b;break;case 0:case 11:case 14:case 15:Ls(2,h,c),En||Ls(4,h,c),Qa(s,c,h);break;case 1:En||(ca(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&JA(h,c,g)),Qa(s,c,h);break;case 21:Qa(s,c,h);break;case 22:En=(g=En)||h.memoizedState!==null,Qa(s,c,h),En=g;break;default:Qa(s,c,h)}}function oO(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Lc(s)}catch(h){Pt(c,c.return,h)}}}function lO(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Lc(s)}catch(h){Pt(c,c.return,h)}}function mF(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new rO),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new rO),c;default:throw Error(r(435,s.tag))}}function Ip(s,c){var h=mF(s);c.forEach(function(g){if(!h.has(g)){h.add(g);var b=NF.bind(null,s,g);g.then(b,b)}})}function zr(s,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var b=h[g],N=s,z=c,M=z;e:for(;M!==null;){switch(M.tag){case 27:if(Hs(M.type)){tn=M.stateNode,Er=!1;break e}break;case 5:tn=M.stateNode,Er=!1;break e;case 3:case 4:tn=M.stateNode.containerInfo,Er=!0;break e}M=M.return}if(tn===null)throw Error(r(160));sO(N,z,b),tn=null,Er=!1,N=b.alternate,N!==null&&(N.return=null),b.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)cO(c,s),c=c.sibling}var qi=null;function cO(s,c){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:zr(c,s),Tr(s),g&4&&(Ls(3,s,s.return),Id(3,s),Ls(5,s,s.return));break;case 1:zr(c,s),Tr(s),g&512&&(En||h===null||ca(h,h.return)),g&64&&Wa&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var b=qi;if(zr(c,s),Tr(s),g&512&&(En||h===null||ca(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":N=b.getElementsByTagName("title")[0],(!N||N[Mo]||N[Xe]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=b.createElement(g),b.head.insertBefore(N,b.querySelector("head > title"))),Jn(N,g,h),N[Xe]=s,cn(N),g=N;break e;case"link":var z=cE("link","href",b).get(g+(h.href||""));if(z){for(var M=0;M<z.length;M++)if(N=z[M],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){z.splice(M,1);break t}}N=b.createElement(g),Jn(N,g,h),b.head.appendChild(N);break;case"meta":if(z=cE("meta","content",b).get(g+(h.content||""))){for(M=0;M<z.length;M++)if(N=z[M],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){z.splice(M,1);break t}}N=b.createElement(g),Jn(N,g,h),b.head.appendChild(N);break;default:throw Error(r(468,g))}N[Xe]=s,cn(N),g=N}s.stateNode=g}else uE(b,s.type,s.stateNode);else s.stateNode=lE(b,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?uE(b,s.type,s.stateNode):lE(b,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Tx(s,s.memoizedProps,h.memoizedProps)}break;case 27:zr(c,s),Tr(s),g&512&&(En||h===null||ca(h,h.return)),h!==null&&g&4&&Tx(s,s.memoizedProps,h.memoizedProps);break;case 5:if(zr(c,s),Tr(s),g&512&&(En||h===null||ca(h,h.return)),s.flags&32){b=s.stateNode;try{oc(b,"")}catch(Re){Pt(s,s.return,Re)}}g&4&&s.stateNode!=null&&(b=s.memoizedProps,Tx(s,b,h!==null?h.memoizedProps:b)),g&1024&&(Dx=!0);break;case 6:if(zr(c,s),Tr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Re){Pt(s,s.return,Re)}}break;case 3:if(Jp=null,b=qi,qi=Qp(c.containerInfo),zr(c,s),qi=b,Tr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Lc(c.containerInfo)}catch(Re){Pt(s,s.return,Re)}Dx&&(Dx=!1,uO(s));break;case 4:g=qi,qi=Qp(s.stateNode.containerInfo),zr(c,s),Tr(s),qi=g;break;case 12:zr(c,s),Tr(s);break;case 31:zr(c,s),Tr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ip(s,g)));break;case 13:zr(c,s),Tr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&($p=et()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ip(s,g)));break;case 22:b=s.memoizedState!==null;var H=h!==null&&h.memoizedState!==null,ae=Wa,me=En;if(Wa=ae||b,En=me||H,zr(c,s),En=me,Wa=ae,Tr(s),g&8192)e:for(c=s.stateNode,c._visibility=b?c._visibility&-2:c._visibility|1,b&&(h===null||H||Wa||En||Jo(s)),h=null,c=s;;){if(c.tag===5||c.tag===26){if(h===null){H=h=c;try{if(N=H.stateNode,b)z=N.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{M=H.stateNode;var be=H.memoizedProps.style,se=be!=null&&be.hasOwnProperty("display")?be.display:null;M.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Re){Pt(H,H.return,Re)}}}else if(c.tag===6){if(h===null){H=c;try{H.stateNode.nodeValue=b?"":H.memoizedProps}catch(Re){Pt(H,H.return,Re)}}}else if(c.tag===18){if(h===null){H=c;try{var ue=H.stateNode;b?JO(ue,!0):JO(H.stateNode,!1)}catch(Re){Pt(H,H.return,Re)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Ip(s,h))));break;case 19:zr(c,s),Tr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ip(s,g)));break;case 30:break;case 21:break;default:zr(c,s),Tr(s)}}function Tr(s){var c=s.flags;if(c&2){try{for(var h,g=s.return;g!==null;){if(tO(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,N=Px(s);Mp(s,N,b);break;case 5:var z=h.stateNode;h.flags&32&&(oc(z,""),h.flags&=-33);var M=Px(s);Mp(s,M,z);break;case 3:case 4:var H=h.stateNode.containerInfo,ae=Px(s);Rx(s,ae,H);break;default:throw Error(r(161))}}catch(me){Pt(s,s.return,me)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function uO(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;uO(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function Xa(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)iO(s,c.alternate,c),c=c.sibling}function Jo(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:Ls(4,c,c.return),Jo(c);break;case 1:ca(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&JA(c,c.return,h),Jo(c);break;case 27:Vd(c.stateNode);case 26:case 5:ca(c,c.return),Jo(c);break;case 22:c.memoizedState===null&&Jo(c);break;case 30:Jo(c);break;default:Jo(c)}s=s.sibling}}function Ja(s,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,b=s,N=c,z=N.flags;switch(N.tag){case 0:case 11:case 15:Ja(b,N,h),Id(4,N);break;case 1:if(Ja(b,N,h),g=N,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ae){Pt(g,g.return,ae)}if(g=N,b=g.updateQueue,b!==null){var M=g.stateNode;try{var H=b.shared.hiddenCallbacks;if(H!==null)for(b.shared.hiddenCallbacks=null,b=0;b<H.length;b++)U_(H[b],M)}catch(ae){Pt(g,g.return,ae)}}h&&z&64&&XA(N),Ld(N,N.return);break;case 27:nO(N);case 26:case 5:Ja(b,N,h),h&&g===null&&z&4&&eO(N),Ld(N,N.return);break;case 12:Ja(b,N,h);break;case 31:Ja(b,N,h),h&&z&4&&oO(b,N);break;case 13:Ja(b,N,h),h&&z&4&&lO(b,N);break;case 22:N.memoizedState===null&&Ja(b,N,h),Ld(N,N.return);break;case 30:break;default:Ja(b,N,h)}c=c.sibling}}function Mx(s,c){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&Nd(h))}function Ix(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Nd(s))}function Fi(s,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)dO(s,c,h,g),c=c.sibling}function dO(s,c,h,g){var b=c.flags;switch(c.tag){case 0:case 11:case 15:Fi(s,c,h,g),b&2048&&Id(9,c);break;case 1:Fi(s,c,h,g);break;case 3:Fi(s,c,h,g),b&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Nd(s)));break;case 12:if(b&2048){Fi(s,c,h,g),s=c.stateNode;try{var N=c.memoizedProps,z=N.id,M=N.onPostCommit;typeof M=="function"&&M(z,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(H){Pt(c,c.return,H)}}else Fi(s,c,h,g);break;case 31:Fi(s,c,h,g);break;case 13:Fi(s,c,h,g);break;case 23:break;case 22:N=c.stateNode,z=c.alternate,c.memoizedState!==null?N._visibility&2?Fi(s,c,h,g):$d(s,c):N._visibility&2?Fi(s,c,h,g):(N._visibility|=2,_c(s,c,h,g,(c.subtreeFlags&10256)!==0||!1)),b&2048&&Mx(z,c);break;case 24:Fi(s,c,h,g),b&2048&&Ix(c.alternate,c);break;default:Fi(s,c,h,g)}}function _c(s,c,h,g,b){for(b=b&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=s,z=c,M=h,H=g,ae=z.flags;switch(z.tag){case 0:case 11:case 15:_c(N,z,M,H,b),Id(8,z);break;case 23:break;case 22:var me=z.stateNode;z.memoizedState!==null?me._visibility&2?_c(N,z,M,H,b):$d(N,z):(me._visibility|=2,_c(N,z,M,H,b)),b&&ae&2048&&Mx(z.alternate,z);break;case 24:_c(N,z,M,H,b),b&&ae&2048&&Ix(z.alternate,z);break;default:_c(N,z,M,H,b)}c=c.sibling}}function $d(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=s,g=c,b=g.flags;switch(g.tag){case 22:$d(h,g),b&2048&&Mx(g.alternate,g);break;case 24:$d(h,g),b&2048&&Ix(g.alternate,g);break;default:$d(h,g)}c=c.sibling}}var Bd=8192;function Ac(s,c,h){if(s.subtreeFlags&Bd)for(s=s.child;s!==null;)fO(s,c,h),s=s.sibling}function fO(s,c,h){switch(s.tag){case 26:Ac(s,c,h),s.flags&Bd&&s.memoizedState!==null&&t9(h,qi,s.memoizedState,s.memoizedProps);break;case 5:Ac(s,c,h);break;case 3:case 4:var g=qi;qi=Qp(s.stateNode.containerInfo),Ac(s,c,h),qi=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Bd,Bd=16777216,Ac(s,c,h),Bd=g):Ac(s,c,h));break;default:Ac(s,c,h)}}function hO(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function Ud(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Kn=g,mO(g,s)}hO(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)pO(s),s=s.sibling}function pO(s){switch(s.tag){case 0:case 11:case 15:Ud(s),s.flags&2048&&Ls(9,s,s.return);break;case 3:Ud(s);break;case 12:Ud(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Lp(s)):Ud(s);break;default:Ud(s)}}function Lp(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Kn=g,mO(g,s)}hO(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:Ls(8,c,c.return),Lp(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,Lp(c));break;default:Lp(c)}s=s.sibling}}function mO(s,c){for(;Kn!==null;){var h=Kn;switch(h.tag){case 0:case 11:case 15:Ls(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Nd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Kn=g;else e:for(h=s;Kn!==null;){g=Kn;var b=g.sibling,N=g.return;if(aO(g),g===h){Kn=null;break e}if(b!==null){b.return=N,Kn=b;break e}Kn=N}}}var gF={getCacheForType:function(s){var c=Qn(_n),h=c.data.get(s);return h===void 0&&(h=s(),c.data.set(s,h)),h},cacheSignal:function(){return Qn(_n).controller.signal}},yF=typeof WeakMap=="function"?WeakMap:Map,At=0,Ut=null,pt=null,yt=0,Tt=0,Yr=null,$s=!1,Oc=!1,Lx=!1,es=0,mn=0,Bs=0,el=0,$x=0,Wr=0,Ec=0,qd=null,Pr=null,Bx=!1,$p=0,gO=0,Bp=1/0,Up=null,Us=null,Mn=0,qs=null,zc=null,ts=0,Ux=0,qx=null,yO=null,Fd=0,Fx=null;function Qr(){return(At&2)!==0&&yt!==0?yt&-yt:K.T!==null?Yx():fd()}function vO(){if(Wr===0)if((yt&536870912)===0||xt){var s=ai;ai<<=1,(ai&3932160)===0&&(ai=262144),Wr=s}else Wr=536870912;return s=Vr.current,s!==null&&(s.flags|=32),Wr}function Rr(s,c,h){(s===Ut&&(Tt===2||Tt===9)||s.cancelPendingCommit!==null)&&(Tc(s,0),Fs(s,yt,Wr,!1)),Ns(s,h),((At&2)===0||s!==Ut)&&(s===Ut&&((At&2)===0&&(el|=h),mn===4&&Fs(s,yt,Wr,!1)),ua(s))}function xO(s,c,h){if((At&6)!==0)throw Error(r(327));var g=!h&&(c&127)===0&&(c&s.expiredLanes)===0||Li(s,c),b=g?bF(s,c):Hx(s,c,!0),N=g;do{if(b===0){Oc&&!g&&Fs(s,c,0,!1);break}else{if(h=s.current.alternate,N&&!vF(h)){b=Hx(s,c,!1),N=!1;continue}if(b===2){if(N=c,s.errorRecoveryDisabledLanes&N)var z=0;else z=s.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var M=s;b=qd;var H=M.current.memoizedState.isDehydrated;if(H&&(Tc(M,z).flags|=256),z=Hx(M,z,!1),z!==2){if(Lx&&!H){M.errorRecoveryDisabledLanes|=N,el|=N,b=4;break e}N=Pr,Pr=b,N!==null&&(Pr===null?Pr=N:Pr.push.apply(Pr,N))}b=z}if(N=!1,b!==2)continue}}if(b===1){Tc(s,0),Fs(s,c,0,!0);break}e:{switch(g=s,N=b,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Fs(g,c,Wr,!$s);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(b=$p+300-et(),10<b)){if(Fs(g,c,Wr,!$s),_r(g,0,!0)!==0)break e;ts=c,g.timeoutHandle=WO(bO.bind(null,g,h,Pr,Up,Bx,c,Wr,el,Ec,$s,N,"Throttled",-0,0),b);break e}bO(g,h,Pr,Up,Bx,c,Wr,el,Ec,$s,N,null,-0,0)}}break}while(!0);ua(s)}function bO(s,c,h,g,b,N,z,M,H,ae,me,be,se,ue){if(s.timeoutHandle=-1,be=c.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ba},fO(c,N,be);var Re=(N&62914560)===N?$p-et():(N&4194048)===N?gO-et():0;if(Re=n9(be,Re),Re!==null){ts=N,s.cancelPendingCommit=Re(AO.bind(null,s,c,N,h,g,b,z,M,H,me,be,null,se,ue)),Fs(s,N,z,!ae);return}}AO(s,c,N,h,g,b,z,M,H)}function vF(s){for(var c=s;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var b=h[g],N=b.getSnapshot;b=b.value;try{if(!Hr(N(),b))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Fs(s,c,h,g){c&=~$x,c&=~el,s.suspendedLanes|=c,s.pingedLanes&=~c,g&&(s.warmLanes|=c),g=s.expirationTimes;for(var b=c;0<b;){var N=31-de(b),z=1<<N;g[N]=-1,b&=~z}h!==0&&cd(s,h,c)}function qp(){return(At&6)===0?(Kd(0),!1):!0}function Kx(){if(pt!==null){if(Tt===0)var s=pt.return;else s=pt,Ka=Ho=null,sx(s),Sc=null,Cd=0,s=pt;for(;s!==null;)QA(s.alternate,s),s=s.return;pt=null}}function Tc(s,c){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,LF(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),ts=0,Kx(),Ut=s,pt=h=qa(s.current,null),yt=c,Tt=0,Yr=null,$s=!1,Oc=Li(s,c),Lx=!1,Ec=Wr=$x=el=Bs=mn=0,Pr=qd=null,Bx=!1,(c&8)!==0&&(c|=c&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=c;0<g;){var b=31-de(g),N=1<<b;c|=s[b],g&=~N}return es=c,cp(),h}function wO(s,c){at=null,K.H=Rd,c===wc||c===yp?(c=I_(),Tt=3):c===Z0?(c=I_(),Tt=4):Tt=c===Sx?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Yr=c,pt===null&&(mn=1,zp(s,ui(c,s.current)))}function SO(){var s=Vr.current;return s===null?!0:(yt&4194048)===yt?pi===null:(yt&62914560)===yt||(yt&536870912)!==0?s===pi:!1}function jO(){var s=K.H;return K.H=Rd,s===null?Rd:s}function NO(){var s=K.A;return K.A=gF,s}function Fp(){mn=4,$s||(yt&4194048)!==yt&&Vr.current!==null||(Oc=!0),(Bs&134217727)===0&&(el&134217727)===0||Ut===null||Fs(Ut,yt,Wr,!1)}function Hx(s,c,h){var g=At;At|=2;var b=jO(),N=NO();(Ut!==s||yt!==c)&&(Up=null,Tc(s,c)),c=!1;var z=mn;e:do try{if(Tt!==0&&pt!==null){var M=pt,H=Yr;switch(Tt){case 8:Kx(),z=6;break e;case 3:case 2:case 9:case 6:Vr.current===null&&(c=!0);var ae=Tt;if(Tt=0,Yr=null,Pc(s,M,H,ae),h&&Oc){z=0;break e}break;default:ae=Tt,Tt=0,Yr=null,Pc(s,M,H,ae)}}xF(),z=mn;break}catch(me){wO(s,me)}while(!0);return c&&s.shellSuspendCounter++,Ka=Ho=null,At=g,K.H=b,K.A=N,pt===null&&(Ut=null,yt=0,cp()),z}function xF(){for(;pt!==null;)kO(pt)}function bF(s,c){var h=At;At|=2;var g=jO(),b=NO();Ut!==s||yt!==c?(Up=null,Bp=et()+500,Tc(s,c)):Oc=Li(s,c);e:do try{if(Tt!==0&&pt!==null){c=pt;var N=Yr;t:switch(Tt){case 1:Tt=0,Yr=null,Pc(s,c,N,1);break;case 2:case 9:if(D_(N)){Tt=0,Yr=null,CO(c);break}c=function(){Tt!==2&&Tt!==9||Ut!==s||(Tt=7),ua(s)},N.then(c,c);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:D_(N)?(Tt=0,Yr=null,CO(c)):(Tt=0,Yr=null,Pc(s,c,N,7));break;case 5:var z=null;switch(pt.tag){case 26:z=pt.memoizedState;case 5:case 27:var M=pt;if(z?dE(z):M.stateNode.complete){Tt=0,Yr=null;var H=M.sibling;if(H!==null)pt=H;else{var ae=M.return;ae!==null?(pt=ae,Kp(ae)):pt=null}break t}}Tt=0,Yr=null,Pc(s,c,N,5);break;case 6:Tt=0,Yr=null,Pc(s,c,N,6);break;case 8:Kx(),mn=6;break e;default:throw Error(r(462))}}wF();break}catch(me){wO(s,me)}while(!0);return Ka=Ho=null,K.H=g,K.A=b,At=h,pt!==null?0:(Ut=null,yt=0,cp(),mn)}function wF(){for(;pt!==null&&!ot();)kO(pt)}function kO(s){var c=YA(s.alternate,s,es);s.memoizedProps=s.pendingProps,c===null?Kp(s):pt=c}function CO(s){var c=s,h=c.alternate;switch(c.tag){case 15:case 0:c=FA(h,c,c.pendingProps,c.type,void 0,yt);break;case 11:c=FA(h,c,c.pendingProps,c.type.render,c.ref,yt);break;case 5:sx(c);default:QA(h,c),c=pt=N_(c,es),c=YA(h,c,es)}s.memoizedProps=s.pendingProps,c===null?Kp(s):pt=c}function Pc(s,c,h,g){Ka=Ho=null,sx(c),Sc=null,Cd=0;var b=c.return;try{if(cF(s,b,c,h,yt)){mn=1,zp(s,ui(h,s.current)),pt=null;return}}catch(N){if(b!==null)throw pt=b,N;mn=1,zp(s,ui(h,s.current)),pt=null;return}c.flags&32768?(xt||g===1?s=!0:Oc||(yt&536870912)!==0?s=!1:($s=s=!0,(g===2||g===9||g===3||g===6)&&(g=Vr.current,g!==null&&g.tag===13&&(g.flags|=16384))),_O(c,s)):Kp(c)}function Kp(s){var c=s;do{if((c.flags&32768)!==0){_O(c,$s);return}s=c.return;var h=fF(c.alternate,c,es);if(h!==null){pt=h;return}if(c=c.sibling,c!==null){pt=c;return}pt=c=s}while(c!==null);mn===0&&(mn=5)}function _O(s,c){do{var h=hF(s.alternate,s);if(h!==null){h.flags&=32767,pt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(s=s.sibling,s!==null)){pt=s;return}pt=s=h}while(s!==null);mn=6,pt=null}function AO(s,c,h,g,b,N,z,M,H){s.cancelPendingCommit=null;do Hp();while(Mn!==0);if((At&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=P0,d0(s,h,N,z,M,H),s===Ut&&(pt=Ut=null,yt=0),zc=c,qs=s,ts=h,Ux=N,qx=b,yO=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,kF(De,function(){return PO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=K.T,K.T=null,b=te.p,te.p=2,z=At,At|=4;try{pF(s,c,h)}finally{At=z,te.p=b,K.T=g}}Mn=1,OO(),EO(),zO()}}function OO(){if(Mn===1){Mn=0;var s=qs,c=zc,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=K.T,K.T=null;var g=te.p;te.p=2;var b=At;At|=4;try{cO(c,s);var N=rb,z=m_(s.containerInfo),M=N.focusedElem,H=N.selectionRange;if(z!==M&&M&&M.ownerDocument&&p_(M.ownerDocument.documentElement,M)){if(H!==null&&A0(M)){var ae=H.start,me=H.end;if(me===void 0&&(me=ae),"selectionStart"in M)M.selectionStart=ae,M.selectionEnd=Math.min(me,M.value.length);else{var be=M.ownerDocument||document,se=be&&be.defaultView||window;if(se.getSelection){var ue=se.getSelection(),Re=M.textContent.length,We=Math.min(H.start,Re),It=H.end===void 0?We:Math.min(H.end,Re);!ue.extend&&We>It&&(z=It,It=We,We=z);var X=h_(M,We),Y=h_(M,It);if(X&&Y&&(ue.rangeCount!==1||ue.anchorNode!==X.node||ue.anchorOffset!==X.offset||ue.focusNode!==Y.node||ue.focusOffset!==Y.offset)){var re=be.createRange();re.setStart(X.node,X.offset),ue.removeAllRanges(),We>It?(ue.addRange(re),ue.extend(Y.node,Y.offset)):(re.setEnd(Y.node,Y.offset),ue.addRange(re))}}}}for(be=[],ue=M;ue=ue.parentNode;)ue.nodeType===1&&be.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<be.length;M++){var ve=be[M];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}rm=!!nb,rb=nb=null}finally{At=b,te.p=g,K.T=h}}s.current=c,Mn=2}}function EO(){if(Mn===2){Mn=0;var s=qs,c=zc,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=K.T,K.T=null;var g=te.p;te.p=2;var b=At;At|=4;try{iO(s,c.alternate,c)}finally{At=b,te.p=g,K.T=h}}Mn=3}}function zO(){if(Mn===4||Mn===3){Mn=0,Fn();var s=qs,c=zc,h=ts,g=yO;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Mn=5:(Mn=0,zc=qs=null,TO(s,s.pendingLanes));var b=s.pendingLanes;if(b===0&&(Us=null),dd(h),c=c.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(ln,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=K.T,b=te.p,te.p=2,K.T=null;try{for(var N=s.onRecoverableError,z=0;z<g.length;z++){var M=g[z];N(M.value,{componentStack:M.stack})}}finally{K.T=c,te.p=b}}(ts&3)!==0&&Hp(),ua(s),b=s.pendingLanes,(h&261930)!==0&&(b&42)!==0?s===Fx?Fd++:(Fd=0,Fx=s):Fd=0,Kd(0)}}function TO(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Nd(c)))}function Hp(){return OO(),EO(),zO(),PO()}function PO(){if(Mn!==5)return!1;var s=qs,c=Ux;Ux=0;var h=dd(ts),g=K.T,b=te.p;try{te.p=32>h?32:h,K.T=null,h=qx,qx=null;var N=qs,z=ts;if(Mn=0,zc=qs=null,ts=0,(At&6)!==0)throw Error(r(331));var M=At;if(At|=4,pO(N.current),dO(N,N.current,z,h),At=M,Kd(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(ln,N)}catch{}return!0}finally{te.p=b,K.T=g,TO(s,c)}}function RO(s,c,h){c=ui(h,c),c=wx(s.stateNode,c,2),s=Ds(s,c,2),s!==null&&(Ns(s,2),ua(s))}function Pt(s,c,h){if(s.tag===3)RO(s,s,h);else for(;c!==null;){if(c.tag===3){RO(c,s,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Us===null||!Us.has(g))){s=ui(h,s),h=DA(2),g=Ds(c,h,2),g!==null&&(MA(h,g,c,s),Ns(g,2),ua(g));break}}c=c.return}}function Gx(s,c,h){var g=s.pingCache;if(g===null){g=s.pingCache=new yF;var b=new Set;g.set(c,b)}else b=g.get(c),b===void 0&&(b=new Set,g.set(c,b));b.has(h)||(Lx=!0,b.add(h),s=SF.bind(null,s,c,h),c.then(s,s))}function SF(s,c,h){var g=s.pingCache;g!==null&&g.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Ut===s&&(yt&h)===h&&(mn===4||mn===3&&(yt&62914560)===yt&&300>et()-$p?(At&2)===0&&Tc(s,0):$x|=h,Ec===yt&&(Ec=0)),ua(s)}function DO(s,c){c===0&&(c=Yh()),s=qo(s,c),s!==null&&(Ns(s,c),ua(s))}function jF(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),DO(s,h)}function NF(s,c){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,b=s.memoizedState;b!==null&&(h=b.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),DO(s,h)}function kF(s,c){return we(s,c)}var Gp=null,Rc=null,Vx=!1,Vp=!1,Zx=!1,Ks=0;function ua(s){s!==Rc&&s.next===null&&(Rc===null?Gp=Rc=s:Rc=Rc.next=s),Vp=!0,Vx||(Vx=!0,_F())}function Kd(s,c){if(!Zx&&Vp){Zx=!0;do for(var h=!1,g=Gp;g!==null;){if(s!==0){var b=g.pendingLanes;if(b===0)var N=0;else{var z=g.suspendedLanes,M=g.pingedLanes;N=(1<<31-de(42|s)+1)-1,N&=b&~(z&~M),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,$O(g,N))}else N=yt,N=_r(g,g===Ut?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Li(g,N)||(h=!0,$O(g,N));g=g.next}while(h);Zx=!1}}function CF(){MO()}function MO(){Vp=Vx=!1;var s=0;Ks!==0&&IF()&&(s=Ks);for(var c=et(),h=null,g=Gp;g!==null;){var b=g.next,N=IO(g,c);N===0?(g.next=null,h===null?Gp=b:h.next=b,b===null&&(Rc=h)):(h=g,(s!==0||(N&3)!==0)&&(Vp=!0)),g=b}Mn!==0&&Mn!==5||Kd(s),Ks!==0&&(Ks=0)}function IO(s,c){for(var h=s.suspendedLanes,g=s.pingedLanes,b=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var z=31-de(N),M=1<<z,H=b[z];H===-1?((M&h)===0||(M&g)!==0)&&(b[z]=ia(M,c)):H<=c&&(s.expiredLanes|=M),N&=~M}if(c=Ut,h=yt,h=_r(s,s===c?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===c&&(Tt===2||Tt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Je(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Li(s,h)){if(c=h&-h,c===s.callbackPriority)return c;switch(g!==null&&Je(g),dd(h)){case 2:case 8:h=Ne;break;case 32:h=De;break;case 268435456:h=ht;break;default:h=De}return g=LO.bind(null,s),h=we(h,g),s.callbackPriority=c,s.callbackNode=h,c}return g!==null&&g!==null&&Je(g),s.callbackPriority=2,s.callbackNode=null,2}function LO(s,c){if(Mn!==0&&Mn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Hp()&&s.callbackNode!==h)return null;var g=yt;return g=_r(s,s===Ut?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(xO(s,g,c),IO(s,et()),s.callbackNode!=null&&s.callbackNode===h?LO.bind(null,s):null)}function $O(s,c){if(Hp())return null;xO(s,c,!0)}function _F(){$F(function(){(At&6)!==0?we(ce,CF):MO()})}function Yx(){if(Ks===0){var s=xc;s===0&&(s=Dn,Dn<<=1,(Dn&261888)===0&&(Dn=256)),Ks=s}return Ks}function BO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:tp(""+s)}function UO(s,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,s.id&&h.setAttribute("form",s.id),c.parentNode.insertBefore(h,c),s=new FormData(s),h.parentNode.removeChild(h),s}function AF(s,c,h,g,b){if(c==="submit"&&h&&h.stateNode===b){var N=BO((b[jt]||null).action),z=g.submitter;z&&(c=(c=z[jt]||null)?BO(c.formAction):z.getAttribute("formAction"),c!==null&&(N=c,z=null));var M=new ap("action","action",null,g,b);s.push({event:M,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ks!==0){var H=z?UO(b,z):new FormData(b);mx(h,{pending:!0,data:H,method:b.method,action:N},null,H)}}else typeof N=="function"&&(M.preventDefault(),H=z?UO(b,z):new FormData(b),mx(h,{pending:!0,data:H,method:b.method,action:N},N,H))},currentTarget:b}]})}}for(var Wx=0;Wx<T0.length;Wx++){var Qx=T0[Wx],OF=Qx.toLowerCase(),EF=Qx[0].toUpperCase()+Qx.slice(1);Ui(OF,"on"+EF)}Ui(v_,"onAnimationEnd"),Ui(x_,"onAnimationIteration"),Ui(b_,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(Gq,"onTransitionRun"),Ui(Vq,"onTransitionStart"),Ui(Zq,"onTransitionCancel"),Ui(w_,"onTransitionEnd"),dt("onMouseEnter",["mouseout","mouseover"]),dt("onMouseLeave",["mouseout","mouseover"]),dt("onPointerEnter",["pointerout","pointerover"]),dt("onPointerLeave",["pointerout","pointerover"]),La("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),La("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),La("onBeforeInput",["compositionend","keypress","textInput","paste"]),La("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),La("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),La("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hd="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(" "),zF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hd));function qO(s,c){c=(c&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],b=g.event;g=g.listeners;e:{var N=void 0;if(c)for(var z=g.length-1;0<=z;z--){var M=g[z],H=M.instance,ae=M.currentTarget;if(M=M.listener,H!==N&&b.isPropagationStopped())break e;N=M,b.currentTarget=ae;try{N(b)}catch(me){lp(me)}b.currentTarget=null,N=H}else for(z=0;z<g.length;z++){if(M=g[z],H=M.instance,ae=M.currentTarget,M=M.listener,H!==N&&b.isPropagationStopped())break e;N=M,b.currentTarget=ae;try{N(b)}catch(me){lp(me)}b.currentTarget=null,N=H}}}}function mt(s,c){var h=c[aa];h===void 0&&(h=c[aa]=new Set);var g=s+"__bubble";h.has(g)||(FO(c,s,2,!1),h.add(g))}function Xx(s,c,h){var g=0;c&&(g|=4),FO(h,s,g,c)}var Zp="_reactListening"+Math.random().toString(36).slice(2);function Jx(s){if(!s[Zp]){s[Zp]=!0,Io.forEach(function(h){h!=="selectionchange"&&(zF.has(h)||Xx(h,!1,s),Xx(h,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[Zp]||(c[Zp]=!0,Xx("selectionchange",!1,c))}}function FO(s,c,h,g){switch(vE(c)){case 2:var b=a9;break;case 8:b=s9;break;default:b=pb}h=b.bind(null,c,h,s),b=void 0,!x0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),g?b!==void 0?s.addEventListener(c,h,{capture:!0,passive:b}):s.addEventListener(c,h,!0):b!==void 0?s.addEventListener(c,h,{passive:b}):s.addEventListener(c,h,!1)}function eb(s,c,h,g,b){var N=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var z=g.tag;if(z===3||z===4){var M=g.stateNode.containerInfo;if(M===b)break;if(z===4)for(z=g.return;z!==null;){var H=z.tag;if((H===3||H===4)&&z.stateNode.containerInfo===b)return;z=z.return}for(;M!==null;){if(z=si(M),z===null)return;if(H=z.tag,H===5||H===6||H===26||H===27){g=N=z;continue e}M=M.parentNode}}g=g.return}ZC(function(){var ae=N,me=y0(h),be=[];e:{var se=S_.get(s);if(se!==void 0){var ue=ap,Re=s;switch(s){case"keypress":if(rp(h)===0)break e;case"keydown":case"keyup":ue=Nq;break;case"focusin":Re="focus",ue=j0;break;case"focusout":Re="blur",ue=j0;break;case"beforeblur":case"afterblur":ue=j0;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=QC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=fq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=_q;break;case v_:case x_:case b_:ue=mq;break;case w_:ue=Oq;break;case"scroll":case"scrollend":ue=uq;break;case"wheel":ue=zq;break;case"copy":case"cut":case"paste":ue=yq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=JC;break;case"toggle":case"beforetoggle":ue=Pq}var We=(c&4)!==0,It=!We&&(s==="scroll"||s==="scrollend"),X=We?se!==null?se+"Capture":null:se;We=[];for(var Y=ae,re;Y!==null;){var ve=Y;if(re=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||re===null||X===null||(ve=hd(Y,X),ve!=null&&We.push(Gd(Y,ve,re))),It)break;Y=Y.return}0<We.length&&(se=new ue(se,Re,null,h,me),be.push({event:se,listeners:We}))}}if((c&7)===0){e:{if(se=s==="mouseover"||s==="pointerover",ue=s==="mouseout"||s==="pointerout",se&&h!==g0&&(Re=h.relatedTarget||h.fromElement)&&(si(Re)||Re[wn]))break e;if((ue||se)&&(se=me.window===me?me:(se=me.ownerDocument)?se.defaultView||se.parentWindow:window,ue?(Re=h.relatedTarget||h.toElement,ue=ae,Re=Re?si(Re):null,Re!==null&&(It=a(Re),We=Re.tag,Re!==It||We!==5&&We!==27&&We!==6)&&(Re=null)):(ue=null,Re=ae),ue!==Re)){if(We=QC,ve="onMouseLeave",X="onMouseEnter",Y="mouse",(s==="pointerout"||s==="pointerover")&&(We=JC,ve="onPointerLeave",X="onPointerEnter",Y="pointer"),It=ue==null?se:Cs(ue),re=Re==null?se:Cs(Re),se=new We(ve,Y+"leave",ue,h,me),se.target=It,se.relatedTarget=re,ve=null,si(me)===ae&&(We=new We(X,Y+"enter",Re,h,me),We.target=re,We.relatedTarget=It,ve=We),It=ve,ue&&Re)t:{for(We=TF,X=ue,Y=Re,re=0,ve=X;ve;ve=We(ve))re++;ve=0;for(var Ke=Y;Ke;Ke=We(Ke))ve++;for(;0<re-ve;)X=We(X),re--;for(;0<ve-re;)Y=We(Y),ve--;for(;re--;){if(X===Y||Y!==null&&X===Y.alternate){We=X;break t}X=We(X),Y=We(Y)}We=null}else We=null;ue!==null&&KO(be,se,ue,We,!1),Re!==null&&It!==null&&KO(be,It,Re,We,!0)}}e:{if(se=ae?Cs(ae):window,ue=se.nodeName&&se.nodeName.toLowerCase(),ue==="select"||ue==="input"&&se.type==="file")var kt=o_;else if(a_(se))if(l_)kt=Fq;else{kt=Uq;var Be=Bq}else ue=se.nodeName,!ue||ue.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ae&&m0(ae.elementType)&&(kt=o_):kt=qq;if(kt&&(kt=kt(s,ae))){s_(be,kt,h,me);break e}Be&&Be(s,se,ae),s==="focusout"&&ae&&se.type==="number"&&ae.memoizedProps.value!=null&&p0(se,"number",se.value)}switch(Be=ae?Cs(ae):window,s){case"focusin":(a_(Be)||Be.contentEditable==="true")&&(dc=Be,O0=ae,wd=null);break;case"focusout":wd=O0=dc=null;break;case"mousedown":E0=!0;break;case"contextmenu":case"mouseup":case"dragend":E0=!1,g_(be,h,me);break;case"selectionchange":if(Hq)break;case"keydown":case"keyup":g_(be,h,me)}var lt;if(k0)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else uc?r_(s,h)&&(vt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(vt="onCompositionStart");vt&&(e_&&h.locale!=="ko"&&(uc||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&uc&&(lt=YC()):(As=me,b0="value"in As?As.value:As.textContent,uc=!0)),Be=Yp(ae,vt),0<Be.length&&(vt=new XC(vt,s,null,h,me),be.push({event:vt,listeners:Be}),lt?vt.data=lt:(lt=i_(h),lt!==null&&(vt.data=lt)))),(lt=Dq?Mq(s,h):Iq(s,h))&&(vt=Yp(ae,"onBeforeInput"),0<vt.length&&(Be=new XC("onBeforeInput","beforeinput",null,h,me),be.push({event:Be,listeners:vt}),Be.data=lt)),AF(be,s,ae,h,me)}qO(be,c)})}function Gd(s,c,h){return{instance:s,listener:c,currentTarget:h}}function Yp(s,c){for(var h=c+"Capture",g=[];s!==null;){var b=s,N=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||N===null||(b=hd(s,h),b!=null&&g.unshift(Gd(s,b,N)),b=hd(s,c),b!=null&&g.push(Gd(s,b,N))),s.tag===3)return g;s=s.return}return[]}function TF(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function KO(s,c,h,g,b){for(var N=c._reactName,z=[];h!==null&&h!==g;){var M=h,H=M.alternate,ae=M.stateNode;if(M=M.tag,H!==null&&H===g)break;M!==5&&M!==26&&M!==27||ae===null||(H=ae,b?(ae=hd(h,N),ae!=null&&z.unshift(Gd(h,ae,H))):b||(ae=hd(h,N),ae!=null&&z.push(Gd(h,ae,H)))),h=h.return}z.length!==0&&s.push({event:c,listeners:z})}var PF=/\r\n?/g,RF=/\u0000|\uFFFD/g;function HO(s){return(typeof s=="string"?s:""+s).replace(PF,`
9
+ `).replace(RF,"")}function GO(s,c){return c=HO(c),HO(s)===c}function Mt(s,c,h,g,b,N){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||oc(s,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&oc(s,""+g);break;case"className":Jh(s,"class",g);break;case"tabIndex":Jh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Jh(s,h,g);break;case"style":GC(s,g,N);break;case"data":if(c!=="object"){Jh(s,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=tp(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(h==="formAction"?(c!=="input"&&Mt(s,c,"name",b.name,b,null),Mt(s,c,"formEncType",b.formEncType,b,null),Mt(s,c,"formMethod",b.formMethod,b,null),Mt(s,c,"formTarget",b.formTarget,b,null)):(Mt(s,c,"encType",b.encType,b,null),Mt(s,c,"method",b.method,b,null),Mt(s,c,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=tp(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Ba);break;case"onScroll":g!=null&&mt("scroll",s);break;case"onScrollEnd":g!=null&&mt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=tp(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":mt("beforetoggle",s),mt("toggle",s),Lo(s,"popover",g);break;case"xlinkActuate":$a(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":$a(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":$a(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":$a(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":$a(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":$a(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":$a(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":$a(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":$a(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Lo(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=lq.get(h)||h,Lo(s,h,g))}}function tb(s,c,h,g,b,N){switch(h){case"style":GC(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?oc(s,g):(typeof g=="number"||typeof g=="bigint")&&oc(s,""+g);break;case"onScroll":g!=null&&mt("scroll",s);break;case"onScrollEnd":g!=null&&mt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ba);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xh.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),c=h.slice(2,b?h.length-7:void 0),N=s[jt]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(c,N,b),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(c,g,b);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Lo(s,h,g)}}}function Jn(s,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",s),mt("load",s);var g=!1,b=!1,N;for(N in h)if(h.hasOwnProperty(N)){var z=h[N];if(z!=null)switch(N){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Mt(s,c,N,z,h,null)}}b&&Mt(s,c,"srcSet",h.srcSet,h,null),g&&Mt(s,c,"src",h.src,h,null);return;case"input":mt("invalid",s);var M=N=z=b=null,H=null,ae=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":b=me;break;case"type":z=me;break;case"checked":H=me;break;case"defaultChecked":ae=me;break;case"value":N=me;break;case"defaultValue":M=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:Mt(s,c,g,me,h,null)}}qC(s,N,M,H,ae,z,b,!1);return;case"select":mt("invalid",s),g=z=N=null;for(b in h)if(h.hasOwnProperty(b)&&(M=h[b],M!=null))switch(b){case"value":N=M;break;case"defaultValue":z=M;break;case"multiple":g=M;default:Mt(s,c,b,M,h,null)}c=N,h=z,s.multiple=!!g,c!=null?sc(s,!!g,c,!1):h!=null&&sc(s,!!g,h,!0);return;case"textarea":mt("invalid",s),N=b=g=null;for(z in h)if(h.hasOwnProperty(z)&&(M=h[z],M!=null))switch(z){case"value":g=M;break;case"defaultValue":b=M;break;case"children":N=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:Mt(s,c,z,M,h,null)}KC(s,g,b,N);return;case"option":for(H in h)h.hasOwnProperty(H)&&(g=h[H],g!=null)&&(H==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":Mt(s,c,H,g,h,null));return;case"dialog":mt("beforetoggle",s),mt("toggle",s),mt("cancel",s),mt("close",s);break;case"iframe":case"object":mt("load",s);break;case"video":case"audio":for(g=0;g<Hd.length;g++)mt(Hd[g],s);break;case"image":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"embed":case"source":case"link":mt("error",s),mt("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)&&(g=h[ae],g!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Mt(s,c,ae,g,h,null)}return;default:if(m0(c)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&tb(s,c,me,g,h,void 0));return}}for(M in h)h.hasOwnProperty(M)&&(g=h[M],g!=null&&Mt(s,c,M,g,h,null))}function DF(s,c,h,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,N=null,z=null,M=null,H=null,ae=null,me=null;for(ue in h){var be=h[ue];if(h.hasOwnProperty(ue)&&be!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=be;default:g.hasOwnProperty(ue)||Mt(s,c,ue,null,g,be)}}for(var se in g){var ue=g[se];if(be=h[se],g.hasOwnProperty(se)&&(ue!=null||be!=null))switch(se){case"type":N=ue;break;case"name":b=ue;break;case"checked":ae=ue;break;case"defaultChecked":me=ue;break;case"value":z=ue;break;case"defaultValue":M=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,c));break;default:ue!==be&&Mt(s,c,se,ue,g,be)}}h0(s,z,M,H,ae,me,N,b);return;case"select":ue=z=M=se=null;for(N in h)if(H=h[N],h.hasOwnProperty(N)&&H!=null)switch(N){case"value":break;case"multiple":ue=H;default:g.hasOwnProperty(N)||Mt(s,c,N,null,g,H)}for(b in g)if(N=g[b],H=h[b],g.hasOwnProperty(b)&&(N!=null||H!=null))switch(b){case"value":se=N;break;case"defaultValue":M=N;break;case"multiple":z=N;default:N!==H&&Mt(s,c,b,N,g,H)}c=M,h=z,g=ue,se!=null?sc(s,!!h,se,!1):!!g!=!!h&&(c!=null?sc(s,!!h,c,!0):sc(s,!!h,h?[]:"",!1));return;case"textarea":ue=se=null;for(M in h)if(b=h[M],h.hasOwnProperty(M)&&b!=null&&!g.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Mt(s,c,M,null,g,b)}for(z in g)if(b=g[z],N=h[z],g.hasOwnProperty(z)&&(b!=null||N!=null))switch(z){case"value":se=b;break;case"defaultValue":ue=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==N&&Mt(s,c,z,b,g,N)}FC(s,se,ue);return;case"option":for(var Re in h)se=h[Re],h.hasOwnProperty(Re)&&se!=null&&!g.hasOwnProperty(Re)&&(Re==="selected"?s.selected=!1:Mt(s,c,Re,null,g,se));for(H in g)se=g[H],ue=h[H],g.hasOwnProperty(H)&&se!==ue&&(se!=null||ue!=null)&&(H==="selected"?s.selected=se&&typeof se!="function"&&typeof se!="symbol":Mt(s,c,H,se,g,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in h)se=h[We],h.hasOwnProperty(We)&&se!=null&&!g.hasOwnProperty(We)&&Mt(s,c,We,null,g,se);for(ae in g)if(se=g[ae],ue=h[ae],g.hasOwnProperty(ae)&&se!==ue&&(se!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,c));break;default:Mt(s,c,ae,se,g,ue)}return;default:if(m0(c)){for(var It in h)se=h[It],h.hasOwnProperty(It)&&se!==void 0&&!g.hasOwnProperty(It)&&tb(s,c,It,void 0,g,se);for(me in g)se=g[me],ue=h[me],!g.hasOwnProperty(me)||se===ue||se===void 0&&ue===void 0||tb(s,c,me,se,g,ue);return}}for(var X in h)se=h[X],h.hasOwnProperty(X)&&se!=null&&!g.hasOwnProperty(X)&&Mt(s,c,X,null,g,se);for(be in g)se=g[be],ue=h[be],!g.hasOwnProperty(be)||se===ue||se==null&&ue==null||Mt(s,c,be,se,g,ue)}function VO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MF(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var b=h[g],N=b.transferSize,z=b.initiatorType,M=b.duration;if(N&&M&&VO(z)){for(z=0,M=b.responseEnd,g+=1;g<h.length;g++){var H=h[g],ae=H.startTime;if(ae>M)break;var me=H.transferSize,be=H.initiatorType;me&&VO(be)&&(H=H.responseEnd,z+=me*(H<M?1:(M-ae)/(H-ae)))}if(--g,c+=8*(N+z)/(b.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var nb=null,rb=null;function Wp(s){return s.nodeType===9?s:s.ownerDocument}function ZO(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 YO(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function ib(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var ab=null;function IF(){var s=window.event;return s&&s.type==="popstate"?s===ab?!1:(ab=s,!0):(ab=null,!1)}var WO=typeof setTimeout=="function"?setTimeout:void 0,LF=typeof clearTimeout=="function"?clearTimeout:void 0,QO=typeof Promise=="function"?Promise:void 0,$F=typeof queueMicrotask=="function"?queueMicrotask:typeof QO<"u"?function(s){return QO.resolve(null).then(s).catch(BF)}:WO;function BF(s){setTimeout(function(){throw s})}function Hs(s){return s==="head"}function XO(s,c){var h=c,g=0;do{var b=h.nextSibling;if(s.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(b),Lc(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Vd(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Vd(h);for(var N=h.firstChild;N;){var z=N.nextSibling,M=N.nodeName;N[Mo]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=z}}else h==="body"&&Vd(s.ownerDocument.body);h=b}while(h);Lc(c)}function JO(s,c){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function sb(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":sb(h),sa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function UF(s,c,h,g){for(;s.nodeType===1;){var b=h;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Mo])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==b.rel||s.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||s.getAttribute("title")!==(b.title==null?null:b.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(b.src==null?null:b.src)||s.getAttribute("type")!==(b.type==null?null:b.type)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var N=b.name==null?null:""+b.name;if(b.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=mi(s.nextSibling),s===null)break}return null}function qF(s,c,h){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=mi(s.nextSibling),s===null))return null;return s}function eE(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=mi(s.nextSibling),s===null))return null;return s}function ob(s){return s.data==="$?"||s.data==="$~"}function lb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function FF(s,c){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||h.readyState!=="loading")c();else{var g=function(){c(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function mi(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var cb=null;function tE(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(c===0)return mi(s.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}s=s.nextSibling}return null}function nE(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return s;c--}else h!=="/$"&&h!=="/&"||c++}s=s.previousSibling}return null}function rE(s,c,h){switch(c=Wp(h),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Vd(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);sa(s)}var gi=new Map,iE=new Set;function Qp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ns=te.d;te.d={f:KF,r:HF,D:GF,C:VF,L:ZF,m:YF,X:QF,S:WF,M:XF};function KF(){var s=ns.f(),c=qp();return s||c}function HF(s){var c=$i(s);c!==null&&c.tag===5&&c.type==="form"?wA(c):ns.r(s)}var Dc=typeof document>"u"?null:document;function aE(s,c,h){var g=Dc;if(g&&typeof c=="string"&&c){var b=li(c);b='link[rel="'+s+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),iE.has(b)||(iE.add(b),s={rel:s,crossOrigin:h,href:c},g.querySelector(b)===null&&(c=g.createElement("link"),Jn(c,"link",s),cn(c),g.head.appendChild(c)))}}function GF(s){ns.D(s),aE("dns-prefetch",s,null)}function VF(s,c){ns.C(s,c),aE("preconnect",s,c)}function ZF(s,c,h){ns.L(s,c,h);var g=Dc;if(g&&s&&c){var b='link[rel="preload"][as="'+li(c)+'"]';c==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+li(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+li(h.imageSizes)+'"]')):b+='[href="'+li(s)+'"]';var N=b;switch(c){case"style":N=Mc(s);break;case"script":N=Ic(s)}gi.has(N)||(s=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),gi.set(N,s),g.querySelector(b)!==null||c==="style"&&g.querySelector(Zd(N))||c==="script"&&g.querySelector(Yd(N))||(c=g.createElement("link"),Jn(c,"link",s),cn(c),g.head.appendChild(c)))}}function YF(s,c){ns.m(s,c);var h=Dc;if(h&&s){var g=c&&typeof c.as=="string"?c.as:"script",b='link[rel="modulepreload"][as="'+li(g)+'"][href="'+li(s)+'"]',N=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Ic(s)}if(!gi.has(N)&&(s=m({rel:"modulepreload",href:s},c),gi.set(N,s),h.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Yd(N)))return}g=h.createElement("link"),Jn(g,"link",s),cn(g),h.head.appendChild(g)}}}function WF(s,c,h){ns.S(s,c,h);var g=Dc;if(g&&s){var b=_s(g).hoistableStyles,N=Mc(s);c=c||"default";var z=b.get(N);if(!z){var M={loading:0,preload:null};if(z=g.querySelector(Zd(N)))M.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":c},h),(h=gi.get(N))&&ub(s,h);var H=z=g.createElement("link");cn(H),Jn(H,"link",s),H._p=new Promise(function(ae,me){H.onload=ae,H.onerror=me}),H.addEventListener("load",function(){M.loading|=1}),H.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Xp(z,c,g)}z={type:"stylesheet",instance:z,count:1,state:M},b.set(N,z)}}}function QF(s,c){ns.X(s,c);var h=Dc;if(h&&s){var g=_s(h).hoistableScripts,b=Ic(s),N=g.get(b);N||(N=h.querySelector(Yd(b)),N||(s=m({src:s,async:!0},c),(c=gi.get(b))&&db(s,c),N=h.createElement("script"),cn(N),Jn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function XF(s,c){ns.M(s,c);var h=Dc;if(h&&s){var g=_s(h).hoistableScripts,b=Ic(s),N=g.get(b);N||(N=h.querySelector(Yd(b)),N||(s=m({src:s,async:!0,type:"module"},c),(c=gi.get(b))&&db(s,c),N=h.createElement("script"),cn(N),Jn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function sE(s,c,h,g){var b=(b=ne.current)?Qp(b):null;if(!b)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Mc(h.href),h=_s(b).hoistableStyles,g=h.get(c),g||(g={type:"style",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Mc(h.href);var N=_s(b).hoistableStyles,z=N.get(s);if(z||(b=b.ownerDocument||b,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,z),(N=b.querySelector(Zd(s)))&&!N._p&&(z.instance=N,z.state.loading=5),gi.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},gi.set(s,h),N||JF(b,s,h,z.state))),c&&g===null)throw Error(r(528,""));return z}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ic(h),h=_s(b).hoistableScripts,g=h.get(c),g||(g={type:"script",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Mc(s){return'href="'+li(s)+'"'}function Zd(s){return'link[rel="stylesheet"]['+s+"]"}function oE(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function JF(s,c,h,g){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=s.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),Jn(c,"link",h),cn(c),s.head.appendChild(c))}function Ic(s){return'[src="'+li(s)+'"]'}function Yd(s){return"script[async]"+s}function lE(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var g=s.querySelector('style[data-href~="'+li(h.href)+'"]');if(g)return c.instance=g,cn(g),g;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),cn(g),Jn(g,"style",b),Xp(g,h.precedence,s),c.instance=g;case"stylesheet":b=Mc(h.href);var N=s.querySelector(Zd(b));if(N)return c.state.loading|=4,c.instance=N,cn(N),N;g=oE(h),(b=gi.get(b))&&ub(g,b),N=(s.ownerDocument||s).createElement("link"),cn(N);var z=N;return z._p=new Promise(function(M,H){z.onload=M,z.onerror=H}),Jn(N,"link",g),c.state.loading|=4,Xp(N,h.precedence,s),c.instance=N;case"script":return N=Ic(h.src),(b=s.querySelector(Yd(N)))?(c.instance=b,cn(b),b):(g=h,(b=gi.get(N))&&(g=m({},h),db(g,b)),s=s.ownerDocument||s,b=s.createElement("script"),cn(b),Jn(b,"link",g),s.head.appendChild(b),c.instance=b);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,Xp(g,h.precedence,s));return c.instance}function Xp(s,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,N=b,z=0;z<g.length;z++){var M=g[z];if(M.dataset.precedence===c)N=M;else if(N!==b)break}N?N.parentNode.insertBefore(s,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(s,c.firstChild))}function ub(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function db(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Jp=null;function cE(s,c,h){if(Jp===null){var g=new Map,b=Jp=new Map;b.set(h,g)}else b=Jp,g=b.get(h),g||(g=new Map,b.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),b=0;b<h.length;b++){var N=h[b];if(!(N[Mo]||N[Xe]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var z=N.getAttribute(c)||"";z=s+z;var M=g.get(z);M?M.push(N):g.set(z,[N])}}return g}function uE(s,c,h){s=s.ownerDocument||s,s.head.insertBefore(h,c==="title"?s.querySelector("head > title"):null)}function e9(s,c,h){if(h===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function dE(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function t9(s,c,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=Mc(g.href),N=c.querySelector(Zd(b));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=em.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=N,cn(N);return}N=c.ownerDocument||c,g=oE(g),(b=gi.get(b))&&ub(g,b),N=N.createElement("link"),cn(N);var z=N;z._p=new Promise(function(M,H){z.onload=M,z.onerror=H}),Jn(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=em.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var fb=0;function n9(s,c){return s.stylesheets&&s.count===0&&nm(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&nm(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+c);0<s.imgBytes&&fb===0&&(fb=62500*MF());var b=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&nm(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>fb?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function em(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nm(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var tm=null;function nm(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,tm=new Map,c.forEach(r9,s),tm=null,em.call(s))}function r9(s,c){if(!(c.state.loading&4)){var h=tm.get(s);if(h)var g=h.get(null);else{h=new Map,tm.set(s,h);for(var b=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<b.length;N++){var z=b[N];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),g=z)}g&&h.set(null,g)}b=c.instance,z=b.getAttribute("data-precedence"),N=h.get(z)||g,N===g&&h.set(null,b),h.set(z,b),this.count++,g=em.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),N?N.parentNode.insertBefore(b,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(b,s.firstChild)),c.state.loading|=4}}var Wd={$$typeof:_,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function i9(s,c,h,g,b,N,z,M,H){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=js(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=js(0),this.hiddenUpdates=js(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=N,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function fE(s,c,h,g,b,N,z,M,H,ae,me,be){return s=new i9(s,c,h,z,H,ae,me,be,M),c=1,N===!0&&(c|=24),N=Gr(3,null,null,c),s.current=N,N.stateNode=s,c=H0(),c.refCount++,s.pooledCache=c,c.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:c},Y0(N),s}function hE(s){return s?(s=pc,s):pc}function pE(s,c,h,g,b,N){b=hE(b),g.context===null?g.context=b:g.pendingContext=b,g=Rs(c),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ds(s,g,c),h!==null&&(Rr(h,s,c),Ad(h,s,c))}function mE(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<c?h:c}}function hb(s,c){mE(s,c),(s=s.alternate)&&mE(s,c)}function gE(s){if(s.tag===13||s.tag===31){var c=qo(s,67108864);c!==null&&Rr(c,s,67108864),hb(s,67108864)}}function yE(s){if(s.tag===13||s.tag===31){var c=Qr();c=ud(c);var h=qo(s,c);h!==null&&Rr(h,s,c),hb(s,c)}}var rm=!0;function a9(s,c,h,g){var b=K.T;K.T=null;var N=te.p;try{te.p=2,pb(s,c,h,g)}finally{te.p=N,K.T=b}}function s9(s,c,h,g){var b=K.T;K.T=null;var N=te.p;try{te.p=8,pb(s,c,h,g)}finally{te.p=N,K.T=b}}function pb(s,c,h,g){if(rm){var b=mb(g);if(b===null)eb(s,c,g,im,h),xE(s,g);else if(l9(b,s,c,h,g))g.stopPropagation();else if(xE(s,g),c&4&&-1<o9.indexOf(s)){for(;b!==null;){var N=$i(b);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var z=bn(N.pendingLanes);if(z!==0){var M=N;for(M.pendingLanes|=2,M.entangledLanes|=2;z;){var H=1<<31-de(z);M.entanglements[1]|=H,z&=~H}ua(N),(At&6)===0&&(Bp=et()+500,Kd(0))}}break;case 31:case 13:M=qo(N,2),M!==null&&Rr(M,N,2),qp(),hb(N,2)}if(N=mb(g),N===null&&eb(s,c,g,im,h),N===b)break;b=N}b!==null&&g.stopPropagation()}else eb(s,c,g,null,h)}}function mb(s){return s=y0(s),gb(s)}var im=null;function gb(s){if(im=null,s=si(s),s!==null){var c=a(s);if(c===null)s=null;else{var h=c.tag;if(h===13){if(s=o(c),s!==null)return s;s=null}else if(h===31){if(s=u(c),s!==null)return s;s=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return im=s,null}function vE(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(St()){case ce:return 2;case Ne:return 8;case De:case Ge:return 32;case ht:return 268435456;default:return 32}default:return 32}}var yb=!1,Gs=null,Vs=null,Zs=null,Qd=new Map,Xd=new Map,Ys=[],o9="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 xE(s,c){switch(s){case"focusin":case"focusout":Gs=null;break;case"dragenter":case"dragleave":Vs=null;break;case"mouseover":case"mouseout":Zs=null;break;case"pointerover":case"pointerout":Qd.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xd.delete(c.pointerId)}}function Jd(s,c,h,g,b,N){return s===null||s.nativeEvent!==N?(s={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[b]},c!==null&&(c=$i(c),c!==null&&gE(c)),s):(s.eventSystemFlags|=g,c=s.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),s)}function l9(s,c,h,g,b){switch(c){case"focusin":return Gs=Jd(Gs,s,c,h,g,b),!0;case"dragenter":return Vs=Jd(Vs,s,c,h,g,b),!0;case"mouseover":return Zs=Jd(Zs,s,c,h,g,b),!0;case"pointerover":var N=b.pointerId;return Qd.set(N,Jd(Qd.get(N)||null,s,c,h,g,b)),!0;case"gotpointercapture":return N=b.pointerId,Xd.set(N,Jd(Xd.get(N)||null,s,c,h,g,b)),!0}return!1}function bE(s){var c=si(s.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=o(h),c!==null){s.blockedOn=c,Z(s.priority,function(){yE(h)});return}}else if(c===31){if(c=u(h),c!==null){s.blockedOn=c,Z(s.priority,function(){yE(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function am(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var h=mb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);g0=g,h.target.dispatchEvent(g),g0=null}else return c=$i(h),c!==null&&gE(c),s.blockedOn=h,!1;c.shift()}return!0}function wE(s,c,h){am(s)&&h.delete(c)}function c9(){yb=!1,Gs!==null&&am(Gs)&&(Gs=null),Vs!==null&&am(Vs)&&(Vs=null),Zs!==null&&am(Zs)&&(Zs=null),Qd.forEach(wE),Xd.forEach(wE)}function sm(s,c){s.blockedOn===c&&(s.blockedOn=null,yb||(yb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,c9)))}var om=null;function SE(s){om!==s&&(om=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){om===s&&(om=null);for(var c=0;c<s.length;c+=3){var h=s[c],g=s[c+1],b=s[c+2];if(typeof g!="function"){if(gb(g||h)===null)continue;break}var N=$i(h);N!==null&&(s.splice(c,3),c-=3,mx(N,{pending:!0,data:b,method:h.method,action:g},g,b))}}))}function Lc(s){function c(H){return sm(H,s)}Gs!==null&&sm(Gs,s),Vs!==null&&sm(Vs,s),Zs!==null&&sm(Zs,s),Qd.forEach(c),Xd.forEach(c);for(var h=0;h<Ys.length;h++){var g=Ys[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Ys.length&&(h=Ys[0],h.blockedOn===null);)bE(h),h.blockedOn===null&&Ys.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var b=h[g],N=h[g+1],z=b[jt]||null;if(typeof N=="function")z||SE(h);else if(z){var M=null;if(N&&N.hasAttribute("formAction")){if(b=N,z=N[jt]||null)M=z.formAction;else if(gb(b)!==null)continue}else M=z.action;typeof M=="function"?h[g+1]=M:(h.splice(g,3),g-=3),SE(h)}}}function jE(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(z){return b=z})},focusReset:"manual",scroll:"manual"})}function c(){b!==null&&(b(),b=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),b!==null&&(b(),b=null)}}}function vb(s){this._internalRoot=s}lm.prototype.render=vb.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,g=Qr();pE(h,g,s,c,null,null)},lm.prototype.unmount=vb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;pE(s.current,2,null,s,null,null),qp(),c[wn]=null}};function lm(s){this._internalRoot=s}lm.prototype.unstable_scheduleHydration=function(s){if(s){var c=fd();s={blockedOn:null,target:s,priority:c};for(var h=0;h<Ys.length&&c!==0&&c<Ys[h].priority;h++);Ys.splice(h,0,s),h===0&&bE(s)}};var NE=t.version;if(NE!=="19.2.4")throw Error(r(527,NE,"19.2.4"));te.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(c),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var u9={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cm.isDisabled&&cm.supportsFiber)try{ln=cm.inject(u9),Ye=cm}catch{}}return tf.createRoot=function(s,c){if(!i(s))throw Error(r(299));var h=!1,g="",b=zA,N=TA,z=PA;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError)),c=fE(s,1,!1,null,null,h,g,null,b,N,z,jE),s[wn]=c.current,Jx(s),new vb(c)},tf.hydrateRoot=function(s,c,h){if(!i(s))throw Error(r(299));var g=!1,b="",N=zA,z=TA,M=PA,H=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(M=h.onRecoverableError),h.formState!==void 0&&(H=h.formState)),c=fE(s,1,!0,c,h??null,g,b,H,N,z,M,jE),c.context=hE(null),h=c.current,g=Qr(),g=ud(g),b=Rs(g),b.callback=null,Ds(h,b,g),h=g,c.current.lanes=h,Ns(c,h),ua(c),s[wn]=c.current,Jx(s),new lm(c)},tf.version="19.2.4",tf}var RE;function b9(){if(RE)return wb.exports;RE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wb.exports=x9(),wb.exports}var w9=b9(),Vl=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(){}},S9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},j9=class{#t=S9;#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)}},hl=new j9;function N9(e){setTimeout(e,0)}var Tl=typeof window>"u"||"Deno"in globalThis;function cr(){}function k9(e,t){return typeof e=="function"?e(t):e}function HS(e){return typeof e=="number"&&e>=0&&e!==1/0}function cI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function go(e,t){return typeof e=="function"?e(t):e}function wi(e,t){return typeof e=="function"?e(t):e}function DE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==Mj(o,t.options))return!1}else if(!qf(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function ME(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Pl(t.options.mutationKey)!==Pl(a))return!1}else if(!qf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Mj(e,t){return(t?.queryKeyHashFn||Pl)(e)}function Pl(e){return JSON.stringify(e,(t,n)=>GS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>qf(e[n],t[n])):!1}var C9=Object.prototype.hasOwnProperty;function Ij(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=IE(e)&&IE(t);if(!r&&!(GS(e)&&GS(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:C9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const w=Ij(y,v,n+1);d[m]=w,w===y&&f++}return a===u&&f===a?e:d}function Ff(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 IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function GS(e){if(!LE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!LE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function LE(e){return Object.prototype.toString.call(e)==="[object Object]"}function _9(e){return new Promise(t=>{hl.setTimeout(t,e)})}function VS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ij(e,t):t}function A9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Lj=Symbol();function uI(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Lj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $j(e,t){return typeof e=="function"?e(...t):!!e}function E9(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 z9=class extends Vl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Tl&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Bj=new z9;function ZS(){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 T9=N9;function P9(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=T9;const a=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var vn=P9(),R9=class extends Vl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Tl&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},xg=new R9;function D9(e){return Math.min(1e3*2**e,3e4)}function dI(e){return(e??"online")==="online"?xg.isOnline():!0}var YS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function fI(e){let t=!1,n=0,r;const i=ZS(),a=()=>i.status!=="pending",o=S=>{if(!a()){const j=new YS(S);y(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Bj.isFocused()&&(e.networkMode==="always"||xg.isOnline())&&e.canRun(),p=()=>dI(e.networkMode)&&e.canRun(),m=S=>{a()||(r?.(),i.resolve(S))},y=S=>{a()||(r?.(),i.reject(S))},v=()=>new Promise(S=>{r=j=>{(a()||f())&&S(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),w=()=>{if(a())return;let S;const j=n===0?e.initialPromise:void 0;try{S=j??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(m).catch(k=>{if(a())return;const O=e.retry??(Tl?0:3),_=e.retryDelay??D9,C=typeof _=="function"?_(n,k):_,T=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,k);if(t||!T){y(k);return}n++,e.onFail?.(n,k),_9(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var hI=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),HS(this.gcTime)&&(this.#t=hl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(hl.clearTimeout(this.#t),this.#t=void 0)}},M9=class extends hI{#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=BE(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=BE(this.options);t.data!==void 0&&(this.setState($E(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=VS(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(cr).catch(cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>wi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>go(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:!cI(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=uI(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(u,f,this):u(f)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=fI({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof YS&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof YS){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...pI(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...$E(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),vn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function pI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $E(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function BE(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 Uj=class extends Vl{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=ZS(),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),UE(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return WS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return WS(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#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 wi(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&&!Ff(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&qE(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||wi(this.options.enabled,this.#e)!==wi(t.enabled,this.#e)||go(this.options.staleTime,this.#e)!==go(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||wi(this.options.enabled,this.#e)!==wi(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 L9(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(cr)),t}#g(){this.#b();const e=go(this.options.staleTime,this.#e);if(Tl||this.#i.isStale||!HS(e))return;const n=cI(this.#i.dataUpdatedAt,e)+1;this.#c=hl.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,!(Tl||wi(this.options.enabled,this.#e)===!1||!HS(this.#l)||this.#l===0)&&(this.#u=hl.setInterval(()=>{(this.options.refetchIntervalInBackground||Bj.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(hl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(hl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const P=this.hasListeners(),$=!P&&UE(e,t),F=P&&qE(e,n,t,r);($||F)&&(p={...p,...pI(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&S==="pending"){let P;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(P=i.data,j=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,P!==void 0&&(S="success",y=VS(i?.data,P,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=VS(i?.data,y,t),this.#d=y,this.#s=null}catch(P){this.#s=P}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),S="error");const k=p.fetchStatus==="fetching",O=S==="pending",_=S==="error",C=O&&k,T=y!==void 0,A={status:S,fetchStatus:p.fetchStatus,isPending:O,isSuccess:S==="success",isError:_,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:_&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&T,isStale:qj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:wi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=A.data!==void 0,$=A.status==="error"&&!P,F=V=>{$?V.reject(A.error):P&&V.resolve(A.data)},U=()=>{const V=this.#o=A.promise=ZS();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||A.data!==B.value)&&U();break;case"rejected":(!$||A.error!==B.reason)&&U();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),Ff(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&a.has(u)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#j(e){vn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function I9(e,t){return wi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function UE(e,t){return I9(e,t)||e.state.data!==void 0&&WS(e,t,t.refetchOnMount)}function WS(e,t,n){if(wi(t.enabled,e)!==!1&&go(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&qj(e,t)}return!1}function qE(e,t,n,r){return(e!==t||wi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&qj(e,n)}function qj(e,t){return wi(t.enabled,e)!==!1&&e.isStaleByTime(go(t.staleTime,e))}function L9(e,t){return!Ff(e.getCurrentResult(),t)}function FE(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{E9(w,()=>t.signal,()=>p=!0)},y=uI(t.options,t.fetchOptions),v=async(w,S,j)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const O=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return m(E),E})(),_=await y(O),{maxPages:C}=t.options,T=j?O9:A9;return{pages:T(w.pages,_,C),pageParams:T(w.pageParams,S,C)}};if(i&&a.length){const w=i==="backward",S=w?$9:KE,j={pages:a,pageParams:o},k=S(r,j);u=await v(j,k,w)}else{const w=e??a.length;do{const S=d===0?o[0]??r.initialPageParam:KE(r,u);if(d>0&&S==null)break;u=await v(u,S),d++}while(d<w)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function KE(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 $9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var B9=class extends hI{#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||mI(),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=fI({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),vn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function mI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gI=class extends Vl{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 B9({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=um(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=um(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=um(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=um(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){vn.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=>ME(t,n))}findAll(e={}){return this.getAll().filter(t=>ME(e,t))}notify(e){vn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return vn.batch(()=>Promise.all(e.map(t=>t.continue().catch(cr))))}};function um(e){return e.options.scope?.id}var U9=class extends Vl{#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),Ff(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Pl(n.mutationKey)!==Pl(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??mI();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){vn.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 HE(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function q9(e,t,n){const r=e.slice(0);return r[t]=n,r}var F9=class extends Vl{#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,vn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=o||u,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!Ff(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(HE(n,i).forEach(p=>{p.destroy()}),HE(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=Ij(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 Uj(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=q9(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&&vn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},K9=class extends Vl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??Mj(r,t);let a=this.get(i);return a||(a=new M9({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(){vn.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=>DE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>DE(e,n)):t}notify(e){vn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){vn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},H9=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new K9,this.#e=e.mutationCache||new gI,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Bj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=xg.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(go(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=k9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return vn.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;vn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return vn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=vn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(cr).catch(cr)}invalidateQueries(e,t={}){return vn.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=vn.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(cr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(cr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(go(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cr).catch(cr)}fetchInfiniteQuery(e){return e.behavior=FE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cr).catch(cr)}ensureInfiniteQueryData(e){return e.behavior=FE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xg.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(Pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{qf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{qf(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=Mj(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===Lj&&(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()}},yI=x.createContext(void 0),Pi=e=>{const t=x.useContext(yI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G9=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(yI.Provider,{value:e,children:t})),vI=x.createContext(!1),xI=()=>x.useContext(vI);vI.Provider;function V9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Z9=x.createContext(V9()),bI=()=>x.useContext(Z9),wI=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?$j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SI=e=>{x.useEffect(()=>{e.clearReset()},[e])},jI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||$j(n,[e.error,r])),NI=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))}},Y9=(e,t)=>e.isLoading&&e.isFetching&&!t,QS=(e,t)=>e?.suspense&&t.isPending,XS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kI({queries:e,...t},n){const r=Pi(),i=xI(),a=bI(),o=x.useMemo(()=>e.map(S=>{const j=r.defaultQueryOptions(S);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(S=>{NI(S);const j=r.getQueryCache().get(S.queryHash);wI(S,a,j)}),SI(a);const[u]=x.useState(()=>new F9(r,o,t)),[d,f,p]=u.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(S=>m?u.subscribe(vn.batchCalls(S)):cr,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const v=d.some((S,j)=>QS(o[j],S))?d.flatMap((S,j)=>{const k=o[j];if(k&&QS(k,S)){const O=new Uj(r,k);return XS(k,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((S,j)=>{const k=o[j];return k&&jI({result:S,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return f(p())}function W9(e,t,n){const r=xI(),i=bI(),a=Pi(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",NI(o),wI(o,i,u),SI(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(y=>{const v=m?f.subscribe(vn.batchCalls(y)):cr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),QS(o,p))throw XS(o,f,i);if(jI({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Tl&&Y9(p,r)&&(d?XS(o,f,i):u?.promise)?.catch(cr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function Sa(e,t){return W9(e,Uj)}function xh(e,t){const n=Pi(),[r]=x.useState(()=>new U9(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(vn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,u)=>{r.mutate(o,u).catch(cr)},[r]);if(i.error&&$j(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var dm=typeof window<"u"?x.useLayoutEffect:x.useEffect;function kb(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 Q9(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 X9(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var J9=!1;function Kf(e){return e[e.length-1]}function eK(e){return typeof e=="function"}function lo(e,t){return eK(e)?e(t):e}var tK=Object.prototype.hasOwnProperty,GE=Object.prototype.propertyIsEnumerable,nK=()=>Object.create(null),tl=(e,t)=>pl(e,t,nK);function pl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=YE(e)&&YE(i);if(!a&&!(bg(e)&&bg(i)))return i;const o=a?e:VE(e);if(!o)return i;const u=a?i:VE(i);if(!u)return i;const d=o.length,f=u.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:u[y],w=e[v],S=i[v];if(w===S){p[v]=w,(a?y<d:tK.call(e,v))&&m++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){p[v]=S;continue}const j=pl(w,S,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function VE(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!GE.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(!GE.call(e,i))return!1;r.push(i)}return r}function bg(e){if(!ZE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZE(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZE(e){return Object.prototype.toString.call(e)==="[object Object]"}function YE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Nl(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(!Nl(e[r],t[r],n))return!1;return!0}if(bg(e)&&bg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!Nl(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||!Nl(e[o],t[o],n)))return!1;return i===a}return!1}function ku(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 Hf(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function rK(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function WE(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return rK(t)}var iK=["http:","https:","mailto:","tel:"];function wg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function nf(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=WE(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+WE(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function aK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Sg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=o,i(u);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var sK="Invariant failed";function jo(e,t){if(!e)throw new Error(sK)}var ml=4,CI=5;function oK(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 Fj(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const o=oK(a);if(o){const[u,d]=o,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Ky(e,t,n,r,i,a,o){o?.(n);let u=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;u<f;){const v=Fj(d,u,t);let w;const S=u,j=v[5];switch(u=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const O=i.static?.get(k);if(O)w=O;else{i.static??=new Map;const _=gl(n.fullPath??n.from);_.parent=i,_.depth=a,w=_,i.static.set(k,_)}}else{const O=k.toLowerCase(),_=i.staticInsensitive?.get(O);if(_)w=_;else{i.staticInsensitive??=new Map;const C=gl(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.staticInsensitive.set(O,C)}}break}case 1:{const k=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=!m&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===T);if(E)w=E;else{const A=_b(1,n.fullPath??n.from,_,C,T);w=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case 3:{const k=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=!m&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===T);if(E)w=E;else{const A=_b(3,n.fullPath??n.from,_,C,T);w=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case 2:{const k=d.substring(S,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,E=_b(2,n.fullPath??n.from,_,C,T);w=E,E.parent=i,E.depth=a,i.wildcard??=[],i.wildcard.push(E)}}i=w}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=gl(n.fullPath??n.from);v.kind=CI,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=gl(n.fullPath??n.from);v.kind=ml,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Ky(e,t,d,u,i,a,o)}function Cb(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 no(e){if(e.pathless)for(const t of e.pathless)no(t);if(e.static)for(const t of e.static.values())no(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())no(t);if(e.dynamic?.length){e.dynamic.sort(Cb);for(const t of e.dynamic)no(t)}if(e.optional?.length){e.optional.sort(Cb);for(const t of e.optional)no(t)}if(e.wildcard?.length){e.wildcard.sort(Cb);for(const t of e.wildcard)no(t)}}function gl(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 _b(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 lK(e,t){const n=gl("/"),r=new Uint16Array(6);for(const i of e)Ky(!1,r,i,1,n,0);no(n),t.masksTree=n,t.flatCache=Sg(1e3)}function cK(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Kj(e,t.masksTree);return t.flatCache.set(e,r),r}function uK(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=gl("/"),Ky(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Kj(r,o,n)}function dK(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=Kj(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=pK(a.route)),t.matchCache.set(r,a),a}function fK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function hK(e,t=!1,n){const r=gl(e.fullPath),i=new Uint16Array(6),a={},o={};let u=0;return Ky(t,i,e,1,r,0,d=>{if(n?.(d,u),jo(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=fK(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}u++}),no(r),{processedTree:{segmentTree:r,singleCache:Sg(1e3),matchCache:Sg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Kj(e,t,n=!1){const r=e.split("/"),i=gK(e,r,t,n);if(!i)return null;const[a]=_I(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function _I(e,t,n){const r=mK(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;o++,u++,d++,f++){const p=r[u];if(p.kind===ml)break;if(p.kind===CI){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const S=p.suffix?.length??0,j=v.substring(w+2,v.length-S-1),k=m.substring(w,m.length-S);a[j]=decodeURIComponent(k)}else{const S=v.substring(1);a[S]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,S=p.suffix?.length??0,j=v.substring(w+3,v.length-S-1),k=p.suffix||p.prefix?m.substring(w,m.length-S):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);a["*"]=S,a._splat=S;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:u,path:d,segment:f}]}function pK(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mK(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function gK(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Kf(t),a=i&&e!=="/",o=t.length-(i?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;u.length;){const m=u.pop(),{node:y,index:v,skipped:w,depth:S,statics:j,dynamics:k,optionals:O}=m;let{extract:_,rawParams:C,parsedParams:T}=m;if(y.skipOnParamError){if(!Ab(e,t,m))continue;C=m.rawParams,_=m.extract,T=m.parsedParams}r&&y.route&&y.kind!==ml&&rf(f,m)&&(f=m);const E=v===o;if(E&&(y.route&&!a&&rf(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const A=E?void 0:t[v];let P;if(E&&y.index){const $={node:y.index,index:v,skipped:w,depth:S+1,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T};let F=!0;if(y.index.skipOnParamError&&(Ab(e,t,$)||(F=!1)),F){if(j===o&&!k&&!O&&!w)return $;rf(p,$)&&(p=$)}}if(y.wildcard&&rf(d,m))for(const $ of y.wildcard){const{prefix:F,suffix:U}=$;if(F&&(E||!($.caseSensitive?A:P??=A.toLowerCase()).startsWith(F)))continue;if(U){if(E)continue;const V=t.slice(v).join("/").slice(-U.length);if(($.caseSensitive?V:V.toLowerCase())!==U)continue}const B={node:$,index:o,skipped:w,depth:S,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T};if(!($.skipOnParamError&&!Ab(e,t,B))){d=B;break}}if(y.optional){const $=w|1<<S,F=S+1;for(let U=y.optional.length-1;U>=0;U--){const B=y.optional[U];u.push({node:B,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E)for(let U=y.optional.length-1;U>=0;U--){const B=y.optional[U],{prefix:V,suffix:ee}=B;if(V||ee){const Q=B.caseSensitive?A:P??=A.toLowerCase();if(V&&!Q.startsWith(V)||ee&&!Q.endsWith(ee))continue}u.push({node:B,index:v+1,skipped:w,depth:F,statics:j,dynamics:k,optionals:O+1,extract:_,rawParams:C,parsedParams:T})}}if(!E&&y.dynamic&&A)for(let $=y.dynamic.length-1;$>=0;$--){const F=y.dynamic[$],{prefix:U,suffix:B}=F;if(U||B){const V=F.caseSensitive?A:P??=A.toLowerCase();if(U&&!V.startsWith(U)||B&&!V.endsWith(B))continue}u.push({node:F,index:v+1,skipped:w,depth:S+1,statics:j,dynamics:k+1,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E&&y.staticInsensitive){const $=y.staticInsensitive.get(P??=A.toLowerCase());$&&u.push({node:$,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(!E&&y.static){const $=y.static.get(A);$&&u.push({node:$,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T})}if(y.pathless){const $=S+1;for(let F=y.pathless.length-1;F>=0;F--){const U=y.pathless[F];u.push({node:U,index:v,skipped:w,depth:$,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:T})}}}if(p&&d)return rf(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function Ab(e,t,n){try{const[r,i]=_I(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 rf(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===ml)>(e.node.kind===ml)||t.node.kind===ml==(e.node.kind===ml)&&t.depth>e.depth))):!0}function ng(e){return Hj(e.filter(t=>t!==void 0).join("/"))}function Hj(e){return e.replace(/\/{2,}/g,"/")}function AI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function yo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function OI(e){return yo(AI(e))}function jg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function yK(e,t,n){return jg(e,n)===jg(t,n)}function vK({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&Kf(u)==="";)u.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&u.push(w):u=[w]:w===".."?u.pop():w==="."||u.push(w)}}u.length>1&&(Kf(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const y=u[m];if(!y)continue;d=Fj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const w=d[5],S=y.substring(0,d[1]),j=y.substring(d[4],w),k=y.substring(d[2],d[3]);v===1?f+=S||j?`${S}{$${k}}${j}`:`$${k}`:v===2?f+=S||j?`${S}{$}${j}`:"$":f+=`${S}{-$${k}}${j}`}f=Hj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function xK(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 Ob(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=>XE(i,n)).join("/"):XE(r,n)}function QE({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let u=0,d,f="";for(;u<o;){const p=u;d=Fj(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),S=e.substring(d[4],m);if(!v){i=!0,(w||S)&&(f+="/"+w+S);continue}const j=Ob("_splat",t,n);f+="/"+w+j+S;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const w=e.substring(p,d[1]),S=e.substring(d[4],m),j=Ob(v,t,n)??"undefined";f+="/"+w+j+S;continue}if(y===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const S=e.substring(p,d[1]),j=e.substring(d[4],m),k=Ob(v,t,n)??"";f+="/"+S+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function XE(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function wr(e){return!!e?.isNotFound}function bK(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var JS="tsr-scroll-restoration-v1_3",wK=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function SK(){const e=bK();if(!e)return null;const t=e.getItem(JS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=lo(r,n)||n;try{e.setItem(JS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var fm=SK(),jK=e=>e.state.__TSR_key||e.href;function NK(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var Ng=!1;function kK({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=o[u];Ng=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}Ng=!1}function CK(e,t){if(!fm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!fm))return;e.isScrollRestorationSetup=!0,Ng=!1;const n=e.options.getScrollRestorationKey||jK;window.history.scrollRestoration="manual";const r=i=>{if(Ng||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=NK(i.target)}const o=n(e.state.location);fm.set(u=>{const d=u[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",wK(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})||(kK({storageKey:JS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&fm.set(o=>(o[a]||={},o)))})}function _K(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 AK(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 Eb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function OK(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]=Eb(i):Array.isArray(a)?a.push(Eb(i)):n[r]=[a,Eb(i)]}return n}var EK=TK(JSON.parse),zK=PK(JSON.stringify,JSON.parse);function TK(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=OK(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function PK(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=AK(i,r);return a?`?${a}`:""}}var kl="__root__";function Gj(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 Mr(e){return e instanceof Response&&!!e.options}function RK(e){return{input:({url:t})=>{for(const n of e)t=e1(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=EI(e[n],t);return t}}}function DK(e){const t=OI(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===i?o.pathname="/":u.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=ng(["/",t,o.pathname]),o)}}function e1(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 EI(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}var nn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(nn||{});function zI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:u};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===m&&w.sub===p)return;const S=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:p.deps=S,w!==void 0?w.nextSub=S:f.subs=S}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,w=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=S:m.subsTail=S,S!==void 0?S.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const S=(f=w).nextSub;S!==void 0&&(m={value:p,prev:m},p=S);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const w=f.dep,S=w.flags;if(p.flags&16)v=!0;else if((S&17)===17){if(e(w)){const j=w.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=w.deps,p=w,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&u(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const O=f.nextDep;if(O!==void 0){f=O;continue e}}return v}while(!0)}function u(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let Vj=0,nl=0,zf=0;const as=[],{link:GCe,unlink:TI,propagate:VCe,checkDirty:MK,shallowPropagate:ZCe}=zI({update(e){return e.depsTail!==void 0?BK(e):UK(e)},notify(e){let t=zf,n=t;do if(as[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(zf=t;n<--t;){const r=as[n];as[n++]=as[t],as[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Hy(e)):KK.call(e)}});function IK(){return Vj}function LK(){++Vj}function $K(){--Vj||FK()}function BK(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Hy(e)}}function UK(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function qK(e){const t=e.flags;if(t&16||t&32&&MK(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Hy(e)}}else e.flags=2}function FK(){try{for(;nl<zf;){const e=as[nl];as[nl++]=void 0,qK(e)}}finally{for(;nl<zf;){const e=as[nl];as[nl++]=void 0,e.flags|=10}nl=0,zf=0}}function KK(){this.depsTail=void 0,this.flags=0,Hy(this);const e=this.subs;e!==void 0&&TI(e)}function Hy(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=TI(n,e)}function Zj(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 t1=[];let rg=0;const{link:JE,unlink:HK,propagate:GK,checkDirty:PI,shallowPropagate:e2}=zI({update(e){return e._update()},notify(e){t1[n1++]=e,e.flags&=~nn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=nn.Mutable|nn.Dirty,kg(e))}});let hm=0,n1=0,ga;function kg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=HK(n,e)}function RI(){if(!(IK()>0)){for(;hm<n1;){const e=t1[hm];t1[hm++]=void 0,e.notify()}hm=0,n1=0}}function DI(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?nn.None:nn.Mutable,get(){return ga!==void 0&&JE(i,ga,rg),i._snapshot},subscribe(a){const o=Zj(a),u={current:!1},d=VK(()=>{i.get(),u.current?o.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=ga,u=Object.is;if(n)ga=i,++rg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=nn.Mutable|nn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,f)?(i._snapshot=f,!0):!1}finally{ga=o,n&&(i.flags&=~nn.RecursedCheck),kg(i)}}};return n?(i.flags=nn.Mutable|nn.Dirty,i.get=function(){const a=i.flags;if(a&nn.Dirty||a&nn.Pending&&PI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&e2(o)}}else a&nn.Pending&&(i.flags=a&~nn.Pending);return ga!==void 0&&JE(i,ga,rg),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(GK(o),e2(o),RI())}},i}function VK(e){const t=()=>{const r=ga;ga=n,++rg,n.depsTail=void 0,n.flags=nn.Watching|nn.RecursedCheck;try{return e()}finally{ga=r,n.flags&=~nn.RecursedCheck,kg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:nn.Watching|nn.RecursedCheck,notify(){const r=this.flags;r&nn.Dirty||r&nn.Pending&&PI(this.deps,this)?t():this.flags=nn.Watching},stop(){this.flags=nn.None,this.depsTail=void 0,kg(this)}};return t(),n}class ZK{constructor(t){this.atom=DI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Zj(t))}}class YK{constructor(t){this.atom=DI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Zj(t))}}function WK(e){return typeof e=="function"?new YK(e):new ZK(e)}function QK(e){try{LK(),e()}finally{$K(),RI()}}function Tf(e){let t;return QK(()=>{t=e()}),t}var r1=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Gy=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Cl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const u=e.router.getMatch(o.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},t2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const u=e.matches[o];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return o}return n?a:i},co=(e,t,n)=>{if(!(!Mr(n)&&!wr(n)))throw Mr(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:Mr(n)?"redirected":r.status==="pending"?"success":r.status,context:Cl(e,t.index),isFetching:!1,error:n})),wr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Mr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},MI=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},n2=(e,t,n)=>{const r=Cl(e,n);e.updateMatch(t,i=>({...i,context:r}))},af=(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,co(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(u){n=u,co(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Mr(n)&&!wr(n)&&(e.serialError??=n)},II=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Gy(e,t)&&(n.options.loader||n.options.beforeLoad||$I(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{r1(e)},i);r._nonReactive.pendingTimeout=a}},XK=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;II(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&co(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},JK=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ku(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:u}=i;o&&af(e,n,o,"PARSE_PARAMS"),u&&af(e,n,u,"VALIDATE_SEARCH"),II(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){Tf(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=ku();const y={...Cl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:S}=i,j=Gy(e,t),k={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=C=>{if(C===void 0){Tf(()=>{p(),m()});return}(Mr(C)||wr(C))&&(p(),af(e,n,C,"BEFORE_LOAD")),Tf(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:C})),m()})};let _;try{if(_=r.options.beforeLoad(k),Hf(_))return p(),_.catch(C=>{af(e,n,C,"BEFORE_LOAD")}).then(O)}catch(C){p(),af(e,n,C,"BEFORE_LOAD")}O(_)},eH=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),o=()=>JK(e,n,t,i),u=()=>{if(MI(e,n))return;const d=XK(e,n,i);return Hf(d)?d.then(o):o()};return a()},tH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:o,styles:a?.styles}))},LI=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=Cl(e,r),m=Gy(e,n);return{params:o,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},r2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(J9??e.router.isServer)||a.ssr===!0)&&Gf(i);const o=i.options.loader,u=typeof o=="function"?o:o?.handler,d=u?.(LI(e,t,n,r,i)),f=!!u&&Hf(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),u){const m=f?await d:d;co(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Cl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let u=o;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Cl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,wr(o)&&await i.options.notFoundComponent?.preload?.(),co(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){u=f,co(e,e.router.getMatch(n),f)}!Mr(u)&&!wr(u)&&await Gf(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Cl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),co(e,o,a)}},nH=async(e,t,n)=>{async function r(v,w,S,j,k){const O=Date.now()-w.updatedAt,_=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,T=typeof C=="function"?C(LI(e,t,i,n,k)):C,{status:E,invalid:A}=j,P=O>_&&(!!e.forceStaleReload||j.cause==="enter"||S!==void 0&&S!==j.id);o=E==="success"&&(A||(T??P)),v&&k.options.preload===!1||(o&&!e.sync&&p?(u=!0,(async()=>{try{await r2(e,t,i,n,k);const $=e.router.getMatch(i);$._nonReactive.loaderPromise?.resolve(),$._nonReactive.loadPromise?.resolve(),$._nonReactive.loaderPromise=void 0,$._nonReactive.loadPromise=void 0}catch($){Mr($)&&await e.router.navigate($.options)}})()):E!=="success"||o?await r2(e,t,i,n,k):n2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!1,u=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(MI(e,i)){if(!e.router.getMatch(i))return e.matches[n];n2(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,S=Gy(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&co(e,j,k),j.status==="pending"&&await r(S,v,w,j,d)}else{const j=S&&!e.router.state.matches.some(O=>O.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=ku(),j!==k.preload&&e.updateMatch(i,O=>({...O,preload:j})),await r(S,v,w,k,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=u?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function i2(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&r1(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=eH(t,y);Hf(v)&&await v}catch(v){if(Mr(v))throw v;if(wr(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?t2(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let y=0;y<o;y++)n.push(nH(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(Mr(w))throw w;wr(w)?u??=w:d??=w}if(d!==void 0)throw d}const f=u??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const y=t2(t,f);jo(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await Gf(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Gf(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],S=t.router.looseRoutesById[w];try{const j=tH(t,v,S);if(j){const k=await j;t.updateMatch(v,O=>({...O,...k}))}}catch(j){console.error(`Error executing head for route ${w}:`,j)}}const m=r1(t);if(Hf(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function a2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Gf(e,t=ig){!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===ig?(()=>{if(e._componentsPromise===void 0){const r=a2(e,ig);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():a2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function $I(e){for(const t of ig)if(e.options[t]?.preload)return!0;return!1}var ig=["component","errorComponent","pendingComponent","notFoundComponent"],vo="__TSR_index",s2="popstate",o2="beforeunload";function rH(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=Cg(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,u,d)=>{const f=t.state[vo];u=l2(f+1,u),a({task:()=>{e.pushState(o,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:u})},replace:(o,u,d)=>{const f=t.state[vo];u=l2(f,u),a({task:()=>{e.replaceState(o,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:u})},go:(o,u)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[vo]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function l2(e,t){t||(t={});const n=Yj();return{...t,key:n,__TSR_key:n,[vo]:e}}function iH(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=P=>i=P,u=(P=>P),d=(()=>Cg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=Yj();t.history.replaceState({[vo]:0,key:P,__TSR_key:P},"")}let f=d(),p,m=!1,y=!1,v=!1,w=!1;const S=()=>f;let j,k;const O=()=>{j&&(A._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),A._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},_=(P,$,F)=>{const U=u($);k||(p=f),f=Cg($,F),j={href:U,state:F,isPush:j?.isPush||P==="push"},k||(k=Promise.resolve().then(()=>O()))},C=P=>{f=d(),A.notify({type:P})},T=async()=>{if(y){y=!1;return}const P=d(),$=P.state[vo]-f.state[vo],F=$===1,U=$===-1,B=!F&&!U||m;m=!1;const V=B?"GO":U?"BACK":"FORWARD",ee=B?{type:"GO",index:$}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const Q=a();if(typeof document<"u"&&Q.length){for(const K of Q)if(await K.blockerFn({currentLocation:f,nextLocation:P,action:V})){y=!0,t.history.go(1),A.notify(ee);return}}}f=d(),A.notify(ee)},E=P=>{if(w){w=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const U of F){const B=U.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return P.preventDefault(),P.returnValue=""},A=rH({getLocation:S,getLength:()=>t.history.length,pushState:(P,$)=>_("push",P,$),replaceState:(P,$)=>_("replace",P,$),back:P=>(P&&(v=!0),w=!0,t.history.back()),forward:P=>{P&&(v=!0),w=!0,t.history.forward()},go:P=>{m=!0,t.history.go(P)},createHref:P=>u(P),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(o2,E,{capture:!0}),t.removeEventListener(s2,T)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(o2,E,{capture:!0}),t.addEventListener(s2,T),t.history.pushState=function(...P){const $=n.apply(t.history,P);return A._ignoreSubscribers||C("PUSH"),$},t.history.replaceState=function(...P){const $=r.apply(t.history,P);return A._ignoreSubscribers||C("REPLACE"),$},A}function aH(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Cg(e,t){const n=aH(e),r=n.indexOf("#"),i=n.indexOf("?"),a=Yj();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||{[vo]:0,key:a,__TSR_key:a}}}function Yj(){return(Math.random()+1).toString(36).substring(7)}function _l(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 sH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var oH=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=xK(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=iH()),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=Sg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=WK(cH(this.latestLocation)),CK(this));let o=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=OI(u);p&&p!=="/"&&f.push(DK({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:RK(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=hK(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&lK(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:u,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:u+k+f,publicHref:p,pathname:nf(u).path,external:!1,searchStr:k,search:tl(n?.search,j),hash:nf(f.slice(1)).path,state:pl(n?.state,m)}}const y=new URL(p,this.origin),v=e1(this.rewrite,y),w=this.options.parseSearch(v.search),S=this.options.stringifySearch(w);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:p,pathname:nf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:S,search:tl(n?.search,w),hash:nf(v.hash.slice(1)).path,state:pl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const u=r(a);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>vK({base:t,to:Hj(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=>uH({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(u,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,lo(i.params,p)),v=this.getMatchedRoutes(m);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const $ of w){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const S=t.leaveParams?m:nf(QE({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};w.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,ag(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=dH({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=tl(f,j);const k=this.options.stringifySearch(j),O=i.hash===!0?a.hash:i.hash?lo(i.hash,a.hash):void 0,_=O?`#${O}`:"";let C=i.state===!0?a.state:i.state?lo(i.state,a.state):{};C=pl(a.state,C);const T=`${S}${k}${_}`;let E,A,P=!1;if(this.rewrite){const $=new URL(T,this.origin),F=EI(this.rewrite,$);E=$.href.replace($.origin,""),F.origin!==this.origin?(A=F.href,P=!0):A=F.pathname+F.search+F.hash}else E=aK(T),A=E;return{publicHref:A,href:E,pathname:S,search:j,searchStr:k,state:C,hash:O??"",external:P,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=cK(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,lo(m,d));a={from:t.from,...y,params:v},u=n(a)}}}return u&&(o.maskedLocation=u),o};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Nl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=yo(this.latestLocation.href)===yo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=ku(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=r;u&&(f={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:o,...u}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=Cg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);u.to=e1(this.rewrite,y).pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const u=!o&&i?i:r;if(wg(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",..._l({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",..._l({resolvedLocation:f,location:d})}),await i2({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];Tf(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return p=S.filter(k=>!j.some(O=>O.id===k.id)),m=S.filter(k=>!j.some(O=>O.routeId===k.routeId)),y=j.filter(k=>!S.some(O=>O.routeId===k.routeId)),v=j.filter(k=>S.some(O=>O.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(d){Mr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):wr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(u=>u.status==="error")&&(o=500),o!==void 0&&this.__store.setState(u=>({...u,statusCode:o}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(_l({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:sH(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&&wg(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=Gf,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)]);Tf(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,o]}))})});try{return r=await i2({router:this,matches:r,location:n,preload:!0,updateMatch:(o,u)=>{i.has(o)?r=r.map(d=>d.id===o?u(d):d):this.updateMatch(o,u)}}),r}catch(o){if(Mr(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});wr(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=uK(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!Nl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Nl(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??zK,parseSearch:e.parseSearch??EK,protocolAllowlist:e.protocolAllowlist??iK}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,u=!1;(r?r.path!=="/"&&i["**"]:yo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:u=!0);const d=u?hH(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let w,S,j;{const V=v?.search??e.search,ee=v?._strictSearch??void 0;try{const Q=ag(y.options.validateSearch,{...V})??void 0;w={...V,...Q},S={...ee,...Q},j=void 0}catch(Q){let K=Q;if(Q instanceof _g||(K=new _g(Q.message,{cause:Q})),t?.throwOnError)throw K;w=V,S={},j=K}}const k=y.options.loaderDeps?.({search:w})??"",O=k?JSON.stringify(k):"",{interpolatedPath:_,usedParams:C}=QE({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=y.id+_+O,E=this.getMatch(T),A=p.get(y.id),P=E?._strictParams??C;let $;if(!E)try{c2(y,C,a,P)}catch(V){if(wr(V)||Mr(V)?$=V:$=new lH(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,P);const F=A?"stay":"enter";let U;if(E)U={...E,cause:F,params:A?.params??i,_strictParams:P,search:tl(A?A.search:E.search,w),_strictSearch:S};else{const V=y.options.loader||y.options.beforeLoad||y.lazyFn||$I(y)?"pending":"success";U={id:T,ssr:y.options.ssr,index:m,routeId:y.id,params:A?.params??i,_strictParams:P,pathname:_,updatedAt:Date.now(),search:A?tl(A.search,w):w,_strictSearch:S,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:ku()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:A?pl(A.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(U.globalNotFound=d===y.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 y=f[m],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),S=p.get(y.routeId);if(y.params=S?tl(S.params,i):i,!w){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const O={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(O)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Kf(t),a={...e.search};for(const f of t)try{Object.assign(a,ag(f.options.validateSearch,a))}catch{}const o=Kf(this.state.matches),u=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{c2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},_g=class extends Error{},lH=class extends Error{};function cH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ag(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new _g("Async validation not supported");if(n.issues)throw new _g(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 uH({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=yo(e);let a,o;const u=dK(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),o=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function dH({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return fH(n)(e,t,r??!1)}function fH(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:u})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));const f=u(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:o,next:u})=>{const d=u(o);if(!t._includeValidateSearch)return d;try{return{...d,...ag(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:lo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const u=o[i];return u({search:a,next:f=>r(i+1,f,o)})};return function(a,o,u){return t.dest=o,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function hH(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 kl}function c2(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 pH="Error preloading route! ☝️",BI=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=kl:this.parentRoute||jo(!1);let i=r?kl:n?.path;i&&i!=="/"&&(i=AI(i));const a=n?.id||i;let o=r?kl:ng([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=ng(["/",o]));const u=o==="__root__"?"/":ng([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=u,this._to=yo(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Gj({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.")}},mH=class extends BI{constructor(e){super(e)}};function Wj(e){const t=e.errorComponent??Qj;return l.jsx(gH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var gH=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 Qj({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 yH({children:e,fallback:t=null}){return UI()?l.jsx(Vi.Fragment,{children:e}):l.jsx(Vi.Fragment,{children:t})}function UI(){return Vi.useSyncExternalStore(vH,()=>!0,()=>!1)}function vH(){return()=>{}}var qI=x.createContext(null);function Ri(e){const t=x.useContext(qI);return e?.warn,t}var zb={exports:{}},Tb={},Pb={exports:{}},Rb={};var u2;function xH(){if(u2)return Rb;u2=1;var e=qu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(m,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),S=w[0].inst,j=w[1];return a(function(){S.value=v,S.getSnapshot=y,d(S)&&j({inst:S})},[m,v,y]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Rb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Rb}var d2;function bH(){return d2||(d2=1,Pb.exports=xH()),Pb.exports}var f2;function wH(){if(f2)return Tb;f2=1;var e=qu(),t=bH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Tb.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var w=a(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function k(E){if(!O){if(O=!0,_=E,E=y(E),v!==void 0&&S.hasValue){var A=S.value;if(v(A,E))return C=A}return C=E}if(A=C,r(_,E))return A;var P=y(E);return v!==void 0&&v(A,P)?(_=E,A):(_=E,C=P)}var O=!1,_,C,T=m===void 0?null:m;return[function(){return k(p())},T===null?void 0:function(){return k(T())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return o(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},Tb}var h2;function SH(){return h2||(h2=1,zb.exports=wH()),zb.exports}var FI=SH();function jH(e,t){return e===t}function NH(e,t,n=jH){const r=x.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(o);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return FI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function $r(e){const t=Ri({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return NH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=pl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Vy=x.createContext(void 0),kH=x.createContext(void 0);function Ao(e){const t=x.useContext(e.from?kH:Vy);return $r({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(jo(!((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 Xj(e){return Ao({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Jj(e){const{select:t,...n}=e;return Ao({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Zy(e){return Ao({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 Yy(e){return Ao({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Oo(e){const t=Ri();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function eN(e){return Ao({...e,select:t=>e.select?e.select(t.context):t.context})}var Zl=lI();const CH=Ta(Zl);function _H(e,t){const n=Ri(),r=X9(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:S,target:j,disabled:k,style:O,className:_,onClick:C,onBlur:T,onFocus:E,onMouseEnter:A,onMouseLeave:P,onTouchStart:$,ignoreBlocker:F,params:U,search:B,hash:V,state:ee,mask:Q,reloadDocument:K,unsafeRelative:te,from:le,_fromLocation:je,...L}=e,I=UI(),q=$r({select:St=>{const ce=St.matches[St.matches.length-1];return{search:ce?.search,hash:St.location.hash,path:ce?.pathname}},structuralSharing:!0}),R=e.from,G=x.useMemo(()=>({...e,from:R}),[n,q,R,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ie=x.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=ie.maskedLocation?ie.maskedLocation.publicHref:ie.publicHref,Ce=ie.maskedLocation?ie.maskedLocation.external:ie.external,Se=x.useMemo(()=>PH(ne,Ce,n.history,k),[k,Ce,ne,n.history]),J=x.useMemo(()=>{if(Se?.external)return wg(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!RH(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),wg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Se,n.protocolAllowlist]),pe=$r({select:St=>{if(J)return!1;if(o?.exact){if(!yK(St.location.pathname,ie.pathname,n.basepath))return!1}else{const ce=jg(St.location.pathname,n.basepath),Ne=jg(ie.pathname,n.basepath);if(!(ce.startsWith(Ne)&&(ce.length===Ne.length||ce[Ne.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Nl(St.location.search,ie.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?I&&St.location.hash===ie.hash:!0}}),Oe=pe?lo(i,{})??AH:Db,W=pe?Db:lo(a,{})??Db,Fe=[_,Oe.className,W.className].filter(Boolean).join(" "),Te=(O||Oe.style||W.style)&&{...O,...Oe.style,...W.style},[it,Ze]=x.useState(!1),Lt=x.useRef(!1),Rt=e.reloadDocument||J?!1:d??n.options.defaultPreload,en=f??n.options.defaultPreloadDelay??0,we=x.useCallback(()=>{n.preloadRoute({...G,_builtLocation:ie}).catch(St=>{console.warn(St),console.warn(pH)})},[n,G,ie]);Q9(r,x.useCallback(St=>{St?.isIntersecting&&we()},[we]),TH,{disabled:!!k||Rt!=="viewport"}),x.useEffect(()=>{Lt.current||!k&&Rt==="render"&&(we(),Lt.current=!0)},[k,we,Rt]);const Je=St=>{const ce=St.currentTarget.getAttribute("target"),Ne=j!==void 0?j:ce;if(!k&&!DH(St)&&!St.defaultPrevented&&(!Ne||Ne==="_self")&&St.button===0){St.preventDefault(),Zl.flushSync(()=>{Ze(!0)});const De=n.subscribe("onResolved",()=>{De(),Ze(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(J)return{...L,ref:r,href:J,...S&&{children:S},...j&&{target:j},...k&&{disabled:k},...O&&{style:O},..._&&{className:_},...C&&{onClick:C},...T&&{onBlur:T},...E&&{onFocus:E},...A&&{onMouseEnter:A},...P&&{onMouseLeave:P},...$&&{onTouchStart:$}};const ot=St=>{if(k||Rt!=="intent")return;if(!en){we();return}const ce=St.currentTarget;if(sf.has(ce))return;const Ne=setTimeout(()=>{sf.delete(ce),we()},en);sf.set(ce,Ne)},Fn=St=>{k||Rt!=="intent"||we()},et=St=>{if(k||!Rt||!en)return;const ce=St.currentTarget,Ne=sf.get(ce);Ne&&(clearTimeout(Ne),sf.delete(ce))};return{...L,...Oe,...W,href:Se?.href,ref:r,onClick:$c([C,Je]),onBlur:$c([T,et]),onFocus:$c([E,ot]),onMouseEnter:$c([A,ot]),onMouseLeave:$c([P,et]),onTouchStart:$c([$,Fn]),disabled:!!k,target:j,...Te&&{style:Te},...Fe&&{className:Fe},...k&&OH,...pe&&EH,...I&&it&&zH}}var Db={},AH={className:"active"},OH={role:"link","aria-disabled":!0},EH={"data-status":"active","aria-current":"page"},zH={"data-transitioning":"transitioning"},sf=new WeakMap,TH={rootMargin:"100px"},$c=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function PH(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function RH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Kt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=_H(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return x.createElement("a",d,o)}return x.createElement(n,a,o)});function DH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var MH=class extends BI{constructor(e){super(e),this.useMatch=t=>Ao({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>eN({...t,from:this.id}),this.useSearch=t=>Yy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Zy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Jj({...t,from:this.id}),this.useLoaderData=t=>Xj({...t,from:this.id}),this.useNavigate=()=>Oo({from:this.fullPath}),this.Link=Vi.forwardRef((t,n)=>l.jsx(Kt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function qr(e){return new MH(e)}function IH(){return e=>$H(e)}var LH=class extends mH{constructor(e){super(e),this.useMatch=t=>Ao({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>eN({...t,from:this.id}),this.useSearch=t=>Yy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Zy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Jj({...t,from:this.id}),this.useLoaderData=t=>Xj({...t,from:this.id}),this.useNavigate=()=>Oo({from:this.fullPath}),this.Link=Vi.forwardRef((t,n)=>l.jsx(Kt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function $H(e){return new LH(e)}function p2(e){return typeof e=="object"?new m2(e,{silent:!0}).createRoute(e):new m2(e,{silent:!0}).createRoute}var m2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=qr(n);return r.isRoot=!1,r},this.silent=t?.silent}},g2=class{constructor(e){this.useMatch=t=>Ao({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>eN({...t,from:this.options.id}),this.useSearch=t=>Yy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Zy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Jj({...t,from:this.options.id}),this.useLoaderData=t=>Xj({...t,from:this.options.id}),this.useNavigate=()=>Oo({from:Ri().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function y2(e){return typeof e=="object"?new g2(e):t=>new g2({id:e,...t})}function BH(e){const t=$r({select:n=>`not-found-${n.location.pathname}-${n.status}`});return l.jsx(Wj,{getResetKey:()=>t,onCatch:(n,r)=>{if(wr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(wr(n))return e.fallback?.(n);throw n},children:e.children})}function UH(){return l.jsx("p",{children:"Not Found"})}function nu(e){return l.jsx(l.Fragment,{children:e.children})}function KI(e,t,n){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...n}):l.jsx(UH,{})}function qH(){return Ri().isScrollRestoring,null}var HI=x.memo(function({matchId:t}){const n=Ri(),r=$r({select:w=>{const S=w.matches.findIndex(k=>k.id===t),j=w.matches[S];return jo(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?l.jsx(a,{}):null,u=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:nu,y=u?Wj:nu,v=f?BH:nu;return l.jsxs(i.isRoot?i.options.shellComponent??nu:nu,{children:[l.jsx(Vy.Provider,{value:t,children:l.jsx(m,{fallback:o,children:l.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||Qj,onCatch:(w,S)=>{if(wr(w))throw w;d?.(w,S)},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(yH,{fallback:o,children:l.jsx(v2,{matchId:t})}):l.jsx(v2,{matchId:t})})})})}),r.parentRouteId===kl&&n.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(FH,{}),l.jsx(qH,{})]}):null]})});function FH(){const e=Ri(),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",..._l(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var v2=x.memo(function({matchId:t}){const n=Ri(),{match:r,key:i,routeId:a}=$r({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],u=x.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?l.jsx(d,{},i):l.jsx(tN,{})},[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=ku();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 jo(wr(r.error)),KI(n,o,r.error);if(r.status==="redirected")throw jo(Mr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),tN=x.memo(function(){const t=Ri(),n=x.useContext(Vy),r=$r({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=$r({select:f=>{const p=f.matches.find(m=>m.id===n);return jo(p),p.globalNotFound}}),o=$r({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(a)return KI(t,i,void 0);if(!o)return null;const d=l.jsx(HI,{matchId:o});return r===kl?l.jsx(x.Suspense,{fallback:u,children:d}):d});function KH(){const e=Ri(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=$r({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=kb(a),u=a||n||i,d=kb(u),f=a||i,p=kb(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return yo(e.latestLocation.publicHref)!==yo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),dm(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),dm(()=>{o&&!a&&e.emit({type:"onLoad",..._l(e.state)})},[o,e,a]),dm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",..._l(e.state)})},[f,p,e]),dm(()=>{if(d&&!u){const m=_l(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&_K(e)}},[u,d,e]),null}function HH(){const e=Ri(),t=e.routesById[kl].options.pendingComponent??e.options.defaultPendingComponent,n=t?l.jsx(t,{}):null,r=l.jsxs(typeof document<"u"&&e.ssr?nu:x.Suspense,{fallback:n,children:[l.jsx(KH,{}),l.jsx(GH,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:r}):r}function GH(){const e=Ri(),t=$r({select:i=>i.matches[0]?.id}),n=$r({select:i=>i.loadedAt}),r=t?l.jsx(HI,{matchId:t}):null;return l.jsx(Vy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:l.jsx(Wj,{getResetKey:()=>n,errorComponent:Qj,onCatch:void 0,children:r})})}var VH=e=>new ZH(e),ZH=class extends oH{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=p2,globalThis.createLazyFileRoute=y2):typeof window<"u"&&(window.createFileRoute=p2,window.createLazyFileRoute=y2);function YH({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(qI.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:r}):r}function WH({router:e,...t}){return l.jsx(YH,{router:e,...t,children:l.jsx(HH,{})})}function GI(e){return $r({select:t=>t.location})}class Oi extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function QH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const XH=QH();function JH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function e7(e){return`${JH()}${e}`}function t7(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 n7(){return""}function x2(){return!!n7()}async function Ee(e,t){const n=t?.body!=null,r=await fetch(`${XH}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{...n?{"Content-Type":"application/json"}:{},...t?.headers}});if(!r.ok){const i=await r.text();let a=`API ${r.status}: ${r.statusText}`,o;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,o=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new Oi(a,r.status,o)}if(r.status!==204)return r.json()}function nN(){return Ee("/projects")}function VI(e){return Ee(`/projects/${encodeURIComponent(e)}`)}function ZI(){return Ee("/runs")}function r7(e){return Ee(`/projects/${encodeURIComponent(e)}/runs`)}function Rl(e){return Ee(`/runs/${encodeURIComponent(e)}`)}function i7(e){return Ee(`/projects/${encodeURIComponent(e)}/keywords`)}function YI(e){return Ee(`/projects/${encodeURIComponent(e)}/competitors`)}function WI(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ee(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function Wy(e,t){return Ee(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function a7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function s7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function QI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function b2(e,t){const n=await VI(e);return Wy(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 o7(e,t){const n=await VI(e);return Wy(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 l7(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Ee(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function c7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function u7(e,t){await Ee(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function d7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function f7(e){await Ee(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function h7(e){return Ee(`/projects/${encodeURIComponent(e)}/export`)}function rN(){return Ee("/settings")}function p7(){return Ee("/session")}function m7(e){return Ee("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function g7(e){return Ee("/session",{method:"POST",body:JSON.stringify({password:e})})}function y7(e,t){return Ee(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function v7(e){return Ee("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function x7(e){try{return await Ee(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Oi&&t.statusCode===404)return null;throw t}}function w2(e,t){return Ee(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function b7(e){await Ee(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function w7(e){return Ee(`/projects/${encodeURIComponent(e)}/notifications`)}function S7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function j7(e,t){await Ee(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function N7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function k7(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function C7(e){return Ee("/apply",{method:"POST",body:JSON.stringify(e)})}function _7(e){return Ee("/runs",{method:"POST",body:JSON.stringify(e??{})})}function XI(e){return Ee(`/projects/${encodeURIComponent(e)}/google/connections`)}function A7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function O7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function E7(e){return Ee(`/projects/${encodeURIComponent(e)}/google/properties`)}function z7(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function T7(e,t,n){return Ee(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function JI(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function P7(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function R7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function D7(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function M7(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function iN(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function I7(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function L7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function $7(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function B7(e){return Ee(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function S2(){return Ee("/cdp/status")}function U7(e,t){return Ee("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function j2(e,t){return Ee(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function eL(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/status`)}function q7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function F7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function K7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/sites`)}function H7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function aN(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function tL(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ee(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function nL(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function N2(e,t){return Ee(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function G7(e){return Ee(`/projects/${encodeURIComponent(e)}/bing/performance`)}function V7(e){return Ee("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function Z7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function Y7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function W7(e,t){const n=t?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function Q7(e){return Ee(`/projects/${encodeURIComponent(e)}/ga/status`)}function X7(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function rL(e,t){return Ee(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function J7(e,t){return Ee(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function eG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function tG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function nG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ee(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function rG(e){return Ee(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function iG(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Ee(`/projects/${encodeURIComponent(e)}/insights${n}`)}function aG(e){return Ee(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function sG(e,t){const n=e7(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:t7(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,lastHeartbeatAt:u}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function oG(){return Ee("/backlinks/status")}function lG(){return Ee("/backlinks/install",{method:"POST"})}function iL(){return Ee("/backlinks/syncs/latest")}function cG(){return Ee("/backlinks/syncs")}function uG(e){return Ee("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function dG(){return Ee("/backlinks/releases")}function fG(){return Ee("/backlinks/latest-release")}function hG(e){return Ee(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function pG(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Ee(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function mG(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 Ee(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function gG(e){return Ee(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function yG(e,t){return Ee(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const vG=6e3,xG=5,bG=180;let ur=[],wG=0;const i1=new Set,a1=new Map,s1=new Map;function Ag(){const e=[...ur];for(const t of i1)t(e)}function sN(e){const t=a1.get(e);t&&(clearTimeout(t),a1.delete(e));const n=s1.get(e);n&&(clearTimeout(n),s1.delete(e))}function aL(e){sN(e);const t=ur.length;ur=ur.filter(n=>n.id!==e),ur.length!==t&&Ag()}function k2(e){sN(e.id),a1.set(e.id,setTimeout(()=>{o1(e.id)},e.durationMs))}function SG(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function gt(e,t="negative",n=vG){const r=SG(e,t,n),i={id:String(++wG),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=ur.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 ur=ur.map(u=>u.id===a.id?o:u),Ag(),k2(o),a.id}}return ur.length>=xG&&aL(ur[0].id),ur=[...ur,i],Ag(),k2(i),i.id}function o1(e){const t=ur.find(n=>n.id===e);!t||t.state==="closing"||(sN(e),ur=ur.map(n=>n.id===e?{...n,state:"closing"}:n),Ag(),s1.set(e,setTimeout(()=>{aL(e)},bG)))}function jG(e){return i1.add(e),()=>{i1.delete(e)}}function C2(){return ur}const NG=5*6e4,Pf=30*6e4,of=3e4,dr=6e4,l1=3e4;function kG(){return new H9({defaultOptions:{queries:{staleTime:NG,retry:1,refetchOnWindowFocus:!1}},mutationCache:new gI({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||gt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const CG=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_G=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_2=e=>{const t=_G(e);return t.charAt(0).toUpperCase()+t.slice(1)},sL=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),AG=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var OG={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 EG=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...u},d)=>x.createElement("svg",{ref:d,...OG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:sL("lucide",i),...!a&&!AG(u)&&{"aria-hidden":"true"},...u},[...o.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Nt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(EG,{ref:a,iconNode:t,className:sL(`lucide-${CG(_2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=_2(e),n};const zG=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],TG=Nt("arrow-up",zG);const PG=[["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"}]],RG=Nt("book-open",PG);const DG=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oL=Nt("check",DG);const MG=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IG=Nt("chevron-down",MG);const LG=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bh=Nt("chevron-right",LG);const $G=[["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"}]],BG=Nt("circle-alert",$G);const UG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],lL=Nt("circle-check",UG);const qG=[["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"}]],cL=Nt("circle-question-mark",qG);const FG=[["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"}]],KG=Nt("copy",FG);const HG=[["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"}]],oN=Nt("download",HG);const GG=[["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"}]],VG=Nt("external-link",GG);const ZG=[["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"}]],YG=Nt("file-text",ZG);const WG=[["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"}]],QG=Nt("github",WG);const XG=[["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"}]],JG=Nt("globe",XG);const eV=[["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"}]],tV=Nt("layout-dashboard",eV);const nV=[["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"}]],uL=Nt("link-2",nV);const rV=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dL=Nt("loader-circle",rV);const iV=[["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"}]],aV=Nt("maximize-2",iV);const sV=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],oV=Nt("menu",sV);const lV=[["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"}]],cV=Nt("minimize-2",lV);const uV=[["path",{d:"M5 12h14",key:"1ays0h"}]],dV=Nt("minus",uV);const fV=[["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"}]],Og=Nt("play",fV);const hV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],A2=Nt("plus",hV);const pV=[["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"}]],O2=Nt("refresh-cw",pV);const mV=[["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"}]],gV=Nt("rocket",mV);const yV=[["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"}]],fL=Nt("rotate-ccw",yV);const vV=[["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"}]],xV=Nt("settings",vV);const bV=[["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"}]],E2=Nt("sparkles",bV);const wV=[["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"}]],hL=Nt("trash-2",wV);const SV=[["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"}]],Eg=Nt("triangle-alert",SV);const jV=[["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"}]],NV=Nt("unplug",jV);const kV=[["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"}]],CV=Nt("upload",kV);const _V=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],AV=Nt("wrench",_V);const OV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wh=Nt("x",OV);function ye(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in u||(u[y]=f[y].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(u){var d;const f=n?.Parent?new a:this;r(f,u),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class hu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pL extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const mL={};function No(e){return mL}function gL(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 c1(e,t){return typeof t=="bigint"?t.toString():t}function Qy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function lN(e){return e==null}function cN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function EV(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return o%u/10**a}const z2=Symbol("evaluating");function Et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==z2)return r===void 0&&(r=z2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Yl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Eo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function T2(e){return JSON.stringify(e)}function zV(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const yL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Vf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const TV=Qy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Cu(e){if(Vf(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Vf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function vL(e){return Cu(e)?{...e}:Array.isArray(e)?[...e]:e}const PV=new Set(["string","number","symbol"]);function _u(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function RV(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const DV={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 MV(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=Eo(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=n.shape[u])}return Yl(this,"shape",o),o},checks:[]});return zo(e,a)}function IV(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=Eo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return Yl(this,"shape",o),o},checks:[]});return zo(e,a)}function LV(e,t){if(!Cu(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=Eo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Yl(this,"shape",a),a}});return zo(e,i)}function $V(e,t){if(!Cu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Eo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Yl(this,"shape",r),r}});return zo(e,n)}function BV(e,t){const n=Eo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Yl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return zo(e,n)}function UV(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=Eo(t._zod.def,{get shape(){const u=t._zod.def.shape,d={...u};if(n)for(const f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(const f in u)d[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return Yl(this,"shape",d),d},checks:[]});return zo(t,o)}function qV(e,t,n){const r=Eo(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 Yl(this,"shape",a),a}});return zo(t,r)}function iu(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 au(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function pm(e){return typeof e=="string"?e:e?.message}function ko(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=pm(e.inst?._zod.def?.error?.(e))??pm(t?.error?.(e))??pm(n.customError?.(e))??pm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function uN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const xL=(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,c1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bL=ye("$ZodError",xL),wL=ye("$ZodError",xL,{Parent:Error});function FV(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 KV(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return r(e),n}const dN=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 hu;if(o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>ko(d,a,No())));throw yL(u,i?.callee),u}return o.value},fN=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>ko(d,a,No())));throw yL(u,i?.callee),u}return o.value},Xy=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 hu;return a.issues.length?{success:!1,error:new(e??bL)(a.issues.map(o=>ko(o,i,No())))}:{success:!0,data:a.value}},HV=Xy(wL),Jy=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,No())))}:{success:!0,data:a.value}},GV=Jy(wL),VV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return dN(e)(t,n,i)},ZV=e=>(t,n,r)=>dN(e)(t,n,r),YV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fN(e)(t,n,i)},WV=e=>async(t,n,r)=>fN(e)(t,n,r),QV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xy(e)(t,n,i)},XV=e=>(t,n,r)=>Xy(e)(t,n,r),JV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Jy(e)(t,n,i)},eZ=e=>async(t,n,r)=>Jy(e)(t,n,r),tZ=/^[cC][^\s-]{8,}$/,nZ=/^[0-9a-z]+$/,rZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iZ=/^[0-9a-vA-V]{20}$/,aZ=/^[A-Za-z0-9]{27}$/,sZ=/^[a-zA-Z0-9_-]{21}$/,oZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lZ=/^([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})$/,P2=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)$/,cZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dZ(){return new RegExp(uZ,"u")}const fZ=/^(?:(?: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])$/,hZ=/^(([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}|:))$/,pZ=/^((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])$/,mZ=/^(([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])$/,gZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,SL=/^[A-Za-z0-9_-]*$/,yZ=/^\+[1-9]\d{6,14}$/,jL="(?:(?:\\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])))",vZ=new RegExp(`^${jL}$`);function NL(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 xZ(e){return new RegExp(`^${NL(e)}$`)}function bZ(e){const t=NL({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(`^${jL}T(?:${r})$`)}const wZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},SZ=/^-?\d+$/,kL=/^-?\d+(?:\.\d+)?$/,jZ=/^(?:true|false)$/i,NZ=/^[^A-Z]*$/,kZ=/^[^a-z]*$/,Fr=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),CL={number:"number",bigint:"bigint",object:"date"},_L=ye("$ZodCheckLessThan",(e,t)=>{Fr.init(e,t);const n=CL[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})}}),AL=ye("$ZodCheckGreaterThan",(e,t)=>{Fr.init(e,t);const n=CL[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})}}),CZ=ye("$ZodCheckMultipleOf",(e,t)=>{Fr.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):EV(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})}}),_Z=ye("$ZodCheckNumberFormat",(e,t)=>{Fr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=DV[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=SZ)}),e._zod.check=o=>{const u=o.value;if(n){if(!Number.isInteger(u)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<i&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),AZ=ye("$ZodCheckMaxLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lN(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=uN(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),OZ=ye("$ZodCheckMinLength",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lN(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=uN(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),EZ=ye("$ZodCheckLengthEquals",(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!lN(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=uN(i),u=a>t.length;r.issues.push({origin:o,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ev=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;Fr.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=()=>{})}),zZ=ye("$ZodCheckRegex",(e,t)=>{ev.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})}}),TZ=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NZ),ev.init(e,t)}),PZ=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kZ),ev.init(e,t)}),RZ=ye("$ZodCheckIncludes",(e,t)=>{Fr.init(e,t);const n=_u(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})}}),DZ=ye("$ZodCheckStartsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`^${_u(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})}}),MZ=ye("$ZodCheckEndsWith",(e,t)=>{Fr.init(e,t);const n=new RegExp(`.*${_u(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=ye("$ZodCheckOverwrite",(e,t)=>{Fr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class LZ{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 $Z={major:4,minor:3,patch:6},un=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$Z;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,u,d)=>{let f=iu(o),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new hu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=iu(o,y)))});else{if(o.issues.length===y)continue;f||(f=iu(o,y))}}return p?p.then(()=>o):o},a=(o,u,d)=>{if(iu(o))return o.aborted=!0,o;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new hu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,u)=>{if(u.skipChecks)return e._zod.parse(o,u);if(u.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,u)):a(f,o,u)}const d=e._zod.parse(o,u);if(d instanceof Promise){if(u.async===!1)throw new hu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Et(e,"~standard",()=>({validate:i=>{try{const a=HV(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return GV(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),hN=ye("$ZodString",(e,t)=>{un.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wZ(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),an=ye("$ZodStringFormat",(e,t)=>{ev.init(e,t),hN.init(e,t)}),BZ=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lZ),an.init(e,t)}),UZ=ye("$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=P2(r))}else t.pattern??(t.pattern=P2());an.init(e,t)}),qZ=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cZ),an.init(e,t)}),FZ=ye("$ZodURL",(e,t)=>{an.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),KZ=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dZ()),an.init(e,t)}),HZ=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=sZ),an.init(e,t)}),GZ=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tZ),an.init(e,t)}),VZ=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nZ),an.init(e,t)}),ZZ=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rZ),an.init(e,t)}),YZ=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=iZ),an.init(e,t)}),WZ=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=aZ),an.init(e,t)}),QZ=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bZ(t)),an.init(e,t)}),XZ=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vZ),an.init(e,t)}),JZ=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xZ(t)),an.init(e,t)}),eY=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=oZ),an.init(e,t)}),tY=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fZ),an.init(e,t),e._zod.bag.format="ipv4"}),nY=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hZ),an.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),rY=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pZ),an.init(e,t)}),iY=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mZ),an.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function OL(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const aY=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gZ),an.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{OL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sY(e){if(!SL.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return OL(n)}const oY=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=SL),an.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{sY(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),lY=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=yZ),an.init(e,t)});function cY(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 uY=ye("$ZodJWT",(e,t)=>{an.init(e,t),e._zod.check=n=>{cY(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),EL=ye("$ZodNumber",(e,t)=>{un.init(e,t),e._zod.pattern=e._zod.bag.pattern??kL,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}}),dY=ye("$ZodNumberFormat",(e,t)=>{_Z.init(e,t),EL.init(e,t)}),fY=ye("$ZodBoolean",(e,t)=>{un.init(e,t),e._zod.pattern=jZ,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}}),hY=ye("$ZodUnknown",(e,t)=>{un.init(e,t),e._zod.parse=n=>n}),pY=ye("$ZodNever",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function R2(e,t,n){e.issues.length&&t.issues.push(...au(n,e.issues)),t.value[n]=e.value}const mY=ye("$ZodArray",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const u=i[o],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>R2(f,n,o))):R2(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function zg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...au(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function zL(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=RV(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function TL(e,t,n,r,i,a){const o=[],u=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(u.has(m))continue;if(f==="never"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>zg(v,n,m,t,p))):zg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const gY=ye("$ZodObject",(e,t)=>{if(un.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...u};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Qy(()=>zL(t));Et(e._zod,"propValues",()=>{const u=t.shape,d={};for(const f in u){const p=u[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=Vf,a=t.catchall;let o;e._zod.parse=(u,d)=>{o??(o=r.value);const f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value={};const p=[],m=o.shape;for(const y of o.keys){const v=m[y],w=v._zod.optout==="optional",S=v._zod.run({value:f[y],issues:[]},d);S instanceof Promise?p.push(S.then(j=>zg(j,u,y,f,w))):zg(S,u,y,f,w)}return a?TL(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),yY=ye("$ZodObjectJIT",(e,t)=>{gY.init(e,t);const n=e._zod.parse,r=Qy(()=>zL(t)),i=y=>{const v=new LZ(["shape","payload","ctx"]),w=r.value,S=_=>{const C=T2(_);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const _ of w.keys)j[_]=`key_${k++}`;v.write("const newResult = {};");for(const _ of w.keys){const C=j[_],T=T2(_),A=y[_]?._zod?.optout==="optional";v.write(`const ${C} = ${S(_)};`),A?v.write(`
12
+ if (${C}.issues.length) {
13
+ if (${T} in input) {
14
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${C}.value === undefined) {
22
+ if (${T} in input) {
23
+ newResult[${T}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${T}] = ${C}.value;
27
+ }
28
+
29
+ `):v.write(`
30
+ if (${C}.issues.length) {
31
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
34
+ })));
35
+ }
36
+
37
+ if (${C}.value === undefined) {
38
+ if (${T} in input) {
39
+ newResult[${T}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${T}] = ${C}.value;
43
+ }
44
+
45
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(_,C)=>O(y,_,C)};let a;const o=Vf,u=!mL.jitless,f=u&&TV.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return o(w)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?TL([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function D2(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=>!iu(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,No())))}),t)}const PL=ye("$ZodUnion",(e,t)=>{un.init(e,t),Et(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Et(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Et(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Et(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=>cN(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),o=!0;else{if(f.issues.length===0)return f;u.push(f)}}return o?Promise.all(u).then(d=>D2(d,i,e,a)):D2(u,i,e,a)}}),vY=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,PL.init(e,t);const n=e._zod.parse;Et(e._zod,"propValues",()=>{const i={};for(const a of t.options){const o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(o)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=Qy(()=>{const i=t.options,a=new Map;for(const o of i){const u=o._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,o)}}return a});e._zod.parse=(i,a)=>{const o=i.value;if(!Vf(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const u=r.value.get(o?.[t.discriminator]);return u?u._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),xY=ye("$ZodIntersection",(e,t)=>{un.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])=>M2(n,d,f)):M2(n,a,o)}});function u1(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(Cu(e)&&Cu(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=u1(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=u1(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 M2(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),iu(e))return e;const o=u1(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 bY=ye("$ZodRecord",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Cu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...au(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...au(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&kL.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[u]=i[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>ko(m,r,No())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...au(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...au(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),wY=ye("$ZodEnum",(e,t)=>{un.init(e,t);const n=gL(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>PV.has(typeof i)).map(i=>typeof i=="string"?_u(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}}),SY=ye("$ZodLiteral",(e,t)=>{if(un.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"?_u(r):r?_u(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}}),jY=ye("$ZodTransform",(e,t)=>{un.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pL(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 hu;return n.value=i,n}});function I2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const RL=ye("$ZodOptional",(e,t)=>{un.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${cN(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=>I2(a,n.value)):I2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),NY=ye("$ZodExactOptional",(e,t)=>{RL.init(e,t),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),kY=ye("$ZodNullable",(e,t)=>{un.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${cN(n.source)}|null)$`):void 0}),Et(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)}),CY=ye("$ZodDefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Et(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=>L2(a,t)):L2(i,t)}});function L2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _Y=ye("$ZodPrefault",(e,t)=>{un.init(e,t),e._zod.optin="optional",Et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),AY=ye("$ZodNonOptional",(e,t)=>{un.init(e,t),Et(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=>$2(a,e)):$2(i,e)}});function $2(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 OY=ye("$ZodCatch",(e,t)=>{un.init(e,t),Et(e._zod,"optin",()=>t.innerType._zod.optin),Et(e._zod,"optout",()=>t.innerType._zod.optout),Et(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,No()))},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,No()))},input:n.value}),n.issues=[]),n)}}),EY=ye("$ZodPipe",(e,t)=>{un.init(e,t),Et(e._zod,"values",()=>t.in._zod.values),Et(e._zod,"optin",()=>t.in._zod.optin),Et(e._zod,"optout",()=>t.out._zod.optout),Et(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=>mm(o,t.in,r)):mm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>mm(a,t.out,r)):mm(i,t.out,r)}});function mm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zY=ye("$ZodReadonly",(e,t)=>{un.init(e,t),Et(e._zod,"propValues",()=>t.innerType._zod.propValues),Et(e._zod,"values",()=>t.innerType._zod.values),Et(e._zod,"optin",()=>t.innerType?._zod?.optin),Et(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(B2):B2(i)}});function B2(e){return e.value=Object.freeze(e.value),e}const TY=ye("$ZodCustom",(e,t)=>{Fr.init(e,t),un.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=>U2(a,n,r,e));U2(i,n,r,e)}});function U2(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(Zf(i))}}var q2;class PY{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 RY(){return new PY}(q2=globalThis).__zod_globalRegistry??(q2.__zod_globalRegistry=RY());const Cf=globalThis.__zod_globalRegistry;function DY(e,t){return new e({type:"string",...qe(t)})}function MY(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function F2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function IY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function LY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function $Y(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function BY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function UY(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function qY(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function FY(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function KY(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function HY(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function GY(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function VY(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function ZY(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function YY(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function WY(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function QY(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function XY(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function JY(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function eW(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function tW(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function nW(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function rW(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function iW(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function aW(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function sW(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function oW(e,t){return new e({type:"number",checks:[],...qe(t)})}function lW(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function cW(e,t){return new e({type:"boolean",...qe(t)})}function uW(e){return new e({type:"unknown"})}function dW(e,t){return new e({type:"never",...qe(t)})}function K2(e,t){return new _L({check:"less_than",...qe(t),value:e,inclusive:!1})}function Mb(e,t){return new _L({check:"less_than",...qe(t),value:e,inclusive:!0})}function H2(e,t){return new AL({check:"greater_than",...qe(t),value:e,inclusive:!1})}function Ib(e,t){return new AL({check:"greater_than",...qe(t),value:e,inclusive:!0})}function G2(e,t){return new CZ({check:"multiple_of",...qe(t),value:e})}function DL(e,t){return new AZ({check:"max_length",...qe(t),maximum:e})}function Tg(e,t){return new OZ({check:"min_length",...qe(t),minimum:e})}function ML(e,t){return new EZ({check:"length_equals",...qe(t),length:e})}function fW(e,t){return new zZ({check:"string_format",format:"regex",...qe(t),pattern:e})}function hW(e){return new TZ({check:"string_format",format:"lowercase",...qe(e)})}function pW(e){return new PZ({check:"string_format",format:"uppercase",...qe(e)})}function mW(e,t){return new RZ({check:"string_format",format:"includes",...qe(t),includes:e})}function gW(e,t){return new DZ({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function yW(e,t){return new MZ({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function Fu(e){return new IZ({check:"overwrite",tx:e})}function vW(e){return Fu(t=>t.normalize(e))}function xW(){return Fu(e=>e.trim())}function bW(){return Fu(e=>e.toLowerCase())}function wW(){return Fu(e=>e.toUpperCase())}function SW(){return Fu(e=>zV(e))}function jW(e,t,n){return new e({type:"array",element:t,...qe(n)})}function NW(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function kW(e){const t=CW(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Zf(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(Zf(i))}},e(n.value,n)));return t}function CW(e,t){const n=new Fr({check:"custom",...qe(t)});return n._zod.check=e,n}function IL(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??Cf,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 Pn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),Pn(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"&&vr(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 LL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const u=e.metadataRegistry.get(o[0])?.id;if(u){const d=r.get(u);if(d&&d!==o[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,o[0])}}const i=o=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${u}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${u}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const u=o[1],{ref:d,defId:f}=i(o);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const o of e.seen.entries()){const u=o[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
46
+
47
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const u=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(u.cycle){a(o);continue}if(u.count>1&&e.reused==="ref"){a(o);continue}}}function $L(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),o._zod.parent===p)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(v.$ref&&y.def)for(const S in d)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(d[S])===JSON.stringify(y.def[S])&&delete d[S]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Pg(t,"input",e.processors),output:Pg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function vr(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 vr(r.element,n);if(r.type==="set")return vr(r.valueType,n);if(r.type==="lazy")return vr(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 vr(r.innerType,n);if(r.type==="intersection")return vr(r.left,n)||vr(r.right,n);if(r.type==="record"||r.type==="map")return vr(r.keyType,n)||vr(r.valueType,n);if(r.type==="pipe")return vr(r.in,n)||vr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(vr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(vr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(vr(i,n))return!0;return!!(r.rest&&vr(r.rest,n))}return!1}const _W=(e,t={})=>n=>{const r=IL({...n,processors:t});return Pn(e,r),LL(r,e),$L(r,e)},Pg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=IL({...i??{},target:a,io:t,processors:n});return Pn(e,o),LL(o,e),$L(o,e)},AW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},OW=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),u&&(i.format=AW[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},EW=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},zW=(e,t,n,r)=>{n.type="boolean"},TW=(e,t,n,r)=>{n.not={}},PW=(e,t,n,r)=>{},RW=(e,t,n,r)=>{const i=e._zod.def,a=gL(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},DW=(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},MW=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},IW=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},LW=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Pn(a.element,t,{...r,path:[...r.path,"items"]})},$W=(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]=Pn(o[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(o)),d=new Set([...u].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Pn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},BW=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((u,d)=>Pn(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},UW=(e,t,n,r)=>{const i=e._zod.def,a=Pn(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Pn(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(a)?a.allOf:[a],...u(o)?o.allOf:[o]];n.allOf=d},qW=(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=Pn(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=Pn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Pn(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)}},FW=(e,t,n,r)=>{const i=e._zod.def,a=Pn(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"}]},KW=(e,t,n,r)=>{const i=e._zod.def;Pn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},HW=(e,t,n,r)=>{const i=e._zod.def;Pn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},GW=(e,t,n,r)=>{const i=e._zod.def;Pn(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)))},VW=(e,t,n,r)=>{const i=e._zod.def;Pn(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},ZW=(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;Pn(a,t,r);const o=t.seen.get(e);o.ref=a},YW=(e,t,n,r)=>{const i=e._zod.def;Pn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},BL=(e,t,n,r)=>{const i=e._zod.def;Pn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},WW=ye("ZodISODateTime",(e,t)=>{QZ.init(e,t),fn.init(e,t)});function QW(e){return rW(WW,e)}const XW=ye("ZodISODate",(e,t)=>{XZ.init(e,t),fn.init(e,t)});function JW(e){return iW(XW,e)}const eQ=ye("ZodISOTime",(e,t)=>{JZ.init(e,t),fn.init(e,t)});function tQ(e){return aW(eQ,e)}const nQ=ye("ZodISODuration",(e,t)=>{eY.init(e,t),fn.init(e,t)});function rQ(e){return sW(nQ,e)}const iQ=(e,t)=>{bL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>KV(e,n)},flatten:{value:n=>FV(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,c1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,c1,2)}},isEmpty:{get(){return e.issues.length===0}}})},Di=ye("ZodError",iQ,{Parent:Error}),aQ=dN(Di),sQ=fN(Di),oQ=Xy(Di),lQ=Jy(Di),cQ=VV(Di),uQ=ZV(Di),dQ=YV(Di),fQ=WV(Di),hQ=QV(Di),pQ=XV(Di),mQ=JV(Di),gQ=eZ(Di),dn=ye("ZodType",(e,t)=>(un.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Pg(e,"input"),output:Pg(e,"output")}}),e.toJSONSchema=_W(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Eo(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)=>zo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>aQ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>oQ(e,n,r),e.parseAsync=async(n,r)=>sQ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>lQ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>cQ(e,n,r),e.decode=(n,r)=>uQ(e,n,r),e.encodeAsync=async(n,r)=>dQ(e,n,r),e.decodeAsync=async(n,r)=>fQ(e,n,r),e.safeEncode=(n,r)=>hQ(e,n,r),e.safeDecode=(n,r)=>pQ(e,n,r),e.safeEncodeAsync=async(n,r)=>mQ(e,n,r),e.safeDecodeAsync=async(n,r)=>gQ(e,n,r),e.refine=(n,r)=>e.check(dX(n,r)),e.superRefine=n=>e.check(fX(n)),e.overwrite=n=>e.check(Fu(n)),e.optional=()=>Y2(e),e.exactOptional=()=>XQ(e),e.nullable=()=>W2(e),e.nullish=()=>Y2(W2(e)),e.nonoptional=n=>iX(e,n),e.array=()=>Ae(e),e.or=n=>qQ([e,n]),e.and=n=>GQ(e,n),e.transform=n=>Q2(e,WQ(n)),e.default=n=>tX(e,n),e.prefault=n=>rX(e,n),e.catch=n=>sX(e,n),e.pipe=n=>Q2(e,n),e.readonly=()=>cX(e),e.describe=n=>{const r=e.clone();return Cf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Cf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Cf.get(e);const r=e.clone();return Cf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),UL=ye("_ZodString",(e,t)=>{hN.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>OW(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(fW(...r)),e.includes=(...r)=>e.check(mW(...r)),e.startsWith=(...r)=>e.check(gW(...r)),e.endsWith=(...r)=>e.check(yW(...r)),e.min=(...r)=>e.check(Tg(...r)),e.max=(...r)=>e.check(DL(...r)),e.length=(...r)=>e.check(ML(...r)),e.nonempty=(...r)=>e.check(Tg(1,...r)),e.lowercase=r=>e.check(hW(r)),e.uppercase=r=>e.check(pW(r)),e.trim=()=>e.check(xW()),e.normalize=(...r)=>e.check(vW(...r)),e.toLowerCase=()=>e.check(bW()),e.toUpperCase=()=>e.check(wW()),e.slugify=()=>e.check(SW())}),yQ=ye("ZodString",(e,t)=>{hN.init(e,t),UL.init(e,t),e.email=n=>e.check(MY(vQ,n)),e.url=n=>e.check(UY(xQ,n)),e.jwt=n=>e.check(nW(RQ,n)),e.emoji=n=>e.check(qY(bQ,n)),e.guid=n=>e.check(F2(V2,n)),e.uuid=n=>e.check(IY(gm,n)),e.uuidv4=n=>e.check(LY(gm,n)),e.uuidv6=n=>e.check($Y(gm,n)),e.uuidv7=n=>e.check(BY(gm,n)),e.nanoid=n=>e.check(FY(wQ,n)),e.guid=n=>e.check(F2(V2,n)),e.cuid=n=>e.check(KY(SQ,n)),e.cuid2=n=>e.check(HY(jQ,n)),e.ulid=n=>e.check(GY(NQ,n)),e.base64=n=>e.check(JY(zQ,n)),e.base64url=n=>e.check(eW(TQ,n)),e.xid=n=>e.check(VY(kQ,n)),e.ksuid=n=>e.check(ZY(CQ,n)),e.ipv4=n=>e.check(YY(_Q,n)),e.ipv6=n=>e.check(WY(AQ,n)),e.cidrv4=n=>e.check(QY(OQ,n)),e.cidrv6=n=>e.check(XY(EQ,n)),e.e164=n=>e.check(tW(PQ,n)),e.datetime=n=>e.check(QW(n)),e.date=n=>e.check(JW(n)),e.time=n=>e.check(tQ(n)),e.duration=n=>e.check(rQ(n))});function D(e){return DY(yQ,e)}const fn=ye("ZodStringFormat",(e,t)=>{an.init(e,t),UL.init(e,t)}),vQ=ye("ZodEmail",(e,t)=>{qZ.init(e,t),fn.init(e,t)}),V2=ye("ZodGUID",(e,t)=>{BZ.init(e,t),fn.init(e,t)}),gm=ye("ZodUUID",(e,t)=>{UZ.init(e,t),fn.init(e,t)}),xQ=ye("ZodURL",(e,t)=>{FZ.init(e,t),fn.init(e,t)}),bQ=ye("ZodEmoji",(e,t)=>{KZ.init(e,t),fn.init(e,t)}),wQ=ye("ZodNanoID",(e,t)=>{HZ.init(e,t),fn.init(e,t)}),SQ=ye("ZodCUID",(e,t)=>{GZ.init(e,t),fn.init(e,t)}),jQ=ye("ZodCUID2",(e,t)=>{VZ.init(e,t),fn.init(e,t)}),NQ=ye("ZodULID",(e,t)=>{ZZ.init(e,t),fn.init(e,t)}),kQ=ye("ZodXID",(e,t)=>{YZ.init(e,t),fn.init(e,t)}),CQ=ye("ZodKSUID",(e,t)=>{WZ.init(e,t),fn.init(e,t)}),_Q=ye("ZodIPv4",(e,t)=>{tY.init(e,t),fn.init(e,t)}),AQ=ye("ZodIPv6",(e,t)=>{nY.init(e,t),fn.init(e,t)}),OQ=ye("ZodCIDRv4",(e,t)=>{rY.init(e,t),fn.init(e,t)}),EQ=ye("ZodCIDRv6",(e,t)=>{iY.init(e,t),fn.init(e,t)}),zQ=ye("ZodBase64",(e,t)=>{aY.init(e,t),fn.init(e,t)}),TQ=ye("ZodBase64URL",(e,t)=>{oY.init(e,t),fn.init(e,t)}),PQ=ye("ZodE164",(e,t)=>{lY.init(e,t),fn.init(e,t)}),RQ=ye("ZodJWT",(e,t)=>{uY.init(e,t),fn.init(e,t)}),qL=ye("ZodNumber",(e,t)=>{EL.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>EW(e,r,i),e.gt=(r,i)=>e.check(H2(r,i)),e.gte=(r,i)=>e.check(Ib(r,i)),e.min=(r,i)=>e.check(Ib(r,i)),e.lt=(r,i)=>e.check(K2(r,i)),e.lte=(r,i)=>e.check(Mb(r,i)),e.max=(r,i)=>e.check(Mb(r,i)),e.int=r=>e.check(Z2(r)),e.safe=r=>e.check(Z2(r)),e.positive=r=>e.check(H2(0,r)),e.nonnegative=r=>e.check(Ib(0,r)),e.negative=r=>e.check(K2(0,r)),e.nonpositive=r=>e.check(Mb(0,r)),e.multipleOf=(r,i)=>e.check(G2(r,i)),e.step=(r,i)=>e.check(G2(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 oW(qL,e)}const DQ=ye("ZodNumberFormat",(e,t)=>{dY.init(e,t),qL.init(e,t)});function Z2(e){return lW(DQ,e)}const MQ=ye("ZodBoolean",(e,t)=>{fY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zW(e,n,r)});function ut(e){return cW(MQ,e)}const IQ=ye("ZodUnknown",(e,t)=>{hY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PW()});function Au(){return uW(IQ)}const LQ=ye("ZodNever",(e,t)=>{pY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TW(e,n,r)});function $Q(e){return dW(LQ,e)}const BQ=ye("ZodArray",(e,t)=>{mY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LW(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Tg(n,r)),e.nonempty=n=>e.check(Tg(1,n)),e.max=(n,r)=>e.check(DL(n,r)),e.length=(n,r)=>e.check(ML(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return jW(BQ,e,t)}const UQ=ye("ZodObject",(e,t)=>{yY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$W(e,n,r,i),Et(e,"shape",()=>t.shape),e.keyof=()=>rt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Au()}),e.loose=()=>e.clone({...e._zod.def,catchall:Au()}),e.strict=()=>e.clone({...e._zod.def,catchall:$Q()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>LV(e,n),e.safeExtend=n=>$V(e,n),e.merge=n=>BV(e,n),e.pick=n=>MV(e,n),e.omit=n=>IV(e,n),e.partial=(...n)=>UV(KL,e,n[0]),e.required=(...n)=>qV(HL,e,n[0])});function ge(e,t){const n={type:"object",shape:e??{},...qe(t)};return new UQ(n)}const FL=ye("ZodUnion",(e,t)=>{PL.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BW(e,n,r,i),e.options=t.options});function qQ(e,t){return new FL({type:"union",options:e,...qe(t)})}const FQ=ye("ZodDiscriminatedUnion",(e,t)=>{FL.init(e,t),vY.init(e,t)});function KQ(e,t,n){return new FQ({type:"union",options:t,discriminator:e,...qe(n)})}const HQ=ye("ZodIntersection",(e,t)=>{xY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UW(e,n,r,i)});function GQ(e,t){return new HQ({type:"intersection",left:e,right:t})}const VQ=ye("ZodRecord",(e,t)=>{bY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qW(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Wl(e,t,n){return new VQ({type:"record",keyType:e,valueType:t,...qe(n)})}const d1=ye("ZodEnum",(e,t)=>{wY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>RW(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 d1({...t,checks:[],...qe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new d1({...t,checks:[],...qe(i),entries:a})}});function rt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new d1({type:"enum",entries:n,...qe(t)})}const ZQ=ye("ZodLiteral",(e,t)=>{SY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DW(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 ka(e,t){return new ZQ({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const YQ=ye("ZodTransform",(e,t)=>{jY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IW(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pL(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Zf(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(Zf(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function WQ(e){return new YQ({type:"transform",transform:e})}const KL=ye("ZodOptional",(e,t)=>{RL.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Y2(e){return new KL({type:"optional",innerType:e})}const QQ=ye("ZodExactOptional",(e,t)=>{NY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function XQ(e){return new QQ({type:"optional",innerType:e})}const JQ=ye("ZodNullable",(e,t)=>{kY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function W2(e){return new JQ({type:"nullable",innerType:e})}const eX=ye("ZodDefault",(e,t)=>{CY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tX(e,t){return new eX({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vL(t)}})}const nX=ye("ZodPrefault",(e,t)=>{_Y.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function rX(e,t){return new nX({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vL(t)}})}const HL=ye("ZodNonOptional",(e,t)=>{AY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function iX(e,t){return new HL({type:"nonoptional",innerType:e,...qe(t)})}const aX=ye("ZodCatch",(e,t)=>{OY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sX(e,t){return new aX({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const oX=ye("ZodPipe",(e,t)=>{EY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZW(e,n,r,i),e.in=t.in,e.out=t.out});function Q2(e,t){return new oX({type:"pipe",in:e,out:t})}const lX=ye("ZodReadonly",(e,t)=>{zY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function cX(e){return new lX({type:"readonly",innerType:e})}const uX=ye("ZodCustom",(e,t)=>{TY.init(e,t),dn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MW(e,n)});function dX(e,t={}){return NW(uX,e,t)}function fX(e){return kW(e)}ge({maxConcurrency:he().int().positive(),maxRequestsPerMinute:he().int().positive(),maxRequestsPerDay:he().int().positive()});const ys=D().min(1);D().min(1);const pN=ge({label:D().min(1),city:D().min(1),region:D().min(1),country:D().length(2),timezone:D().optional()}),mN=rt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ge({id:D(),projectId:D(),channel:ka("webhook"),url:D().url(),urlDisplay:D(),urlHost:D(),events:Ae(mN),enabled:ut().default(!0),source:D().optional(),webhookSecret:D().optional(),createdAt:D(),updatedAt:D()});ge({channel:ka("webhook"),url:D().url(),events:Ae(mN).min(1),source:D().optional()});const GL=rt(["cli","api","config-file"]);function hX(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 pX(e,t){return t?e.some(n=>n.label===t):!0}ge({displayName:D().min(1),canonicalDomain:D().min(1),ownedDomains:Ae(D().min(1)).optional(),country:D().length(2),language:D().min(2),tags:Ae(D()).optional(),labels:Wl(D(),D()).optional(),providers:Ae(ys).optional(),locations:Ae(pN).optional(),defaultLocation:D().nullable().optional(),autoExtractBacklinks:ut().optional(),configSource:GL.optional()});ge({id:D(),name:D(),displayName:D().optional(),canonicalDomain:D(),ownedDomains:Ae(D()).default([]),country:D().length(2),language:D().min(2),tags:Ae(D()).default([]),labels:Wl(D(),D()).default({}),locations:Ae(pN).default([]),defaultLocation:D().nullable().optional(),autoExtractBacklinks:ut().default(!1),configSource:GL.default("cli"),configRevision:he().int().positive().default(1),createdAt:D().optional(),updatedAt:D().optional()});ge({id:D(),keyword:D(),createdAt:D()});ge({keywords:Ae(D().trim().min(1)).min(1)});ge({provider:ys,count:he().int().min(1).max(20).optional()});ge({id:D(),domain:D(),createdAt:D()});ge({competitors:Ae(D().trim().min(1)).min(1)});function f1(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function mX(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=f1(a);n.has(o)||(n.add(o),r.push(a))}return r}const gX=ge({name:D().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:Wl(D(),D()).optional().default({})}),yX=ge({preset:D().optional(),cron:D().optional(),timezone:D().optional().default("UTC"),providers:Ae(ys).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),vX=ge({channel:ka("webhook"),url:D().url(),events:Ae(mN).min(1)}),xX=ge({gsc:ge({propertyUrl:D()}).optional(),syncSchedule:ge({preset:D().optional(),cron:D().optional()}).optional()}).optional(),bX=ge({displayName:D().min(1),canonicalDomain:D().min(1),ownedDomains:Ae(D().min(1)).optional().default([]),country:D().length(2),language:D().min(2),keywords:Ae(D().min(1)).optional().default([]),competitors:Ae(D().min(1)).optional().default([]),providers:Ae(ys).optional().default([]),locations:Ae(pN).optional().default([]),defaultLocation:D().optional(),schedule:yX,notifications:Ae(vX).optional().default([]),google:xX,autoExtractBacklinks:ut().optional().default(!1)}).superRefine((e,t)=>{const n=hX(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),pX(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ge({apiVersion:ka("canonry/v1"),kind:ka("Project"),metadata:gX,spec:bX});const wX=rt(["gsc","ga4"]);ge({id:D(),domain:D(),connectionType:wX,propertyId:D().nullable().optional(),sitemapUrl:D().nullable().optional(),scopes:Ae(D()).default([]),createdAt:D(),updatedAt:D()});ge({date:D(),query:D(),page:D(),country:D().nullable().optional(),device:D().nullable().optional(),clicks:he(),impressions:he(),ctr:he(),position:he()});const h1=ge({id:D(),url:D(),indexingState:D().nullable().optional(),verdict:D().nullable().optional(),coverageState:D().nullable().optional(),pageFetchState:D().nullable().optional(),robotsTxtState:D().nullable().optional(),crawlTime:D().nullable().optional(),lastCrawlResult:D().nullable().optional(),isMobileFriendly:ut().nullable().optional(),richResults:Ae(D()).default([]),inspectedAt:D()});rt(["stable","reindexed","deindexed","still-missing","new"]);const SX=ge({url:D(),previousState:D().nullable(),currentState:D().nullable(),transitionDate:D()}),jX=ge({reason:D(),count:he(),urls:Ae(h1).default([])});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),deindexed:he(),percentage:he()}),lastInspectedAt:D().nullable(),indexed:Ae(h1).default([]),notIndexed:Ae(h1).default([]),deindexed:Ae(SX).default([]),reasonGroups:Ae(jX).default([])});ge({url:D(),type:rt(["URL_UPDATED","URL_DELETED"]),notifiedAt:D()});ge({url:D(),type:rt(["URL_UPDATED","URL_DELETED"]),notifiedAt:D(),status:rt(["success","error"]),error:D().optional()});ge({date:D(),indexed:he(),notIndexed:he(),reasonBreakdown:Wl(D(),he()).default({})});ge({id:D(),domain:D(),siteUrl:D().nullable().optional(),createdAt:D(),updatedAt:D()});const Lb=ge({id:D(),url:D(),httpCode:he().nullable().optional(),inIndex:ut().nullable().optional(),lastCrawledDate:D().nullable().optional(),inIndexDate:D().nullable().optional(),inspectedAt:D(),documentSize:he().nullable().optional(),anchorCount:he().nullable().optional(),discoveryDate:D().nullable().optional()});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),unknown:he().optional(),percentage:he()}),lastInspectedAt:D().nullable(),indexed:Ae(Lb).default([]),notIndexed:Ae(Lb).default([]),unknown:Ae(Lb).default([]).optional()});ge({query:D(),impressions:he(),clicks:he(),ctr:he(),averagePosition:he()});ge({date:D(),indexed:he(),notIndexed:he(),unknown:he()});ge({url:D(),status:rt(["success","error"]),submittedAt:D(),error:D().optional()});const Ku=rt(["live","staging"]);ge({projectName:D(),url:D(),stagingUrl:D().optional(),username:D(),defaultEnv:Ku,createdAt:D(),updatedAt:D()});const X2=ge({url:D(),reachable:ut(),pageCount:he().nullable().optional(),version:D().nullable().optional(),error:D().nullable().optional(),plugins:Ae(D()).optional(),authenticatedUser:ge({id:he(),slug:D()}).nullable().optional()});ge({connected:ut(),projectName:D(),defaultEnv:Ku,live:X2.nullable(),staging:X2.nullable(),adminUrl:D().nullable().optional()});const NX=ge({id:he(),slug:D(),title:D(),status:D(),modifiedAt:D().nullable().optional(),link:D().nullable().optional()}),VL=ge({title:D().nullable(),description:D().nullable(),noindex:ut().nullable(),writable:ut().default(!1),writeTargets:Ae(D()).default([])}),kX=ge({type:D(),json:Wl(D(),Au())}),CX=NX.extend({env:Ku,content:D(),seo:VL,schemaBlocks:Ae(kX).default([])}),J2=CX.extend({contentHash:D(),contentSnippet:D()}),ZL=ge({manualRequired:ka(!0),targetUrl:D(),adminUrl:D().nullable().optional(),content:D(),nextSteps:Ae(D()).default([])}),_X=ge({slug:D(),severity:rt(["high","medium","low"]),code:rt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:D()});ge({slug:D(),title:D(),status:D(),wordCount:he(),seo:VL,schemaPresent:ut(),issues:Ae(_X).default([])});const AX=ge({slug:D(),status:rt(["applied","skipped","manual"]),error:D().optional(),manualAssist:ZL.optional()});ge({env:Ku,strategy:rt(["plugin","manual"]),results:Ae(AX)});const OX=ge({slug:D(),status:rt(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(D()).optional(),manualAssist:ZL.optional(),error:D().optional()});ge({env:Ku,results:Ae(OX)});const EX=ge({slug:D(),title:D(),canonrySchemas:Ae(D()),thirdPartySchemas:Ae(D()),hasCanonrySchema:ut()});ge({env:Ku,pages:Ae(EX)});const zX=ge({name:D(),status:rt(["completed","skipped","failed"]),summary:D().optional(),error:D().optional()});ge({projectName:D(),steps:Ae(zX)});ge({slug:D(),live:J2,staging:J2,hasDifferences:ut(),differences:ge({title:ut(),slug:ut(),content:ut(),seoTitle:ut(),seoDescription:ut(),noindex:ut(),schema:ut()})});const YL=rt(["queued","running","completed","partial","failed","cancelled"]),yn=YL.enum,WL=rt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),Gt=WL.enum,QL=rt(["manual","scheduled","config-apply"]),Rf=QL.enum,Ou=rt(["cited","not-cited"]);Ou.enum;const Rg=rt(["visible","not-visible"]);Rg.enum;const XL=rt(["new","cited","lost","emerging","not-cited"]);XL.enum;ge({kind:ka(Gt["answer-visibility"]).optional(),trigger:ka(Rf.manual).optional(),providers:Ae(ys).optional(),location:D().min(1).optional(),allLocations:ut().optional(),noLocation:ut().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const TX=ge({message:D(),raw:Au().optional()}),PX=ge({message:D().optional(),providers:Wl(D(),TX).optional()}),RX=ge({id:D(),projectId:D(),kind:WL,status:YL,trigger:QL.default("manual"),location:D().nullable().optional(),startedAt:D().nullable().optional(),finishedAt:D().nullable().optional(),error:PX.nullable().optional(),createdAt:D()});function gN(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 JL=ge({uri:D(),title:D()}),e5=ge({id:D(),runId:D(),keywordId:D(),keyword:D().optional(),provider:ys,citationState:Ou,answerMentioned:ut().optional(),visibilityState:Rg.optional(),transition:XL.optional(),answerText:D().nullable().optional(),citedDomains:Ae(D()).default([]),competitorOverlap:Ae(D()).default([]),recommendedCompetitors:Ae(D()).default([]),matchedTerms:Ae(D()).default([]),groundingSources:Ae(JL).default([]),searchQueries:Ae(D()).default([]),model:D().nullable().optional(),location:D().nullable().optional(),createdAt:D()});ge({snapshots:Ae(e5),total:he().int().nonnegative()});const DX=ge({keywordId:D().nullable(),keyword:D().nullable(),run1State:Ou.nullable(),run2State:Ou.nullable(),run1AnswerMentioned:ut().nullable(),run2AnswerMentioned:ut().nullable(),run1VisibilityState:Rg.nullable(),run2VisibilityState:Rg.nullable(),changed:ut(),visibilityChanged:ut()});ge({run1:D(),run2:D(),diff:Ae(DX)});const MX=RX.extend({snapshots:Ae(e5).optional()});ge({totalRuns:he().int().nonnegative(),run:MX.nullable()});ge({id:D(),projectId:D().nullable().optional(),actor:D(),action:D(),entityType:D(),entityId:D().nullable().optional(),diff:Au().optional(),createdAt:D()});const IX=rt(["yes","no","unknown","not-mentioned"]);ge({companyName:D().min(1),domain:D().min(1),phrases:Ae(D().min(1)).optional().default([]),competitors:Ae(D().min(1)).optional().default([])});const LX=ge({name:D(),count:he().int().nonnegative()}),$X=ge({id:D(),name:D(),weight:he(),score:he(),grade:D(),status:rt(["pass","partial","fail"]),findings:Ae(ge({type:D(),message:D()})).default([]),recommendations:Ae(D()).default([])}),BX=ge({url:D(),finalUrl:D(),auditedAt:D(),overallScore:he(),overallGrade:D(),summary:D(),factors:Ae($X).default([])}),UX=ge({industry:D(),summary:D(),services:Ae(D()).default([]),categoryTerms:Ae(D()).default([])}),qX=ge({provider:D(),displayName:D(),model:D().nullable().optional(),mentioned:ut(),cited:ut(),describedAccurately:IX,accuracyNotes:D().nullable().optional(),incorrectClaims:Ae(D()).default([]),recommendedCompetitors:Ae(D()).default([]),citedDomains:Ae(D()).default([]),groundingSources:Ae(JL).default([]),searchQueries:Ae(D()).default([]),answerText:D(),error:D().nullable().optional()}),FX=ge({phrase:D(),providerResults:Ae(qX).default([])}),KX=ge({totalQueries:he().int().nonnegative(),totalProviders:he().int().nonnegative(),totalComparisons:he().int().nonnegative(),mentionCount:he().int().nonnegative(),citationCount:he().int().nonnegative(),topCompetitors:Ae(LX).default([]),visibilityGap:D(),whatThisMeans:Ae(D()).default([]),recommendedActions:Ae(D()).default([])});ge({companyName:D(),domain:D(),homepageUrl:D(),generatedAt:D(),phrases:Ae(D()).default([]),competitors:Ae(D()).default([]),profile:UX,audit:BX,queryResults:Ae(FX).default([]),summary:KX});ge({id:D(),projectId:D(),cronExpr:D(),preset:D().nullable().optional(),timezone:D().default("UTC"),enabled:ut().default(!0),providers:Ae(ys).default([]),lastRunAt:D().nullable().optional(),nextRunAt:D().nullable().optional(),createdAt:D(),updatedAt:D()});ge({preset:D().optional(),cron:D().optional(),timezone:D().optional().default("UTC"),enabled:ut().optional().default(!0),providers:Ae(ys).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const HX=rt(["mentioned","cited"]),uo=HX.enum;ge({id:D(),projectId:D(),propertyId:D(),clientEmail:D(),connected:ut(),createdAt:D(),updatedAt:D()});ge({date:D(),landingPage:D(),sessions:he(),organicSessions:he(),users:he()});const yN=rt(["session","first_user","manual_utm"]),GX=ge({source:D(),medium:D(),sessions:he(),users:he(),sourceDimension:yN}),VX=ge({source:D(),medium:D(),sourceDimension:yN,landingPage:D(),sessions:he(),users:he()}),ZX=ge({source:D(),medium:D(),sessions:he(),users:he(),channelGroup:D()});ge({totalSessions:he(),totalOrganicSessions:he(),totalDirectSessions:he(),totalUsers:he(),topPages:Ae(ge({landingPage:D(),sessions:he(),organicSessions:he(),directSessions:he(),users:he()})),aiReferrals:Ae(GX),aiReferralLandingPages:Ae(VX),aiSessionsDeduped:he(),aiUsersDeduped:he(),aiSessionsBySession:he(),aiUsersBySession:he(),socialReferrals:Ae(ZX),socialSessions:he(),socialUsers:he(),organicSharePct:he(),aiSharePct:he(),aiSharePctBySession:he(),directSharePct:he(),socialSharePct:he(),organicSharePctDisplay:D(),aiSharePctDisplay:D(),aiSharePctBySessionDisplay:D(),directSharePctDisplay:D(),socialSharePctDisplay:D(),lastSyncedAt:D().nullable()});ge({date:D(),source:D(),medium:D(),landingPage:D(),sessions:he(),users:he(),sourceDimension:yN});ge({date:D(),source:D(),medium:D(),sessions:he(),users:he(),channelGroup:D()});ge({date:D(),sessions:he(),organicSessions:he(),users:he()});function ez(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const YX=rt(["aero","user","compaction"]);YX.enum;const t5=128;ge({key:D().min(1).max(t5),value:D().min(1)});ge({key:D().min(1).max(t5)});const vN=rt(["queued","downloading","querying","ready","failed"]);vN.enum;ge({id:D(),release:D(),status:vN,phaseDetail:D().nullable().optional(),vertexPath:D().nullable().optional(),edgesPath:D().nullable().optional(),vertexSha256:D().nullable().optional(),edgesSha256:D().nullable().optional(),vertexBytes:he().int().nullable().optional(),edgesBytes:he().int().nullable().optional(),projectsProcessed:he().int().nullable().optional(),domainsDiscovered:he().int().nullable().optional(),downloadStartedAt:D().nullable().optional(),downloadFinishedAt:D().nullable().optional(),queryStartedAt:D().nullable().optional(),queryFinishedAt:D().nullable().optional(),error:D().nullable().optional(),createdAt:D(),updatedAt:D()});const WX=ge({linkingDomain:D(),numHosts:he().int()}),QX=ge({projectId:D(),release:D(),targetDomain:D(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:D(),queriedAt:D(),excludedLinkingDomains:he().int().optional(),excludedHosts:he().int().optional()});ge({summary:QX.nullable(),total:he().int(),rows:Ae(WX)});ge({release:D(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:D(),queriedAt:D()});ge({duckdbInstalled:ut(),duckdbVersion:D().nullable().optional(),duckdbSpec:D(),pluginDir:D()});ge({installed:ut(),version:D(),path:D(),alreadyPresent:ut()});ge({release:D(),vertexUrl:D(),edgesUrl:D(),vertexBytes:he().int().nullable(),edgesBytes:he().int().nullable(),lastModified:D().nullable()});ge({release:D(),syncStatus:vN.nullable(),bytes:he().int(),lastUsedAt:D().nullable()});rt(["snapshot","insight"]);const XX=ge({kind:ka("snapshot"),id:D(),runId:D(),keyword:D(),provider:D(),model:D().nullable(),citationState:Ou,matchedField:rt(["answerText","citedDomains","searchQueries","keyword"]),snippet:D(),createdAt:D()}),JX=ge({kind:ka("insight"),id:D(),runId:D().nullable(),type:rt(["regression","gain","opportunity"]),severity:rt(["critical","high","medium","low"]),title:D(),keyword:D(),provider:D(),matchedField:rt(["title","keyword","recommendation","cause"]),snippet:D(),dismissed:ut(),createdAt:D()}),eJ=KQ("kind",[XX,JX]);ge({query:D(),totalHits:he().int().nonnegative(),truncated:ut(),hits:Ae(eJ)});const n5=rt(["create","expand","refresh","add-schema"]);n5.enum;const r5=rt(["gsc","competitor-evidence","both"]);r5.enum;const i5=rt(["high","medium","low"]);i5.enum;const tJ=rt(["blog-post","comparison","listicle","how-to","guide","glossary"]);tJ.enum;const a5=rt(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);a5.enum;const nJ=ge({url:D(),gscImpressions:he().nonnegative(),gscClicks:he().nonnegative(),gscAvgPosition:he().nonnegative().nullable(),organicSessions:he().nonnegative()}),rJ=ge({domain:D(),url:D(),title:D(),citationCount:he().int().nonnegative()}),iJ=ge({demand:he(),competitor:he(),absence:he(),gapSeverity:he()}),aJ=ge({actionId:D(),state:a5,lastUpdated:D()}),sJ=ge({targetRef:D(),query:D(),action:n5,ourBestPage:nJ.nullable(),winningCompetitor:rJ.nullable(),score:he(),scoreBreakdown:iJ,drivers:Ae(D()),demandSource:r5,actionConfidence:i5,existingAction:aJ.nullable()});ge({targets:Ae(sJ),contextMetrics:ge({totalAiReferralSessions:he().int().nonnegative(),latestRunId:D(),runTimestamp:D()})});const oJ=ge({uri:D(),title:D(),domain:D(),isOurDomain:ut(),isCompetitor:ut(),citationCount:he().int().nonnegative(),providers:Ae(ys)}),lJ=ge({query:D(),groundingSources:Ae(oJ)});ge({sources:Ae(lJ),latestRunId:D()});const cJ=ge({query:D(),competitorDomains:Ae(D()),competitorCount:he().int().nonnegative(),missRate:he().min(0).max(1),lastSeenInRunId:D()});ge({gaps:Ae(cJ),latestRunId:D()});const s5=rt(["ok","warn","fail","skipped"]);s5.enum;const xN=rt(["global","project"]);xN.enum;const o5=rt(["auth","config","providers","integrations","database","schedules"]);o5.enum;const uJ=ge({id:D(),category:o5,scope:xN,title:D(),status:s5,code:D().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:D(),remediation:D().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Wl(D(),Au()).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.")});ge({scope:xN,project:D().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:D().describe("ISO-8601 timestamp when this doctor run started."),durationMs:he().int().nonnegative(),summary:ge({total:he().int().nonnegative(),ok:he().int().nonnegative(),warn:he().int().nonnegative(),fail:he().int().nonnegative(),skipped:he().int().nonnegative()}),checks:Ae(uJ)});const dJ=ge({provider:D(),citationState:Ou,cited:ut(),mentioned:ut(),runId:D(),runCreatedAt:D()}),fJ=ge({keywordId:D(),keyword:D(),providers:Ae(dJ),citedCount:he().int().nonnegative(),mentionedCount:he().int().nonnegative(),totalProviders:he().int().nonnegative()}),hJ=ge({keywordId:D(),keyword:D(),provider:D(),citingCompetitors:Ae(D()),runId:D(),runCreatedAt:D()}),pJ=ge({providersConfigured:he().int().nonnegative(),providersCiting:he().int().nonnegative(),providersMentioning:he().int().nonnegative(),totalKeywords:he().int().nonnegative(),keywordsCitedAndMentioned:he().int().nonnegative(),keywordsCitedOnly:he().int().nonnegative(),keywordsMentionedOnly:he().int().nonnegative(),keywordsInvisible:he().int().nonnegative(),latestRunId:D().nullable(),latestRunAt:D().nullable()});ge({summary:pJ,byKeyword:Ae(fJ),competitorGaps:Ae(hJ),status:rt(["ready","no-data"]),reason:rt(["no-runs-yet","no-keywords"]).optional()});var fo=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(fo||{});const mJ={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},ym={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},gJ=gN;function yJ(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 tv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Gi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function tz(e){return e===null?"Unknown":e?"Pass":"Fail"}function p1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function vJ(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function xJ(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 $b(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 ${p1(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${p1(u)} · ${r}`}return`${e} · ${r}`}function Dg(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function l5(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 bJ(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 wJ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function SJ(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Co(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
52
+ `):void 0}function jJ(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:Dg(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:Dg(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>SJ(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function NJ(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 kJ(e,t,n){const r=NJ(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const c5="canonry.run-tracker",m1=new Set;let nz=!1,CJ=0,nv={runs:{},batches:{}};function _J(){const e=Dl();for(const t of m1)t(e)}function AJ(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function OJ(){typeof window>"u"||window.sessionStorage.setItem(c5,JSON.stringify(nv))}function u5(){nz||(nz=!0,!(typeof window>"u")&&(nv=AJ(window.sessionStorage.getItem(c5))))}function rv(e){nv=e,OJ(),_J()}function Dl(){return u5(),nv}function EJ(e){return u5(),m1.add(e),()=>{m1.delete(e)}}function d5(e){const t=Dl();rv({...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 rz(e){const t=Dl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;rv({...t,runs:r})}function zJ(e){const t=Dl(),n=`batch_${Date.now()}_${++CJ}`;return rv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function TJ(e){const t=Dl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;rv({...t,batches:r})}function bN(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function PJ(e,t){let n=0,r=0,i=0,a=0,o=0;for(const u of e){const d=t[u]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function iz(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wN(...e){return t=>{let n=!1;const r=e.map(i=>{const a=iz(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():iz(e[i],null)}}}}function Ql(...e){return x.useCallback(wN(...e),e)}var RJ=Symbol.for("react.lazy"),Mg=Fy[" use ".trim().toString()];function DJ(e){return typeof e=="object"&&e!==null&&"then"in e}function f5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RJ&&"_payload"in e&&DJ(e._payload)}function MJ(e){const t=LJ(e),n=x.forwardRef((r,i)=>{let{children:a,...o}=r;f5(a)&&typeof Mg=="function"&&(a=Mg(a._payload));const u=x.Children.toArray(a),d=u.find(BJ);if(d){const f=d.props.children,p=u.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 IJ=MJ("Slot");function LJ(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(f5(i)&&typeof Mg=="function"&&(i=Mg(i._payload)),x.isValidElement(i)){const o=qJ(i),u=UJ(a,i.props);return i.type!==x.Fragment&&(u.ref=r?wN(r,o):o),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $J=Symbol("radix.slottable");function BJ(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$J}function UJ(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function qJ(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 h5(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=h5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=h5(e))&&(r&&(r+=" "),r+=t);return r}const az=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sz=zt,p5=(e,t)=>n=>{var r;if(t?.variants==null)return sz(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=az(p)||az(m);return i[f][y]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(w=>{let[S,j]=w;return Array.isArray(j)?j.includes({...a,...u}[S]):{...a,...u}[S]===j})?[...f,m,y]:f},[]);return sz(e,o,d,n?.class,n?.className)},FJ=(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},KJ=(e,t)=>({classGroupId:e,validator:t}),m5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ig="-",oz=[],HJ="arbitrary..",GJ=e=>{const t=ZJ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return VJ(o);const u=o.split(Ig),d=u[0]===""&&u.length>1?1:0;return g5(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=r[o],f=n[o];return d?f?FJ(f,d):d:f||oz}return n[o]||oz}}},g5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=g5(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const u=t===0?e.join(Ig):e.slice(t).join(Ig),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},VJ=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?HJ+r:void 0})(),ZJ=e=>{const{theme:t,classGroups:n}=e;return YJ(n,t)},YJ=(e,t)=>{const n=m5();for(const r in e){const i=e[r];SN(i,n,r,t)}return n},SN=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];WJ(o,t,n,r)}},WJ=(e,t,n,r)=>{if(typeof e=="string"){QJ(e,t,n);return}if(typeof e=="function"){XJ(e,t,n,r);return}JJ(e,t,n,r)},QJ=(e,t,n)=>{const r=e===""?t:y5(t,e);r.classGroupId=n},XJ=(e,t,n,r)=>{if(eee(e)){SN(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(KJ(n,e))},JJ=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[u,d]=i[o];SN(d,y5(t,u),n,r)}},y5=(e,t)=>{let n=e;const r=t.split(Ig),i=r.length;for(let a=0;a<i;a++){const o=r[a];let u=n.nextPart.get(o);u||(u=m5(),n.nextPart.set(o,u)),n=u}return n},eee=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,tee=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)}}},g1="!",lz=":",nee=[],cz=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ree=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,u=0,d=0,f;const p=i.length;for(let S=0;S<p;S++){const j=i[S];if(o===0&&u===0){if(j===lz){a.push(i.slice(d,S)),d=S+1;continue}if(j==="/"){f=S;continue}}j==="["?o++:j==="]"?o--:j==="("?u++:j===")"&&u--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(g1)?(y=m.slice(0,-1),v=!0):m.startsWith(g1)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return cz(a,v,y,w)};if(t){const i=t+lz,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):cz(nee,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},iee=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],u=o[0]==="[",d=t.has(o);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},aee=e=>({cache:tee(e.cacheSize),parseClassName:ree(e),sortModifiers:iee(e),...GJ(e)}),see=/\s+/,oee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],u=e.trim().split(see);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!S,k=r(j?w.substring(0,S):w);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(w),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const O=y.length===0?"":y.length===1?y[0]:a(y).join(":"),_=v?O+g1:O,C=_+k;if(o.indexOf(C)>-1)continue;o.push(C);const T=i(k,j);for(let E=0;E<T.length;++E){const A=T[E];o.push(_+A)}d=p+(d.length>0?" "+d:d)}return d},lee=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=v5(n))&&(i&&(i+=" "),i+=r);return i},v5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v5(e[r]))&&(n&&(n+=" "),n+=t);return n},cee=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=aee(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=oee(d,n);return i(d,p),p};return a=o,(...d)=>a(lee(...d))},uee=[],In=e=>{const t=n=>n[e]||uee;return t.isThemeGetter=!0,t},x5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,b5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hee=/\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$/,pee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qs=e=>dee.test(e),ft=e=>!!e&&!Number.isNaN(Number(e)),Xs=e=>!!e&&Number.isInteger(Number(e)),Bb=e=>e.endsWith("%")&&ft(e.slice(0,-1)),rs=e=>fee.test(e),w5=()=>!0,yee=e=>hee.test(e)&&!pee.test(e),jN=()=>!1,vee=e=>mee.test(e),xee=e=>gee.test(e),bee=e=>!Me(e)&&!Ie(e),wee=e=>To(e,N5,jN),Me=e=>x5.test(e),rl=e=>To(e,k5,yee),uz=e=>To(e,Oee,ft),See=e=>To(e,_5,w5),jee=e=>To(e,C5,jN),dz=e=>To(e,S5,jN),Nee=e=>To(e,j5,xee),vm=e=>To(e,A5,vee),Ie=e=>b5.test(e),lf=e=>Xl(e,k5),kee=e=>Xl(e,C5),fz=e=>Xl(e,S5),Cee=e=>Xl(e,N5),_ee=e=>Xl(e,j5),xm=e=>Xl(e,A5,!0),Aee=e=>Xl(e,_5,!0),To=(e,t,n)=>{const r=x5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Xl=(e,t,n=!1)=>{const r=b5.exec(e);return r?r[1]?t(r[1]):n:!1},S5=e=>e==="position"||e==="percentage",j5=e=>e==="image"||e==="url",N5=e=>e==="length"||e==="size"||e==="bg-size",k5=e=>e==="length",Oee=e=>e==="number",C5=e=>e==="family-name",_5=e=>e==="number"||e==="weight",A5=e=>e==="shadow",Eee=()=>{const e=In("color"),t=In("font"),n=In("text"),r=In("font-weight"),i=In("tracking"),a=In("leading"),o=In("breakpoint"),u=In("container"),d=In("spacing"),f=In("radius"),p=In("shadow"),m=In("inset-shadow"),y=In("text-shadow"),v=In("drop-shadow"),w=In("blur"),S=In("perspective"),j=In("aspect"),k=In("ease"),O=In("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...C(),Ie,Me],E=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],P=()=>[Ie,Me,d],$=()=>[Qs,"full","auto",...P()],F=()=>[Xs,"none","subgrid",Ie,Me],U=()=>["auto",{span:["full",Xs,Ie,Me]},Xs,Ie,Me],B=()=>[Xs,"auto",Ie,Me],V=()=>["auto","min","max","fr",Ie,Me],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...P()],te=()=>[Qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],le=()=>[Qs,"screen","full","dvw","lvw","svw","min","max","fit",...P()],je=()=>[Qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],L=()=>[e,Ie,Me],I=()=>[...C(),fz,dz,{position:[Ie,Me]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",Cee,wee,{size:[Ie,Me]}],G=()=>[Bb,lf,rl],ie=()=>["","none","full",f,Ie,Me],ne=()=>["",ft,lf,rl],Ce=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[ft,Bb,fz,dz],pe=()=>["","none",w,Ie,Me],Oe=()=>["none",ft,Ie,Me],W=()=>["none",ft,Ie,Me],Fe=()=>[ft,Ie,Me],Te=()=>[Qs,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rs],breakpoint:[rs],color:[w5],container:[rs],"drop-shadow":[rs],ease:["in","out","in-out"],font:[bee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rs],shadow:[rs],spacing:["px",ft],text:[rs],"text-shadow":[rs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qs,Me,Ie,j]}],container:["container"],columns:[{columns:[ft,Me,Ie,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Xs,"auto",Ie,Me]}],basis:[{basis:[Qs,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,Qs,"auto","initial","none",Me]}],grow:[{grow:["",ft,Ie,Me]}],shrink:[{shrink:["",ft,Ie,Me]}],order:[{order:[Xs,"first","last","none",Ie,Me]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"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":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m: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":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...le()]}],"min-inline-size":[{"min-inline":["auto",...le()]}],"max-inline-size":[{"max-inline":["none",...le()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[u,"screen",...te()]}],"min-w":[{"min-w":[u,"screen","none",...te()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,lf,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Aee,See]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bb,Me]}],"font-family":[{font:[kee,jee,t]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ie,Me]}],"line-clamp":[{"line-clamp":[ft,"none",Ie,uz]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ie,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",Ie,rl]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ft,"auto",Ie,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xs,Ie,Me],radial:["",Ie,Me],conic:[Xs,Ie,Me]},_ee,Nee]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"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":[ft,Ie,Me]}],"outline-w":[{outline:["",ft,lf,rl]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,xm,vm]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,xm,vm]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ft,rl]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,xm,vm]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ft,Ie,Me]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"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":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ie,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"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:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Me]}],filter:[{filter:["","none",Ie,Me]}],blur:[{blur:pe()}],brightness:[{brightness:[ft,Ie,Me]}],contrast:[{contrast:[ft,Ie,Me]}],"drop-shadow":[{"drop-shadow":["","none",v,xm,vm]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ft,Ie,Me]}],"hue-rotate":[{"hue-rotate":[ft,Ie,Me]}],invert:[{invert:["",ft,Ie,Me]}],saturate:[{saturate:[ft,Ie,Me]}],sepia:[{sepia:["",ft,Ie,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Me]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[ft,Ie,Me]}],"backdrop-contrast":[{"backdrop-contrast":[ft,Ie,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,Ie,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,Ie,Me]}],"backdrop-invert":[{"backdrop-invert":["",ft,Ie,Me]}],"backdrop-opacity":[{"backdrop-opacity":[ft,Ie,Me]}],"backdrop-saturate":[{"backdrop-saturate":[ft,Ie,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,Ie,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",Ie,Me]}],ease:[{ease:["linear","initial",k,Ie,Me]}],delay:[{delay:[ft,Ie,Me]}],animate:[{animate:["none",O,Ie,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ie,Me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[Ie,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"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",Ie,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie,Me]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[ft,lf,rl,uz]}],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"]}},zee=cee(Eee);function Mi(...e){return zee(zt(e))}const Tee=p5("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"}}),xe=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?IJ:"button";return l.jsx(o,{ref:a,className:Mi(Tee({variant:t,size:n,className:e})),...i})});xe.displayName="Button";const Pee=p5("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 O5({className:e,variant:t,...n}){return l.jsx("div",{className:Mi(Pee({variant:t}),e),...n})}function hz({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return l.jsxs(Kt,{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 Ml({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 wt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(O5,{variant:r,...n,children:t})}function iv({status:e}){return l.jsx(wt,{tone:l5(e),children:tv(e)})}function xo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Ree(e,t){const n=x.createContext(t),r=a=>{const{children:o,...u}=a,d=x.useMemo(()=>u,Object.values(u));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 Dee(e,t=[]){let n=[];function r(a,o){const u=x.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...w}=m,S=y?.[e]?.[d]||u,j=x.useMemo(()=>w,Object.values(w));return l.jsx(S.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||u,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(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,Mee(i,...t)]}function Mee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Yf=globalThis?.document?x.useLayoutEffect:()=>{},Iee=Fy[" useId ".trim().toString()]||(()=>{}),Lee=0;function Ub(e){const[t,n]=x.useState(Iee());return Yf(()=>{n(r=>r??String(Lee++))},[e]),e||(t?`radix-${t}`:"")}var $ee=Fy[" useInsertionEffect ".trim().toString()]||Yf;function Bee({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=Uee({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const f=x.useCallback(p=>{if(u){const m=qee(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[u,e,a,o]);return[d,f]}function Uee({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return $ee(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function qee(e){return typeof e=="function"}function E5(e){const t=Fee(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,u=x.Children.toArray(a),d=u.find(Hee);if(d){const f=d.props.children,p=u.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 Fee(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=Vee(i),u=Gee(a,i.props);return i.type!==x.Fragment&&(u.ref=r?wN(r,o):o),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kee=Symbol("radix.slottable");function Hee(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kee}function Gee(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Vee(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 Zee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vs=Zee.reduce((e,t)=>{const n=E5(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...u}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yee(e,t){e&&Zl.flushSync(()=>e.dispatchEvent(t))}function Wf(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function Wee(e,t=globalThis?.document){const n=Wf(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 Qee="DismissableLayer",y1="dismissableLayer.update",Xee="dismissableLayer.pointerDownOutside",Jee="dismissableLayer.focusOutside",pz,z5=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),T5=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:u,...d}=e,f=x.useContext(z5),[p,m]=x.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=Ql(t,A=>m(A)),S=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(j),O=p?S.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=O>=k,T=nte(A=>{const P=A.target,$=[...f.branches].some(F=>F.contains(P));!C||$||(i?.(A),o?.(A),A.defaultPrevented||u?.())},y),E=rte(A=>{const P=A.target;[...f.branches].some(F=>F.contains(P))||(a?.(A),o?.(A),A.defaultPrevented||u?.())},y);return Wee(A=>{O===f.layers.size-1&&(r?.(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))},y),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(pz=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),mz(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=pz)}},[p,y,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),mz())},[p,f]),x.useEffect(()=>{const A=()=>v({});return document.addEventListener(y1,A),()=>document.removeEventListener(y1,A)},[]),l.jsx(vs.div,{...d,ref:w,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:xo(e.onFocusCapture,E.onFocusCapture),onBlurCapture:xo(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:xo(e.onPointerDownCapture,T.onPointerDownCapture)})});T5.displayName=Qee;var ete="DismissableLayerBranch",tte=x.forwardRef((e,t)=>{const n=x.useContext(z5),r=x.useRef(null),i=Ql(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(vs.div,{...e,ref:i})});tte.displayName=ete;function nte(e,t=globalThis?.document){const n=Wf(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){P5(Xee,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function rte(e,t=globalThis?.document){const n=Wf(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&P5(Jee,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 mz(){const e=new CustomEvent(y1);document.dispatchEvent(e)}function P5(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?Yee(i,a):i.dispatchEvent(a)}var qb="focusScope.autoFocusOnMount",Fb="focusScope.autoFocusOnUnmount",gz={bubbles:!1,cancelable:!0},ite="FocusScope",R5=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[u,d]=x.useState(null),f=Wf(i),p=Wf(a),m=x.useRef(null),y=Ql(t,S=>d(S)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const C=_.target;u.contains(C)?m.current=C:to(m.current,{select:!0})},j=function(_){if(v.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||to(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const T of _)T.removedNodes.length>0&&to(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",j);const O=new MutationObserver(k);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",j),O.disconnect()}}},[r,u,v.paused]),x.useEffect(()=>{if(u){vz.add(v);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(qb,gz);u.addEventListener(qb,f),u.dispatchEvent(k),k.defaultPrevented||(ate(ute(D5(u)),{select:!0}),document.activeElement===S&&to(u))}return()=>{u.removeEventListener(qb,f),setTimeout(()=>{const k=new CustomEvent(Fb,gz);u.addEventListener(Fb,p),u.dispatchEvent(k),k.defaultPrevented||to(S??document.body,{select:!0}),u.removeEventListener(Fb,p),vz.remove(v)},0)}}},[u,f,p,v]);const w=x.useCallback(S=>{if(!n&&!r||v.paused)return;const j=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(j&&k){const O=S.currentTarget,[_,C]=ste(O);_&&C?!S.shiftKey&&k===C?(S.preventDefault(),n&&to(_,{select:!0})):S.shiftKey&&k===_&&(S.preventDefault(),n&&to(C,{select:!0})):k===O&&S.preventDefault()}},[n,r,v.paused]);return l.jsx(vs.div,{tabIndex:-1,...o,ref:y,onKeyDown:w})});R5.displayName=ite;function ate(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(to(r,{select:t}),document.activeElement!==n)return}function ste(e){const t=D5(e),n=yz(t,e),r=yz(t.reverse(),e);return[n,r]}function D5(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 yz(e,t){for(const n of e)if(!ote(n,{upTo:t}))return n}function ote(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 lte(e){return e instanceof HTMLInputElement&&"select"in e}function to(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&lte(e)&&t&&e.select()}}var vz=cte();function cte(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xz(e,t),e.unshift(t)},remove(t){e=xz(e,t),e[0]?.resume()}}}function xz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ute(e){return e.filter(t=>t.tagName!=="A")}var dte="Portal",M5=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);Yf(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?CH.createPortal(l.jsx(vs.div,{...r,ref:t}),o):null});M5.displayName=dte;function fte(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var av=e=>{const{present:t,children:n}=e,r=hte(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Ql(r.ref,pte(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};av.displayName="Presence";function hte(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[u,d]=fte(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=bm(r.current);a.current=u==="mounted"?f:"none"},[u]),Yf(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=bm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Yf(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const S=bm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=bm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function bm(e){return e?.animationName||"none"}function pte(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 Kb=0;function mte(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bz()),document.body.insertAdjacentElement("beforeend",e[1]??bz()),Kb++,()=>{Kb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kb--}},[])}function bz(){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 va=function(){return va=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},va.apply(this,arguments)};function I5(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 gte(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 sg="right-scroll-bar-position",og="width-before-scroll-bar",yte="with-scroll-bars-hidden",vte="--removed-body-scroll-bar-size";function Hb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xte(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 bte=typeof window<"u"?x.useLayoutEffect:x.useEffect,wz=new WeakMap;function wte(e,t){var n=xte(null,function(r){return e.forEach(function(i){return Hb(i,r)})});return bte(function(){var r=wz.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(u){a.has(u)||Hb(u,null)}),a.forEach(function(u){i.has(u)||Hb(u,o)})}wz.set(n,e)},[e]),n}function Ste(e){return e}function jte(e,t){t===void 0&&(t=Ste);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function Nte(e){e===void 0&&(e={});var t=jte(null);return t.options=va({async:!0,ssr:!1},e),t}var L5=function(e){var t=e.sideCar,n=I5(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,va({},n))};L5.isSideCarExport=!0;function kte(e,t){return e.useMedium(t),L5}var $5=Nte(),Gb=function(){},sv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Gb,onWheelCapture:Gb,onTouchMoveCapture:Gb}),i=r[0],a=r[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,S=e.inert,j=e.allowPinchZoom,k=e.as,O=k===void 0?"div":k,_=e.gapMode,C=I5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=y,E=wte([n,t]),A=va(va({},C),i);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:$5,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:S,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?x.cloneElement(x.Children.only(u),va(va({},A),{ref:E})):x.createElement(O,va({},A,{className:d,ref:E}),u))});sv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sv.classNames={fullWidth:og,zeroRight:sg};var Cte=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _te(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Cte();return t&&e.setAttribute("nonce",t),e}function Ate(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ote(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ete=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_te())&&(Ate(t,n),Ote(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zte=function(){var e=Ete();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},B5=function(){var e=zte(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Tte={left:0,top:0,right:0,gap:0},Vb=function(e){return parseInt(e||"",10)||0},Pte=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[Vb(n),Vb(r),Vb(i)]},Rte=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tte;var t=Pte(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])}},Dte=B5(),pu="data-scroll-locked",Mte=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
53
+ .`.concat(yte,` {
54
+ overflow: hidden `).concat(r,`;
55
+ padding-right: `).concat(u,"px ").concat(r,`;
56
+ }
57
+ body[`).concat(pu,`] {
58
+ overflow: hidden `).concat(r,`;
59
+ overscroll-behavior: contain;
60
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
61
+ padding-left: `.concat(i,`px;
62
+ padding-top: `).concat(a,`px;
63
+ padding-right: `).concat(o,`px;
64
+ margin-left:0;
65
+ margin-top:0;
66
+ margin-right: `).concat(u,"px ").concat(r,`;
67
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
68
+ }
69
+
70
+ .`).concat(sg,` {
71
+ right: `).concat(u,"px ").concat(r,`;
72
+ }
73
+
74
+ .`).concat(og,` {
75
+ margin-right: `).concat(u,"px ").concat(r,`;
76
+ }
77
+
78
+ .`).concat(sg," .").concat(sg,` {
79
+ right: 0 `).concat(r,`;
80
+ }
81
+
82
+ .`).concat(og," .").concat(og,` {
83
+ margin-right: 0 `).concat(r,`;
84
+ }
85
+
86
+ body[`).concat(pu,`] {
87
+ `).concat(vte,": ").concat(u,`px;
88
+ }
89
+ `)},Sz=function(){var e=parseInt(document.body.getAttribute(pu)||"0",10);return isFinite(e)?e:0},Ite=function(){x.useEffect(function(){return document.body.setAttribute(pu,(Sz()+1).toString()),function(){var e=Sz()-1;e<=0?document.body.removeAttribute(pu):document.body.setAttribute(pu,e.toString())}},[])},Lte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Ite();var a=x.useMemo(function(){return Rte(i)},[i]);return x.createElement(Dte,{styles:Mte(a,!t,i,n?"":"!important")})},v1=!1;if(typeof window<"u")try{var wm=Object.defineProperty({},"passive",{get:function(){return v1=!0,!0}});window.addEventListener("test",wm,wm),window.removeEventListener("test",wm,wm)}catch{v1=!1}var Bc=v1?{passive:!1}:!1,$te=function(e){return e.tagName==="TEXTAREA"},U5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$te(e)&&n[t]==="visible")},Bte=function(e){return U5(e,"overflowY")},Ute=function(e){return U5(e,"overflowX")},jz=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=q5(e,r);if(i){var a=F5(e,r),o=a[1],u=a[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Fte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},q5=function(e,t){return e==="v"?Bte(t):Ute(t)},F5=function(e,t){return e==="v"?qte(t):Fte(t)},Kte=function(e,t){return e==="h"&&t==="rtl"?-1:1},Hte=function(e,t,n,r,i){var a=Kte(e,window.getComputedStyle(t).direction),o=a*r,u=n.target,d=t.contains(u),f=!1,p=o>0,m=0,y=0;do{if(!u)break;var v=F5(e,u),w=v[0],S=v[1],j=v[2],k=S-j-a*w;(w||k)&&q5(e,u)&&(m+=k,y+=w);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},Sm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nz=function(e){return[e.deltaX,e.deltaY]},kz=function(e){return e&&"current"in e?e.current:e},Gte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vte=function(e){return`
90
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
91
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
+ `)},Zte=0,Uc=[];function Yte(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Zte++)[0],a=x.useState(B5)[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 S=gte([e.lockRef.current],(e.shards||[]).map(kz),!0).filter(Boolean);return S.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(S,j){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!o.current.allowPinchZoom;var k=Sm(S),O=n.current,_="deltaX"in S?S.deltaX:O[0]-k[0],C="deltaY"in S?S.deltaY:O[1]-k[1],T,E=S.target,A=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in S&&A==="h"&&E.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,F=$?$===E||$.contains(E):!1;if(F)return!1;var U=jz(A,E);if(!U)return!0;if(U?T=A:(T=A==="v"?"h":"v",U=jz(A,E)),!U)return!1;if(!r.current&&"changedTouches"in S&&(_||C)&&(r.current=T),!T)return!0;var B=r.current||T;return Hte(B,j,S,B==="h"?_:C)},[]),d=x.useCallback(function(S){var j=S;if(!(!Uc.length||Uc[Uc.length-1]!==a)){var k="deltaY"in j?Nz(j):Sm(j),O=t.current.filter(function(T){return T.name===j.type&&(T.target===j.target||j.target===T.shadowParent)&&Gte(T.delta,k)})[0];if(O&&O.should){j.cancelable&&j.preventDefault();return}if(!O){var _=(o.current.shards||[]).map(kz).filter(Boolean).filter(function(T){return T.contains(j.target)}),C=_.length>0?u(j,_[0]):!o.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(S,j,k,O){var _={name:S,delta:j,target:k,should:O,shadowParent:Wte(k)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=x.useCallback(function(S){n.current=Sm(S),r.current=void 0},[]),m=x.useCallback(function(S){f(S.type,Nz(S),S.target,u(S,e.lockRef.current))},[]),y=x.useCallback(function(S){f(S.type,Sm(S),S.target,u(S,e.lockRef.current))},[]);x.useEffect(function(){return Uc.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Bc),document.addEventListener("touchmove",d,Bc),document.addEventListener("touchstart",p,Bc),function(){Uc=Uc.filter(function(S){return S!==a}),document.removeEventListener("wheel",d,Bc),document.removeEventListener("touchmove",d,Bc),document.removeEventListener("touchstart",p,Bc)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:Vte(i)}):null,v?x.createElement(Lte,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Qte=kte($5,Yte);var K5=x.forwardRef(function(e,t){return x.createElement(sv,va({},e,{ref:t,sideCar:Qte}))});K5.classNames=sv.classNames;var Xte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qc=new WeakMap,jm=new WeakMap,Nm={},Zb=0,H5=function(e){return e&&(e.host||H5(e.parentNode))},Jte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=H5(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})},ene=function(e,t,n,r){var i=Jte(t,Array.isArray(e)?e:[e]);Nm[n]||(Nm[n]=new WeakMap);var a=Nm[n],o=[],u=new Set,d=new Set(i),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(u.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",S=(qc.get(y)||0)+1,j=(a.get(y)||0)+1;qc.set(y,S),a.set(y,j),o.push(y),S===1&&w&&jm.set(y,!0),j===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),u.clear(),Zb++,function(){o.forEach(function(m){var y=qc.get(m)-1,v=a.get(m)-1;qc.set(m,y),a.set(m,v),y||(jm.has(m)||m.removeAttribute(r),jm.delete(m)),v||m.removeAttribute(n)}),Zb--,Zb||(qc=new WeakMap,qc=new WeakMap,jm=new WeakMap,Nm={})}},tne=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Xte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ene(r,i,n,"aria-hidden")):function(){return null}},ov="Dialog",[G5]=Dee(ov),[nne,ea]=G5(ov),V5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,u=x.useRef(null),d=x.useRef(null),[f,p]=Bee({prop:r,defaultProp:i??!1,onChange:a,caller:ov});return l.jsx(nne,{scope:t,triggerRef:u,contentRef:d,contentId:Ub(),titleId:Ub(),descriptionId:Ub(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};V5.displayName=ov;var Z5="DialogTrigger",rne=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ea(Z5,n),a=Ql(t,i.triggerRef);return l.jsx(vs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":CN(i.open),...r,ref:a,onClick:xo(e.onClick,i.onOpenToggle)})});rne.displayName=Z5;var NN="DialogPortal",[ine,Y5]=G5(NN,{forceMount:void 0}),W5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ea(NN,t);return l.jsx(ine,{scope:t,forceMount:n,children:x.Children.map(r,o=>l.jsx(av,{present:n||a.open,children:l.jsx(M5,{asChild:!0,container:i,children:o})}))})};W5.displayName=NN;var Lg="DialogOverlay",Q5=x.forwardRef((e,t)=>{const n=Y5(Lg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ea(Lg,e.__scopeDialog);return a.modal?l.jsx(av,{present:r||a.open,children:l.jsx(sne,{...i,ref:t})}):null});Q5.displayName=Lg;var ane=E5("DialogOverlay.RemoveScroll"),sne=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ea(Lg,n);return l.jsx(K5,{as:ane,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(vs.div,{"data-state":CN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Il="DialogContent",X5=x.forwardRef((e,t)=>{const n=Y5(Il,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ea(Il,e.__scopeDialog);return l.jsx(av,{present:r||a.open,children:a.modal?l.jsx(one,{...i,ref:t}):l.jsx(lne,{...i,ref:t})})});X5.displayName=Il;var one=x.forwardRef((e,t)=>{const n=ea(Il,e.__scopeDialog),r=x.useRef(null),i=Ql(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return tne(a)},[]),l.jsx(J5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xo(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&a.preventDefault()}),onFocusOutside:xo(e.onFocusOutside,a=>a.preventDefault())})}),lne=x.forwardRef((e,t)=>{const n=ea(Il,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return l.jsx(J5,{...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()}})}),J5=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,u=ea(Il,n),d=x.useRef(null),f=Ql(t,d);return mte(),l.jsxs(l.Fragment,{children:[l.jsx(R5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(T5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":CN(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(cne,{titleId:u.titleId}),l.jsx(dne,{contentRef:d,descriptionId:u.descriptionId})]})]})}),kN="DialogTitle",e4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ea(kN,n);return l.jsx(vs.h2,{id:i.titleId,...r,ref:t})});e4.displayName=kN;var t4="DialogDescription",n4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ea(t4,n);return l.jsx(vs.p,{id:i.descriptionId,...r,ref:t})});n4.displayName=t4;var r4="DialogClose",i4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ea(r4,n);return l.jsx(vs.button,{type:"button",...r,ref:t,onClick:xo(e.onClick,()=>i.onOpenChange(!1))})});i4.displayName=r4;function CN(e){return e?"open":"closed"}var a4="DialogTitleWarning",[YCe,s4]=Ree(a4,{contentName:Il,titleName:kN,docsSlug:"dialog"}),cne=({titleId:e})=>{const t=s4(a4),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},une="DialogDescriptionWarning",dne=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${s4(une).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},o4=V5,l4=W5,_N=Q5,AN=X5,ON=e4,c4=n4,u4=i4;const fne=o4,hne=l4,d4=x.forwardRef(({className:e,...t},n)=>l.jsx(_N,{ref:n,className:Mi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));d4.displayName=_N.displayName;const pne=400,mne=1200,gne=720,f4=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(gne),o=x.useRef(!1),u=x.useRef(0),d=x.useRef(0),f=x.useCallback(y=>{o.current=!0,u.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=x.useCallback(y=>{if(!o.current)return;const v=u.current-y.clientX,w=Math.min(mne,Math.max(pne,d.current+v));a(w)},[]),m=x.useCallback(()=>{o.current=!1},[]);return l.jsxs(hne,{children:[l.jsx(d4,{}),l.jsxs(AN,{ref:r,className:Mi("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(u4,{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(wh,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});f4.displayName=AN.displayName;const yne=({className:e,...t})=>l.jsx("div",{className:Mi("flex flex-col gap-1.5 pr-10",e),...t}),h4=x.forwardRef(({className:e,...t},n)=>l.jsx(ON,{ref:n,className:Mi("text-lg font-medium text-zinc-50",e),...t}));h4.displayName=ON.displayName;const p4=x.forwardRef(({className:e,...t},n)=>l.jsx(c4,{ref:n,className:Mi("text-sm text-zinc-500",e),...t}));p4.displayName=c4.displayName;function vne({title:e,subtitle:t,children:n,open:r,onClose:i}){return l.jsx(fne,{open:r,onOpenChange:a=>a?void 0:i(),children:l.jsxs(f4,{children:[l.jsxs(yne,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(h4,{id:"drawer-title",children:e}),l.jsx(p4,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:n})]})})}function Tn({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&&Zl.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)]})}function Cz(e,t){const n=xne(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"?Vi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=p.toLowerCase();d.has(m)||d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((y,v)=>{if(!y)return null;if(v%2===1){const S=d.get(y.toLowerCase())??"answer-highlight";return f.type==="bold"?Vi.createElement("mark",{key:`hl-${p}-${v}`,className:S},Vi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Vi.createElement("mark",{key:`hl-${p}-${v}`,className:S},y)}return f.type==="bold"?Vi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function xne(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Yb(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 bne({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,o]=x.useState("mentions"),[u,d]=x.useState(-1),[f,p]=x.useState(null),[m,y]=x.useState(!1),[v,w]=x.useState({}),S=mX(t.project),j=new Set(S.map(f1)),k=e.runHistory,O=k.length>1,[_,C]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(T.current=!0,Rl(G.runId).then(ie=>{const ne=ie.snapshots.find(Ce=>Ce.keyword===e.keyword&&Ce.provider===e.provider);ne&&C({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:G.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const E=u>=0&&f!==null,A=E?f:_||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},P=A.visibilityState==="pending"||A.citationState==="pending",$=P?!1:A.visibilityState!=null?A.visibilityState==="visible":A.answerMentioned!=null?A.answerMentioned:A.citationState==="cited"||A.citationState==="emerging",F=A.answerMentioned!=null||A.visibilityState!=null||A.recommendedCompetitors.length>0,U=A.citedDomains.length>0||A.groundingSources.length>0||A.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...S.map(f1),B,B.split(" ").slice(0,2).join(" "),...A.matchedTerms].filter(G=>G.trim().length>2),ee=[...A.competitorDomains.flatMap(G=>{const ie=G.split(".")[0];return ie&&ie.length>=4?[ie]:[]}),...A.recommendedCompetitors].filter(G=>G.trim().length>2),Q=[{terms:V,className:"answer-highlight-brand"},...ee.length>0?[{terms:ee,className:"answer-highlight-competitor"}]:[]],K=P?"pending":A.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",te=x.useRef(0),le=x.useCallback(async G=>{const ie=++te.current;if(G===-1||G===k.length-1){d(-1),p(null),i(!1);return}d(G),i(!1);const ne=k[G],Ce=`${ne.runId}::${e.keyword}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}y(!0);try{const Se=await Rl(ne.runId);if(ie!==te.current)return;const J=Se.snapshots.find(Oe=>Oe.keyword===e.keyword&&Oe.provider===e.provider)??Se.snapshots.find(Oe=>Oe.keyword===e.keyword),pe=J?{citationState:J.citationState,answerMentioned:J.answerMentioned,visibilityState:J.visibilityState,visibilityTransition:ne.visibilityTransition,provider:J.provider,model:J.model??null,answerSnippet:J.answerText??"",citedDomains:J.citedDomains,competitorDomains:J.competitorOverlap,recommendedCompetitors:J.recommendedCompetitors??[],matchedTerms:J.matchedTerms??[],groundingSources:J.groundingSources,evidenceUrls:[],changeLabel:Yb(ne.visibilityTransition,ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Yb(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};w(Oe=>({...Oe,[Ce]:pe})),p(pe)}catch{if(ie!==te.current)return;p({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Yb(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{ie===te.current&&y(!1)}},[k,e.keyword,e.provider,v]),L=(E||e.historyScope!=="provider")&&A.model?`${A.provider} (${A.model}) · ${A.changeLabel.toLowerCase()}`:`${A.provider} · ${A.changeLabel.toLowerCase()}`,I=!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(" · "):"",q=$?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:L}:A.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:L}:P?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:L},R=()=>{if(!A.answerSnippet)return null;const G=A.answerSnippet.split(`
97
+ `),ie=[];let ne=[],Ce=0;const Se=()=>{if(ne.length===0)return;const J=ne.join(" ").trim();J&&ie.push(l.jsx("p",{className:ie.length>0?"mt-2.5":"",children:Cz(J,Q)},Ce++)),ne=[]};for(const J of G){const pe=J.trim();if(/^[-\u2013\u2014]{3,}$/.test(pe)){Se(),ie.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Oe=pe.match(/^(#{1,3})\s+(.+)$/);if(Oe){Se();const W=Oe[1].length,Fe=Oe[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Oe[2],Te=W===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":W===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ie.push(l.jsx("p",{className:Te,children:Cz(Fe,Q)},Ce++));continue}if(pe===""){Se();continue}ne.push(pe)}return Se(),ie};return l.jsx(o4,{open:!0,onOpenChange:G=>{G||n()},children:l.jsxs(l4,{children:[l.jsx(_N,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(AN,{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," ","·"," ",A.provider||"All providers"]}),l.jsx(ON,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(u4,{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(wh,{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:k.map((G,ie)=>{const ne=u===-1&&ie===k.length-1||u===ie,Ce=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),Se=G.visibilityTransition??Ce,J=Ce==="visible"?"bg-emerald-400":Se==="emerging"?"bg-amber-400":Se==="lost"?"bg-rose-400":"bg-zinc-600",Oe=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),W=!!(G.model&&ie>0&&k[ie-1]?.model&&k[ie-1].model!==G.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>le(ie===k.length-1?-1:ie),"aria-label":[`Run ${Oe}: ${Ce}`,G.model?`model ${G.model}`:null,W?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[l.jsx("span",{className:`size-2 rounded-full ${J} ${W?"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:Oe})]},ie)})}),u>=0&&u<k.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",l.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),l.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>le(-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(G=>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:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.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:q.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${K}`,children:q.title}),l.jsx("p",{className:"evidence-position-meta",children:q.meta}),I&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:I})]}),A.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:R()}),A.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"})]}),!A.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:$?"Why you're visible":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,ie)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?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:G})]},ie))})]}),A.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:A.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||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(Tn,{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--${$?"visible":"not-visible"}`,children:[l.jsx("span",{className:"mention-status-icon",children:P?"…":$?"✓":"—"}),l.jsx("span",{className:"mention-status-label",children:P?"Pending":$?"Visible":"Not visible"})]}),A.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:A.matchedTerms.map(G=>l.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!P&&!$&&A.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:V.map(G=>l.jsx("span",{className:"mention-chip mention-chip--muted",children:G},G))}),l.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(A.recommendedCompetitors.length>0||A.competitorDomains.length>0)&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Competitors in answer"}),l.jsx(Tn,{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 G=A.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),ie=new Set(G.map(Ce=>ez(Ce.replace(/\.[^.]+$/,""))));return[...A.recommendedCompetitors.filter(Ce=>!ie.has(ez(Ce))),...G].map(Ce=>l.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&l.jsxs(l.Fragment,{children:[A.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(Tn,{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:A.citedDomains.map((G,ie)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ce=j.has(ne),Se=!Ce&&A.competitorDomains.some(pe=>pe.toLowerCase().replace(/^www\./,"")===ne),J=Ce?"you":Se?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${J}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ie+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:G}),Ce&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Se&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)})})]}),A.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 (",A.groundingSources.length,")"]}),l.jsx(Tn,{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:A.groundingSources.map((G,ie)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:G.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},ie))})]}),A.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:A.evidenceUrls.map(G=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),A.citedDomains.length===0&&A.groundingSources.length===0&&A.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"]})]}),!F&&!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 Hi(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 Wb=[{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 lv(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 wne=lv({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"}),Sne=lv({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"}),jne=lv({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"}),Nne=lv({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"}),kne=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:Hi(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:Hi(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:Hi(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:Hi(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Wb[0],Wb[1],Hi(["cited","cited","cited","cited","cited"]),Wb[2],2/7,Hi(["not-cited","not-cited","not-cited","cited"]);function Cne(e,t){return e.projects.find(n=>n.project.id===t)}function _ne(e,t){return e.runs.find(n=>n.id===t)}function Ane(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 One={regression:"negative",gain:"positive",opportunity:"caution"},Ene={regression:"lost",gain:"emerging",opportunity:"not-cited"},zne={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function Tne(e){return{id:e.id,tone:One[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??zne[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:Ene[e.type]}]}}function Pne(e){return e.filter(t=>!t.dismissed).map(Tne)}function m4(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 x1(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Rne(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 EN(e){switch(e){case Gt["answer-visibility"]:return"Answer visibility sweep";case Gt["gsc-sync"]:return"GSC sync";case Gt["inspect-sitemap"]:return"Sitemap inspection";case Gt["ga-sync"]:return"GA sync";case Gt["bing-inspect"]:return"Bing URL inspection";case Gt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Gt["site-audit"]:return"Site audit";case Gt["backlink-extract"]:return"Backlink extract"}}function Dne(e){return e===Rf.manual?"Manual":e===Rf.scheduled?"Scheduled":e===Rf["config-apply"]?"Config apply":e}function zN(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:EN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?x1(e.startedAt):x1(e.createdAt),duration:Rne(e.startedAt,e.finishedAt),statusDetail:e.error?g4(e.error):Mne(e),summary:Ine(e),triggerLabel:Dne(e.trigger)}}function g4(e){const t=gN(e);return t.length>200?t.slice(0,200)+"…":t}function Mne(e){switch(e.status){case yn.queued:return"Waiting for execution slot.";case yn.running:return"Provider queries in progress.";case yn.completed:return"All key phrases checked.";case yn.partial:return"Run completed with some key phrases skipped.";case yn.failed:return e.error?g4(e.error):"Run failed.";case yn.cancelled:return"Run was cancelled.";default:return""}}function Ine(e){const t=EN(e.kind);switch(e.status){case yn.queued:return`${t} queued`;case yn.running:return`${t} in progress`;case yn.completed:return`${t} completed`;case yn.partial:return`${t} partially completed`;case yn.failed:return`${t} failed`;case yn.cancelled:return`${t} cancelled`;default:return e.status}}function y4(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.keyword??a.id;t.has(o)||t.set(o,!1),a.citationState==="cited"&&t.set(o,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function v4(e){return e>=70?"positive":e>=40?"caution":"negative"}function Lne(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function $ne(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function Bne(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const a of e){const o=a.keywordId,u=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState==="cited"&&(u.cited=!0);for(const d of a.competitorOverlap)u.competitorOverlap.add(d);t.set(o,u)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:$ne(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function Une(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 qne(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function Fne(e,t){const n=Une(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:qne(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 x4(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 Kne(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const u=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;u.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.keyword);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const S of m){const j=u.get(`${y.keyword}::${S}`),k=(y.providerRuns?.[S]?.length??0)>0;if(!j&&!k)continue;const O=j?.model??null,_=O?`${S}:${O}`:null,C=_?y.modelRuns?.[_]:void 0,T=y.providerRuns?.[S],E=(T?.length?T:null)??(C?.length?C:null),A=T?.length?"provider":C?.length?"model":"keyword",P=E?E.at(-1).transition:w,$=E?E.at(-1).visibilityTransition??(E.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=E?.at(-1)?.citationState,U=E?.at(-1)?.visibilityState,B=j?P==="lost"?"lost":P==="emerging"?"emerging":j.citationState==="cited"?"cited":"not-cited":F==="cited"?"cited":"not-cited",V=j?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),ee=b1(E||y.runs),Q=_z(E||y.runs),K=Hne(y,S),te=(E??y.runs).map(I=>({runId:I.runId,citationState:I.citationState,createdAt:I.createdAt,model:K.get(I.runId)??null,answerMentioned:I.answerMentioned,visibilityState:I.visibilityState,visibilityTransition:I.visibilityTransition})),le=Gne(te),je=A==="provider"&&le.length<=1?"model":A,L=Vne(te);i.push({id:`evidence_${e}_${a++}`,keyword:y.keyword,provider:j?.provider??S,model:j?.model??null,location:j?.location??null,citationState:B,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:Az($,Q,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Az(P,ee),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:Zne(V,$,y.keyword),runHistory:te,historyScope:je,modelsSeen:le,modelTransitions:L})}}}for(const u of r)o.has(u.keyword)||i.push({id:`evidence_${e}_${a++}`,keyword:u.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${u.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function Hne(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),u=o==="unknown"?null:o;for(const d of a)n.set(d.runId,u)}return n}function Gne(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function Vne(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 b1(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 _z(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 Az(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?`${cf(r.positive)} in latest run`:`${cf(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return cf(r.first);case"not-cited":case"not-visible":return t<=1?`${cf(r.negative)} in latest run`:`${cf(r.negative)} across ${t} runs`;default:return e}}function cf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Zne(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 Oz(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.keyword),r.set(a,o)}return r}const Qb=3;function Yne(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],u=[],d=new Set;for(const k of t)k.citationState==="lost"&&(d.has(k.keyword)||(d.add(k.keyword),u.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));u.length>0&&o.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${u.length} key phrase${u.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:u});const f=Oz(r,a),p=Oz(i,a);for(const k of a){const O=f.get(k)??new Set,_=p.get(k)??new Set,C=[...O].filter(T=>!_.has(T));C.length>0&&o.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:C.map(T=>{const E=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:E?.id??"",citationState:"cited"}})})}const m=new Map;for(const k of n){const O=k.runs.at(-1);O&&m.set(k.keyword,{transition:O.transition,citationState:O.citationState})}const y=[],v=[],w=new Set;for(const[k,{transition:O,citationState:_}]of m){if(!(O==="emerging"||O==="new"&&_==="cited"))continue;w.add(k);const T=t.find(E=>E.keyword===k&&(E.citationState==="emerging"||E.citationState==="cited"));y.push({keyword:k,evidenceId:T?.id??"",provider:T?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||v.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(v.length>0){const k=new Set(v.map(O=>O.keyword)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const S=new Set(t.map(k=>k.keyword)),j=[];for(const k of n){if(!S.has(k.keyword)||k.runs.length<Qb||k.runs.at(-1)?.citationState!=="not-cited")continue;if(b1(k.runs)>=Qb){const C=t.find(T=>T.keyword===k.keyword);j.push({keyword:k.keyword,evidenceId:C?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} key phrase${j.length>1?"s":""} uncited for ${Qb}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:j});for(const k of a){const O=f.get(k)??new Set,C=[...p.get(k)??new Set].filter(T=>!O.has(T));C.length>0&&o.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:C.map(T=>{const E=t.find(A=>A.keyword===T);return{keyword:T,evidenceId:E?.id??"",citationState:"not-cited"}})})}return o.length===0&&o.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),o}function Wne(e,t){const n=e.filter(i=>i.id!=="insight_lost"&&i.id!=="insight_stable"),r=[...t,...n];return r.length===0?[{id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}]:r}function Qne(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState==="cited").map(f=>f.keyword)).size;return{gained:d,lost:0,tone:d>0?"positive":"neutral",hasPreviousRun:!1}}const n=d=>{const f=new Set;for(const p of d)p.citationState==="cited"&&p.keyword&&f.add(p.keyword);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const u=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:u,hasPreviousRun:!0}}function Xne(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===Gt["answer-visibility"])??e[0],r=n.status===yn.completed?"Healthy":n.status===yn.running?"Running":n.status===yn.queued?"Queued":n.status===yn.partial?"Partial":"Failed",i=n.status===yn.completed?"positive":n.status===yn.failed?"negative":n.status===yn.partial?"caution":"neutral",a=e.filter(d=>d.kind===Gt["answer-visibility"]).length,o=e.length-a,u=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:u,tone:i,description:`Latest: ${EN(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 Jne(e){const t=m4(e.project),n=Kne(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(A=>A.kind===Gt["answer-visibility"]).sort((A,P)=>P.createdAt.localeCompare(A.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=y4(i),o=Bne(i),u=Fne(e.gscCoverage,e.bingCoverage),d=x4(i,e.competitors.map(A=>A.domain)),f=Yne({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(A=>A.domain)}),p=e.dbInsights!=null?Pne(e.dbInsights):null,m=p!=null?Wne(f,p):f,y=[...e.runs].sort((A,P)=>P.createdAt.localeCompare(A.createdAt)),v=y.find(A=>A.kind===Gt["answer-visibility"]),w=y.find(A=>A.kind!==Gt["answer-visibility"]);if(v&&w){const A=new Date(w.createdAt).getTime()-new Date(v.createdAt).getTime(),P=1440*60*1e3;A>P&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${x1(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const S=y.map(A=>zN(A,e.project.displayName||e.project.name)),j=new Map;for(const A of i){const P=A.provider||"gemini",$=A.model??null,F=`${P}::${$??"unknown"}`,U=j.get(F)??{provider:P,model:$,cited:0,total:0};U.total++,A.citationState==="cited"&&U.cited++,j.set(F,U)}const k=[...j.values()].sort((A,P)=>A.provider.localeCompare(P.provider)||(A.model??"").localeCompare(P.model??"")).map(({provider:A,model:P,cited:$,total:F})=>({provider:A,model:P,score:F>0?Math.round($/F*100):0,cited:$,total:F})),O=e.project.providers.filter(A=>!A.startsWith("cdp:")),_=new Set(i.map(A=>A.provider)),C=O.filter(A=>_.has(A)).length,T=i.length>0&&O.length>1&&C<O.length,E=T?`${C} of ${O.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${a.score}`:"No data",delta:i.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?T?"caution":v4(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:E},keywordCounts:{cited:a.citedCount,total:a.totalCount},gapKeyPhrases:o,indexCoverage:u,providerScores:k,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:Lne(d.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:Xne(y),movementSummary:Qne(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((A,P)=>{const $=new Set;for(const ee of i)(ee.competitorOverlap.includes(A.domain)||ee.citedDomains.includes(A.domain))&&ee.keyword&&$.add(ee.keyword);const F=[...$],U=new Set(i.map(ee=>ee.keyword).filter(Boolean)),B=U.size>0?F.length/U.size:0,V=B>=.5?"High":B>=.2?"Moderate":F.length>0?"Low":"None";return{id:A.id||`comp_${P}`,domain:A.domain,citationCount:F.length,totalKeywords:U.size,pressureLabel:V,citedKeywords:F,movement:"",notes:""}}),recentRuns:S.slice(0,5)}}function ere(e){const t=m4(e.project),n=e.runs.filter(w=>w.kind===Gt["answer-visibility"]).sort((w,S)=>S.createdAt.localeCompare(w.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=y4(r),a=x4(r,e.competitors.map(w=>w.domain)),o=[...e.runs].sort((w,S)=>S.createdAt.localeCompare(w.createdAt)),u=o.find(w=>w.kind===Gt["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=u?zN(u,d):{id:"none",projectId:e.project.id,projectName:d,kind:Gt["answer-visibility"],kindLabel:"No runs yet",status:yn.queued,trigger:Rf.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(w=>!w.startsWith("cdp:")),m=new Set(r.map(w=>w.provider)),y=p.filter(w=>m.has(w)).length,v=r.length>0&&p.length>1&&y<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?v?"caution":v4(i.score):"neutral",providerCoverage:v?`${y} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(w=>w.provider)).size} provider${new Set(r.map(w=>w.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:a.label}}function tre(e,t){const n=[],r=[],i=[];for(const o of e){r.push(Jne(o)),i.push(ere(o));const u=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(zN(d,o.project.displayName||o.project.name))}n.sort((o,u)=>u.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?nre(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function nre(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===yn.running||a.status===yn.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 He={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],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],analytics:{metrics:(e,t)=>["analytics",e,"metrics",t],gaps:(e,t)=>["analytics",e,"gaps",t],sources:(e,t)=>["analytics",e,"sources",t]},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]}},b4=x.createContext(null);b4.Provider;function Sh(){return x.useContext(b4)}function Jl(e){const n=Sh()?.dashboard??null,r=Sa({queryKey:He.projects.all,queryFn:nN,enabled:!n}),i=Sa({queryKey:He.runs.all,queryFn:ZI,enabled:!n,staleTime:l1,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:l1}),a=Sa({queryKey:He.settings,queryFn:()=>rN().catch(()=>null),enabled:!n}),o=r.data??[],u=i.data??[],d=kI({queries:o.map(w=>{const S=u.filter(k=>k.projectId===w.id),j=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,O)=>O.createdAt.localeCompare(k.createdAt));return{queryKey:He.projects.detail(w.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[O,_,C,T,E,A,P,$]=await Promise.all([i7(w.name).catch(()=>[]),YI(w.name).catch(()=>[]),WI(w.name).catch(()=>[]),k?Rl(k).catch(()=>null):Promise.resolve(null),j[1]?Rl(j[1].id).catch(()=>null):Promise.resolve(null),iN(w.name).catch(()=>null),aN(w.name).catch(()=>null),k?iG(w.name,k).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:O,competitors:_,timeline:C,latestRunDetail:T,previousRunDetail:E,gscCoverage:A,bingCoverage:P,dbInsights:$}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:Pf}})}),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(S=>S.data).filter(S=>S!=null);return tre(w,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function rre(){const e=await sG("/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 cv(e,t){return Sa({queryKey:He.health,queryFn:rre,enabled:e,refetchInterval:15e3,initialData:t})}function ire(e){return Sa({queryKey:He.runs.detail(e??""),queryFn:()=>Rl(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Hu(){const e=Oo(),t=Yy({strict:!1}),n=$r({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Ai.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Ai.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Ai.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const are={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function sre(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function ore(){const e=x.useSyncExternalStore(jG,C2,C2),t=Oo(),{openRun:n}=Hu(),r=x.useCallback(a=>{o1(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),o1(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 ${are[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":sre(a),children:a.cta.label}):null]}),l.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:l.jsx(wh,{className:"size-3.5"})})]},a.id))})}function lre(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cre=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ure=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dre={};function Ez(e,t){return(dre.jsx?ure:cre).test(e)}const fre=/[ \t\n\f\r]/g;function hre(e){return typeof e=="object"?e.type==="text"?zz(e.value):!1:zz(e)}function zz(e){return e.replace(fre,"")===""}let jh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};jh.prototype.normal={};jh.prototype.property={};jh.prototype.space=void 0;function w4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jh(n,r,t)}function w1(e){return e.toLowerCase()}class Kr{constructor(t,n){this.attribute=n,this.property=t}}Kr.prototype.attribute="";Kr.prototype.booleanish=!1;Kr.prototype.boolean=!1;Kr.prototype.commaOrSpaceSeparated=!1;Kr.prototype.commaSeparated=!1;Kr.prototype.defined=!1;Kr.prototype.mustUseProperty=!1;Kr.prototype.number=!1;Kr.prototype.overloadedBoolean=!1;Kr.prototype.property="";Kr.prototype.spaceSeparated=!1;Kr.prototype.space=void 0;let pre=0;const ct=ec(),zn=ec(),S1=ec(),_e=ec(),Ft=ec(),mu=ec(),Xr=ec();function ec(){return 2**++pre}const j1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:zn,commaOrSpaceSeparated:Xr,commaSeparated:mu,number:_e,overloadedBoolean:S1,spaceSeparated:Ft},Symbol.toStringTag,{value:"Module"})),Xb=Object.keys(j1);class TN extends Kr{constructor(t,n,r,i){let a=-1;if(super(t,n),Tz(this,"space",i),typeof r=="number")for(;++a<Xb.length;){const o=Xb[a];Tz(this,Xb[a],(r&j1[o])===j1[o])}}}TN.prototype.defined=!0;function Tz(e,t,n){n&&(e[t]=n)}function Gu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new TN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[w1(r)]=r,n[w1(a.attribute)]=r}return new jh(t,n,e.space)}const S4=Gu({properties:{ariaActiveDescendant:null,ariaAtomic:zn,ariaAutoComplete:null,ariaBusy:zn,ariaChecked:zn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Ft,ariaCurrent:null,ariaDescribedBy:Ft,ariaDetails:null,ariaDisabled:zn,ariaDropEffect:Ft,ariaErrorMessage:null,ariaExpanded:zn,ariaFlowTo:Ft,ariaGrabbed:zn,ariaHasPopup:null,ariaHidden:zn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ft,ariaLevel:_e,ariaLive:null,ariaModal:zn,ariaMultiLine:zn,ariaMultiSelectable:zn,ariaOrientation:null,ariaOwns:Ft,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:zn,ariaReadOnly:zn,ariaRelevant:null,ariaRequired:zn,ariaRoleDescription:Ft,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:zn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function j4(e,t){return t in e?e[t]:t}function N4(e,t){return j4(e,t.toLowerCase())}const mre=Gu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mu,acceptCharset:Ft,accessKey:Ft,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Ft,autoFocus:ct,autoPlay:ct,blocking:Ft,capture:null,charSet:null,checked:ct,cite:null,className:Ft,cols:_e,colSpan:null,content:null,contentEditable:zn,controls:ct,controlsList:Ft,coords:_e|mu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:S1,draggable:zn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Ft,height:_e,hidden:S1,high:_e,href:null,hrefLang:null,htmlFor:Ft,httpEquiv:Ft,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Ft,itemRef:Ft,itemScope:ct,itemType:Ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,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:ct,optimum:_e,pattern:null,ping:Ft,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Ft,required:ct,reversed:ct,rows:_e,rowSpan:_e,sandbox:Ft,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:zn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:zn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ft,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:zn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:N4}),gre=Gu({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:Xr,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Ft,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:mu,g2:mu,glyphName:mu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xr,rev:Xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xr,requiredFeatures:Xr,requiredFonts:Xr,requiredFormats:Xr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xr,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:j4}),k4=Gu({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()}}),C4=Gu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:N4}),_4=Gu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yre={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"},vre=/[A-Z]/g,Pz=/-[a-z]/g,xre=/^data[-\w.:]+$/i;function bre(e,t){const n=w1(t);let r=t,i=Kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xre.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Pz,Sre);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Pz.test(a)){let o=a.replace(vre,wre);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=TN}return new i(r,t)}function wre(e){return"-"+e.toLowerCase()}function Sre(e){return e.charAt(1).toUpperCase()}const jre=w4([S4,mre,k4,C4,_4],"html"),PN=w4([S4,gre,k4,C4,_4],"svg");function Nre(e){return e.join(" ").trim()}var Fc={},Jb,Rz;function kre(){if(Rz)return Jb;Rz=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
98
+ `,f="/",p="*",m="",y="comment",v="declaration";function w(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var O=1,_=1;function C(ee){var Q=ee.match(t);Q&&(O+=Q.length);var K=ee.lastIndexOf(d);_=~K?ee.length-K:_+ee.length}function T(){var ee={line:O,column:_};return function(Q){return Q.position=new E(ee),$(),Q}}function E(ee){this.start=ee,this.end={line:O,column:_},this.source=k.source}E.prototype.content=j;function A(ee){var Q=new Error(k.source+":"+O+":"+_+": "+ee);if(Q.reason=ee,Q.filename=k.source,Q.line=O,Q.column=_,Q.source=j,!k.silent)throw Q}function P(ee){var Q=ee.exec(j);if(Q){var K=Q[0];return C(K),j=j.slice(K.length),Q}}function $(){P(n)}function F(ee){var Q;for(ee=ee||[];Q=U();)Q!==!1&&ee.push(Q);return ee}function U(){var ee=T();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Q=2;m!=j.charAt(Q)&&(p!=j.charAt(Q)||f!=j.charAt(Q+1));)++Q;if(Q+=2,m===j.charAt(Q-1))return A("End of comment missing");var K=j.slice(2,Q-2);return _+=2,C(K),j=j.slice(Q),_+=2,ee({type:y,comment:K})}}function B(){var ee=T(),Q=P(r);if(Q){if(U(),!P(i))return A("property missing ':'");var K=P(a),te=ee({type:v,property:S(Q[0].replace(e,m)),value:K?S(K[0].replace(e,m)):m});return P(o),te}}function V(){var ee=[];F(ee);for(var Q;Q=B();)Q!==!1&&(ee.push(Q),F(ee));return ee}return $(),V()}function S(j){return j?j.replace(u,m):m}return Jb=w,Jb}var Dz;function Cre(){if(Dz)return Fc;Dz=1;var e=Fc&&Fc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=n;const t=e(kre());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),u=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return Fc}var uf={},Mz;function _re(){if(Mz)return uf;Mz=1,Object.defineProperty(uf,"__esModule",{value:!0}),uf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},u=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,u):f=f.replace(r,u),f.replace(t,o))};return uf.camelCase=d,uf}var df,Iz;function Are(){if(Iz)return df;Iz=1;var e=df&&df.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Cre()),n=_re();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(o[(0,n.camelCase)(u,a)]=d)}),o}return r.default=r,df=r,df}var Ore=Are();const Ere=Ta(Ore),A4=O4("end"),RN=O4("start");function O4(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 zre(e){const t=RN(e),n=A4(e);if(t&&n)return{start:t,end:n}}function Df(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Lz(e.position):"start"in e||"end"in e?Lz(e):"line"in e||"column"in e?N1(e):""}function N1(e){return $z(e&&e.line)+":"+$z(e&&e.column)}function Lz(e){return N1(e&&e.start)+"-"+N1(e&&e.end)}function $z(e){return e&&typeof e=="number"?e:1}class pr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Df(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}}pr.prototype.file="";pr.prototype.name="";pr.prototype.reason="";pr.prototype.message="";pr.prototype.stack="";pr.prototype.column=void 0;pr.prototype.line=void 0;pr.prototype.ancestors=void 0;pr.prototype.cause=void 0;pr.prototype.fatal=void 0;pr.prototype.place=void 0;pr.prototype.ruleId=void 0;pr.prototype.source=void 0;const DN={}.hasOwnProperty,Tre=new Map,Pre=/[A-Z]/g,Rre=new Set(["table","tbody","thead","tfoot","tr"]),Dre=new Set(["td","th"]),E4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mre(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=Kre(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=Fre(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"?PN:jre,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=z4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function z4(e,t,n){if(t.type==="element")return Ire(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Lre(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Bre(e,t,n);if(t.type==="mdxjsEsm")return $re(e,t);if(t.type==="root")return Ure(e,t,n);if(t.type==="text")return qre(e,t)}function Ire(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=PN,e.schema=i),e.ancestors.push(t);const a=P4(e,t.tagName,!1),o=Hre(e,t);let u=IN(e,t);return Rre.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!hre(d):!0})),T4(e,o,a,t),MN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Lre(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)}Qf(e,t.position)}function $re(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qf(e,t.position)}function Bre(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=PN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:P4(e,t.name,!0),o=Gre(e,t),u=IN(e,t);return T4(e,o,a,t),MN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ure(e,t,n){const r={};return MN(r,IN(e,t)),e.create(t,e.Fragment,r,n)}function qre(e,t){return t.value}function T4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function MN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fre(e,t,n){return r;function r(i,a,o,u){const f=Array.isArray(o.children)?n:t;return u?f(a,o,u):f(a,o)}}function Kre(e,t){return n;function n(r,i,a,o){const u=Array.isArray(a.children),d=RN(r);return t(i,a,o,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Hre(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&DN.call(t.properties,i)){const a=Vre(e,i,t.properties[i]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&Dre.has(t.tagName)?r=u:n[o]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Gre(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const u=o.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Qf(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Qf(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function IN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Tre;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const u=z4(e,a,o);u!==void 0&&n.push(u)}return n}function Vre(e,t,n){const r=bre(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?lre(n):Nre(n)),r.property==="style"){let i=typeof n=="object"?n:Zre(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Yre(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?yre[r.property]||r.property:r.attribute,n]}}function Zre(e,t){try{return Ere(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new pr("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=E4+"#cannot-parse-style-attribute",i}}function P4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const u=Ez(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=o}else r=Ez(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return DN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qf(e)}function Qf(e,t){const n=new pr("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=E4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yre(e){const t={};let n;for(n in e)DN.call(e,n)&&(t[Wre(n)]=e[n]);return t}function Wre(e){let t=e.replace(Pre,Qre);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Qre(e){return"-"+e.toLowerCase()}const ew={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"]},Xre={};function Jre(e,t){const n=Xre,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return R4(e,r,i)}function R4(e,t,n){if(eie(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 Bz(e.children,t,n)}return Array.isArray(e)?Bz(e,t,n):""}function Bz(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=R4(e[i],t,n);return r.join("")}function eie(e){return!!(e&&typeof e=="object")}const Uz=document.createElement("i");function LN(e){const t="&"+e+";";Uz.innerHTML=t;const n=Uz.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ca(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 Si(e,t){return e.length>0?(Ca(e,e.length,0,t),e):t}const qz={}.hasOwnProperty;function tie(e){const t={};let n=-1;for(;++n<e.length;)nie(t,e[n]);return t}function nie(e,t){let n;for(n in t){const i=(qz.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){qz.call(i,o)||(i[o]=[]);const u=a[o];rie(i[o],Array.isArray(u)?u:u?[u]:[])}}}function rie(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ca(e,0,0,r)}function D4(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 gu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xa=Po(/[A-Za-z]/),ei=Po(/[\dA-Za-z]/),iie=Po(/[#-'*+\--9=?A-Z^-~]/);function k1(e){return e!==null&&(e<32||e===127)}const C1=Po(/\d/),aie=Po(/[\dA-Fa-f]/),sie=Po(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function Br(e){return e!==null&&(e<0||e===32)}function Ot(e){return e===-2||e===-1||e===32}const oie=Po(new RegExp("\\p{P}|\\p{S}","u")),lie=Po(/\s/);function Po(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&ei(e.charCodeAt(n+1))&&ei(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(o=String.fromCharCode(a,u),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Vt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return Ot(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ot(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const cie={tokenize:uie};function uie(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Vt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Qe(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),o)}}const die={tokenize:fie},Fz={tokenize:hie};function fie(e){const t=this,n=[];let r=0,i,a,o;return u;function u(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const C=t.events.length;let T=C,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){E=t.events[T][1].end;break}k(r);let A=C;for(;A<t.events.length;)t.events[A][1].end={...E},A++;return Ca(t.events,T+1,0,t.events.slice(C)),t.events.length=A,f(_)}return u(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return w(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fz,p,m)(_)}function p(_){return i&&O(),k(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(_)}function y(_){return t.containerState={},e.attempt(Fz,v,w)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function w(_){if(_===null){i&&O(),k(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),S(_)}function S(_){if(_===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Qe(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(_),S)}function j(_,C){const T=t.sliceStream(_);if(C&&T.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(T),t.parser.lazy[_.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<o&&(!i.events[E][1].end||i.events[E][1].end.offset>o))return;const A=t.events.length;let P=A,$,F;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){F=t.events[P][1].end;break}$=!0}for(k(r),E=A;E<t.events.length;)t.events[E][1].end={...F},E++;Ca(t.events,P+1,0,t.events.slice(A)),t.events.length=E}}function k(_){let C=n.length;for(;C-- >_;){const T=n[C];t.containerState=T[1],T[0].exit.call(t,e)}n.length=_}function O(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hie(e,t,n){return Vt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kz(e){if(e===null||Br(e)||lie(e))return 1;if(oie(e))return 2}function $N(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 _1={name:"attention",resolveAll:pie,tokenize:mie};function pie(e,t){let n=-1,r,i,a,o,u,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};Hz(m,-d),Hz(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...u.end}},e[r][1].end={...o.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Si(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Si(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=Si(f,$N(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Si(f,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Si(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ca(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 mie(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kz(r);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const f=e.exit("attentionSequence"),p=Kz(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function Hz(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const gie={name:"autolink",tokenize:yie};function yie(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 xa(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||ei(v)?(r=1,u(v)):f(v)}function u(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||ei(v))&&r++<32?(e.consume(v),u):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||k1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):iie(v)?(e.consume(v),f):n(v)}function p(v){return ei(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||ei(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const uv={partial:!0,tokenize:vie};function vie(e,t,n){return r;function r(a){return Ot(a)?Vt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Qe(a)?t(a):n(a)}}const M4={continuation:{tokenize:bie},exit:wie,name:"blockQuote",tokenize:xie};function xie(e,t,n){const r=this;return i;function i(o){if(o===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Ot(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function bie(e,t,n){const r=this;return i;function i(o){return Ot(o)?Vt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(M4,t,n)(o)}}function wie(e){e.exit("blockQuote")}const I4={name:"characterEscape",tokenize:Sie};function Sie(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 sie(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const L4={name:"characterReference",tokenize:jie};function jie(e,t,n){const r=this;let i=0,a,o;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=ei,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=aie,p):(e.enter("characterReferenceValue"),a=7,o=C1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===ei&&!LN(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const Gz={partial:!0,tokenize:kie},Vz={concrete:!0,name:"codeFenced",tokenize:Nie};function Nie(e,t,n){const r=this,i={partial:!0,tokenize:T};let a=0,o=0,u;return d;function d(E){return f(E)}function f(E){const A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===u?(o++,e.consume(E),p):o<3?n(E):(e.exit("codeFencedFenceSequence"),Ot(E)?Vt(e,m,"whitespace")(E):m(E))}function m(E){return E===null||Qe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Gz,S,C)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):Ot(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Vt(e,v,"whitespace")(E)):E===96&&E===u?n(E):(e.consume(E),y)}function v(E){return E===null||Qe(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===u?n(E):(e.consume(E),w)}function S(E){return e.attempt(i,C,j)(E)}function j(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return a>0&&Ot(E)?Vt(e,O,"linePrefix",a+1)(E):O(E)}function O(E){return E===null||Qe(E)?e.check(Gz,S,C)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||Qe(E)?(e.exit("codeFlowValue"),O(E)):(e.consume(E),_)}function C(E){return e.exit("codeFenced"),t(E)}function T(E,A,P){let $=0;return F;function F(Q){return E.enter("lineEnding"),E.consume(Q),E.exit("lineEnding"),U}function U(Q){return E.enter("codeFencedFence"),Ot(Q)?Vt(E,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):B(Q)}function B(Q){return Q===u?(E.enter("codeFencedFenceSequence"),V(Q)):P(Q)}function V(Q){return Q===u?($++,E.consume(Q),V):$>=o?(E.exit("codeFencedFenceSequence"),Ot(Q)?Vt(E,ee,"whitespace")(Q):ee(Q)):P(Q)}function ee(Q){return Q===null||Qe(Q)?(E.exit("codeFencedFence"),A(Q)):P(Q)}}}function kie(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 tw={name:"codeIndented",tokenize:_ie},Cie={partial:!0,tokenize:Aie};function _ie(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Vt(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):Qe(f)?e.attempt(Cie,o,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||Qe(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Aie(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Vt(e,a,"linePrefix",5)(o)}function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):Qe(o)?i(o):n(o)}}const Oie={name:"codeText",previous:zie,resolve:Eie,tokenize:Tie};function Eie(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 zie(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tie(e,t,n){let r=0,i,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):Qe(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||Qe(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 Pie{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&&ff(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),ff(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ff(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);ff(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ff(this.left,n.reverse())}}}function ff(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 $4(e){const t={};let n=-1,r,i,a,o,u,d,f;const p=new Pie(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,Rie(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Ca(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Rie(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,d=[],f={};let p,m,y=-1,v=n,w=0,S=0;const j=[S];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(S=y+1,j.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=u.slice(j[y],j[y+1]),O=a.pop();d.push([O,O+k.length-1]),e.splice(O,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return f}const Die={resolve:Iie,tokenize:Lie},Mie={partial:!0,tokenize:$ie};function Iie(e){return $4(e),e}function Lie(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):Qe(u)?e.check(Mie,o,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function $ie(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Vt(e,a,"linePrefix")}function a(o){if(o===null||Qe(o))return n(o);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function B4(e,t,n,r,i,a,o,u,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),y):k===null||k===32||k===41||k1(k)?n(k):(e.enter(r),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(u),y(k)):k===null||k===60||Qe(k)?n(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function S(k){return!p&&(k===null||k===41||Br(k))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,S):k===41?(e.consume(k),p--,S):k===null||k===32||k===40||k1(k)?n(k):(e.consume(k),k===92?j:S)}function j(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function U4(e,t,n,r,i,a){const o=this;let u=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return u>999||v===null||v===91||v===93&&!d||v===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Qe(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||Qe(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Ot(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function q4(e,t,n,r,i,a){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Vt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Qe(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function Mf(e,t){let n;return r;function r(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ot(i)?Vt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Bie={name:"definition",tokenize:qie},Uie={partial:!0,tokenize:Fie};function qie(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return U4.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=gu(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 Br(v)?Mf(e,f)(v):f(v)}function f(v){return B4(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Uie,m,m)(v)}function m(v){return Ot(v)?Vt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Qe(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function Fie(e,t,n){return r;function r(u){return Br(u)?Mf(e,i)(u):n(u)}function i(u){return q4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ot(u)?Vt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||Qe(u)?t(u):n(u)}}const Kie={name:"hardBreakEscape",tokenize:Hie};function Hie(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Qe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Gie={name:"headingAtx",resolve:Vie,tokenize:Zie};function Vie(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"},Ca(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Zie(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||Br(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Qe(p)?(e.exit("atxHeading"),t(p)):Ot(p)?Vt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Br(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const Yie=["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"],Zz=["pre","script","style","textarea"],Wie={concrete:!0,name:"htmlFlow",resolveTo:Jie,tokenize:eae},Qie={partial:!0,tokenize:nae},Xie={partial:!0,tokenize:tae};function Jie(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 eae(e,t,n){const r=this;let i,a,o,u,d;return f;function f(R){return p(R)}function p(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),m}function m(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),a=!0,S):R===63?(e.consume(R),i=3,r.interrupt?t:L):xa(R)?(e.consume(R),o=String.fromCharCode(R),j):n(R)}function y(R){return R===45?(e.consume(R),i=2,v):R===91?(e.consume(R),i=5,u=0,w):xa(R)?(e.consume(R),i=4,r.interrupt?t:L):n(R)}function v(R){return R===45?(e.consume(R),r.interrupt?t:L):n(R)}function w(R){const G="CDATA[";return R===G.charCodeAt(u++)?(e.consume(R),u===G.length?r.interrupt?t:B:w):n(R)}function S(R){return xa(R)?(e.consume(R),o=String.fromCharCode(R),j):n(R)}function j(R){if(R===null||R===47||R===62||Br(R)){const G=R===47,ie=o.toLowerCase();return!G&&!a&&Zz.includes(ie)?(i=1,r.interrupt?t(R):B(R)):Yie.includes(o.toLowerCase())?(i=6,G?(e.consume(R),k):r.interrupt?t(R):B(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):a?O(R):_(R))}return R===45||ei(R)?(e.consume(R),o+=String.fromCharCode(R),j):n(R)}function k(R){return R===62?(e.consume(R),r.interrupt?t:B):n(R)}function O(R){return Ot(R)?(e.consume(R),O):F(R)}function _(R){return R===47?(e.consume(R),F):R===58||R===95||xa(R)?(e.consume(R),C):Ot(R)?(e.consume(R),_):F(R)}function C(R){return R===45||R===46||R===58||R===95||ei(R)?(e.consume(R),C):T(R)}function T(R){return R===61?(e.consume(R),E):Ot(R)?(e.consume(R),T):_(R)}function E(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),d=R,A):Ot(R)?(e.consume(R),E):P(R)}function A(R){return R===d?(e.consume(R),d=null,$):R===null||Qe(R)?n(R):(e.consume(R),A)}function P(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Br(R)?T(R):(e.consume(R),P)}function $(R){return R===47||R===62||Ot(R)?_(R):n(R)}function F(R){return R===62?(e.consume(R),U):n(R)}function U(R){return R===null||Qe(R)?B(R):Ot(R)?(e.consume(R),U):n(R)}function B(R){return R===45&&i===2?(e.consume(R),K):R===60&&i===1?(e.consume(R),te):R===62&&i===4?(e.consume(R),I):R===63&&i===3?(e.consume(R),L):R===93&&i===5?(e.consume(R),je):Qe(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Qie,q,V)(R)):R===null||Qe(R)?(e.exit("htmlFlowData"),V(R)):(e.consume(R),B)}function V(R){return e.check(Xie,ee,q)(R)}function ee(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),Q}function Q(R){return R===null||Qe(R)?V(R):(e.enter("htmlFlowData"),B(R))}function K(R){return R===45?(e.consume(R),L):B(R)}function te(R){return R===47?(e.consume(R),o="",le):B(R)}function le(R){if(R===62){const G=o.toLowerCase();return Zz.includes(G)?(e.consume(R),I):B(R)}return xa(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),le):B(R)}function je(R){return R===93?(e.consume(R),L):B(R)}function L(R){return R===62?(e.consume(R),I):R===45&&i===2?(e.consume(R),L):B(R)}function I(R){return R===null||Qe(R)?(e.exit("htmlFlowData"),q(R)):(e.consume(R),I)}function q(R){return e.exit("htmlFlow"),t(R)}}function tae(e,t,n){const r=this;return i;function i(o){return Qe(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 nae(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(uv,t,n)}}const rae={name:"htmlText",tokenize:iae};function iae(e,t,n){const r=this;let i,a,o;return u;function u(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),T):L===63?(e.consume(L),_):xa(L)?(e.consume(L),P):n(L)}function f(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),a=0,w):xa(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),y):Qe(L)?(o=m,te(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),v):m(L)}function v(L){return L===62?K(L):L===45?y(L):m(L)}function w(L){const I="CDATA[";return L===I.charCodeAt(a++)?(e.consume(L),a===I.length?S:w):n(L)}function S(L){return L===null?n(L):L===93?(e.consume(L),j):Qe(L)?(o=S,te(L)):(e.consume(L),S)}function j(L){return L===93?(e.consume(L),k):S(L)}function k(L){return L===62?K(L):L===93?(e.consume(L),k):S(L)}function O(L){return L===null||L===62?K(L):Qe(L)?(o=O,te(L)):(e.consume(L),O)}function _(L){return L===null?n(L):L===63?(e.consume(L),C):Qe(L)?(o=_,te(L)):(e.consume(L),_)}function C(L){return L===62?K(L):_(L)}function T(L){return xa(L)?(e.consume(L),E):n(L)}function E(L){return L===45||ei(L)?(e.consume(L),E):A(L)}function A(L){return Qe(L)?(o=A,te(L)):Ot(L)?(e.consume(L),A):K(L)}function P(L){return L===45||ei(L)?(e.consume(L),P):L===47||L===62||Br(L)?$(L):n(L)}function $(L){return L===47?(e.consume(L),K):L===58||L===95||xa(L)?(e.consume(L),F):Qe(L)?(o=$,te(L)):Ot(L)?(e.consume(L),$):K(L)}function F(L){return L===45||L===46||L===58||L===95||ei(L)?(e.consume(L),F):U(L)}function U(L){return L===61?(e.consume(L),B):Qe(L)?(o=U,te(L)):Ot(L)?(e.consume(L),U):$(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,V):Qe(L)?(o=B,te(L)):Ot(L)?(e.consume(L),B):(e.consume(L),ee)}function V(L){return L===i?(e.consume(L),i=void 0,Q):L===null?n(L):Qe(L)?(o=V,te(L)):(e.consume(L),V)}function ee(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Br(L)?$(L):(e.consume(L),ee)}function Q(L){return L===47||L===62||Br(L)?$(L):n(L)}function K(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function te(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),le}function le(L){return Ot(L)?Vt(e,je,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):je(L)}function je(L){return e.enter("htmlTextData"),o(L)}}const BN={name:"labelEnd",resolveAll:lae,resolveTo:cae,tokenize:uae},aae={tokenize:dae},sae={tokenize:fae},oae={tokenize:hae};function lae(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&&Ca(e,0,e.length,n),e}function cae(e,t){let n=e.length,r=0,i,a,o,u;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=Si(u,e.slice(a+1,a+r+3)),u=Si(u,[["enter",p,t]]),u=Si(u,$N(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),u=Si(u,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),u=Si(u,e.slice(o+1)),u=Si(u,[["exit",d,t]]),Ca(e,a,e.length,u),e}function uae(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(gu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(aae,p,o?p:m)(y):y===91?e.attempt(sae,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(oae,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function dae(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 Br(m)?Mf(e,a)(m):a(m)}function a(m){return m===41?p(m):B4(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Br(m)?Mf(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?q4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Br(m)?Mf(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 fae(e,t,n){const r=this;return i;function i(u){return U4.call(r,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(gu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function hae(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 pae={name:"labelStartImage",resolveAll:BN.resolveAll,tokenize:mae};function mae(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const gae={name:"labelStartLink",resolveAll:BN.resolveAll,tokenize:yae};function yae(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 nw={name:"lineEnding",tokenize:vae};function vae(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Vt(e,t,"linePrefix")}}const lg={name:"thematicBreak",tokenize:xae};function xae(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Qe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Ot(f)?Vt(e,u,"whitespace")(f):u(f))}}const Dr={continuation:{tokenize:jae},exit:kae,name:"list",tokenize:Sae},bae={partial:!0,tokenize:Cae},wae={partial:!0,tokenize:Nae};function Sae(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return u;function u(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:C1(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(lg,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 C1(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(uv,r.interrupt?n:p,e.attempt(bae,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Ot(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function jae(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Ot(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wae,t,o)(u))}function o(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vt(e,e.attempt(Dr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Nae(e,t,n){const r=this;return Vt(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 kae(e){e.exit(this.containerState.type)}function Cae(e,t,n){const r=this;return Vt(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!Ot(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Yz={name:"setextUnderline",resolveTo:_ae,tokenize:Aae};function _ae(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 Aae(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),Ot(f)?Vt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Qe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Oae={tokenize:Eae};function Eae(e){const t=this,n=e.attempt(uv,r,e.attempt(this.parser.constructs.flowInitial,i,Vt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Die,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 zae={resolveAll:K4()},Tae=F4("string"),Pae=F4("text");function F4(e){return{resolveAll:K4(e==="text"?Rae:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,u);return o;function o(p){return f(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function K4(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 Rae(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(f===-2)d=!0,u++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const Dae={42:Dr,43:Dr,45:Dr,48:Dr,49:Dr,50:Dr,51:Dr,52:Dr,53:Dr,54:Dr,55:Dr,56:Dr,57:Dr,62:M4},Mae={91:Bie},Iae={[-2]:tw,[-1]:tw,32:tw},Lae={35:Gie,42:lg,45:[Yz,lg],60:Wie,61:Yz,95:lg,96:Vz,126:Vz},$ae={38:L4,92:I4},Bae={[-5]:nw,[-4]:nw,[-3]:nw,33:pae,38:L4,42:_1,60:[gie,rae],91:gae,92:[Kie,I4],93:BN,95:_1,96:Oie},Uae={null:[_1,zae]},qae={null:[42,95]},Fae={null:[]},Kae=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qae,contentInitial:Mae,disable:Fae,document:Dae,flow:Lae,flowInitial:Iae,insideSpan:Uae,string:$ae,text:Bae},Symbol.toStringTag,{value:"Module"}));function Hae(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],u=[];const d={attempt:A(T),check:A(E),consume:O,enter:_,exit:C,interrupt:A(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return o=Si(o,U),j(),o[o.length-1]!==null?[]:(P(t,0),f.events=$N(a,f.events,f),f.events)}function y(U,B){return Vae(v(U),B)}function v(U){return Gae(o,U)}function w(){const{_bufferIndex:U,_index:B,line:V,column:ee,offset:Q}=r;return{_bufferIndex:U,_index:B,line:V,column:ee,offset:Q}}function S(U){i[U.line]=U.column,F()}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;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(U){p=p(U)}function O(U){Qe(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,F()):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 _(U,B){const V=B||{};return V.type=U,V.start=w(),f.events.push(["enter",V,f]),u.push(V),V}function C(U){const B=u.pop();return B.end=w(),f.events.push(["exit",B,f]),B}function T(U,B){P(U,B.from)}function E(U,B){B.restore()}function A(U,B){return V;function V(ee,Q,K){let te,le,je,L;return Array.isArray(ee)?q(ee):"tokenize"in ee?q([ee]):I(ee);function I(ne){return Ce;function Ce(Se){const J=Se!==null&&ne[Se],pe=Se!==null&&ne.null,Oe=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return q(Oe)(Se)}}function q(ne){return te=ne,le=0,ne.length===0?K:R(ne[le])}function R(ne){return Ce;function Ce(Se){return L=$(),je=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?ie():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,G,ie)(Se)}}function G(ne){return U(je,L),Q}function ie(ne){return L.restore(),++le<te.length?R(te[le]):K}}}function P(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Ca(f.events,B,f.events.length-B,U.resolve(f.events.slice(B),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function $(){const U=w(),B=f.previous,V=f.currentConstruct,ee=f.events.length,Q=Array.from(u);return{from:ee,restore:K};function K(){r=U,f.previous=B,f.currentConstruct=V,f.events.length=ee,u=Q,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Gae(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Vae(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 Zae(e){const r={constructs:tie([Kae,...(e||{}).extensions||[]]),content:i(cie),defined:[],document:i(die),flow:i(Oae),lazy:{},string:i(Tae),text:i(Pae)};return r;function i(a){return o;function o(u){return Hae(r,a,u)}}}function Yae(e){for(;!$4(e););return e}const Wz=/[\0\t\n\r]/g;function Wae(){let e=1,t="",n=!0,r;return i;function i(a,o,u){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Wz.lastIndex=m,f=Wz.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Qae=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xae(e){return e.replace(Qae,Jae)}function Jae(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return D4(n.slice(a?2:1),a?16:10)}return LN(n)||e}const H4={}.hasOwnProperty;function ese(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),tse(n)(Yae(Zae(n).document().write(Wae()(e,t,!0))))}function tse(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(en),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(it),blockQuote:a(pe),characterEscape:$,characterReference:$,codeFenced:a(Oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Oe,o),codeText:a(W,o),codeTextData:$,data:$,codeFlowValue:$,definition:a(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Te),hardBreakEscape:a(Ze),hardBreakTrailing:a(Ze),htmlFlow:a(Lt,o),htmlFlowData:$,htmlText:a(Lt,o),htmlTextData:$,image:a(Rt),label:o,link:a(en),listItem:a(Je),listItemValue:y,listOrdered:a(we,m),listUnordered:a(we),paragraph:a(ot),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(it),strong:a(Fn),thematicBreak:a(St)},exit:{atxHeading:d(),atxHeadingSequence:T,autolink:d(),autolinkEmail:J,autolinkProtocol:Se,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ne,characterReference:Ce,codeFenced:d(j),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:d(k),codeText:d(Q),codeTextData:F,data:F,definition:d(),definitionDestinationString:C,definitionLabelString:O,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(V),htmlFlowData:F,htmlText:d(ee),htmlTextData:F,image:d(te),label:je,labelText:le,lineEnding:U,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:L,resourceTitleString:I,resource:q,setextHeading:d(P),setextHeadingLineSequence:A,setextHeadingText:E,strong:d(),thematicBreak:d()}};G4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ne={type:"root",children:[]};const De={stack:[Ne],tokenStack:[],config:t,enter:u,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 on=Ge.pop();ht=i(ce,on,ht)}for(ht=-1;++ht<ce.length;){const on=t[ce[ht][0]];H4.call(on,ce[ht][1].type)&&on[ce[ht][1].type].call(Object.assign({sliceSerialize:ce[ht][2].sliceSerialize},De),ce[ht][1])}if(De.tokenStack.length>0){const on=De.tokenStack[De.tokenStack.length-1];(on[1]||Qz).call(De,void 0,on[0])}for(Ne.position={start:Js(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Js(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,De){let Ge=Ne-1,ht=-1,on=!1,xn,ln,Ye,$t;for(;++Ge<=De;){const de=ce[Ge];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?ht++:ht--,$t=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(xn&&!$t&&!ht&&!Ye&&(Ye=Ge),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=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(xn){let ze=Ge;for(ln=void 0;ze--;){const fe=ce[ze];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;ln&&(ce[ln][1].type="lineEndingBlank",on=!0),fe[1].type="lineEnding",ln=ze}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}Ye&&(!ln||Ye<ln)&&(xn._spread=!0),xn.end=Object.assign({},ln?ce[ln][1].start:de[1].end),ce.splice(ln||Ge,0,["exit",xn,de[2]]),Ge++,De++}if(de[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};xn=ze,ce.splice(Ge,0,["enter",ze,de[2]]),Ge++,De++,Ye=void 0,$t=!0}}}return ce[Ne][1]._spread=on,De}function a(ce,Ne){return De;function De(Ge){u.call(this,ce(Ge),Ge),Ne&&Ne.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ce,Ne,De){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ne,De||void 0]),ce.position={start:Js(Ne.start),end:void 0}}function d(ce){return Ne;function Ne(De){ce&&ce.call(this,De),f.call(this,De)}}function f(ce,Ne){const De=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ce.type&&(Ne?Ne.call(this,ce,Ge[0]):(Ge[1]||Qz).call(this,ce,Ge[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Df({start:ce.start,end:ce.end})+"): it’s not open");De.position.end=Js(ce.end)}function p(){return Jre(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(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 S(){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 k(){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(),De=this.stack[this.stack.length-1];De.label=Ne,De.identifier=gu(this.sliceSerialize(ce)).toLowerCase()}function _(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function C(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function T(ce){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const De=this.sliceSerialize(ce).length;Ne.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(ce){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const De=this.stack[this.stack.length-1].children;let Ge=De[De.length-1];(!Ge||Ge.type!=="text")&&(Ge=et(),Ge.position={start:Js(ce.start),end:void 0},De.push(Ge)),this.stack.push(Ge)}function F(ce){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ce),Ne.position.end=Js(ce.end)}function U(ce){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Ne.children[Ne.children.length-1];De.position.end=Js(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,ce),F.call(this,ce))}function B(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function ee(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function Q(){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 te(){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 le(ce){const Ne=this.sliceSerialize(ce),De=this.stack[this.stack.length-2];De.label=Xae(Ne),De.identifier=gu(Ne).toLowerCase()}function je(){const ce=this.stack[this.stack.length-1],Ne=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Ge=ce.children;De.children=Ge}else De.alt=Ne}function L(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function I(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function q(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function G(ce){const Ne=this.resume(),De=this.stack[this.stack.length-1];De.label=Ne,De.identifier=gu(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ie(ce){this.data.characterReferenceType=ce.type}function ne(ce){const Ne=this.sliceSerialize(ce),De=this.data.characterReferenceType;let Ge;De?(Ge=D4(Ne,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=LN(Ne);const ht=this.stack[this.stack.length-1];ht.value+=Ge}function Ce(ce){const Ne=this.stack.pop();Ne.position.end=Js(ce.end)}function Se(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ce)}function J(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ce)}function pe(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function W(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function it(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function Lt(){return{type:"html",value:""}}function Rt(){return{type:"image",title:null,url:"",alt:null}}function en(){return{type:"link",title:null,url:"",children:[]}}function we(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Je(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function Fn(){return{type:"strong",children:[]}}function et(){return{type:"text",value:""}}function St(){return{type:"thematicBreak"}}}function Js(e){return{line:e.line,column:e.column,offset:e.offset}}function G4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?G4(e,r):nse(e,r)}}function nse(e,t){let n;for(n in t)if(H4.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 Qz(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Df({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Df({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Df({start:t.start,end:t.end})+") is still open")}function rse(e){const t=this;t.parser=n;function n(r){return ese(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ise(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 ase(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
101
+ `}]}function sse(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 ose(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lse(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cse(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Vu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function use(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 dse(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function V4(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 fse(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return V4(e,t);const i={src:Vu(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 hse(e,t){const n={src:Vu(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 pse(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 mse(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return V4(e,t);const i={href:Vu(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 gse(e,t){const n={href:Vu(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 yse(e,t,n){const r=e.all(t),i=n?vse(n):Z4(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
103
+ `}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
104
+ `});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function vse(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=Z4(n[r])}return t}function Z4(e){const t=e.spread;return t??e.children.length>1}function xse(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 bse(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wse(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Sse(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jse(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=RN(t.children[1]),d=A4(t.children[t.children.length-1]);u&&d&&(o.position={start:u,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Nse(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,u=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function kse(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xz=9,Jz=32;function Cse(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(eT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(eT(t.slice(i),i>0,!1)),a.join("")}function eT(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Xz||a===Jz;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Xz||a===Jz;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _se(e,t){const n={type:"text",value:Cse(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ase(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ose={blockquote:ise,break:ase,code:sse,delete:ose,emphasis:lse,footnoteReference:cse,heading:use,html:dse,imageReference:fse,image:hse,inlineCode:pse,linkReference:mse,link:gse,listItem:yse,list:xse,paragraph:bse,root:wse,strong:Sse,table:jse,tableCell:kse,tableRow:Nse,text:_se,thematicBreak:Ase,toml:km,yaml:km,definition:km,footnoteDefinition:km};function km(){}const Y4=-1,dv=0,If=1,$g=2,UN=3,qN=4,FN=5,KN=6,W4=7,Q4=8,tT=typeof self=="object"?self:globalThis,Ese=(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 dv:case Y4:return n(o,i);case If:{const u=n([],i);for(const d of o)u.push(r(d));return u}case $g:{const u=n({},i);for(const[d,f]of o)u[r(d)]=r(f);return u}case UN:return n(new Date(o),i);case qN:{const{source:u,flags:d}=o;return n(new RegExp(u,d),i)}case FN:{const u=n(new Map,i);for(const[d,f]of o)u.set(r(d),r(f));return u}case KN:{const u=n(new Set,i);for(const d of o)u.add(r(d));return u}case W4:{const{name:u,message:d}=o;return n(new tT[u](d),i)}case Q4:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new tT[a](o),i)};return r},nT=e=>Ese(new Map,e)(0),Kc="",{toString:zse}={},{keys:Tse}=Object,hf=e=>{const t=typeof e;if(t!=="object"||!e)return[dv,t];const n=zse.call(e).slice(8,-1);switch(n){case"Array":return[If,Kc];case"Object":return[$g,Kc];case"Date":return[UN,Kc];case"RegExp":return[qN,Kc];case"Map":return[FN,Kc];case"Set":return[KN,Kc];case"DataView":return[If,n]}return n.includes("Array")?[If,n]:n.includes("Error")?[W4,n]:[$g,n]},Cm=([e,t])=>e===dv&&(t==="function"||t==="symbol"),Pse=(e,t,n,r)=>{const i=(o,u)=>{const d=r.push(o)-1;return n.set(u,d),d},a=o=>{if(n.has(o))return n.get(o);let[u,d]=hf(o);switch(u){case dv:{let p=o;switch(d){case"bigint":u=Q4,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([Y4],o)}return i([u,p],o)}case If:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([u,p],o);for(const y of o)p.push(a(y));return m}case $g:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([u,p],o);for(const y of Tse(o))(e||!Cm(hf(o[y])))&&p.push([a(y),a(o[y])]);return m}case UN:return i([u,o.toISOString()],o);case qN:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case FN:{const p=[],m=i([u,p],o);for(const[y,v]of o)(e||!(Cm(hf(y))||Cm(hf(v))))&&p.push([a(y),a(v)]);return m}case KN:{const p=[],m=i([u,p],o);for(const y of o)(e||!Cm(hf(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([u,{name:d,message:f}],o)};return a},rT=(e,{json:t,lossy:n}={})=>{const r=[];return Pse(!(t||n),!!t,new Map,r)(e),r},Bg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nT(rT(e,t)):structuredClone(e):(e,t)=>nT(rT(e,t));function Rse(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 Dse(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Mse(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Rse,r=e.options.footnoteBackLabel||Dse,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),y=Vu(m.toLowerCase());let v=0;const w=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++v<=S;){w.length>0&&w.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,v);typeof O=="string"&&(O={type:"text",value:O}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const O=j.children[j.children.length-1];O&&O.type==="text"?O.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else p.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Bg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
105
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
106
+ `}]}}const X4=(function(e){if(e==null)return Bse;if(typeof e=="function")return fv(e);if(typeof e=="object")return Array.isArray(e)?Ise(e):Lse(e);if(typeof e=="string")return $se(e);throw new Error("Expected function, string, or object as test")});function Ise(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=X4(e[n]);return fv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Lse(e){const t=e;return fv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function $se(e){return fv(t);function t(n){return n&&n.type===e}}function fv(e){return t;function t(n,r,i){return!!(Use(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Bse(){return!0}function Use(e){return e!==null&&typeof e=="object"&&"type"in e}const J4=[],qse=!0,iT=!1,Fse="skip";function Kse(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=X4(i),o=r?-1:1;u(e,void 0,[])();function u(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=J4,w,S,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=Hse(n(d,p)),v[0]===iT))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==Fse)for(S=(r?k.children.length:-1)+o,j=p.concat(k);S>-1&&S<k.children.length;){const O=k.children[S];if(w=u(O,S,j)(),w[0]===iT)return w;S=typeof w[1]=="number"?w[1]:S+o}}return v}}}function Hse(e){return Array.isArray(e)?e:typeof e=="number"?[qse,e]:e==null?J4:[e]}function e$(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),Kse(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const A1={}.hasOwnProperty,Gse={};function Vse(e,t){const n=t||Gse,r=new Map,i=new Map,a=new Map,o={...Ose,...n.handlers},u={all:f,applyData:Yse,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:Zse,wrap:Qse};return e$(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),u;function d(p,m){const y=p.type,v=u.handlers[y];if(A1.call(u.handlers,y)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in p){const{children:S,...j}=p,k=Bg(j);return k.children=u.all(p),k}return Bg(p)}return(u.options.unknownHandler||Wse)(u,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=u.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=aT(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=aT(S.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function Zse(e,t){e.position&&(t.position=zre(e))}function Yse(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,Bg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Wse(e,t){const n=t.data||{},r="value"in t&&!(A1.call(n,"hProperties")||A1.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 Qse(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 aT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sT(e,t){const n=Vse(e,t),r=n.one(e,void 0),i=Mse(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 Xse(e,t){return e&&"run"in e?async function(n,r){const i=sT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return sT(n,{file:r,...e||t})}}function oT(e){if(e)throw e}var rw,lT;function Jse(){if(lT)return rw;lT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return rw=function d(){var f,p,m,y,v,w,S=arguments[0],j=1,k=arguments.length,O=!1;for(typeof S=="boolean"&&(O=S,S=arguments[1]||{},j=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=u(S,p),y=u(f,p),S!==y&&(O&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},o(S,{name:p,newValue:d(O,w,y)})):typeof y<"u"&&o(S,{name:p,newValue:y}));return S},rw}var eoe=Jse();const iw=Ta(eoe);function O1(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 toe(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?noe(p,u)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function noe(e,t){let n;return r;function r(...o){const u=e.length>o.length;let d;u&&o.push(i);try{d=e.apply(this,o)}catch(f){const p=f;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(o,...u){n||(n=!0,t(o,...u))}function a(o){i(null,o)}}const ma={basename:roe,dirname:ioe,extname:aoe,join:soe,sep:"/"};function roe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ioe(e){if(Nh(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 aoe(e){Nh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),u===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function soe(...e){let t=-1,n;for(;++t<e.length;)Nh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ooe(n)}function ooe(e){Nh(e);const t=e.codePointAt(0)===47;let n=loe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function loe(e,t){let n="",r=0,i=-1,a=0,o=-1,u,d;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else u===46&&a>-1?a++:a=-1}return n}function Nh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const coe={cwd:uoe};function uoe(){return"/"}function E1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function doe(e){if(typeof e=="string")e=new URL(e);else if(!E1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return foe(e)}function foe(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 aw=["history","path","basename","stem","extname","dirname"];class t${constructor(t){let n;t?E1(t)?n={path:t}:typeof t=="string"||hoe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":coe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<aw.length;){const a=aw[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)aw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ma.basename(this.path):void 0}set basename(t){ow(t,"basename"),sw(t,"basename"),this.path=ma.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ma.dirname(this.path):void 0}set dirname(t){cT(this.basename,"dirname"),this.path=ma.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ma.extname(this.path):void 0}set extname(t){if(sw(t,"extname"),cT(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=ma.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){E1(t)&&(t=doe(t)),ow(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ma.basename(this.path,this.extname):void 0}set stem(t){ow(t,"stem"),sw(t,"stem"),this.path=ma.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 pr(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 sw(e,t){if(e&&e.includes(ma.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ma.sep+"`")}function ow(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hoe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const poe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),moe={}.hasOwnProperty;class HN extends poe{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=toe()}copy(){const t=new HN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(iw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(uw("data",this.frozen),this.namespace[t]=n,this):moe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(uw("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=_m(t),r=this.parser||this.Parser;return lw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),lw("process",this.parser||this.Parser),cw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const u=_m(t),d=r.parse(u);r.run(d,u,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);voe(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),lw("processSync",this.parser||this.Parser),cw("processSync",this.compiler||this.Compiler),this.process(t,i),dT("processSync","process",n),r;function i(a,o){n=!0,oT(a),r=o}}run(t,n,r){uT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,u){const d=_m(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?u(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),dT("runSync","run",r),i;function a(o,u){oT(o),i=u,r=!0}}stringify(t,n){this.freeze();const r=_m(n),i=this.compiler||this.Compiler;return cw("stringify",i),uT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(uw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=iw(!0,i.settings,f.settings))}function u(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const S=r[y][1];O1(S)&&O1(v)&&(v=iw(!0,S,v)),r[y]=[f,v,...w]}}}}const goe=new HN().freeze();function lw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function uw(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 uT(e){if(!O1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _m(e){return yoe(e)?e:new t$(e)}function yoe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function voe(e){return typeof e=="string"||xoe(e)}function xoe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const boe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fT=[],hT={allowDangerousHtml:!0},woe=/^(https?|ircs?|mailto|xmpp)$/i,Soe=[{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 joe(e){const t=Noe(e),n=koe(e);return Coe(t.runSync(t.parse(n),n),e)}function Noe(e){const t=e.rehypePlugins||fT,n=e.remarkPlugins||fT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hT}:hT;return goe().use(rse).use(n).use(Xse,r).use(t)}function koe(e){const t=e.children||"",n=new t$;return typeof t=="string"&&(n.value=t),n}function Coe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||_oe;for(const p of Soe)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+boe+p.id,void 0);return e$(e,f),Mre(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in ew)if(Object.hasOwn(ew,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],S=ew[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return u&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function _oe(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||woe.test(e.slice(0,t))?e:""}function Aoe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const hv=Aoe();async function pT(e){const t=await fetch(`${hv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Oi(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Ooe(e){const t=await fetch(`${hv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Oi(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Eoe(e){const t=await fetch(`${hv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Oi(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function zoe({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${hv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new Oi(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)break;m+=p.decode(v,{stream:!0});let S=m.indexOf(`
111
+
112
+ `);for(;S!==-1;){const j=m.slice(0,S);m=m.slice(S+2);for(const k of j.split(`
113
+ `)){if(!k.startsWith("data:"))continue;const O=k.slice(5).trim();if(O)try{o(JSON.parse(O))}catch{}}S=m.indexOf(`
114
+
115
+ `)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function n$(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Toe=[{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?"}],Poe=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/keywords",label:"Keywords",hint:"List tracked keywords",prompt:"List the tracked keywords for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],Am=e=>`canonry:aero:provider:${e}`,mT=e=>`canonry:aero:scope:${e}`;function Roe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,o]=x.useState([]),[u,d]=x.useState(""),[f,p]=x.useState(!1),[m,y]=x.useState([]),[v,w]=x.useState(""),[S,j]=x.useState(null),[k,O]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Am(e))??null),[_,C]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(mT(e))==="all"?"all":"read-only"),T=x.useRef(null),E=x.useRef(null),A=x.useRef(null),[P,$]=x.useState(0),F=x.useMemo(()=>{const q=u.trimStart();if(!q.startsWith("/"))return[];if(/\s/.test(q))return[];const R=q.toLowerCase();return Poe.filter(G=>G.command.startsWith(R)||G.label.toLowerCase().includes(R.slice(1)))},[u]);x.useEffect(()=>{$(q=>F.length===0?0:Math.min(q,F.length-1))},[F.length]);const U=Sa({queryKey:He.agent.providers(e),queryFn:()=>Ooe(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const q=U.data?.providers??[];if(k){const G=q.find(ie=>ie.id===k&&ie.configured);if(G)return G}const R=U.data?.defaultProvider;return R?q.find(G=>G.id===R)??null:null},[k,U.data]);x.useEffect(()=>{if(!U.data||!k)return;U.data.providers.find(R=>R.id===k&&R.configured)||(O(null),window.localStorage.removeItem(Am(e)))},[U.data,k,e]);const V=x.useCallback(q=>{O(q),!(typeof window>"u")&&(q?window.localStorage.setItem(Am(e),q):window.localStorage.removeItem(Am(e)))},[e]),ee=x.useCallback(()=>{C(q=>{const R=q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(mT(e),R),R})},[e]);x.useEffect(()=>{if(!t)return;const q=R=>{R.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[t,r]),x.useEffect(()=>{if(!t)return;let q=!1;j(null);const R=()=>{q||f||pT(e).then(ne=>{q||o(ne.messages)}).catch(ne=>{q||j(ne instanceof Error?ne.message:"Failed to load transcript")})};R();const ie=window.setInterval(R,15e3);return()=>{q=!0,window.clearInterval(ie)}},[t,e,f]),x.useEffect(()=>()=>{T.current?.abort()},[e]),x.useEffect(()=>{const q=E.current;q&&(q.scrollTop=q.scrollHeight)},[a,v,m]);async function Q(q){const R=q.trim();if(!R||f)return;j(null),d(""),p(!0),w(""),y([]);const G={role:"user",content:R,timestamp:Date.now()};o(ne=>[...ne,G]);const ie=new AbortController;T.current=ie;try{await zoe({project:e,prompt:R,provider:k??void 0,scope:_,signal:ie.signal,onEvent:K});const ne=await pT(e);o(ne.messages)}catch(ne){ne.name!=="AbortError"&&j(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),w(""),T.current=null}}function K(q){switch(q.type){case"message_update":w(n$(q.message));break;case"message_end":q.message.role==="assistant"&&w("");break;case"tool_execution_start":y(R=>[...R,{id:q.toolCallId,name:q.toolName,args:q.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(R=>R.map(G=>G.id===q.toolCallId?{...G,endedAt:Date.now(),isError:q.isError,result:q.result}:G));break;case"error":j(q.message);break}}async function te(){T.current?.abort();try{await Eoe(e),o([]),j(null)}catch(q){j(q instanceof Error?q.message:"Reset failed")}}const le=a.length===0,je=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",I=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:je,onClick:q=>{r&&q.target===q.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(E2,{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(Doe,{providers:U.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),l.jsx("button",{type:"button",onClick:te,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(fL,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.jsx("button",{type:"button",onClick:()=>i(q=>!q),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(cV,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.jsx(aV,{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(wh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),l.jsxs("div",{ref:E,className:I,children:[S&&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:S}),le&&!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:Toe.map(q=>l.jsx("button",{type:"button",onClick:()=>Q(q.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:q.label},q.label))})]}),Boe(a,e,k,_),m.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>l.jsx(r$,{trail:q},q.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(i$,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&l.jsx(Koe,{})]}),l.jsx(Moe,{projectName:e,activeProvider:B,scope:_,onToggleScope:ee,disabled:f}),l.jsxs("div",{className:"relative",children:[F.length>0&&l.jsx(Ioe,{matches:F,selectedIndex:P,onHover:$,onPick:q=>{d(""),A.current?.focus(),q.action==="clear"?te():Q(q.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:q=>{if(q.preventDefault(),F.length>0){const R=F[P];d(""),R.action==="clear"?te():Q(R.prompt);return}Q(u)},children:[l.jsx("textarea",{ref:A,value:u,onChange:q=>d(q.target.value),onKeyDown:q=>{if(F.length>0){if(q.key==="ArrowDown"){q.preventDefault(),$(R=>(R+1)%F.length);return}if(q.key==="ArrowUp"){q.preventDefault(),$(R=>(R-1+F.length)%F.length);return}if(q.key==="Tab"){q.preventDefault();const R=F[P];d(`${R.command} `);return}if(q.key==="Escape"){q.preventDefault(),d("");return}}if(q.key==="Enter"&&!q.shiftKey)if(q.preventDefault(),F.length>0){const R=F[P];d(""),R.action==="clear"?te():Q(R.prompt)}else Q(u)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),l.jsx("button",{type:"submit",disabled:f||!u.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:l.jsx(TG,{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(E2,{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 Doe({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=x.useState(!1),u=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=y=>{u.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return l.jsxs("div",{ref:u,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(IG,{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,y=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(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[l.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?l.jsx(oL,{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}),y&&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:Loe(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 Moe({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 Ioe({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 Loe(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 $oe(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Boe(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],u=$oe(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(Uoe,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=Foe(o,d,o.timestamp??0),m=n$(o);i.push(l.jsxs(x.Fragment,{children:[p.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>l.jsx(r$,{trail:y},y.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(i$,{content:m})]})]},u)),a=f-1;continue}}return i}function Uoe({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),o=x.useMemo(()=>qoe(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return 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:u,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:o,children:i?l.jsxs(l.Fragment,{children:[l.jsx(oL,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):l.jsxs(l.Fragment,{children:[l.jsx(KG,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),l.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function qoe(e,t,n,r){const i=["canonry","agent","ask",gT(e),gT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function gT(e){return`'${e.replace(/'/g,"'\\''")}'`}function Foe(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 r$({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`,u=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return l.jsxs("div",{className:`rounded-md border ${u} ${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(dL,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?l.jsx(Eg,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):l.jsx(AV,{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(bh,{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:yT(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:yT(e.result)})]})]})]})}function yT(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 i$({content:e}){return l.jsx("div",{className:"aero-markdown text-zinc-100",children:l.jsx(joe,{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 Koe(){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 Hoe(){const e=GI(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=Sa({queryKey:He.projects.all,queryFn:nN,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(Roe,{projectName:a.name},a.name):null}const vT=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:QG},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:RG},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:YG}],xT=e=>({label:e,state:"checking",detail:"Checking service health"}),Goe={apiStatus:xT("API"),workerStatus:xT("Worker")};function Voe(e){switch(e){case Gt["answer-visibility"]:return"Visibility sweep";case Gt["gsc-sync"]:return"GSC sync";case Gt["inspect-sitemap"]:return"Sitemap inspection";case Gt["ga-sync"]:return"GA sync";case Gt["bing-inspect"]:return"Bing URL inspection";case Gt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Gt["site-audit"]:return"Site audit";case Gt["backlink-extract"]:return"Backlink extract"}}function Zoe(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function Yoe(e){const t=Voe(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Woe(e,t){return e.error?`${t}: ${gN(e.error)}`:e.location?`${t} · ${e.location}`:t}function Qoe(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function Xoe(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 Joe(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function ele(){const e=x.useSyncExternalStore(EJ,Dl,Dl),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=Sa({queryKey:He.runs.all,queryFn:ZI,enabled:t,staleTime:l1,refetchInterval:3e3}),r=Sa({queryKey:He.projects.all,queryFn:nN,enabled:t}),i=x.useRef({}),a=x.useCallback(()=>{n.refetch()},[n.refetch]);return x.useEffect(()=>{t&&a()},[t,a]),x.useEffect(()=>{if(!t||typeof window>"u")return;const o=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",o)}},[t,a]),x.useEffect(()=>{const o=n.data??[],u=r.data??[],d=Object.fromEntries(o.map(p=>[p.id,p])),f=Object.fromEntries(o.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const m=d[p.runId];if(!m||!bN(m.status)||(i.current[m.id]??p.lastAnnouncedStatus)===m.status)continue;if(p.sourceAction==="run-all"){rz(m.id);continue}const v=Qoe(m.projectId,p.projectLabel,u);gt({title:Yoe(m),detail:Woe(m,v),tone:Zoe(m.status),dedupeKey:`run:${m.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:m.id}}),rz(m.id)}for(const p of Object.values(e.batches)){const m=PJ(p.runIds,d);m.finished&&(gt({title:"Run-all batch finished",detail:Xoe(m,p.skippedCount),tone:Joe(m),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),TJ(p.batchId))}i.current=f},[r.data,n.data,e]),null}function tle(){const e=Sh(),{dashboard:t,isLoading:n,refetch:r}=Jl(),o=cv(!e,e?.health).data??e?.health??Goe,u=GI(),{runId:d,evidenceId:f,closeDrawer:p}=Hu(),[m,y]=x.useState(!1),v=ire(d),w=v.data??null,S=v.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{y(!1)},[u.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?_ne(j,d):void 0,O=f&&j?Ane(j,f):void 0,_=(()=>{const C=u.pathname;if(C==="/")return"Portfolio";if(C==="/projects")return"Projects";if(C==="/runs")return"Runs";if(C==="/settings")return"Settings";if(C==="/setup")return"Setup";if(C==="/backlinks")return"Backlinks";if(C.startsWith("/projects/")){const E=C.split("/").filter(Boolean)[1];if(E&&j){const A=j.projects.find(P=>P.project.id===E);if(A)return A.project.name}return"Project"}return"Not found"})();return 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(hz,{version:o.apiStatus.version})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(Kt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(tV,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(Kt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(JG,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(Kt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Og,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(Kt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(uL,{className:"sidebar-icon"}),l.jsx("span",{children:"Backlinks"})]}),l.jsxs(Kt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(xV,{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(C=>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+C*15}%`}})]},C))]}):j&&j.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const T=C.visibilitySummary.tone;return l.jsxs(Kt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),l.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(Kt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(gV,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:vT.map(({label:C,href:T,Icon:E})=>l.jsx("a",{className:"sidebar-footer-icon",href:T,target:"_blank",rel:"noopener noreferrer",title:C,"aria-label":C,children:l.jsx(E,{className:"size-4"})},T))})]}),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(hz,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(Kt,{to:"/",children:"Home"}),l.jsx(bh,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:_})]})]}),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:Co(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:Co(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),l.jsxs(xe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[l.jsx(oV,{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(xe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[l.jsx(wh,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(Kt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(Kt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(Kt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(Kt,{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(C=>l.jsx(Kt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.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(C=>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"})]},C))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>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(T=>l.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},C))})]}):l.jsx(tN,{})}),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:vT.map(({label:C,href:T,Icon:E})=>l.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",title:C,"aria-label":C,className:"footer-icon",children:l.jsx(E,{className:"size-3.5"})},T))})]})]}),k?l.jsxs(vne,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(iv,{status:k.status}),l.jsx("span",{className:"text-zinc-400",children:k.startedAt}),l.jsx("span",{className:"text-zinc-500",children:k.duration}),l.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.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"}),S?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(C=>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:C.keyword??"Unknown key phrase"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Ml,{provider:C.provider}),l.jsx(O5,{variant:C.citationState==="cited"?"success":"neutral",children:C.citationState})]})]}),C.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.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:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((T,E)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:T.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},E))})]}),C.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:C.answerText})]})]},C.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"}),"Querying remaining key phrases..."]})]}):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 key phrase 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:yJ(w.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?l.jsx(bne,{evidence:O.evidence,project:O.project,onClose:p}):null,l.jsx(ele,{}),l.jsx(ore,{}),l.jsx(Hoe,{})]})}class nle 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(Eg,{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(xe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(fL,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(xe,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const $e=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Mi("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}));$e.displayName="Card";const z1=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Mi("flex flex-col gap-1.5 p-5",e),...t}));z1.displayName="CardHeader";const T1=x.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Mi("font-medium tracking-tight text-zinc-50",e),...t}));T1.displayName="CardTitle";const P1=x.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Mi("text-sm text-zinc-500",e),...t}));P1.displayName="CardDescription";const cg=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Mi("p-5 pt-0",e),...t}));cg.displayName="CardContent";function rle({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((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,S=a+(1-(y-o)/d)*p;return`${w},${S}`}).join(" ");return 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 ile({project:e}){return l.jsxs(Kt,{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," · ",tv(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(rle,{points:e.trend,tone:l5(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(bh,{className:"h-4 w-4 text-zinc-500"})})]})}function ale(){const e=Sh(),{dashboard:t,isLoading:n}=Jl(),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,u=cv(!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=jJ(i.systemHealth,u,r.settings),{openRun:f}=Hu();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(ile,{project:p},p.project.id))}):l.jsxs($e,{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(xe,{size:"sm",asChild:!0,children:l.jsx(Kt,{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(Kt,{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(iv,{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($e,{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(wt,{tone:p.tone,title:p.id==="api"?Co(u.apiStatus):p.id==="worker"?Co(u.workerStatus):void 0,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const GN=Symbol.for("yaml.alias"),R1=Symbol.for("yaml.document"),bo=Symbol.for("yaml.map"),a$=Symbol.for("yaml.pair"),_a=Symbol.for("yaml.scalar"),Zu=Symbol.for("yaml.seq"),Ei=Symbol.for("yaml.node.type"),tc=e=>!!e&&typeof e=="object"&&e[Ei]===GN,pv=e=>!!e&&typeof e=="object"&&e[Ei]===R1,kh=e=>!!e&&typeof e=="object"&&e[Ei]===bo,Cn=e=>!!e&&typeof e=="object"&&e[Ei]===a$,Zt=e=>!!e&&typeof e=="object"&&e[Ei]===_a,Ch=e=>!!e&&typeof e=="object"&&e[Ei]===Zu;function Nn(e){if(e&&typeof e=="object")switch(e[Ei]){case bo:case Zu:return!0}return!1}function kn(e){if(e&&typeof e=="object")switch(e[Ei]){case GN:case bo:case _a:case Zu:return!0}return!1}const s$=e=>(Zt(e)||Nn(e))&&!!e.anchor,cl=Symbol("break visit"),sle=Symbol("skip children"),Lf=Symbol("remove node");function Yu(e,t){const n=ole(t);pv(e)?su(null,e.contents,n,Object.freeze([e]))===Lf&&(e.contents=null):su(null,e,n,Object.freeze([]))}Yu.BREAK=cl;Yu.SKIP=sle;Yu.REMOVE=Lf;function su(e,t,n,r){const i=lle(e,t,n,r);if(kn(i)||Cn(i))return cle(e,r,i),su(e,i,n,r);if(typeof i!="symbol"){if(Nn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=su(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===cl)return cl;o===Lf&&(t.items.splice(a,1),a-=1)}}}else if(Cn(t)){r=Object.freeze(r.concat(t));const a=su("key",t.key,n,r);if(a===cl)return cl;a===Lf&&(t.key=null);const o=su("value",t.value,n,r);if(o===cl)return cl;o===Lf&&(t.value=null)}}return i}function ole(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 lle(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(kh(t))return n.Map?.(e,t,r);if(Ch(t))return n.Seq?.(e,t,r);if(Cn(t))return n.Pair?.(e,t,r);if(Zt(t))return n.Scalar?.(e,t,r);if(tc(t))return n.Alias?.(e,t,r)}function cle(e,t,n){const r=t[t.length-1];if(Nn(r))r.items[e]=n;else if(Cn(r))e==="key"?r.key=n:r.value=n;else if(pv(r))r.contents=n;else{const i=tc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const ule={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dle=e=>e.replace(/[!,[\]{}]/g,t=>ule[t]);class xr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},xr.defaultYaml,t),this.tags=Object.assign({},xr.defaultTags,n)}clone(){const t=new xr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new xr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:xr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},xr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:xr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},xr.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+dle(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&&kn(t.contents)){const a={};Yu(t.contents,(o,u)=>{kn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
117
+ `)}}xr.defaultYaml={explicit:!1,version:"1.2"};xr.defaultTags={"!!":"tag:yaml.org,2002:"};function o$(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 l$(e){const t=new Set;return Yu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function c$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function fle(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=l$(e));const o=c$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Zt(o.node)||Nn(o.node)))o.node.anchor=o.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function ou(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],u=ou(e,r,String(i),o);u===void 0?delete r[i]:u!==o&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=ou(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=ou(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=ou(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function _i(e,t,n){if(Array.isArray(e))return e.map((r,i)=>_i(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!s$(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class VN{constructor(t){Object.defineProperty(this,Ei,{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(!pv(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=_i(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?ou(a,{"":u},"",u):u}}class ZN extends VN{constructor(t){super(GN),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=[],Yu(t,{Node:(a,o)=>{(tc(o)||s$(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(o);if(u||(_i(o,null,n),u=r.get(o)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=ug(i,o,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(o$(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 ug(e,t,n){if(tc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Nn(t)){let r=0;for(const i of t.items){const a=ug(e,i,n);a>r&&(r=a)}return r}else if(Cn(t)){const r=ug(e,t.key,n),i=ug(e,t.value,n);return Math.max(r,i)}return 1}const u$=e=>!e||typeof e!="function"&&typeof e!="object";class nt extends VN{constructor(t){super(_a),this.value=t}toJSON(t,n){return n?.keep?this.value:_i(this.value,t,n)}toString(){return String(this.value)}}nt.BLOCK_FOLDED="BLOCK_FOLDED";nt.BLOCK_LITERAL="BLOCK_LITERAL";nt.PLAIN="PLAIN";nt.QUOTE_DOUBLE="QUOTE_DOUBLE";nt.QUOTE_SINGLE="QUOTE_SINGLE";const hle="tag:yaml.org,2002:";function ple(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 Xf(e,t,n){if(pv(e)&&(e=e.contents),kn(e))return e;if(Cn(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:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new ZN(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=hle+t.slice(2));let f=ple(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new nt(e);return d&&(d.node=m),m}f=e instanceof Map?o[bo]:Symbol.iterator in Object(e)?o[Zu]: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 nt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Ug(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 Xf(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 _f=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class d$ extends VN{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>kn(r)||Cn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(_f(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Nn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,Ug(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(Nn(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&&Zt(a)?a.value:a:Nn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Cn(n))return!1;const r=n.value;return r==null||t&&Zt(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 Nn(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(Nn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,Ug(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const mle=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function os(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const yl=(e,t,n)=>e.endsWith(`
118
+ `)?os(n,t):n.includes(`
119
+ `)?`
120
+ `+os(n,t):(e.endsWith(" ")?"":" ")+n,f$="flow",D1="block",dg="quoted";function mv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:u}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let y,v,w=!1,S=-1,j=-1,k=-1;n===D1&&(S=bT(e,S,t.length),S!==-1&&(m=S+d));for(let _;_=e[S+=1];){if(n===dg&&_==="\\"){switch(j=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(_===`
121
+ `)n===D1&&(S=bT(e,S,t.length)),m=S+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
122
+ `&&v!==" "){const C=e[S+1];C&&C!==" "&&C!==`
123
+ `&&C!==" "&&(y=S)}if(S>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===dg){for(;v===" "||v===" ";)v=_,_=e[S+=1],w=!0;const C=S>k+1?S-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else w=!0}v=_}if(w&&u&&u(),f.length===0)return e;o&&o();let O=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const C=f[_],T=f[_+1]||e.length;C===0?O=`
124
+ ${t}${e.slice(0,T)}`:(n===dg&&p[C]&&(O+=`${e[C]}\\`),O+=`
125
+ ${t}${e.slice(C+1,T)}`)}return O}function bT(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 gv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yv=e=>/^(%|---|\.\.\.)/m.test(e);function gle(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 $f(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(yv(e)?" ":"");let o="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(u,d)+`
128
+
129
+ `;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
130
+ `,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,u=d+1}break;default:d+=1}return o=u?o+n.slice(u):n,r?o:mv(o,a,dg,gv(t,!1))}function M1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
131
+ `)||/[ \t]\n|\n[ \t]/.test(e))return $f(e,t);const n=t.indent||(yv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
132
+ ${n}`)+"'";return t.implicitKey?r:mv(r,n,f$,gv(t,!1))}function lu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=$f;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=M1:a&&!i?r=$f:r=n?M1:$f}return r(e,t)}let I1;try{I1=new RegExp(`(^|(?<!
133
+ ))
134
+ +(?!
135
+ |$)`,"g")}catch{I1=/\n+(?!\n|$)/g}function fg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:u,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return lu(n,r);const f=r.indent||(r.forceBlockIndent||yv(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===nt.BLOCK_FOLDED?!1:t===nt.BLOCK_LITERAL?!0:!gle(n,d,f.length);if(!n)return p?`|
136
+ `:`>
137
+ `;let m,y;for(y=n.length;y>0;--y){const T=n[y-1];if(T!==`
138
+ `&&T!==" "&&T!==" ")break}let v=n.substring(y);const w=v.indexOf(`
139
+ `);w===-1?m="-":n===v||w!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
140
+ `&&(v=v.slice(0,-1)),v=v.replace(I1,`$&${f}`));let S=!1,j,k=-1;for(j=0;j<n.length;++j){const T=n[j];if(T===" ")S=!0;else if(T===`
141
+ `)k=j;else break}let O=n.substring(0,k<j?k+1:j);O&&(n=n.substring(O.length),O=O.replace(/\n+/g,`$&${f}`));let C=(S?f?"2":"1":"")+m;if(e&&(C+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=n.replace(/\n+/g,`
142
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let E=!1;const A=gv(r,!0);o!=="folded"&&t!==nt.BLOCK_FOLDED&&(A.onOverflow=()=>{E=!0});const P=mv(`${O}${T}${v}`,f,D1,A);if(!E)return`>${C}
143
+ ${f}${P}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
144
+ ${f}${O}${n}${v}`}function yle(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
145
+ `)||p&&/[[\]{},]/.test(a))return lu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
146
+ `)?lu(a,t):fg(e,t,n,r);if(!u&&!p&&i!==nt.PLAIN&&a.includes(`
147
+ `))return fg(e,t,n,r);if(yv(a)){if(d==="")return t.forceBlockIndent=!0,fg(e,t,n,r);if(u&&d===f)return lu(a,t)}const m=a.replace(/\n+/g,`$&
148
+ ${d}`);if(o){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return lu(a,t)}return u?m:mv(m,d,f$,gv(t,!1))}function YN(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==nt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(u=nt.QUOTE_DOUBLE);const d=p=>{switch(p){case nt.BLOCK_FOLDED:case nt.BLOCK_LITERAL:return i||a?lu(o.value,t):fg(o,t,n,r);case nt.QUOTE_DOUBLE:return $f(o.value,t);case nt.QUOTE_SINGLE:return M1(o.value,t);case nt.PLAIN:return yle(o,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function h$(e,t){const n=Object.assign({blockQuote:!0,commentString:mle,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 vle(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(Zt(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 xle(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Zt(e)||Nn(e))&&e.anchor;a&&o$(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 Eu(e,t,n,r){if(Cn(e))return e.toString(t,n,r);if(tc(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=kn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=vle(t.doc.schema.tags,a));const o=xle(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Zt(a)?YN(a,t,n,r):a.toString(t,n,r);return o?Zt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
149
+ ${t.indent}${u}`:u}function ble({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=kn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(Nn(e)||!kn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||Nn(e)||(Zt(e)?e.type===nt.BLOCK_FOLDED||e.type===nt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let w=!1,S=!1,j=Eu(e,n,()=>w=!0,()=>S=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return w&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!w?j+=yl(j,n.indent,f(y)):S&&i&&i(),j;w&&(y=null),v?(y&&(j+=yl(j,n.indent,f(y))),j=`? ${j}
150
+ ${u}:`):(j=`${j}:`,y&&(j+=yl(j,n.indent,f(y))));let k,O,_;kn(t)?(k=!!t.spaceBefore,O=t.commentBefore,_=t.comment):(k=!1,O=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Zt(t)&&(n.indentAtStart=j.length+1),S=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Ch(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const T=Eu(t,n,()=>C=!0,()=>S=!0);let E=" ";if(y||k||O){if(E=k?`
151
+ `:"",O){const A=f(O);E+=`
152
+ ${os(A,n.indent)}`}T===""&&!n.inFlow?E===`
153
+ `&&_&&(E=`
154
+
155
+ `):E+=`
156
+ ${n.indent}`}else if(!v&&Nn(t)){const A=T[0],P=T.indexOf(`
157
+ `),$=P!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let U=!1;if($&&(A==="&"||A==="!")){let B=T.indexOf(" ");A==="&"&&B!==-1&&B<P&&T[B+1]==="!"&&(B=T.indexOf(" ",B+1)),(B===-1||P<B)&&(U=!0)}U||(E=`
158
+ ${n.indent}`)}}else(T===""||T[0]===`
159
+ `)&&(E="");return j+=E+T,n.inFlow?C&&r&&r():_&&!C?j+=yl(j,n.indent,f(_)):S&&i&&i(),j}function wle(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Om="<<",us={identify:e=>e===Om||typeof e=="symbol"&&e.description===Om,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new nt(Symbol(Om)),{addToJSMap:p$}),stringify:()=>Om},Sle=(e,t)=>(us.identify(t)||Zt(t)&&(!t.type||t.type===nt.PLAIN)&&us.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===us.tag&&n.default);function p$(e,t,n){if(n=e&&tc(n)?n.resolve(e.doc):n,Ch(n))for(const r of n.items)dw(e,t,r);else if(Array.isArray(n))for(const r of n)dw(e,t,r);else dw(e,t,n)}function dw(e,t,n){const r=e&&tc(n)?n.resolve(e.doc):n;if(!kh(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 m$(e,t,{key:n,value:r}){if(kn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Sle(e,n))p$(e,t,r);else{const i=_i(n,"",e);if(t instanceof Map)t.set(i,_i(r,i,e));else if(t instanceof Set)t.add(i);else{const a=jle(n,i,e),o=_i(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function jle(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kn(e)&&n?.doc){const r=h$(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)+'..."'),wle(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function WN(e,t,n){const r=Xf(e,void 0,n),i=Xf(t,void 0,n);return new Sr(r,i)}class Sr{constructor(t,n=null){Object.defineProperty(this,Ei,{value:a$}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return kn(n)&&(n=n.clone(t)),kn(r)&&(r=r.clone(t)),new Sr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return m$(n,r,this)}toString(t,n,r){return t?.doc?ble(this,t,n,r):JSON.stringify(this)}}function g$(e,t,n){return(t.inFlow??e.flow?kle:Nle)(e,t,n)}function Nle({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let w=0;w<t.length;++w){const S=t[w];let j=null;if(kn(S))!m&&S.spaceBefore&&y.push(""),qg(n,y,S.commentBefore,m),S.comment&&(j=S.comment);else if(Cn(S)){const O=kn(S.key)?S.key:null;O&&(!m&&O.spaceBefore&&y.push(""),qg(n,y,O.commentBefore,m))}m=!1;let k=Eu(S,p,()=>j=null,()=>m=!0);j&&(k+=yl(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const S=y[w];v+=S?`
160
+ ${d}${S}`:`
161
+ `}}return e?(v+=`
162
+ `+os(f(e),d),u&&u()):m&&o&&o(),v}function kle({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:u}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let w=0;w<e.length;++w){const S=e[w];let j=null;if(kn(S))S.spaceBefore&&m.push(""),qg(t,m,S.commentBefore,!1),S.comment&&(j=S.comment);else if(Cn(S)){const O=kn(S.key)?S.key:null;O&&(O.spaceBefore&&m.push(""),qg(t,m,O.commentBefore,!1),O.comment&&(f=!0));const _=kn(S.value)?S.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):S.value==null&&O?.comment&&(j=O.comment)}j&&(f=!0);let k=Eu(S,d,()=>j=null);w<e.length-1&&(k+=","),j&&(k+=yl(k,r,u(j))),!f&&(m.length>p||k.includes(`
163
+ `))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const w=m.reduce((S,j)=>S+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=y;for(const S of m)w+=S?`
164
+ ${a}${i}${S}`:`
165
+ `;return`${w}
166
+ ${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function qg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=os(t(r),e);n.push(a.trimStart())}}function vl(e,t){const n=Zt(t)?t.value:t;for(const r of e)if(Cn(r)&&(r.key===t||r.key===n||Zt(r.key)&&r.key.value===n))return r}class ji extends d${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),u=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&o.items.push(WN(d,f,r))};if(n instanceof Map)for(const[d,f]of n)u(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;Cn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Sr(t,t?.value):r=new Sr(t.key,t.value);const i=vl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Zt(i.value)&&u$(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(u=>a(r,u)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=vl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=vl(this.items,t)?.value;return(!n&&Zt(i)?i.value:i)??void 0}has(t){return!!vl(this.items,t)}set(t,n){this.add(new Sr(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)m$(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Cn(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})),g$(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Wu={collection:"map",default:!0,nodeClass:ji,tag:"tag:yaml.org,2002:map",resolve(e,t){return kh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>ji.from(e,t,n)};class Ll extends d${static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Zu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Em(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Em(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Zt(i)?i.value:i}has(t){const n=Em(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Em(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Zt(i)&&u$(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(_i(a,String(i++),n));return r}toString(t,n,r){return t?g$(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(o++);u=i.call(n,d,u)}a.items.push(Xf(u,void 0,r))}}return a}}function Em(e){let t=Zt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Qu={collection:"seq",default:!0,nodeClass:Ll,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ch(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ll.from(e,t,n)},vv={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),YN(e,t,n,r)}},xv={identify:e=>e==null,createNode:()=>new nt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new nt(null),stringify:({source:e},t)=>typeof e=="string"&&xv.test.test(e)?e:t.options.nullStr},QN={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new nt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&QN.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 ta({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let u=t-(a.length-o-1);for(;u-- >0;)a+="0"}return a}const y$={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:ta},v$={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():ta(e)}},x$={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 nt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ta},bv=e=>typeof e=="bigint"||Number.isInteger(e),XN=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function b$(e,t,n){const{value:r}=e;return bv(r)&&r>=0?n+r.toString(t):ta(e)}const w$={identify:e=>bv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>XN(e,2,8,n),stringify:e=>b$(e,8,"0o")},S$={identify:bv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>XN(e,0,10,n),stringify:ta},j$={identify:e=>bv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>XN(e,2,16,n),stringify:e=>b$(e,16,"0x")},Cle=[Wu,Qu,vv,xv,QN,w$,S$,j$,y$,v$,x$];function wT(e){return typeof e=="bigint"||Number.isInteger(e)}const zm=({value:e})=>JSON.stringify(e),_le=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:zm},{identify:e=>e==null,createNode:()=>new nt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:zm},{identify:wT,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})=>wT(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:zm}],Ale={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Ole=[Wu,Qu].concat(_le,Ale),JN={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const o=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[f]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=nt.BLOCK_LITERAL),t!==nt.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(u.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=u.substr(y,d);u=p.join(t===nt.BLOCK_LITERAL?`
167
+ `:" ")}return YN({comment:e,type:t,value:u},r,i,a)}};function N$(e,t){if(Ch(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Cn(r)){if(kh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Sr(new nt(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]=Cn(r)?r:new Sr(r)}}else t("Expected a sequence for this tag");return e}function k$(e,t,n){const{replacer:r}=n,i=new Ll(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let u,d;if(Array.isArray(o))if(o.length===2)u=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)u=f[0],d=o[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=o;i.items.push(WN(u,d,n))}return i}const ek={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:N$,createNode:k$};class yu extends Ll{constructor(){super(),this.add=ji.prototype.add.bind(this),this.delete=ji.prototype.delete.bind(this),this.get=ji.prototype.get.bind(this),this.has=ji.prototype.has.bind(this),this.set=ji.prototype.set.bind(this),this.tag=yu.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(Cn(i)?(a=_i(i.key,"",n),o=_i(i.value,a,n)):a=_i(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=k$(t,n,r),a=new this;return a.items=i.items,a}}yu.tag="tag:yaml.org,2002:omap";const tk={collection:"seq",identify:e=>e instanceof Map,nodeClass:yu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=N$(e,t),r=[];for(const{key:i}of n.items)Zt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new yu,n)},createNode:(e,t,n)=>yu.from(e,t,n)};function C$({value:e,source:t},n){return t&&(e?_$:A$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const _$={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 nt(!0),stringify:C$},A$={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 nt(!1),stringify:C$},Ele={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:ta},zle={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():ta(e)}},Tle={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 nt(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:ta},_h=e=>typeof e=="bigint"||Number.isInteger(e);function wv(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 nk(e,t,n){const{value:r}=e;if(_h(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ta(e)}const Ple={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>wv(e,2,2,n),stringify:e=>nk(e,2,"0b")},Rle={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>wv(e,1,8,n),stringify:e=>nk(e,8,"0")},Dle={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>wv(e,0,10,n),stringify:ta},Mle={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>wv(e,2,16,n),stringify:e=>nk(e,16,"0x")};class vu extends ji{constructor(t){super(t),this.tag=vu.tag}add(t){let n;Cn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Sr(t.key,null):n=new Sr(t,null),vl(this.items,n.key)||this.items.push(n)}get(t,n){const r=vl(this.items,t);return!n&&Cn(r)?Zt(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=vl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Sr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(WN(o,null,r));return a}}vu.tag="tag:yaml.org,2002:set";const rk={collection:"map",identify:e=>e instanceof Set,nodeClass:vu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>vu.from(e,t,n),resolve(e,t){if(kh(e)){if(e.hasAllNullValues(!0))return Object.assign(new vu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ik(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,u)=>o*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function O$(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ta(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 E$={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})=>ik(e,n),stringify:O$},z$={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=>ik(e,!1),stringify:O$},Sv={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(Sv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,o||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=ik(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$/,"")??""},ST=[Wu,Qu,vv,xv,_$,A$,Ple,Rle,Dle,Mle,Ele,zle,Tle,JN,us,tk,ek,rk,E$,z$,Sv],jT=new Map([["core",Cle],["failsafe",[Wu,Qu,vv]],["json",Ole],["yaml11",ST],["yaml-1.1",ST]]),NT={binary:JN,bool:QN,float:x$,floatExp:v$,floatNaN:y$,floatTime:z$,int:S$,intHex:j$,intOct:w$,intTime:E$,map:Wu,merge:us,null:xv,omap:tk,pairs:ek,seq:Qu,set:rk,timestamp:Sv},Ile={"tag:yaml.org,2002:binary":JN,"tag:yaml.org,2002:merge":us,"tag:yaml.org,2002:omap":tk,"tag:yaml.org,2002:pairs":ek,"tag:yaml.org,2002:set":rk,"tag:yaml.org,2002:timestamp":Sv};function fw(e,t,n){const r=jT.get(t);if(r&&!e)return n&&!r.includes(us)?r.concat(us):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(jT.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(us)),i.reduce((a,o)=>{const u=typeof o=="string"?NT[o]:o;if(!u){const d=JSON.stringify(o),f=Object.keys(NT).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(u)||a.push(u),a},[])}const Lle=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class ak{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?fw(t,"compat"):t?fw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?Ile:{},this.tags=fw(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,bo,{value:Wu}),Object.defineProperty(this,_a,{value:vv}),Object.defineProperty(this,Zu,{value:Qu}),this.sortMapEntries=typeof o=="function"?o:o===!0?Lle:null}clone(){const t=Object.create(ak.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function $le(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=h$(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(os(d,""))}let o=!1,u=null;if(e.contents){if(kn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(os(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>o=!0;let f=Eu(e.contents,i,()=>u=null,d);u&&(f+=yl(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Eu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
170
+ `)?(n.push("..."),n.push(os(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||u)&&n[n.length-1]!==""&&n.push(""),n.push(os(a(d),"")))}return n.join(`
171
+ `)+`
172
+ `}class jv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ei,{value:R1});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 xr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(jv.prototype,{[Ei]:{value:R1}});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=kn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hc(this.contents)&&this.contents.add(t)}addIn(t,n){Hc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=l$(this);t.anchor=!n||r.has(n)?c$(n||"a",r):n}return new ZN(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,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=fle(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},S=Xf(t,p,w);return u&&Nn(S)&&(S.flow=!0),y(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Sr(i,a)}delete(t){return Hc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return _f(t)?this.contents==null?!1:(this.contents=null,!0):Hc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Nn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return _f(t)?!n&&Zt(this.contents)?this.contents.value:this.contents:Nn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Nn(this.contents)?this.contents.has(t):!1}hasIn(t){return _f(t)?this.contents!==void 0:Nn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ug(this.schema,[t],n):Hc(this.contents)&&this.contents.set(t,n)}setIn(t,n){_f(t)?this.contents=n:this.contents==null?this.contents=Ug(this.schema,Array.from(t),n):Hc(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 xr({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 xr({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 ak(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=_i(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof o=="function"?ou(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 $le(this,t)}}function Hc(e){if(Nn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class T$ extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Tm extends T${constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Ble extends T${constructor(t,n,r){super("YAMLWarning",t,n,r)}}const kT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const u=Math.min(a-39,o.length-79);o="…"+o.substring(u),a-=u-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
173
+ `),o=u+o}if(/[^ ]/.test(o)){let u=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(u=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(u);n.message+=`:
174
+
175
+ ${o}
176
+ ${f}
177
+ `}};function zu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:u}){let d=!1,f=u,p=u,m="",y="",v=!1,w=!1,S=null,j=null,k=null,O=null,_=null,C=null,T=null;for(const P of e)switch(w&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&a(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(f&&P.type!=="comment"&&P.type!=="newline"&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),P.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&P.source.includes(" ")&&(S=P),p=!0;break;case"comment":{p||a(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=P.source.substring(1)||" ";m?m+=y+$:m=$,y="",f=!1;break}case"newline":f?m?m+=P.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=P.source,f=!0,v=!0,(j||k)&&(O=P),p=!0;break;case"anchor":j&&a(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&a(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=P,T??(T=P.offset),f=!1,p=!1,w=!0;break;case"tag":{k&&a(P,"MULTIPLE_TAGS","A node can have at most one tag"),k=P,T??(T=P.offset),f=!1,p=!1,w=!0;break}case n:(j||k)&&a(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),C&&a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`),C=P,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=P,f=!1,p=!1;break}default:a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),f=!1,p=!1}const E=e[e.length-1],A=E?E.offset+E.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(f&&S.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:O,end:A,start:T??A}}function Jf(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(Jf(t.key)||Jf(t.value))return!0}return!1;default:return!0}}function L1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Jf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function P$(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Zt(a)&&Zt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const CT="All mapping items must start at the same column";function Ule({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??ji,u=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:w}=p,S=zu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!S.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",CT)),!S.anchor&&!S.tag&&!v){f=S.end,S.comment&&(u.comment?u.comment+=`
179
+ `+S.comment:u.comment=S.comment);continue}(S.newlineAfterProp||Jf(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==r.indent&&i(d,"BAD_INDENT",CT);n.atKey=!0;const k=S.end,O=y?e(n,y,S,i):t(n,k,m,null,S,i);n.schema.compat&&L1(r.indent,y,i),n.atKey=!1,P$(n,u.items,O)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const _=zu(v??[],{indicator:"map-value-ind",next:w,offset:O.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(w?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<_.found.offset-1024&&i(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=w?e(n,w,_,i):t(n,d,v,null,_,i);n.schema.compat&&L1(r.indent,w,i),d=C.range[2];const T=new Sr(O,C);n.options.keepSourceTokens&&(T.srcToken=p),u.items.push(T)}else{j&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(O.comment?O.comment+=`
180
+ `+_.comment:O.comment=_.comment);const C=new Sr(O);n.options.keepSourceTokens&&(C.srcToken=p),u.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function qle({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Ll,u=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=zu(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(u.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&L1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function Ah(e,t,n,r){let i="";if(e){let a=!1,o="";for(const u of e){const{source:d,type:f}=u;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const hw="Block collections are not allowed within flow collections",pw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Fle({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",u=o?"flow map":"flow sequence",d=a?.nodeClass??(o?ji:Ll),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:O,key:_,sep:C,value:T}=k,E=zu(O,{flow:u,indicator:"explicit-key-ind",next:_??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!T){j===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),E.comment&&(f.comment?f.comment+=`
181
+ `+E.comment:f.comment=E.comment),m=E.end;continue}!o&&n.options.strict&&Jf(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${u} items`),E.comment){let A="";e:for(const P of O)switch(P.type){case"comma":case"space":break;case"comment":A=P.source.substring(1);break e;default:break e}if(A){let P=f.items[f.items.length-1];Cn(P)&&(P=P.value??P.key),P.comment?P.comment+=`
182
+ `+A:P.comment=A,E.comment=E.comment.substring(A.length+1)}}if(!o&&!C&&!E.found){const A=T?e(n,T,E,i):t(n,E.end,C,null,E,i);f.items.push(A),m=A.range[2],pw(T)&&i(A.range,"BLOCK_IN_FLOW",hw)}else{n.atKey=!0;const A=E.end,P=_?e(n,_,E,i):t(n,A,O,null,E,i);pw(_)&&i(P.range,"BLOCK_IN_FLOW",hw),n.atKey=!1;const $=zu(C??[],{flow:u,indicator:"map-value-ind",next:T,offset:P.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!o&&!E.found&&n.options.strict){if(C)for(const B of C){if(B===$.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<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${u}`):i($.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=T?e(n,T,$,i):$.found?t(n,$.end,C,null,$,i):null;F?pw(T)&&i(F.range,"BLOCK_IN_FLOW",hw):$.comment&&(P.comment?P.comment+=`
183
+ `+$.comment:P.comment=$.comment);const U=new Sr(P,F);if(n.options.keepSourceTokens&&(U.srcToken=k),o){const B=f;P$(n,B.items,P)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new ji(n.schema);B.flow=!0,B.items.push(U);const V=(F??P).range;B.range=[P.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const y=o?"}":"]",[v,...w]=r.end;let S=m;if(v?.source===y)S=v.offset+v.source.length;else{const j=u[0].toUpperCase()+u.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=Ah(w,S,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
184
+ `+j.comment:f.comment=j.comment),f.range=[r.offset,S,j.offset]}else f.range=[r.offset,S,S];return f}function mw(e,t,n,r,i,a){const o=n.type==="block-map"?Ule(e,t,n,r,a):n.type==="block-seq"?qle(e,t,n,r,a):Fle(e,t,n,r,a),u=o.constructor;return i==="!"||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}function Kle(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&a?y.offset>a.offset?y:a:y??a;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===ji.tagName&&u==="map"||o===Ll.tagName&&u==="seq")return mw(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===u);if(!d){const y=t.schema.knownTags[o];if(y?.collection===u)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${u} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),mw(e,t,n,i,o)}const f=mw(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=kn(p)?p:new nt(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function Hle(e,t,n){const r=t.offset,i=Gle(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?nt.BLOCK_FOLDED:nt.BLOCK_LITERAL,o=t.source?Vle(t.source):[];let u=o.length;for(let S=o.length-1;S>=0;--S){const j=o[S][1];if(j===""||j==="\r")u=S;else break}if(u===0){const S=i.chomp==="+"&&o.length>0?`
185
+ `.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:S,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let S=0;S<u;++S){const[j,k]=o[S];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=S,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let S=o.length-1;S>=u;--S)o[S][0].length>d&&(u=S+1);let m="",y="",v=!1;for(let S=0;S<p;++S)m+=o[S][0].slice(d)+`
186
+ `;for(let S=p;S<u;++S){let[j,k]=o[S];f+=j.length+k.length+1;const O=k[k.length-1]==="\r";if(O&&(k=k.slice(0,-1)),k&&j.length<d){const C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(O?2:1),"BAD_INDENT",C),j=""}a===nt.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
187
+ `):j.length>d||k[0]===" "?(y===" "?y=`
188
+ `:!v&&y===`
189
+ `&&(y=`
190
+
191
+ `),m+=y+j.slice(d)+k,y=`
192
+ `,v=!0):k===""?y===`
193
+ `?m+=`
194
+ `:y=`
195
+ `:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let S=u;S<o.length;++S)m+=`
196
+ `+o[S][0].slice(d);m[m.length-1]!==`
197
+ `&&(m+=`
198
+ `);break;default:m+=`
199
+ `}const w=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,w,w]}}function Gle({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,u="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!u&&(v==="-"||v==="+"))u=v;else{const w=Number(v);!o&&w?o=w:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const S=v.source;S&&typeof S=="string"&&(m+=S.length)}}}return{mode:a,indent:o,chomp:u,comment:p,length:m}}function Vle(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 Zle(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let u,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":u=nt.PLAIN,d=Yle(a,f);break;case"single-quoted-scalar":u=nt.QUOTE_SINGLE,d=Wle(a,f);break;case"double-quoted-scalar":u=nt.QUOTE_DOUBLE,d=Qle(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=Ah(o,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function Yle(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}`),R$(e)}function Wle(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),R$(e.slice(1,-1)).replace(/''/g,"'")}function R$(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
200
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
201
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
202
+ `?i+=a:a=`
203
+ `:(i+=a+r[1],a=" "),o=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=o,r=u.exec(e),i+a+(r?.[1]??"")}function Qle(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}=Xle(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=Jle[a];if(o)n+=o;else if(a===`
206
+ `)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
207
+ `)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=ece(e,r+1,u,t),r+=u}else{const u=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(i===" "||i===" "){const a=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
208
+ `&&!(o==="\r"&&e[r+2]===`
209
+ `)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Xle(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 Jle={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
214
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ece(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(o)}function D$(e,t,n,r){const{value:i,type:a,comment:o,range:u}=t.type==="block-scalar"?Hle(e,t,r):Zle(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[_a]:d?f=tce(e.schema,i,d,n,r):t.type==="scalar"?f=nce(e,i,t,r):f=e.schema[_a];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Zt(m)?m:new nt(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new nt(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function tce(e,t,n,r,i){if(n==="!")return e[_a];const a=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)a.push(u);else return u;for(const u of a)if(u.test?.test(t))return u;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[_a])}function nce({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[_a];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[_a];if(o.tag!==u.tag){const d=t.tagString(o.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function rce(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 ice={composeNode:M$,composeEmptyNode:sk};function M$(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=ace(e,t,r),(u||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=D$(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Kle(ice,e,t,n,r),u&&(f.anchor=u.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=sk(e,t.offset,void 0,null,n,r),p=!1}}return u&&f.anchor===""&&r(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Zt(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 sk(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:u,end:d},f){const p={type:"scalar",offset:rce(t,n,r),indent:-1,source:""},m=D$(e,p,u,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function ace({options:e},{offset:t,source:n,end:r},i){const a=new ZN(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,u=Ah(r,o,e.strict,i);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function sce(e,t,{offset:n,start:r,value:i,end:a},o){const u=Object.assign({_directives:t},e),d=new jv(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=zu(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?M$(f,i,p,o):sk(f,p.end,r,null,p,o);const m=d.contents.range[2],y=Ah(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function pf(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 _T(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 oce{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=pf(n);a?this.warnings.push(new Ble(o,r,i)):this.errors.push(new Tm(o,r,i))},this.directives=new xr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=_T(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(Nn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Cn(o)&&(o=o.key);const u=o.commentBefore;o.commentBefore=u?`${r}
219
+ ${u}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
220
+ ${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_T(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=pf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=sce(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 Tm(pf(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 Tm(pf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Ah(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 Tm(pf(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 jv(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 I$="\uFEFF",L$="",$$="",$1="";function lce(e){switch(e){case I$:return"byte-order-mark";case L$:return"doc-mode";case $$:return"flow-error-end";case $1: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 Ki(e){switch(e){case void 0:case" ":case`
224
+ `:case"\r":case" ":return!0;default:return!1}}const AT=new Set("0123456789ABCDEFabcdef"),cce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Pm=new Set(",[]{}"),uce=new Set(` ,[]{}
225
+ \r `),gw=e=>!e||uce.has(e);class dce{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==="...")&&Ki(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]===I$&&(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 L$,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==="...")&&Ki(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&&!Ki(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===":")&&Ki(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(gw),"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("..."))&&Ki(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield $$,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(gw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Ki(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=>Ki(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
233
+ `:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
234
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
235
+ `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
236
+ `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const u=a;for(;o===" ";)o=this.buffer[--a];if(o===`
237
+ `&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield $1,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(Ki(a)||t&&Pm.has(a))break;n=r}else if(Ki(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&&Pm.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&&Pm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield $1,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(gw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Ki(n)||t&&Pm.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ki(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(cce.has(n))n=this.buffer[++t];else if(n==="%"&&AT.has(this.buffer[t+1])&&AT.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 fce{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 ro(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function OT(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 B$(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 Rm(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 Gc(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 ET(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ro(t.start,"explicit-key-ind")&&!ro(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,B$(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 hce{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 dce,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=lce(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"&&ET(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&&OT(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":{OT(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=Rm(this.peek(2)),r=Gc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
243
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
244
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":o.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ro(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(B$(n.key)&&!ro(n.sep,"newline")){const o=Gc(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(ro(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Gc(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]}):ro(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&&!ro(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||ro(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=Rm(r),a=Gc(i);ET(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
245
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
246
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Rm(t),r=Gc(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=Rm(t),r=Gc(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 pce(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new fce||null,prettyErrors:t}}function mce(e,t={}){const{lineCounter:n,prettyErrors:r}=pce(t),i=new hce(n?.addNewLine),a=new oce(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of o)u.errors.forEach(kT(e,n)),u.warnings.forEach(kT(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function gce({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,o]=x.useState([]),[u,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=mce(t),m=[],y=[];for(let v=0;v<p.length;v++){const w=p[v];if(w.errors.length>0){m.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const j=await C7(S);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(gt({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return 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
+ keywords: []`,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))}),u.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>l.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),l.jsx("div",{className:"mt-3",children:l.jsx(xe,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function yce(){const{dashboard:e,isLoading:t,refetch:n}=Jl();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(A=>l.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>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"})]},A))]})]});const r=e.projects,i=Oo(),[a,o]=x.useState(!1),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState("US"),[S,j]=x.useState("en"),[k,O]=x.useState(!1),[_,C]=x.useState(null),T=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),E=async()=>{if(!(!T||!m)){O(!0),C(null);try{const A=await Wy(T,{displayName:f||u,canonicalDomain:m,country:v,language:S});gt({title:"Project created",detail:`${A.displayName||A.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${A.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){C(A instanceof Error?A.message:"Failed to create project")}finally{O(!1)}}};return 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(xe,{type:"button",onClick:()=>o(A=>!A),children:[l.jsx(A2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?l.jsxs($e,{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:u,onChange:A=>d(A.target.value)}),T&&T!==u?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):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:A=>p(A.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:A=>y(A.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:A=>w(A.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:S,onChange:A=>j(A.target.value.toLowerCase())})]})]})]}),_?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:_}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(xe,{type:"button",disabled:!T||!m||k,onClick:E,children:k?"Creating...":"Create project"}),l.jsx(xe,{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(A=>{const P=A.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[l.jsxs("td",{children:[l.jsx(Kt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:A.project.displayName||A.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),l.jsx("td",{children:l.jsx(wt,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:P?l.jsx(iv,{status:P.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):a?null:l.jsxs($e,{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(xe,{type:"button",onClick:()=>o(!0),children:[l.jsx(A2,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(gce,{onApplied:()=>{n()}})]})}function B1({state:e}){return l.jsx(wt,{tone:bJ(e),children:tv(e)})}function U$({run:e}){const{openRun:t}=Hu();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(iv,{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(xe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function q$({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),1):o&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=m*(1-v);return 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(Tn,{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 zT({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,u)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},u))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function vce(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 xce({evidence:e}){const{openEvidence:t}=Hu(),[n,r]=x.useState(new Set),i=x.useMemo(()=>{const o=new Map;for(const u of e){const d=o.get(u.keyword)??[];o.set(u.keyword,[...d,u])}return[...o.entries()].map(([u,d])=>({phrase:u,items:d}))},[e]),a=o=>{r(u=>{const d=new Set(u);return d.has(o)?d.delete(o):d.add(o),d})};return 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:"Key Phrase"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:"Citation History"}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:i.map(({phrase:o,items:u})=>{const d=n.has(o),f=u.map(w=>w.citationState),p=f.includes("cited")?"cited":f.includes("emerging")?"emerging":f.includes("lost")?"lost":f.every(w=>w==="pending")?"pending":"not-cited",m=vce(u),y=u.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,v=(()=>{if(m.length===0)return"Awaiting first run";if(m.length===1)return"First observation";const w=m[m.length-1].citationState,S=m[m.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let j=0;for(let k=m.length-1;k>=0&&m[k].citationState===w;k--)j++;return w==="cited"?j<=1?"Cited in latest run":`Cited for ${j} runs`:j<=1?"Not cited in latest run":`Not cited across ${j} runs`})();return l.jsxs(x.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>a(o),"aria-expanded":d,children:[l.jsx("td",{children:l.jsx(bh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${d?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:o}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:u.map(w=>l.jsx(Ml,{provider:w.provider},w.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(B1,{state:p}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",u.length]})]})}),l.jsx("td",{children:l.jsx(zT,{history:m})}),l.jsx("td",{className:"evidence-change-cell",children:v}),l.jsx("td",{})]}),d&&u.map(w=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(Ml,{provider:w.provider})}),l.jsx("td",{children:l.jsx(B1,{state:w.citationState})}),l.jsx("td",{children:l.jsx(zT,{history:w.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),l.jsx("td",{children:l.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},o)})})]})})}function bce({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:"Key Phrases"})]})}),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(wt,{tone:wJ(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}function TT({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:u,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(wt,{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:u}),l.jsx("span",{children:d?`Updated ${Gi(d)}`:"No recent sync yet"})]})]})}function Dm({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 wce=["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 ok(e){if(typeof e!="string")return!1;var t=wce;return t.includes(e)}var Sce=["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"],jce=new Set(Sce);function F$(e){return typeof e!="string"?!1:jce.has(e)}function K$(e){return typeof e=="string"&&e.startsWith("data-")}function Qi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(F$(n)||K$(n))&&(t[n]=e[n]);return t}function Nv(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Qi(t)}return typeof e=="object"&&!Array.isArray(e)?Qi(e):null}function Ur(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(F$(n)||K$(n)||ok(n))&&(t[n]=e[n]);return t}function Nce(e){return e==null?null:x.isValidElement(e)?Ur(e.props):typeof e=="object"&&!Array.isArray(e)?Ur(e):null}var kce=["children","width","height","viewBox","className","style","title","desc"];function U1(){return U1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U1.apply(null,arguments)}function Cce(e,t){if(e==null)return{};var n,r,i=_ce(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 _ce(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 lk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:u,title:d,desc:f}=e,p=Cce(e,kce),m=a||{width:r,height:i,x:0,y:0},y=zt("recharts-surface",o);return x.createElement("svg",U1({},Ur(p),{className:y,width:r,height:i,style:u,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)}),Ace=["children","className"];function q1(){return q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q1.apply(null,arguments)}function Oce(e,t){if(e==null)return{};var n,r,i=Ece(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 Ece(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 Xi=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Oce(e,Ace),a=zt("recharts-layer",r);return x.createElement("g",q1({className:a},Ur(i),{ref:t}),n)}),H$=x.createContext(null),zce=()=>x.useContext(H$);function Ht(e){return function(){return e}}const G$=Math.cos,Fg=Math.sin,na=Math.sqrt,Kg=Math.PI,kv=2*Kg,F1=Math.PI,K1=2*F1,ul=1e-6,Tce=K1-ul;function V$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Pce(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return V$;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 Rce{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?V$:Pce(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,u=this._y1,d=r-t,f=i-n,p=o-t,m=u-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>ul)if(!(Math.abs(m*d-f*p)>ul)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,w=i-u,S=d*d+f*f,j=v*v+w*w,k=Math.sqrt(S),O=Math.sqrt(y),_=a*Math.tan((F1-Math.acos((S+y-j)/(2*k*O)))/2),C=_/O,T=_/k;Math.abs(C-1)>ul&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+T*d},${this._y1=n+T*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>ul||Math.abs(this._y1-p)>ul)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%K1+K1),y>Tce?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>ul&&this._append`A${r},${r},0,${+(y>=F1)},${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 ck(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 Rce(t)}function uk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Z$(e){this._context=e}Z$.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 Cv(e){return new Z$(e)}function Y$(e){return e[0]}function W$(e){return e[1]}function Q$(e,t){var n=Ht(!0),r=null,i=Cv,a=null,o=ck(u);e=typeof e=="function"?e:e===void 0?Y$:Ht(e),t=typeof t=="function"?t:t===void 0?W$:Ht(t);function u(d){var f,p=(d=uk(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Ht(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Ht(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Ht(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function Mm(e,t,n){var r=null,i=Ht(!0),a=null,o=Cv,u=null,d=ck(f);e=typeof e=="function"?e:e===void 0?Y$:Ht(+e),t=typeof t=="function"?t:Ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?W$:Ht(+n);function f(m){var y,v,w,S=(m=uk(m)).length,j,k=!1,O,_=new Array(S),C=new Array(S);for(a==null&&(u=o(O=d())),y=0;y<=S;++y){if(!(y<S&&i(j=m[y],y,m))===k)if(k=!k)v=y,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=y-1;w>=v;--w)u.point(_[w],C[w]);u.lineEnd(),u.areaEnd()}k&&(_[y]=+e(j,y,m),C[y]=+t(j,y,m),u.point(r?+r(j,y,m):_[y],n?+n(j,y,m):C[y]))}if(O)return u=null,O+""||null}function p(){return Q$().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Ht(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Ht(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Ht(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(u=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=u=null:u=o(a=m),f):a},f}class X${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 Dce(e){return new X$(e,!0)}function Mce(e){return new X$(e,!1)}const dk={draw(e,t){const n=na(t/Kg);e.moveTo(n,0),e.arc(0,0,n,0,kv)}},Ice={draw(e,t){const n=na(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()}},J$=na(1/3),Lce=J$*2,$ce={draw(e,t){const n=na(t/Lce),r=n*J$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Bce={draw(e,t){const n=na(t),r=-n/2;e.rect(r,r,n,n)}},Uce=.8908130915292852,e3=Fg(Kg/10)/Fg(7*Kg/10),qce=Fg(kv/10)*e3,Fce=-G$(kv/10)*e3,Kce={draw(e,t){const n=na(t*Uce),r=qce*n,i=Fce*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=kv*a/5,u=G$(o),d=Fg(o);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},yw=na(3),Hce={draw(e,t){const n=-na(t/(yw*3));e.moveTo(0,n*2),e.lineTo(-yw*n,-n),e.lineTo(yw*n,-n),e.closePath()}},yi=-.5,vi=na(3)/2,H1=1/na(12),Gce=(H1/2+1)*3,Vce={draw(e,t){const n=na(t/Gce),r=n/2,i=n*H1,a=r,o=n*H1+n,u=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(u,d),e.lineTo(yi*r-vi*i,vi*r+yi*i),e.lineTo(yi*a-vi*o,vi*a+yi*o),e.lineTo(yi*u-vi*d,vi*u+yi*d),e.lineTo(yi*r+vi*i,yi*i-vi*r),e.lineTo(yi*a+vi*o,yi*o-vi*a),e.lineTo(yi*u+vi*d,yi*d-vi*u),e.closePath()}};function Zce(e,t){let n=null,r=ck(i);e=typeof e=="function"?e:Ht(e||dk),t=typeof t=="function"?t:Ht(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Ht(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ht(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Hg(){}function Gg(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 t3(e){this._context=e}t3.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:Gg(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:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Yce(e){return new t3(e)}function n3(e){this._context=e}n3.prototype={areaStart:Hg,areaEnd:Hg,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:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wce(e){return new n3(e)}function r3(e){this._context=e}r3.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:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qce(e){return new r3(e)}function i3(e){this._context=e}i3.prototype={areaStart:Hg,areaEnd:Hg,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 Xce(e){return new i3(e)}function PT(e){return e<0?-1:1}function RT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(PT(a)+PT(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function DT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function vw(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,o-u*n,a,o)}function Vg(e){this._context=e}Vg.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:vw(this,this._t0,DT(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,vw(this,DT(this,n=RT(this,e,t)),n);break;default:vw(this,this._t0,n=RT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function a3(e){this._context=new s3(e)}(a3.prototype=Object.create(Vg.prototype)).point=function(e,t){Vg.prototype.point.call(this,t,e)};function s3(e){this._context=e}s3.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 Jce(e){return new Vg(e)}function eue(e){return new a3(e)}function o3(e){this._context=e}o3.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=MT(e),i=MT(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 MT(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 tue(e){return new o3(e)}function _v(e,t){this._context=e,this._t=t}_v.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 nue(e){return new _v(e,.5)}function rue(e){return new _v(e,0)}function iue(e){return new _v(e,1)}function $l(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,u=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function G1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function aue(e,t){return e[t]}function sue(e){const t=[];return t.key=e,t}function oue(){var e=Ht([]),t=G1,n=$l,r=aue;function i(a){var o=Array.from(e.apply(this,arguments),sue),u,d=o.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(o[u][f]=[0,+r(m,o[u].key,f,a)]).data=m;for(u=0,p=uk(t(o));u<d;++u)o[p[u]].index=u;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Ht(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Ht(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?G1:typeof a=="function"?a:Ht(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??$l,i):n},i}function lue(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}$l(e,t)}}function cue(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,u=0;o<i;++o)u+=e[o][n][1]||0;r[n][1]+=r[n][0]=-u/2}$l(e,t)}}function uue(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var u=0,d=0,f=0;u<o;++u){for(var p=e[t[u]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,k=S[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,$l(e,t)}}var xw={},bw={},IT;function due(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(bw)),bw}var ww={},LT;function l3(){return LT||(LT=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})(ww)),ww}var Sw={},$T;function fk(){return $T||($T=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})(Sw)),Sw}var jw={},Nw={},BT;function fue(){return BT||(BT=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})(Nw)),Nw}var UT;function hk(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fue(),n=fk();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<o;){const m=i[u];f?m==="\\"&&u+1<o?(u++,d+=i[u]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(jw)),jw}var qT;function pk(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=due(),n=l3(),r=fk(),i=hk();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?n.isDeepKey(d)?a(u,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=u[d];return p===void 0?f:p}default:{if(Array.isArray(d))return o(u,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?f:p}}}function o(u,d,f){if(d.length===0)return f;let p=u;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(xw)),xw}var kw,FT;function hue(){return FT||(FT=1,kw=pk().get),kw}var pue=hue();const Av=Ta(pue);var mue=4;function ho(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mue,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function tr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var u=n[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+ho(u)+a:i+a},"")}var Ni=e=>e===0?0:e>0?1:-1,Aa=e=>typeof e=="number"&&e!=+e,Bl=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Le=e=>(typeof e=="number"||e instanceof Number)&&!Aa(e),zi=e=>Le(e)||typeof e=="string",gue=0,eh=e=>{var t=++gue;return"".concat(e||"").concat(t)},_o=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Le(t)&&typeof t!="string")return r;var a;if(Bl(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Aa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},c3=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 ya(e,t,n){return Le(e)&&Le(t)?ho(e+n*(t-e)):t}function u3(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Av(r,t))===n)}var ir=e=>e===null||typeof e>"u",Oh=e=>ir(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ir(e){return e!=null}function Xu(){}var yue=["type","size","sizeType"];function V1(){return V1=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},V1.apply(null,arguments)}function KT(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 HT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KT(Object(n),!0).forEach(function(r){vue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vue(e,t,n){return(t=xue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xue(e){var t=bue(e,"string");return typeof t=="symbol"?t:t+""}function bue(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 wue(e,t){if(e==null)return{};var n,r,i=Sue(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 Sue(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 d3={symbolCircle:dk,symbolCross:Ice,symbolDiamond:$ce,symbolSquare:Bce,symbolStar:Kce,symbolTriangle:Hce,symbolWye:Vce},jue=Math.PI/180,Nue=e=>{var t="symbol".concat(Oh(e));return d3[t]||dk},kue=(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*jue;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}},Cue=(e,t)=>{d3["symbol".concat(Oh(e))]=t},f3=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=wue(e,yue),a=HT(HT({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var u=()=>{var y=Nue(o),v=Zce().type(y).size(kue(n,r,o)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Ur(a);return Le(f)&&Le(p)&&Le(n)?x.createElement("path",V1({},m,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};f3.registerSymbol=Cue;var h3=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,mk=(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=>{ok(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},_ue=(e,t,n)=>r=>(e(t,n,r),null),p3=(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];ok(i)&&typeof a=="function"&&(r||(r={}),r[i]=_ue(a,t,n))}),r};function GT(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 Aue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GT(Object(n),!0).forEach(function(r){Oue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oue(e,t,n){return(t=Eue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eue(e){var t=zue(e,"string");return typeof t=="symbol"?t:t+""}function zue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nr(e,t){var n=Aue({},e),r=t,i=Object.keys(t),a=i.reduce((o,u)=>(o[u]===void 0&&r[u]!==void 0&&(o[u]=r[u]),o),n);return a}function Zg(){return Zg=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},Zg.apply(null,arguments)}function VT(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 m3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VT(Object(n),!0).forEach(function(r){Tue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tue(e,t,n){return(t=Pue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pue(e){var t=Rue(e,"string");return typeof t=="symbol"?t:t+""}function Rue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bi=32,Due={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Mue(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Iue(e){var{data:t,iconType:n,inactiveColor:r}=e,i=bi/2,a=bi/6,o=bi/3,u=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:u,strokeDasharray:Mue(t.payload),x1:0,y1:i,x2:bi,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(o,`
255
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
256
+ H`).concat(bi,"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:u,d:"M0,".concat(bi/8,"h").concat(bi,"v").concat(bi*3/4,"h").concat(-bi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=m3({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(f3,{fill:u,cx:i,cy:i,size:bi,sizeType:"diameter",type:d})}function Lue(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:u}=e,d={x:0,y:0,width:bi,height:bi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,w=zt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var S=typeof u=="object"?m3({},u):{};S.color=m.inactive?a:S.color||m.color;var j=v?v(m.value,m,y):m.value;return x.createElement("li",Zg({className:w,style:f,key:"legend-item-".concat(y)},p3(e,m,y)),x.createElement(lk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(Iue,{data:m,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:S},j))})}var $ue=e=>{var t=Nr(e,Due),{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(Lue,Zg({},t,{payload:n})))},Cw={},_w={},ZT;function Bue(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],u=r(o,a,n);i.has(u)||i.set(u,o)}return Array.from(i.values())}e.uniqBy=t})(_w)),_w}var Aw={},YT;function Uue(){return YT||(YT=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})(Aw)),Aw}var Ow={},WT;function g3(){return WT||(WT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Ow)),Ow}var Ew={},zw={},Tw={},QT;function que(){return QT||(QT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Tw)),Tw}var XT;function y3(){return XT||(XT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=que();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(zw)),zw}var Pw={},JT;function Fue(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Pw)),Pw}var eP;function Kue(){return eP||(eP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=y3(),n=Fue();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Ew)),Ew}var Rw={},Dw={},tP;function Hue(){return tP||(tP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pk();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Dw)),Dw}var Mw={},Iw={},Lw={},$w={},nP;function v3(){return nP||(nP=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})($w)),$w}var Bw={},rP;function x3(){return rP||(rP=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})(Bw)),Bw}var Uw={},iP;function b3(){return iP||(iP=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})(Uw)),Uw}var aP;function Gue(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=v3(),n=x3(),r=b3();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,S,j,k,O,_){const C=y(w,S,j,k,O,_);return C!==void 0?!!C:a(w,S,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return u(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const w=Object.keys(m);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let S=0;S<w.length;S++){const j=w[S];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,S]of m.entries()){const j=p.get(w);if(y(j,S,w,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let S=0;S<m.length;S++){const j=m[S];let k=!1;for(let O=0;O<p.length;O++){if(w.has(O))continue;const _=p[O];let C=!1;if(y(_,j,S,p,m,v)&&(C=!0),C){w.add(O),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Lw)),Lw}var sP;function w3(){return sP||(sP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gue();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Iw)),Iw}var qw={},Fw={},Kw={},oP;function Vue(){return oP||(oP=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})(Kw)),Kw}var Hw={},lP;function gk(){return lP||(lP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Hw)),Hw}var Gw={},cP;function S3(){return cP||(cP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",O="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",T="[object Int8Array]",E="[object Int16Array]",A="[object Int32Array]",P="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=E,e.int32ArrayTag=A,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=O,e.uint32ArrayTag=_,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(Gw)),Gw}var Vw={},uP;function Zue(){return uP||(uP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Vw)),Vw}var dP;function j3(){return dP||(dP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vue(),n=gk(),r=S3(),i=x3(),a=Zue();function o(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,y,v=new Map,w=void 0){const S=w?.(p,m,y,v);if(S!==void 0)return S;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,y,v,w);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,O]of p)j.set(k,u(O,k,y,v,w));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(u(k,void 0,y,v,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,y,v,w);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,w),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,w),j}return p}function d(p,m,y=p,v,w){const S=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<S.length;j++){const k=S[j],O=Object.getOwnPropertyDescriptor(p,k);(O==null||O.writable)&&(p[k]=u(m[k],k,y,v,w))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=u,e.copyProperties=d})(Fw)),Fw}var fP;function Yue(){return fP||(fP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j3();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(qw)),qw}var hP;function Wue(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w3(),n=Yue();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Mw)),Mw}var Zw={},Yw={},Ww={},pP;function Que(){return pP||(pP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j3(),n=gk(),r=S3();function i(a,o){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=o?.(u,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Ww)),Ww}var mP;function Xue(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Que();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Yw)),Yw}var Qw={},Xw={},gP;function N3(){return gP||(gP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(Xw)),Xw}var Jw={},yP;function Jue(){return yP||(yP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gk();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Jw)),Jw}var vP;function ede(){return vP||(vP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l3(),n=N3(),r=Jue(),i=hk();function a(o,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&o?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(Qw)),Qw}var xP;function tde(){return xP||(xP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w3(),n=fk(),r=Xue(),i=pk(),a=ede();function o(u,d){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,u);return p===void 0?a.has(f,u):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=o})(Zw)),Zw}var bP;function nde(){return bP||(bP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g3(),n=Hue(),r=Wue(),i=tde();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})(Rw)),Rw}var wP;function rde(){return wP||(wP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bue(),n=Uue(),r=g3(),i=Kue(),a=nde();function o(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(Cw)),Cw}var eS,SP;function ide(){return SP||(SP=1,eS=rde().uniqBy),eS}var ade=ide();const jP=Ta(ade);function k3(e,t,n){return t===!0?jP(e,n):typeof t=="function"?jP(e,t):e}var yk=x.createContext(null),sde=e=>e,hn=()=>{var e=x.useContext(yk);return e?e.store.dispatch:sde},hg=()=>{},ode=()=>hg,lde=(e,t)=>e===t;function Ue(e){var t=x.useContext(yk),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:hg,[t,e]);return FI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ode,t?t.store.getState:hg,t?t.store.getState:hg,n,lde)}function cde(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ude(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function dde(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 NP=e=>Array.isArray(e)?e:[e];function fde(e){const t=Array.isArray(e[0])?e[0]:e;return dde(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function hde(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var pde=class{constructor(e){this.value=e}deref(){return this.value}},mde=typeof WeakRef<"u"?WeakRef:pde,gde=0,kP=1;function Im(){return{s:gde,v:void 0,o:null,p:null}}function C3(e,t={}){let n=Im();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let u=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=u.o;w===null&&(u.o=w=new WeakMap);const S=w.get(v);S===void 0?(u=Im(),w.set(v,u)):u=S}else{let w=u.p;w===null&&(u.p=w=new Map);const S=w.get(v);S===void 0?(u=Im(),w.set(v,u)):u=S}}const f=u;let p;if(u.s===kP)p=u.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new mde(p):p}return f.s=kP,f.v=p,p}return o.clearCache=()=>{n=Im(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function yde(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),cde(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=C3,argsMemoizeOptions:w=[]}=p,S=NP(y),j=NP(w),k=fde(i),O=m(function(){return a++,f.apply(null,arguments)},...S),_=v(function(){o++;const T=hde(k,arguments);return u=O.apply(null,T),u},...j);return Object.assign(_,{resultFunc:f,memoizedResultFunc:O,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var oe=yde(C3),vde=Object.assign((e,t=oe)=>{ude(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,u,d)=>(o[n[d]]=u,o),{}))},{withTypes:()=>vde}),tS={},nS={},rS={},CP;function xde(){return CP||(CP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),u=t(i);if(o===u&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-o:o-u}return 0};e.compareValues=n})(rS)),rS}var iS={},aS={},_P;function _3(){return _P||(_P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(aS)),aS}var AP;function bde(){return AP||(AP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_3(),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})(iS)),iS}var OP;function wde(){return OP||(OP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xde(),n=bde(),r=hk();function i(a,o,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,w)=>{let S=v;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},p=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:f(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?f(w,v):typeof w=="object"?w[v]:w,m=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(w=>p(w,v))})).slice().sort((v,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(v.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(nS)),nS}var sS={},EP;function Sde(){return EP||(EP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(sS)),sS}var oS={},zP;function A3(){return zP||(zP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N3(),n=y3(),r=v3(),i=b3();function a(o,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],o):!1}e.isIterateeCall=a})(oS)),oS}var TP;function jde(){return TP||(TP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wde(),n=Sde(),r=A3();function i(a,...o){const u=o.length;return u>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:u>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(tS)),tS}var lS,PP;function Nde(){return PP||(PP=1,lS=jde().sortBy),lS}var kde=Nde();const Ov=Ta(kde);var O3=e=>e.legend.settings,Cde=e=>e.legend.size,_de=e=>e.legend.payload,Ade=oe([_de,O3],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Ov(r,n):r});function Ode(){return Ue(Ade)}var Lm=1;function E3(){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)>Lm||Math.abs(o.left-t.left)>Lm||Math.abs(o.top-t.top)>Lm||Math.abs(o.width-t.width)>Lm)&&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 er(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 Ede=typeof Symbol=="function"&&Symbol.observable||"@@observable",RP=Ede,cS=()=>Math.random().toString(36).substring(7).split("").join("."),zde={INIT:`@@redux/INIT${cS()}`,REPLACE:`@@redux/REPLACE${cS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${cS()}`},Yg=zde;function vk(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 z3(e,t,n){if(typeof e!="function")throw new Error(er(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(er(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(er(1));return n(z3)(e,t)}let r=e,i=t,a=new Map,o=a,u=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(er(3));return i}function m(j){if(typeof j!="function")throw new Error(er(4));if(d)throw new Error(er(5));let k=!0;f();const O=u++;return o.set(O,j),function(){if(k){if(d)throw new Error(er(6));k=!1,f(),o.delete(O),a=null}}}function y(j){if(!vk(j))throw new Error(er(7));if(typeof j.type>"u")throw new Error(er(8));if(typeof j.type!="string")throw new Error(er(17));if(d)throw new Error(er(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(er(10));r=j,y({type:Yg.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(er(11));function O(){const C=k;C.next&&C.next(p())}return O(),{unsubscribe:j(O)}},[RP](){return this}}}return y({type:Yg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[RP]:w}}function Tde(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Yg.INIT})>"u")throw new Error(er(12));if(typeof n(void 0,{type:Yg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(er(13))})}function T3(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{Tde(n)}catch(a){i=a}return function(o={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],w=y(v,u);if(typeof w>"u")throw u&&u.type,new Error(er(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function Wg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Pde(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(er(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(o));return a=Wg(...u)(i.dispatch),{...i,dispatch:a}}}function P3(e){return vk(e)&&"type"in e&&typeof e.type=="string"}var R3=Symbol.for("immer-nothing"),DP=Symbol.for("immer-draftable"),jr=Symbol.for("immer-state");function Zi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ti=Object,Tu=ti.getPrototypeOf,Qg="constructor",Ev="prototype",Z1="configurable",Xg="enumerable",pg="writable",th="value",hs=e=>!!e&&!!e[jr];function Ji(e){return e?D3(e)||Tv(e)||!!e[DP]||!!e[Qg]?.[DP]||Pv(e)||Rv(e):!1}var Rde=ti[Ev][Qg].toString(),MP=new WeakMap;function D3(e){if(!e||!xk(e))return!1;const t=Tu(e);if(t===null||t===ti[Ev])return!0;const n=ti.hasOwnProperty.call(t,Qg)&&t[Qg];if(n===Object)return!0;if(!ru(n))return!1;let r=MP.get(n);return r===void 0&&(r=Function.toString.call(n),MP.set(n,r)),r===Rde}function zv(e,t,n=!0){Eh(e)===0?(n?Reflect.ownKeys(e):ti.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Eh(e){const t=e[jr];return t?t.type_:Tv(e)?1:Pv(e)?2:Rv(e)?3:0}var IP=(e,t,n=Eh(e))=>n===2?e.has(t):ti[Ev].hasOwnProperty.call(e,t),Y1=(e,t,n=Eh(e))=>n===2?e.get(t):e[t],Jg=(e,t,n,r=Eh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Dde(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Tv=Array.isArray,Pv=e=>e instanceof Map,Rv=e=>e instanceof Set,xk=e=>typeof e=="object",ru=e=>typeof e=="function",uS=e=>typeof e=="boolean";function Mde(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var is=e=>e.copy_||e.base_,bk=e=>e.modified_?e.copy_:e.base_;function W1(e,t){if(Pv(e))return new Map(e);if(Rv(e))return new Set(e);if(Tv(e))return Array[Ev].slice.call(e);const n=D3(e);if(t===!0||t==="class_only"&&!n){const r=ti.getOwnPropertyDescriptors(e);delete r[jr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u[pg]===!1&&(u[pg]=!0,u[Z1]=!0),(u.get||u.set)&&(r[o]={[Z1]:!0,[pg]:!0,[Xg]:u[Xg],[th]:e[o]})}return ti.create(Tu(e),r)}else{const r=Tu(e);if(r!==null&&n)return{...e};const i=ti.create(r);return ti.assign(i,e)}}function wk(e,t=!1){return Dv(e)||hs(e)||!Ji(e)||(Eh(e)>1&&ti.defineProperties(e,{set:$m,add:$m,clear:$m,delete:$m}),ti.freeze(e),t&&zv(e,(n,r)=>{wk(r,!0)},!1)),e}function Ide(){Zi(2)}var $m={[th]:Ide};function Dv(e){return e===null||!xk(e)?!0:ti.isFrozen(e)}var ey="MapSet",Q1="Patches",LP="ArrayMethods",M3={};function Ul(e){const t=M3[e];return t||Zi(0,e),t}var $P=e=>!!M3[e],nh,I3=()=>nh,Lde=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:$P(ey)?Ul(ey):void 0,arrayMethodsPlugin_:$P(LP)?Ul(LP):void 0});function BP(e,t){t&&(e.patchPlugin_=Ul(Q1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function X1(e){J1(e),e.drafts_.forEach($de),e.drafts_=null}function J1(e){e===nh&&(nh=e.parent_)}var UP=e=>nh=Lde(nh,e);function $de(e){const t=e[jr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[jr].modified_&&(X1(t),Zi(4)),Ji(e)&&(e=FP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[jr].base_,e,t)}else e=FP(t,n);return Bde(t,e,!0),X1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==R3?e:void 0}function FP(e,t){if(Dv(t))return t;const n=t[jr];if(!n)return ty(t,e.handledSet_,e);if(!Mv(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);B3(n,e)}return n.copy_}function Bde(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&wk(t,n)}function L3(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Mv=(e,t)=>e.scope_===t,Ude=[];function $3(e,t,n,r){const i=is(e),a=e.type_;if(r!==void 0&&Y1(i,r,a)===t){Jg(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;zv(i,(d,f)=>{if(hs(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const o=e.draftLocations_.get(t)??Ude;for(const u of o)Jg(i,u,n,a)}function qde(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!Mv(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=bk(a);$3(e,a.draft_??a,o,n),B3(a,i)})}function B3(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)}L3(e)}}function Fde(e,t,n){const{scope_:r}=e;if(hs(n)){const i=n[jr];Mv(i,r)&&i.callbacks_.push(function(){mg(e);const o=bk(i);$3(e,n,o,t)})}else Ji(n)&&e.callbacks_.push(function(){const a=is(e);e.type_===3?a.has(n)&&ty(n,r.handledSet_,r):Y1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ty(Y1(e.copy_,t,e.type_),r.handledSet_,r)})}function ty(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||hs(e)||t.has(e)||!Ji(e)||Dv(e)||(t.add(e),zv(e,(r,i)=>{if(hs(i)){const a=i[jr];if(Mv(a,n)){const o=bk(a);Jg(e,r,o,e.type_),L3(a)}}else Ji(i)&&ty(i,t,n)})),e}function Kde(e,t){const n=Tv(e),r={type_:n?1:0,scope_:t?t.scope_:I3(),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=ny;n&&(i=[r],a=rh);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,[u,r]}var ny={get(e,t){if(t===jr)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=is(e);if(!IP(i,t,e.type_))return Hde(e,i,t);const a=i[t];if(e.finalized_||!Ji(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Mde(t))return a;if(a===dS(e.base_,t)){mg(e);const o=e.type_===1?+t:t,u=tj(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in is(e)},ownKeys(e){return Reflect.ownKeys(is(e))},set(e,t,n){const r=U3(is(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=dS(is(e),t),a=i?.[jr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Dde(n,i)&&(n!==void 0||IP(e.base_,t,e.type_)))return!0;mg(e),ej(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),Fde(e,t,n)),!0},deleteProperty(e,t){return mg(e),dS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ej(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=is(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[pg]:!0,[Z1]:e.type_!==1||t!=="length",[Xg]:r[Xg],[th]:n[t]}},defineProperty(){Zi(11)},getPrototypeOf(e){return Tu(e.base_)},setPrototypeOf(){Zi(12)}},rh={};for(let e in ny){let t=ny[e];rh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}rh.deleteProperty=function(e,t){return rh.set.call(this,e,t,void 0)};rh.set=function(e,t,n){return ny.set.call(this,e[0],t,n,e[0])};function dS(e,t){const n=e[jr];return(n?is(n):e)[t]}function Hde(e,t,n){const r=U3(t,n);return r?th in r?r[th]:r.get?.call(e.draft_):void 0}function U3(e,t){if(!(t in e))return;let n=Tu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Tu(n)}}function ej(e){e.modified_||(e.modified_=!0,e.parent_&&ej(e.parent_))}function mg(e){e.copy_||(e.assigned_=new Map,e.copy_=W1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Gde=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(ru(n)&&!ru(r)){const o=r;r=n;const u=this;return function(f=o,...p){return u.produce(f,m=>r.call(this,m,...p))}}ru(r)||Zi(6),i!==void 0&&!ru(i)&&Zi(7);let a;if(Ji(n)){const o=UP(this),u=tj(o,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?X1(o):J1(o)}return BP(o,i),qP(a,o)}else if(!n||!xk(n)){if(a=r(n),a===void 0&&(a=n),a===R3&&(a=void 0),this.autoFreeze_&&wk(a,!0),i){const o=[],u=[];Ul(Q1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else Zi(1,n)},this.produceWithPatches=(n,r)=>{if(ru(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},uS(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),uS(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),uS(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ji(t)||Zi(8),hs(t)&&(t=ki(t));const n=UP(this),r=tj(n,t,void 0);return r[jr].isManual_=!0,J1(n),r}finishDraft(t,n){const r=t&&t[jr];(!r||!r.isManual_)&&Zi(9);const{scope_:i}=r;return BP(i,n),qP(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=Ul(Q1).applyPatches_;return hs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function tj(e,t,n,r){const[i,a]=Pv(t)?Ul(ey).proxyMap_(t,n):Rv(t)?Ul(ey).proxySet_(t,n):Kde(t,n);return(n?.scope_??I3()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?qde(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 hs(e)||Zi(10,e),q3(e)}function q3(e){if(!Ji(e)||Dv(e))return e;const t=e[jr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=W1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=W1(e,!0);return zv(n,(i,a)=>{Jg(n,i,q3(a))},r),t&&(t.finalized_=!1),n}var Vde=new Gde,F3=Vde.produce;function K3(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Zde=K3(),Yde=K3,Wde=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Wg:Wg.apply(null,arguments)};function ri(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(ni(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=>P3(r)&&r.type===e,n}var H3=class Af extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Af.prototype)}static get[Symbol.species](){return Af}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Af(...t[0].concat(this)):new Af(...t.concat(this))}};function KP(e){return Ji(e)?F3(e,()=>{}):e}function Bm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Qde(e){return typeof e=="boolean"}var Xde=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new H3;return n&&(Qde(n)?o.push(Zde):o.push(Yde(n.extraArgument))),o},G3="RTK_autoBatch",Xt=()=>e=>({payload:e,meta:{[G3]:!0}}),HP=e=>t=>{setTimeout(t,e)},V3=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:HP(10):e.type==="callback"?e.queueNotification:HP(e.timeout),f=()=>{o=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return u.add(p),()=>{y(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[G3],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Jde=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new H3(e);return r&&i.push(V3(typeof r=="object"?r:void 0)),i};function efe(e){const t=Xde(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(vk(n))u=T3(n);else throw new Error(ni(1));let d;typeof r=="function"?d=r(t):d=t();let f=Wg;i&&(f=Wde({trace:!1,...typeof i=="object"&&i}));const p=Pde(...d),m=Jde(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return z3(u,a,v)}function Z3(e){const t={},n=[];let r;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(ni(28));if(u in t)throw new Error(ni(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function tfe(e){return typeof e=="function"}function nfe(e,t){let[n,r,i]=Z3(t),a;if(tfe(e))a=()=>KP(e());else{const u=KP(e);a=()=>u}function o(u=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(hs(p)){const v=m(p,d);return v===void 0?p:v}else{if(Ji(p))return F3(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},u)}return o.getInitialState=a,o}var rfe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ife=(e=21)=>{let t="",n=e;for(;n--;)t+=rfe[Math.random()*64|0];return t},afe=Symbol.for("rtk-slice-createasyncthunk");function sfe(e,t){return`${e}/${t}`}function ofe({creators:e}={}){const t=e?.asyncThunk?.[afe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(ni(11));const o=(typeof r.reducers=="function"?r.reducers(cfe()):r.reducers)||{},u=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,C){const T=typeof _=="string"?_:_.type;if(!T)throw new Error(ni(12));if(T in d.sliceCaseReducersByType)throw new Error(ni(13));return d.sliceCaseReducersByType[T]=C,f},addMatcher(_,C){return d.sliceMatchers.push({matcher:_,reducer:C}),f},exposeAction(_,C){return d.actionCreators[_]=C,f},exposeCaseReducer(_,C){return d.sliceCaseReducersByName[_]=C,f}};u.forEach(_=>{const C=o[_],T={reducerName:_,type:sfe(i,_),createNotation:typeof r.reducers=="function"};dfe(C)?hfe(T,C,f,t):ufe(T,C,f)});function p(){const[_={},C=[],T=void 0]=typeof r.extraReducers=="function"?Z3(r.extraReducers):[r.extraReducers],E={..._,...d.sliceCaseReducersByType};return nfe(r.initialState,A=>{for(let P in E)A.addCase(P,E[P]);for(let P of d.sliceMatchers)A.addMatcher(P.matcher,P.reducer);for(let P of C)A.addMatcher(P.matcher,P.reducer);T&&A.addDefaultCase(T)})}const m=_=>_,y=new Map,v=new WeakMap;let w;function S(_,C){return w||(w=p()),w(_,C)}function j(){return w||(w=p()),w.getInitialState()}function k(_,C=!1){function T(A){let P=A[_];return typeof P>"u"&&C&&(P=Bm(v,T,j)),P}function E(A=m){const P=Bm(y,C,()=>new WeakMap);return Bm(P,A,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=lfe(U,A,()=>Bm(v,A,j),C);return $})}return{reducerPath:_,getSelectors:E,get selectors(){return E(T)},selectSlice:T}}const O={name:i,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(_,{reducerPath:C,...T}={}){const E=C??a;return _.inject({reducerPath:E,reducer:S},T),{...O,...k(E,!0)}}};return O}}function lfe(e,t,n,r){function i(a,...o){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...o)}return i.unwrapped=e,i}var mr=ofe();function cfe(){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 ufe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!ffe(r))throw new Error(ni(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?ri(e,o):ri(e))}function dfe(e){return e._reducerDefinitionType==="asyncThunk"}function ffe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hfe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(ni(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Um,pending:u||Um,rejected:d||Um,settled:f||Um})}function Um(){}var pfe="task",Y3="listener",W3="completed",Sk="cancelled",mfe=`task-${Sk}`,gfe=`task-${W3}`,nj=`${Y3}-${Sk}`,yfe=`${Y3}-${W3}`,Iv=class{constructor(e){this.code=e,this.message=`${pfe} ${Sk} (reason: ${e})`}name="TaskAbortError";message},jk=(e,t)=>{if(typeof e!="function")throw new TypeError(ni(32))},ry=()=>{},Q3=(e,t=ry)=>(e.catch(t),e),X3=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Al=e=>{if(e.aborted)throw new Iv(e.reason)};function J3(e,t){let n=ry;return new Promise((r,i)=>{const a=()=>i(new Iv(e.reason));if(e.aborted){a();return}n=X3(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=ry})}var vfe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Iv?"cancelled":"rejected",error:n}}finally{t?.()}},iy=e=>t=>Q3(J3(e,t).then(n=>(Al(e),n))),eB=e=>{const t=iy(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:xu}=Object,GP={},Lv="listenerMiddleware",xfe=(e,t)=>{const n=r=>X3(e,()=>r.abort(e.reason));return(r,i)=>{jk(r);const a=new AbortController;n(a);const o=vfe(async()=>{Al(e),Al(a.signal);const u=await r({pause:iy(a.signal),delay:eB(a.signal),signal:a.signal});return Al(a.signal),u},()=>a.abort(gfe));return i?.autoJoin&&t.push(o.catch(ry)),{result:iy(e)(o),cancel(){a.abort(mfe)}}}},bfe=(e,t)=>{const n=async(r,i)=>{Al(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await J3(t,Promise.race(u));return Al(t),d}finally{a()}};return(r,i)=>Q3(n(r,i))},tB=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=ri(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(ni(21));return jk(a),{predicate:i,type:t,effect:a}},nB=xu(e=>{const{type:t,predicate:n,effect:r}=tB(e);return{id:ife(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(ni(22))}}},{withTypes:()=>nB}),VP=(e,t)=>{const{type:n,effect:r,predicate:i}=tB(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},rj=e=>{e.pending.forEach(t=>{t.abort(nj)})},wfe=(e,t)=>()=>{for(const n of t.keys())rj(n);e.clear()},ZP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},rB=xu(ri(`${Lv}/add`),{withTypes:()=>rB}),Sfe=ri(`${Lv}/removeAll`),iB=xu(ri(`${Lv}/remove`),{withTypes:()=>iB}),jfe=(...e)=>{console.error(`${Lv}/error`,...e)},zh=(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=jfe}=e;jk(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&rj(v)}),d=v=>{const w=VP(t,v)??nB(v);return u(w)};xu(d,{withTypes:()=>d});const f=v=>{const w=VP(t,v);return w&&(w.unsubscribe(),v.cancelActive&&rj(w)),!!w};xu(f,{withTypes:()=>f});const p=async(v,w,S,j)=>{const k=new AbortController,O=bfe(d,k.signal),_=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,xu({},S,{getOriginalState:j,condition:(C,T)=>O(C,T).then(Boolean),take:O,delay:eB(k.signal),pause:iy(k.signal),extra:a,signal:k.signal,fork:xfe(k.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,T,E)=>{C!==k&&(C.abort(nj),E.delete(C))})},cancel:()=>{k.abort(nj),v.pending.delete(k)},throwIfCancelled:()=>{Al(k.signal)}})))}catch(C){C instanceof Iv||ZP(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),k.abort(yfe),i(v),v.pending.delete(k)}},m=wfe(t,n);return{middleware:v=>w=>S=>{if(!P3(S))return w(S);if(rB.match(S))return d(S.payload);if(Sfe.match(S)){m();return}if(iB.match(S))return f(S.payload);let j=v.getState();const k=()=>{if(j===GP)throw new Error(ni(23));return j};let O;try{if(O=w(S),t.size>0){const _=v.getState(),C=Array.from(t.values());for(const T of C){let E=!1;try{E=T.predicate(S,_,j)}catch(A){E=!1,ZP(o,A,{raisedBy:"predicate"})}E&&p(T,S,v,k)}}}finally{j=GP}return O},startListening:d,stopListening:f,clearListeners:m}};function ni(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 Nfe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},aB=mr({name:"chartLayout",initialState:Nfe,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:kfe,setLayout:Cfe,setChartSize:_fe,setScale:Afe}=aB.actions,Ofe=aB.reducer;function sB(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function st(e){return Number.isFinite(e)}function Oa(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function YP(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?YP(Object(n),!0).forEach(function(r){Efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Efe(e,t,n){return(t=zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zfe(e){var t=Tfe(e,"string");return typeof t=="symbol"?t:t+""}function Tfe(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 Gn(e,t,n){return ir(e)||ir(t)?n:zi(t)?Av(e,t,n):typeof t=="function"?t(e):n}var Pfe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:u}=t;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&Le(e[a]))return cu(cu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&Le(e[o]))return cu(cu({},e),{},{[o]:e[o]+(i||0)})}return e},Pa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",oB=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,o=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||o.push(t),a||o.push(n),o},lB=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var w=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,S=i==="category"&&o.bandwidth?o.bandwidth()/w:0;if(S=v==="angleAxis"&&a&&a.length>=2?Ni(a[0]-a[1])*2*S:S,m||y){var j=(m||y||[]).map((k,O)=>{var _=r?r.indexOf(k):k,C=o.map(_);return st(C)?{coordinate:C+S,value:k,offset:S,index:O}:null}).filter(Ir);return j}return d&&f?f.map((k,O)=>{var _=o.map(k);return st(_)?{coordinate:_+S,value:k,index:O,offset:S}:null}).filter(Ir):o.ticks&&p!=null?o.ticks(p).map((k,O)=>{var _=o.map(k);return st(_)?{coordinate:_+S,value:k,index:O,offset:S}:null}).filter(Ir):o.domain().map((k,O)=>{var _=o.map(k);return st(_)?{coordinate:_+S,value:r?r[k]:k,index:O,offset:S}:null}).filter(Ir)},Rfe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=Aa(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},Dfe=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var u=e[o],d=u?.[i];if(d!=null){var f=Aa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},Mfe={sign:Rfe,expand:lue,none:$l,silhouette:cue,wiggle:uue,positive:Dfe},Ife=(e,t,n)=>{var r,i=(r=Mfe[n])!==null&&r!==void 0?r:$l,a=oue().keys(t).value((u,d)=>Number(Gn(u,d,0))).order(G1).offset(i),o=a(e);return o.forEach((u,d)=>{u.forEach((f,p)=>{var m=Gn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Le(m[0])&&Le(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function Lfe(e){return e==null?void 0:String(e)}function WP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ir(i[t.dataKey])){var u=u3(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=Gn(i,ir(o)?t.dataKey:o),f=t.scale.map(d);return Le(f)?f:null}var $fe=e=>{var t=e.flat(2).filter(Le);return[Math.min(...t),Math.max(...t)]},Bfe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Ufe=(e,t,n)=>{if(e!=null)return Bfe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,u=o.reduce((d,f)=>{var p=sB(f,t,n),m=$fe(p);return!st(m[0])||!st(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},QP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ay=(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=Ov(t,p=>p.coordinate),a=1/0,o=1,u=i.length;o<u;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function JP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return cu(cu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function cB(e,t){if(e)return String(e);if(typeof t=="string")return t}var qfe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Ffe=(e,t)=>t==="centric"?e.angle:e.radius,xs=e=>e.layout.width,bs=e=>e.layout.height,Kfe=e=>e.layout.scale,uB=e=>e.layout.margin,$v=oe(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Bv=oe(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Hfe="data-recharts-item-index",Gfe="data-recharts-item-id",Th=60;function eR(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 qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(r){Vfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vfe(e,t,n){return(t=Zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zfe(e){var t=Yfe(e,"string");return typeof t=="symbol"?t:t+""}function Yfe(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 Wfe=e=>e.brush.height;function Qfe(e){var t=Bv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Th;return n+i}return n},0)}function Xfe(e){var t=Bv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Th;return n+i}return n},0)}function Jfe(e){var t=$v(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function ehe(e){var t=$v(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var ar=oe([xs,bs,uB,Wfe,Qfe,Xfe,Jfe,ehe,O3,Cde],(e,t,n,r,i,a,o,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+u},y=qm(qm({},m),p),v=y.bottom;y.bottom+=r,y=Pfe(y,d,f);var w=e-y.left-y.right,S=t-y.top-y.bottom;return qm(qm({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(S,0)})}),the=oe(ar,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),dB=oe(xs,bs,(e,t)=>({x:0,y:0,width:e,height:t})),nhe=x.createContext(null),kr=()=>x.useContext(nhe)!=null,Uv=e=>e.brush,qv=oe([Uv,ar,uB],(e,t,n)=>({height:e.height,x:Le(e.x)?e.x:t.left,y:Le(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Le(e.width)?e.width:t.width})),fS={},hS={},pS={},tR;function rhe(){return tR||(tR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(o,u),o=void 0,u=null)},m=()=>{f&&p(),S()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{w(),o=void 0,u=null},j=()=>{p()},k=function(...O){if(i?.aborted)return;o=this,u=O;const _=y==null;v(),d&&_&&p()};return k.schedule=v,k.cancel=S,k.flush=j,i?.addEventListener("abort",S,{once:!0}),k}e.debounce=t})(pS)),pS}var nR;function ihe(){return nR||(nR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rhe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...S){p=r.apply(this,S),m=null},i,{edges:f}),v=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,S),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,S),p)},w=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(hS)),hS}var rR;function ahe(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ihe();function n(r,i=0,a={}){const{leading:o=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:u})}e.throttle=n})(fS)),fS}var mS,iR;function she(){return iR||(iR=1,mS=ahe().throttle),mS}var ohe=she();const lhe=Ta(ohe);var sy=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++]))}},ba={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},fB=(e,t,n)=>{var{width:r=ba.width,height:i=ba.height,aspect:a,maxHeight:o}=n,u=Bl(r)?e:Number(r),d=Bl(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:u,calculatedHeight:d}},che={width:0,height:0,overflow:"visible"},uhe={width:0,overflowX:"visible"},dhe={height:0,overflowY:"visible"},fhe={},hhe=e=>{var{width:t,height:n}=e,r=Bl(t),i=Bl(n);return r&&i?che:r?uhe:i?dhe:fhe};function phe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=ba.width,a=ba.height):i===void 0?i=r&&r>0?void 0:ba.width:a===void 0&&(a=r&&r>0?void 0:ba.height),{width:i,height:a}}function ij(){return ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ij.apply(null,arguments)}function aR(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 sR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aR(Object(n),!0).forEach(function(r){mhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mhe(e,t,n){return(t=ghe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ghe(e){var t=yhe(e,"string");return typeof t=="symbol"?t:t+""}function yhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hB=x.createContext(ba.initialDimension);function vhe(e){return Oa(e.width)&&Oa(e.height)}function pB(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return vhe(i)?x.createElement(hB.Provider,{value:i},t):null}var Nk=()=>x.useContext(hB),xhe=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=ba.initialDimension,width:i,height:a,minWidth:o=ba.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=ba.debounce,id:m,className:y,onResize:v,style:w={}}=e,S=x.useRef(null),j=x.useRef();j.current=v,x.useImperativeHandle(t,()=>S.current);var[k,O]=x.useState({containerWidth:r.width,containerHeight:r.height}),_=x.useCallback((P,$)=>{O(F=>{var U=Math.round(P),B=Math.round($);return F.containerWidth===U&&F.containerHeight===B?F:{containerWidth:U,containerHeight:B}})},[]);x.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Xu;var P=B=>{var V,ee=B[0];if(ee!=null){var{width:Q,height:K}=ee.contentRect;_(Q,K),(V=j.current)===null||V===void 0||V.call(j,Q,K)}};p>0&&(P=lhe(P,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(P),{width:F,height:U}=S.current.getBoundingClientRect();return _(F,U),$.observe(S.current),()=>{$.disconnect()}},[_,p]);var{containerWidth:C,containerHeight:T}=k;sy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:E,calculatedHeight:A}=fB(C,T,{width:i,height:a,aspect:n,maxHeight:d});return sy(E!=null&&E>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
258
+ please check the style of container, or the props width(%s) and height(%s),
259
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
260
+ height and width.`,E,A,i,a,o,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:zt("recharts-responsive-container",y),style:sR(sR({},w),{},{width:i,height:a,minWidth:o,minHeight:u,maxHeight:d}),ref:S},x.createElement("div",{style:hhe({width:i,height:a})},x.createElement(pB,{width:E,height:A},f)))}),oy=x.forwardRef((e,t)=>{var n=Nk();if(Oa(n.width)&&Oa(n.height))return e.children;var{width:r,height:i}=phe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=fB(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Le(a)&&Le(o)?x.createElement(pB,{width:a,height:o},e.children):x.createElement(xhe,ij({},e,{width:r,height:i,ref:t}))});function kk(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 Ph=()=>{var e,t=kr(),n=Ue(the),r=Ue(qv),i=(e=Ue(Uv))===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}},bhe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},mB=()=>{var e;return(e=Ue(ar))!==null&&e!==void 0?e:bhe},Ck=()=>Ue(xs),_k=()=>Ue(bs),whe=()=>Ue(e=>e.layout.margin),sn=e=>e.layout.layoutType,Ju=()=>Ue(sn),Ak=()=>{var e=Ju();if(e==="horizontal"||e==="vertical")return e},gB=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},She=()=>{var e=Ju();return e!==void 0},Rh=e=>{var t=hn(),n=kr(),{width:r,height:i}=e,a=Nk(),o=r,u=i;return a&&(o=a.width>0?a.width:r,u=a.height>0?a.height:i),x.useEffect(()=>{!n&&Oa(o)&&Oa(u)&&t(_fe({width:o,height:u}))},[t,n,o,u]),null},yB=Symbol.for("immer-nothing"),oR=Symbol.for("immer-draftable"),ii=Symbol.for("immer-state");function Yi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ih=Object.getPrototypeOf;function Pu(e){return!!e&&!!e[ii]}function ql(e){return e?vB(e)||Array.isArray(e)||!!e[oR]||!!e.constructor?.[oR]||Dh(e)||Kv(e):!1}var jhe=Object.prototype.constructor.toString(),lR=new WeakMap;function vB(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=lR.get(n);return r===void 0&&(r=Function.toString.call(n),lR.set(n,r)),r===jhe}function ly(e,t,n=!0){Fv(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 Fv(e){const t=e[ii];return t?t.type_:Array.isArray(e)?1:Dh(e)?2:Kv(e)?3:0}function aj(e,t){return Fv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xB(e,t,n){const r=Fv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Nhe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Dh(e){return e instanceof Map}function Kv(e){return e instanceof Set}function dl(e){return e.copy_||e.base_}function sj(e,t){if(Dh(e))return new Map(e);if(Kv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=vB(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[ii];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[o]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[o]})}return Object.create(ih(e),r)}else{const r=ih(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Ok(e,t=!1){return Hv(e)||Pu(e)||!ql(e)||(Fv(e)>1&&Object.defineProperties(e,{set:Fm,add:Fm,clear:Fm,delete:Fm}),Object.freeze(e),t&&Object.values(e).forEach(n=>Ok(n,!0))),e}function khe(){Yi(2)}var Fm={value:khe};function Hv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Che={};function Fl(e){const t=Che[e];return t||Yi(0,e),t}var ah;function bB(){return ah}function _he(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function cR(e,t){t&&(Fl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function oj(e){lj(e),e.drafts_.forEach(Ahe),e.drafts_=null}function lj(e){e===ah&&(ah=e.parent_)}function uR(e){return ah=_he(ah,e)}function Ahe(e){const t=e[ii];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function dR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ii].modified_&&(oj(t),Yi(4)),ql(e)&&(e=cy(t,e),t.parent_||uy(t,e)),t.patches_&&Fl("Patches").generateReplacementPatches_(n[ii].base_,e,t.patches_,t.inversePatches_)):e=cy(t,n,[]),oj(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yB?e:void 0}function cy(e,t,n){if(Hv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[ii];if(!i)return ly(t,(a,o)=>fR(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return uy(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),ly(o,(d,f)=>fR(e,i,a,d,f,n,u),r),uy(e,a,!1),n&&e.patches_&&Fl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function fR(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=Hv(i);if(!(u&&!o)){if(Pu(i)){const d=a&&t&&t.type_!==3&&!aj(t.assigned_,r)?a.concat(r):void 0,f=cy(e,i,d);if(xB(n,r,f),Pu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(ql(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;cy(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Dh(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&uy(e,i)}}}function uy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ok(t,n)}function Ohe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:bB(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Ek;n&&(i=[r],a=sh);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,u}var Ek={get(e,t){if(t===ii)return e;const n=dl(e);if(!aj(n,t))return Ehe(e,n,t);const r=n[t];return e.finalized_||!ql(r)?r:r===gS(e.base_,t)?(yS(e),e.copy_[t]=uj(r,e)):r},has(e,t){return t in dl(e)},ownKeys(e){return Reflect.ownKeys(dl(e))},set(e,t,n){const r=wB(dl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=gS(dl(e),t),a=i?.[ii];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Nhe(n,i)&&(n!==void 0||aj(e.base_,t)))return!0;yS(e),cj(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 gS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,yS(e),cj(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=dl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Yi(11)},getPrototypeOf(e){return ih(e.base_)},setPrototypeOf(){Yi(12)}},sh={};ly(Ek,(e,t)=>{sh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});sh.deleteProperty=function(e,t){return sh.set.call(this,e,t,void 0)};sh.set=function(e,t,n){return Ek.set.call(this,e[0],t,n,e[0])};function gS(e,t){const n=e[ii];return(n?dl(n):e)[t]}function Ehe(e,t,n){const r=wB(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function wB(e,t){if(!(t in e))return;let n=ih(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ih(n)}}function cj(e){e.modified_||(e.modified_=!0,e.parent_&&cj(e.parent_))}function yS(e){e.copy_||(e.copy_=sj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zhe=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"&&Yi(6),r!==void 0&&typeof r!="function"&&Yi(7);let i;if(ql(t)){const a=uR(this),o=uj(t,void 0);let u=!0;try{i=n(o),u=!1}finally{u?oj(a):lj(a)}return cR(a,r),dR(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===yB&&(i=void 0),this.autoFreeze_&&Ok(i,!0),r){const a=[],o=[];Fl("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Yi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,d=>t(d,...u));let r,i;return[this.produce(t,n,(o,u)=>{r=o,i=u}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ql(e)||Yi(8),Pu(e)&&(e=The(e));const t=uR(this),n=uj(e,void 0);return n[ii].isManual_=!0,lj(t),n}finishDraft(e,t){const n=e&&e[ii];(!n||!n.isManual_)&&Yi(9);const{scope_:r}=n;return cR(r,t),dR(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=Fl("Patches").applyPatches_;return Pu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function uj(e,t){const n=Dh(e)?Fl("MapSet").proxyMap_(e,t):Kv(e)?Fl("MapSet").proxySet_(e,t):Ohe(e,t);return(t?t.scope_:bB()).drafts_.push(n),n}function The(e){return Pu(e)||Yi(10,e),SB(e)}function SB(e){if(!ql(e)||Hv(e))return e;const t=e[ii];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=sj(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=sj(e,!0);return ly(n,(i,a)=>{xB(n,i,SB(a))},r),t&&(t.finalized_=!1),n}var Phe=new zhe;Phe.produce;var Rhe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},jB=mr({name:"legend",initialState:Rhe,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:Xt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Xt()},removeLegendPayload:{reducer(e,t){var n=ki(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Xt()}}}),{setLegendSize:hR,setLegendSettings:Dhe,addLegendPayload:Mhe,replaceLegendPayload:Ihe,removeLegendPayload:Lhe}=jB.actions,$he=jB.reducer,vS={exports:{}},xS={};var pR;function Bhe(){if(pR)return xS;pR=1;var e=qu();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return xS.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=o(function(){function j(T){if(!k){if(k=!0,O=T,T=m(T),y!==void 0&&w.hasValue){var E=w.value;if(y(E,T))return _=E}return _=T}if(E=_,n(O,T))return E;var A=m(T);return y!==void 0&&y(E,A)?(O=T,E):(O=T,_=A)}var k=!1,O,_,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var S=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},xS}var mR;function Uhe(){return mR||(mR=1,vS.exports=Bhe()),vS.exports}Uhe();function qhe(e){e()}function Fhe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){qhe(()=>{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 gR={notify(){},get:()=>[]};function Khe(e,t){let n,r=gR,i=0,a=!1;function o(S){p();const j=r.subscribe(S);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=Fhe())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=gR)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var Hhe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ghe=Hhe(),Vhe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Zhe=Vhe(),Yhe=()=>Ghe||Zhe?x.useLayoutEffect:x.useEffect,Whe=Yhe();function yR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Qhe(e,t){if(yR(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])||!yR(e[n[i]],t[n[i]]))return!1;return!0}var Xhe=Symbol.for("react-redux-context"),Jhe=typeof globalThis<"u"?globalThis:{};function epe(){if(!x.createContext)return{};const e=Jhe[Xhe]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var tpe=epe();function npe(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=Khe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);Whe(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const u=n||tpe;return x.createElement(u.Provider,{value:a},t)}var rpe=npe,ipe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function ape(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Mh(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(ipe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Qhe(e[r],t[r]))return!1}else if(!ape(e[r],t[r]))return!1;return!0}var spe=["contextPayload"];function dj(){return dj=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},dj.apply(null,arguments)}function vR(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 Ru(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){ope(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ope(e,t,n){return(t=lpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lpe(e){var t=cpe(e,"string");return typeof t=="symbol"?t:t+""}function cpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function upe(e,t){if(e==null)return{};var n,r,i=dpe(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 dpe(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 fpe(e){return e.value}function hpe(e){var{contextPayload:t}=e,n=upe(e,spe),r=k3(t,e.payloadUniqBy,fpe),i=Ru(Ru({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement($ue,i)}function ppe(e,t,n,r,i,a){var{layout:o,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=u==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Ru(Ru({},f),p)}function mpe(e){var t=hn();return x.useEffect(()=>{t(Dhe(e))},[t,e]),null}function gpe(e){var t=hn();return x.useEffect(()=>(t(hR(e)),()=>{t(hR({width:0,height:0}))}),[t,e]),null}function ype(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var vpe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function xpe(e){var t=Nr(e,vpe),n=Ode(),r=zce(),i=whe(),{width:a,height:o,wrapperStyle:u,portal:d}=t,[f,p]=E3([n]),m=Ck(),y=_k();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=ype(t.layout,o,a,v),S=d?u:Ru(Ru({position:"absolute",width:w?.width||a||"auto",height:w?.height||o||"auto"},ppe(u,t,i,m,y,f)),u),j=d??r;if(j==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},x.createElement(mpe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(gpe,{width:f.width,height:f.height}),x.createElement(hpe,dj({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return Zl.createPortal(k,j)}var NB=x.memo(xpe,Mh);NB.displayName="Legend";function fj(){return fj=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},fj.apply(null,arguments)}function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){bpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bpe(e,t,n){return(t=wpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wpe(e){var t=Spe(e,"string");return typeof t=="symbol"?t:t+""}function Spe(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 jpe(e){return Array.isArray(e)&&zi(e[0])&&zi(e[1])?e.join(" ~ "):e}var Vc={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 Npe(e,t){return t==null?e:Ov(e,t)}var kpe=e=>{var{separator:t=Vc.separator,contentStyle:n,itemStyle:r,labelStyle:i=Vc.labelStyle,payload:a,formatter:o,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Vc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var T={padding:0,margin:0},E=Npe(a,u),A=E.map((P,$)=>{if(!P||P.type==="none")return null;var F=P.formatter||o||jpe,{value:U,name:B}=P,V=U,ee=B;if(F){var Q=F(U,B,P,$,a);if(Array.isArray(Q))[V,ee]=Q;else if(Q!=null)V=Q;else return null}var K=mf(mf({},Vc.itemStyle),{},{color:P.color||Vc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:K},zi(ee)?x.createElement("span",{className:"recharts-tooltip-item-name"},ee):null,zi(ee)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},V),x.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:T},A)}return null},w=mf(mf({},Vc.contentStyle),n),S=mf({margin:0},i),j=!ir(p),k=j?p:"",O=zt("recharts-default-tooltip",d),_=zt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",fj({className:O,style:w},C),x.createElement("p",{className:_,style:S},x.isValidElement(k)?k:"".concat(k)),v())},gf="recharts-tooltip-wrapper",Cpe={visibility:"hidden"};function _pe(e){var{coordinate:t,translateX:n,translateY:r}=e;return zt(gf,{["".concat(gf,"-right")]:Le(n)&&t&&Le(t.x)&&n>=t.x,["".concat(gf,"-left")]:Le(n)&&t&&Le(t.x)&&n<t.x,["".concat(gf,"-bottom")]:Le(r)&&t&&Le(t.y)&&r>=t.y,["".concat(gf,"-top")]:Le(r)&&t&&Le(t.y)&&r<t.y})}function bR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Le(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,w=y;return v<w?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var S=m+u,j=y+f;return S>j?Math.max(p,y):Math.max(m,y)}function Ape(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 Ope(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,y;return u.height>0&&u.width>0&&n?(m=bR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),y=bR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Ape({translateX:m,translateY:y,useTranslate3d:d})):p=Cpe,{cssProperties:p,cssClasses:_pe({translateX:m,translateY:y,coordinate:n})}}var Epe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ih={isSsr:Epe()};function kB(){var[e,t]=x.useState(()=>Ih.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 wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){zpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zpe(e,t,n){return(t=Tpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tpe(e){var t=Ppe(e,"string");return typeof t=="symbol"?t:t+""}function Ppe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rpe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Dpe(e){var t,n,r,i,a,o,u=kB(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var j,k,O,_;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(O=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Zc(Zc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Ope({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:Zc(Zc({transition:Rpe({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Zc(Zc({},y),{},{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 Mpe=x.memo(Dpe),CB=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function hj(){return hj=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},hj.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){Ipe(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 Ipe(e,t,n){return(t=Lpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lpe(e){var t=$pe(e,"string");return typeof t=="symbol"?t:t+""}function $pe(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 NR={curveBasisClosed:Wce,curveBasisOpen:Qce,curveBasis:Yce,curveBumpX:Dce,curveBumpY:Mce,curveLinearClosed:Xce,curveLinear:Cv,curveMonotoneX:Jce,curveMonotoneY:eue,curveNatural:tue,curveStep:nue,curveStepAfter:iue,curveStepBefore:rue},dy=e=>st(e.x)&&st(e.y),kR=e=>e.base!=null&&dy(e.base)&&dy(e),yf=e=>e.x,vf=e=>e.y,Bpe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Oh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=NR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return NR[n]||Cv},CR={connectNulls:!1,type:"linear"},Upe=e=>{var{type:t=CR.type,points:n=[],baseLine:r,layout:i,connectNulls:a=CR.connectNulls}=e,o=Bpe(t,i),u=a?n.filter(dy):n;if(Array.isArray(r)){var d,f=n.map((w,S)=>jR(jR({},w),{},{base:r[S]}));i==="vertical"?d=Mm().y(vf).x1(yf).x0(w=>w.base.x):d=Mm().x(yf).y1(vf).y0(w=>w.base.y);var p=d.defined(kR).curve(o),m=a?f.filter(kR):f;return p(m)}var y;i==="vertical"&&Le(r)?y=Mm().y(vf).x1(yf).x0(r):Le(r)?y=Mm().x(yf).y1(vf).y0(r):y=Q$().x(yf).y(vf);var v=y.defined(dy).curve(o);return v(u)},gg=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Ju();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?Upe(o):r;return x.createElement("path",hj({},Qi(e),mk(e),{className:zt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},qpe=["x","y","top","left","width","height","className"];function pj(){return pj=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},pj.apply(null,arguments)}function _R(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 Fpe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(r){Kpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kpe(e,t,n){return(t=Hpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hpe(e){var t=Gpe(e,"string");return typeof t=="symbol"?t:t+""}function Gpe(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 Vpe(e,t){if(e==null)return{};var n,r,i=Zpe(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 Zpe(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 Ype=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Wpe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:u}=e,d=Vpe(e,qpe),f=Fpe({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Le(t)||!Le(n)||!Le(a)||!Le(o)||!Le(r)||!Le(i)?null:x.createElement("path",pj({},Ur(f),{className:zt("recharts-cross",u),d:Ype(t,n,a,o,r,i)}))};function Qpe(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 AR(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 OR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AR(Object(n),!0).forEach(function(r){Xpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xpe(e,t,n){return(t=Jpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jpe(e){var t=eme(e,"string");return typeof t=="symbol"?t:t+""}function eme(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 tme=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),nme=(e,t,n)=>e.map(r=>"".concat(tme(r)," ").concat(t,"ms ").concat(n)).join(","),rme=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),oh=(e,t)=>Object.keys(t).reduce((n,r)=>OR(OR({},n),{},{[r]:e(r,t[r])}),{});function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){ime(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ime(e,t,n){return(t=ame(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ame(e){var t=sme(e,"string");return typeof t=="symbol"?t:t+""}function sme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fy=(e,t,n)=>e+(t-e)*n,mj=e=>{var{from:t,to:n}=e;return t!==n},_B=(e,t,n)=>{var r=oh((i,a)=>{if(mj(a)){var[o,u]=e(a.from,a.to,a.velocity);return Bn(Bn({},a),{},{from:o,velocity:u})}return a},t);return n<1?oh((i,a)=>mj(a)&&r[i]!=null?Bn(Bn({},a),{},{velocity:fy(a.velocity,r[i].velocity,n),from:fy(a.from,r[i].from,n)}):a,t):_B(e,r,n-1)};function ome(e,t,n,r,i,a){var o,u=r.reduce((y,v)=>Bn(Bn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>oh((y,v)=>v.from,u),f=()=>!Object.values(u).filter(mj).length,p=null,m=y=>{o||(o=y);var v=y-o,w=v/n.dt;u=_B(n,u,w),i(Bn(Bn(Bn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function lme(e,t,n,r,i,a,o){var u=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Bn(Bn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=oh((S,j)=>fy(...j,n(y)),d);if(a(Bn(Bn(Bn({},e),t),v)),y<1)u=o.setTimeout(p);else{var w=oh((S,j)=>fy(...j,n(1)),d);a(Bn(Bn(Bn({},e),t),w))}};return()=>(u=o.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const cme=(e,t,n,r,i,a)=>{var o=rme(e,t);return n==null?()=>(i(Bn(Bn({},e),t)),()=>{}):n.isStepper===!0?ome(e,t,n,o,i,a):lme(e,t,n,r,o,i,a)};var hy=1e-4,AB=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],OB=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),zR=(e,t)=>n=>{var r=AB(e,t);return OB(r,n)},ume=(e,t)=>n=>{var r=AB(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return OB(i,n)},dme=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]]},fme=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=dme(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},hme=(e,t,n,r)=>{var i=zR(e,n),a=zR(t,r),o=ume(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,w=o(m);if(Math.abs(v-p)<hy||w<hy)return a(m);m=u(m-v/w)}return a(m)};return d.isStepper=!1,d},TR=function(){return hme(...fme(...arguments))},pme=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,u,d)=>{var f=-(o-u)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-u)<hy&&Math.abs(m)<hy?[u,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},mme=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return TR(e);case"spring":return pme();default:if(e.split("(")[0]==="cubic-bezier")return TR(e)}return typeof e=="function"?e:null};function gme(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var u=o,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class yme{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 vme(){return gme(new yme)}var xme=x.createContext(vme);function bme(e,t){var n=x.useContext(xme);return x.useMemo(()=>t??n(e),[e,t,n])}var wme={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},PR={t:0},bS={t:1};function EB(e){var t=Nr(e,wme),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=kB(),m=n==="auto"?!Ih.isSsr&&!p:n,y=bme(t.animationId,t.animationManager),[v,w]=x.useState(m?PR:bS),S=x.useRef(null);return x.useEffect(()=>{m||w(bS)},[m]),x.useEffect(()=>{if(!m||!r)return Xu;var j=cme(PR,bS,mme(a),i,w,y.getTimeoutController()),k=()=>{S.current=j()};return y.start([d,o,k,i,u]),()=>{y.stop(),S.current&&S.current(),u()}},[m,r,i,a,o,d,u,y]),f(v.t)}function zB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(eh(t)),r=x.useRef(e);return r.current!==e&&(n.current=eh(t),r.current=e),n.current}var Sme=["radius"],jme=["radius"],RR,DR,MR,IR,LR,$R,BR,UR,qR,FR;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 HR(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){Nme(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 Nme(e,t,n){return(t=kme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kme(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 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 GR(e,t){if(e==null)return{};var n,r,i=_me(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 _me(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 da(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var VR=(e,t,n,r,i)=>{var a=ho(n),o=ho(r),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var S,j=(S=i[v])!==null&&S!==void 0?S:0;y[v]=j>u?u:j}m=tr(RR||(RR=da(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=tr(DR||(DR=da(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=tr(MR||(MR=da(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=tr(IR||(IR=da(["A ",",",",0,0,",`,
261
+ `,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=tr(LR||(LR=da(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=tr($R||($R=da(["A ",",",",0,0,",`,
262
+ `,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=tr(BR||(BR=da(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=tr(UR||(UR=da(["A ",",",",0,0,",`,
263
+ `,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=tr(qR||(qR=da(["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*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=tr(FR||(FR=da(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},ZR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ame=e=>{var t=Nr(e,ZR),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var te=n.current.getTotalLength();te&&i(te)}catch{}},[]);var{x:a,y:o,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=x.useRef(u),k=x.useRef(d),O=x.useRef(a),_=x.useRef(o),C=x.useMemo(()=>({x:a,y:o,width:u,height:d,radius:f}),[a,o,u,d,f]),T=zB(C,"rectangle-");if(a!==+a||o!==+o||u!==+u||d!==+d||u===0||d===0)return null;var E=zt("recharts-rectangle",p);if(!S){var A=Ur(t),{radius:P}=A,$=GR(A,Sme);return x.createElement("path",py({},$,{x:ho(a),y:ho(o),width:ho(u),height:ho(d),radius:typeof f=="number"?f:void 0,className:E,d:VR(a,o,u,d,f)}))}var F=j.current,U=k.current,B=O.current,V=_.current,ee="0px ".concat(r===-1?1:r,"px"),Q="".concat(r,"px ").concat(r,"px"),K=nme(["strokeDasharray"],y,typeof m=="string"?m:ZR.animationEasing);return x.createElement(EB,{animationId:T,key:T,canBegin:r>0,duration:y,easing:m,isActive:S,begin:v},te=>{var le=ya(F,u,te),je=ya(U,d,te),L=ya(B,a,te),I=ya(V,o,te);n.current&&(j.current=le,k.current=je,O.current=L,_.current=I);var q;w?te>0?q={transition:K,strokeDasharray:Q}:q={strokeDasharray:ee}:q={strokeDasharray:Q};var R=Ur(t),{radius:G}=R,ie=GR(R,jme);return x.createElement("path",py({},ie,{radius:typeof f=="number"?f:void 0,className:E,d:VR(L,I,le,je,f),ref:n,style:HR(HR({},q),t.style)}))})};function YR(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?YR(Object(n),!0).forEach(function(r){Ome(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ome(e,t,n){return(t=Eme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eme(e){var t=zme(e,"string");return typeof t=="symbol"?t:t+""}function zme(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 my=Math.PI/180,Tme=e=>e*180/Math.PI,rr=(e,t,n,r)=>({x:e+Math.cos(-my*r)*n,y:t+Math.sin(-my*r)*n}),Pme=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},Rme=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Dme=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Rme({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(n-i)/o,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:o,angle:Tme(d),angleInRadian:d}},Mme=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}},Ime=(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},Lme=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Dme({x:n,y:r},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:d,endAngle:f}=Mme(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?WR(WR({},t),{},{radius:i,angle:Ime(p,t)}):null};function TB(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=rr(t,n,r,i),u=rr(t,n,r,a);return{points:[o,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var QR,XR,JR,eD,tD,nD,rD;function gj(){return gj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gj.apply(null,arguments)}function xl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $me=(e,t)=>{var n=Ni(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Km=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:u,cornerIsExternal:d}=e,f=u*(o?1:-1)+r,p=Math.asin(u/f)/my,m=d?i:i+a*p,y=rr(t,n,f,m),v=rr(t,n,r,m),w=d?i-a*p:i,S=rr(t,n,f*Math.cos(p*my),w);return{center:y,circleTangency:v,lineTangency:S,theta:p}},PB=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,u=$me(a,o),d=a+u,f=rr(t,n,i,a),p=rr(t,n,i,d),m=tr(QR||(QR=xl(["M ",",",`
271
+ A `,",",`,0,
272
+ `,",",`,
273
+ `,",",`
274
+ `])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var y=rr(t,n,r,a),v=rr(t,n,r,d);m+=tr(XR||(XR=xl(["L ",",",`
275
+ A `,",",`,0,
276
+ `,",",`,
277
+ `,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),y.x,y.y)}else m+=tr(JR||(JR=xl(["L ",","," Z"])),t,n);return m},Bme=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Ni(f-d),{circleTangency:m,lineTangency:y,theta:v}=Km({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=Km({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return o?tr(eD||(eD=xl(["M ",",",`
278
+ a`,",",",0,0,1,",`,0
279
+ a`,",",",0,0,1,",`,0
280
+ `])),y.x,y.y,a,a,a*2,a,a,-a*2):PB({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=tr(tD||(tD=xl(["M ",",",`
281
+ A`,",",",0,0,",",",",",`
282
+ A`,",",",0,",",",",",",",`
283
+ A`,",",",0,0,",",",",",`
284
+ `])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),w.x,w.y,a,a,+(p<0),S.x,S.y);if(r>0){var{circleTangency:_,lineTangency:C,theta:T}=Km({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:E,lineTangency:A,theta:P}=Km({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-f):Math.abs(d-f)-T-P;if($<0&&a===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=tr(nD||(nD=xl(["L",",",`
285
+ A`,",",",0,0,",",",",",`
286
+ A`,",",",0,",",",",",",",`
287
+ A`,",",",0,0,",",",",","Z"])),A.x,A.y,a,a,+(p<0),E.x,E.y,r,r,+($>180),+(p>0),_.x,_.y,a,a,+(p<0),C.x,C.y)}else O+=tr(rD||(rD=xl(["L",",","Z"])),t,n);return O},Ume={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qme=e=>{var t=Nr(e,Ume),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=zt("recharts-sector",m),v=a-i,w=_o(o,v,0,!0),S;return w>0&&Math.abs(f-p)<360?S=Bme({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):S=PB({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",gj({},Ur(t),{className:y,d:S}))};function Fme(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(h3(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:u}=t,d=rr(r,i,a,u),f=rr(r,i,o,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return TB(t)}}var wS={},SS={},jS={},iD;function Kme(){return iD||(iD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_3();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(jS)),jS}var aD;function Hme(){return aD||(aD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kme();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})(SS)),SS}var sD;function Gme(){return sD||(sD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A3(),n=Hme();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const u=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=o;return d}e.range=r})(wS)),wS}var NS,oD;function Vme(){return oD||(oD=1,NS=Gme().range),NS}var Zme=Vme();const RB=Ta(Zme);var ra=e=>e.chartData,zk=oe([ra],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Gv=(e,t,n,r)=>r?zk(e):ra(e),Yme=(e,t,n)=>n?zk(e):ra(e),Wme=oe([Gv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});oe([zk],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var Qme=oe([ra],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ja(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(st(t)&&st(n))return!0}return!1}function lD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function DB(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(st(n))i=n;else if(typeof n=="function")return;if(st(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ja(o))return o}}function Xme(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ja(r))return lD(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,u;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Le(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&QP.test(i)){var d=QP.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Le(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&XP.test(a)){var p=XP.exec(a);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t?.[1];var y=[o,u];if(ja(y))return t==null?y:lD(y,t,n)}}}var ed=1e9,Jme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Pk,rn=!0,Ti="[DecimalError] ",Ol=Ti+"Invalid argument: ",Tk=Ti+"Exponent out of range: ",td=Math.floor,fl=Math.pow,ege=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jr,Hn=1e7,Jt=7,MB=9007199254740991,gy=td(MB/Jt),Pe={};Pe.absoluteValue=Pe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Pe.comparedTo=Pe.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Jt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Pe.dividedBy=Pe.div=function(e){return ds(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return qt(ds(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Rn(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Jr))throw Error(Ti+"NaN");if(n.s<1)throw Error(Ti+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(rn=!1,t=ds(lh(n,a),lh(e,a),a),rn=!0,qt(t,i))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$B(t,e):IB(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ti+"NaN");return n.s?(rn=!1,t=ds(n,e,0,1).times(e),rn=!0,n.minus(t)):qt(new r(n),i)};Pe.naturalExponential=Pe.exp=function(){return LB(this)};Pe.naturalLogarithm=Pe.ln=function(){return lh(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?IB(t,e):$B(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ol+e);if(t=Rn(i)+1,r=i.d.length-1,n=r*Jt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Pe.squareRoot=Pe.sqrt=function(){var e,t,n,r,i,a,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Ti+"NaN")}for(e=Rn(u),rn=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=wa(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=td((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(ds(u,a,o+2)).times(.5),wa(a.d).slice(0,o)===(t=wa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(qt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;o+=4}return rn=!0,qt(r,n)};Pe.times=Pe.mul=function(e){var t,n,r,i,a,o,u,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*y[i-r-1]+t,a[i--]=u%Hn|0,t=u/Hn|0;a[i]=(a[i]+t)%Hn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,rn?qt(e,m.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ea(e,0,ed),t===void 0?t=r.rounding:Ea(t,0,8),qt(n,e+Rn(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Kl(r,!0):(Ea(e,0,ed),t===void 0?t=i.rounding:Ea(t,0,8),r=qt(new i(r),e+1,t),n=Kl(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Kl(i):(Ea(e,0,ed),t===void 0?t=a.rounding:Ea(t,0,8),r=qt(new a(i),e+Rn(i)+1,t),n=Kl(r.abs(),!1,e+Rn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return qt(new t(e),Rn(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,n,r,i,a,o,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Jr);if(u=new d(u),!u.s){if(e.s<1)throw Error(Ti+"Infinity");return u}if(u.eq(Jr))return u;if(r=d.precision,e.eq(Jr))return qt(u,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=u.s,o){if((n=p<0?-p:p)<=MB){for(i=new d(Jr),t=Math.ceil(r/Jt+4),rn=!1;n%2&&(i=i.times(u),uD(i.d,t)),n=td(n/2),n!==0;)u=u.times(u),uD(u.d,t);return rn=!0,e.s<0?new d(Jr).div(i):qt(i,r)}}else if(a<0)throw Error(Ti+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,rn=!1,i=e.times(lh(u,r+f)),rn=!0,i=LB(i),i.s=a,i};Pe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Rn(i),r=Kl(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ea(e,1,ed),t===void 0?t=a.rounding:Ea(t,0,8),i=qt(new a(i),e,t),n=Rn(i),r=Kl(i,e<=n||n<=a.toExpNeg,e)),r};Pe.toSignificantDigits=Pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ea(e,1,ed),t===void 0?t=r.rounding:Ea(t,0,8)),qt(new r(n),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Rn(e),n=e.constructor;return Kl(e,t<=n.toExpNeg||t>=n.toExpPos)};function IB(e,t){var n,r,i,a,o,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),rn?qt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=o,u=d.length),o=Math.ceil(m/Jt),u=o>u?o+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Hn|0,d[a]%=Hn;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,rn?qt(t,m):t}function Ea(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ol+e)}function wa(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=Jt-r.length,n&&(a+=io(n)),a+=r;o=e[t],r=o+"",n=Jt-r.length,n&&(a+=io(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ds=(function(){function e(r,i){var a,o=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+o,r[u]=a%Hn|0,o=a/Hn|0;return o&&r.unshift(o),r}function t(r,i,a,o){var u,d;if(a!=o)d=a>o?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Hn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var u,d,f,p,m,y,v,w,S,j,k,O,_,C,T,E,A,P,$=r.constructor,F=r.s==i.s?1:-1,U=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Ti+"Division by zero");for(d=r.e-i.e,A=B.length,T=U.length,v=new $(F),w=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?O=a=$.precision:o?O=a+(Rn(r)-Rn(i))+1:O=a,O<0)return new $(0);if(O=O/Jt+2|0,f=0,A==1)for(p=0,B=B[0],O++;(f<T||p)&&O--;f++)_=p*Hn+(U[f]||0),w[f]=_/B|0,p=_%B|0;else{for(p=Hn/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),A=B.length,T=U.length),C=A,S=U.slice(0,A),j=S.length;j<A;)S[j++]=0;P=B.slice(),P.unshift(0),E=B[0],B[1]>=Hn/2&&++E;do p=0,u=t(B,S,A,j),u<0?(k=S[0],A!=j&&(k=k*Hn+(S[1]||0)),p=k/E|0,p>1?(p>=Hn&&(p=Hn-1),m=e(B,p),y=m.length,j=S.length,u=t(m,S,y,j),u==1&&(p--,n(m,A<y?P:B,y))):(p==0&&(u=p=1),m=B.slice()),y=m.length,y<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t(B,S,A,j),u<1&&(p++,n(S,A<j?P:B,j))),j=S.length):u===0&&(p++,S=[0]),w[f++]=p,u&&S[0]?S[j++]=U[C]||0:(S=[U[C]],j=1);while((C++<T||S[0]!==void 0)&&O--)}return w[0]||w.shift(),v.e=d,qt(v,o?a+Rn(v)+1:a)}})();function LB(e,t){var n,r,i,a,o,u,d=0,f=0,p=e.constructor,m=p.precision;if(Rn(e)>16)throw Error(Tk+Rn(e));if(!e.s)return new p(Jr);for(rn=!1,u=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(fl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(Jr),p.precision=u;;){if(i=qt(i.times(e),u),n=n.times(++d),o=a.plus(ds(i,n,u)),wa(o.d).slice(0,u)===wa(a.d).slice(0,u)){for(;f--;)a=qt(a.times(a),u);return p.precision=m,t==null?(rn=!0,qt(a,m)):a}a=o}}function Rn(e){for(var t=e.e*Jt,n=e.d[0];n>=10;n/=10)t++;return t}function kS(e,t,n){if(t>e.LN10.sd())throw rn=!0,n&&(e.precision=n),Error(Ti+"LN10 precision limit exceeded");return qt(new e(e.LN10),t)}function io(e){for(var t="";e--;)t+="0";return t}function lh(e,t){var n,r,i,a,o,u,d,f,p,m=1,y=10,v=e,w=v.d,S=v.constructor,j=S.precision;if(v.s<1)throw Error(Ti+(v.s?"NaN":"-Infinity"));if(v.eq(Jr))return new S(0);if(t==null?(rn=!1,f=j):f=t,v.eq(10))return t==null&&(rn=!0),kS(S,f);if(f+=y,S.precision=f,n=wa(w),r=n.charAt(0),a=Rn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=wa(v.d),r=n.charAt(0),m++;a=Rn(v),r>1?(v=new S("0."+n),a++):v=new S(r+"."+n.slice(1))}else return d=kS(S,f+2,j).times(a+""),v=lh(new S(r+"."+n.slice(1)),f-y).plus(d),S.precision=j,t==null?(rn=!0,qt(v,j)):v;for(u=o=v=ds(v.minus(Jr),v.plus(Jr),f),p=qt(v.times(v),f),i=3;;){if(o=qt(o.times(p),f),d=u.plus(ds(o,new S(i),f)),wa(d.d).slice(0,f)===wa(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(kS(S,f+2,j).times(a+""))),u=ds(u,new S(m),f),S.precision=j,t==null?(rn=!0,qt(u,j)):u;u=d,i+=2}}function cD(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=td(n/Jt),e.d=[],r=(n+1)%Jt,n<0&&(r+=Jt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Jt;r<i;)e.d.push(+t.slice(r,r+=Jt));t=t.slice(r),r=Jt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),rn&&(e.e>gy||e.e<-gy))throw Error(Tk+n)}else e.s=0,e.e=0,e.d=[0];return e}function qt(e,t,n){var r,i,a,o,u,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Jt,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/Jt),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=Jt,i=r-Jt+o}if(n!==void 0&&(a=fl(10,o-i-1),u=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?f/fl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Rn(e),m.length=1,t=t-a-1,m[0]=fl(10,(Jt-t%Jt)%Jt),e.e=td(-t/Jt)||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=fl(10,Jt-r),m[p]=i>0?(f/fl(10,o-i)%fl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Hn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Hn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(rn&&(e.e>gy||e.e<-gy))throw Error(Tk+Rn(e));return e}function $B(e,t){var n,r,i,a,o,u,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),rn?qt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/Jt),u)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}o=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Hn-1;--d[a],d[i]+=Hn}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,rn?qt(t,v):t):new y(0)}function Kl(e,t,n){var r,i=Rn(e),a=wa(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+io(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+io(-i-1)+a,n&&(r=n-o)>0&&(a+=io(r))):i>=o?(a+=io(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+io(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=io(r))),e.s<0?"-"+a:a}function uD(e,t){if(e.length>t)return e.length=t,!0}function BB(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(Ol+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 cD(o,a.toString())}else if(typeof a!="string")throw Error(Ol+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,ege.test(a))cD(o,a);else throw Error(Ol+a)}if(i.prototype=Pe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=BB,i.config=i.set=tge,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 tge(e){if(!e||typeof e!="object")throw Error(Ti+"Object expected");var t,n,r,i=["precision",1,ed,"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(td(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ol+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ol+n+": "+r);return this}var Pk=BB(Jme);Jr=new Pk(1);const bt=Pk;function UB(e){var t;return e===0?t=1:t=Math.floor(new bt(e).abs().log(10).toNumber())+1,t}function qB(e,t,n){for(var r=new bt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var FB=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},Rk=(e,t,n)=>{if(e.lte(0))return new bt(0);var r=UB(e.toNumber()),i=new bt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,u=new bt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=u.mul(i);return t?new bt(d.toNumber()):new bt(Math.ceil(d.toNumber()))},KB=(e,t,n)=>{var r;if(e.lte(0))return new bt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new bt(a).abs().log(10).toNumber()),u=new bt(10).pow(o),d=e.div(u).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,u=u.mul(new bt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new bt(m).mul(u);return t?y:new bt(Math.ceil(y.toNumber()))},nge=(e,t,n)=>{var r=new bt(1),i=new bt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new bt(10).pow(UB(e)-1),i=new bt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new bt(Math.floor(e)))}else e===0?i=new bt(Math.floor((t-1)/2)):n||(i=new bt(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new bt(d-o).mul(r)).toNumber());return u},HB=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]:Rk;if(!Number.isFinite((n-t)/(r-1)))return{step:new bt(0),tickMin:new bt(0),tickMax:new bt(0)};var u=o(new bt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new bt(0):(d=new bt(t).add(n).div(2),d=d.sub(new bt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new bt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?HB(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new bt(f).mul(u)),tickMax:d.add(new bt(p).mul(u))})},dD=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=FB([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 nge(d,i,a);var m=o==="snap125"?KB:Rk,{step:y,tickMin:v,tickMax:w}=HB(d,f,u,a,0,m),S=qB(v,w.add(new bt(.1).mul(y)),y);return n>r?S.reverse():S},fD=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=FB([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=o==="snap125"?KB:Rk,p=Math.max(n,2),m=f(new bt(d).sub(u).div(p-1),a,0),y=[...qB(new bt(u),new bt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},rge=e=>e.rootProps.barCategoryGap,Vv=e=>e.rootProps.stackOffset,GB=e=>e.rootProps.reverseStackOrder,Dk=e=>e.options.chartName,Mk=e=>e.rootProps.syncId,VB=e=>e.rootProps.syncMethod,Ik=e=>e.options.eventEmitter,ige=e=>e.rootProps.baseValue,hr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},il={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},fa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Zv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Yv(e,t,n){if(n!=="auto")return n;if(e!=null)return Pa(e,t)?"category":"number"}function hD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hD(Object(n),!0).forEach(function(r){age(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function age(e,t,n){return(t=sge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sge(e){var t=oge(e,"string");return typeof t=="symbol"?t:t+""}function oge(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 pD={allowDataOverflow:il.allowDataOverflow,allowDecimals:il.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:il.angleAxisId,includeHidden:!1,name:void 0,reversed:il.reversed,scale:il.scale,tick:il.tick,tickCount:void 0,ticks:void 0,type:il.type,unit:void 0,niceTicks:"auto"},mD={allowDataOverflow:fa.allowDataOverflow,allowDecimals:fa.allowDecimals,allowDuplicatedCategory:fa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fa.radiusAxisId,includeHidden:fa.includeHidden,name:void 0,reversed:fa.reversed,scale:fa.scale,tick:fa.tick,tickCount:fa.tickCount,ticks:void 0,type:fa.type,unit:void 0,niceTicks:"auto"},lge=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Lk=oe([lge,gB],(e,t)=>{var n;if(e!=null)return e;var r=(n=Yv(t,"angleAxis",pD.type))!==null&&n!==void 0?n:"category";return yy(yy({},pD),{},{type:r})}),cge=(e,t)=>e.polarAxis.radiusAxis[t],$k=oe([cge,gB],(e,t)=>{var n;if(e!=null)return e;var r=(n=Yv(t,"radiusAxis",mD.type))!==null&&n!==void 0?n:"category";return yy(yy({},mD),{},{type:r})}),Wv=e=>e.polarOptions,Bk=oe([xs,bs,ar],Pme),ZB=oe([Wv,Bk],(e,t)=>{if(e!=null)return _o(e.innerRadius,t,0)}),YB=oe([Wv,Bk],(e,t)=>{if(e!=null)return _o(e.outerRadius,t,t*.8)}),uge=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},WB=oe([Wv],uge);oe([Lk,WB],Zv);var QB=oe([Bk,ZB,YB],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});oe([$k,QB],Zv);var XB=oe([sn,Wv,ZB,YB,xs,bs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:u,startAngle:d,endAngle:f}=t;return{cx:_o(o,i,i/2),cy:_o(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Vn=(e,t)=>t,Qv=(e,t,n)=>n;function Uk(e){return e?.id}function JB(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=Uk(u);f.forEach((m,y)=>{var v=a==null||i?y:String(Gn(m,a,null)),w=Gn(m,u.dataKey,0),S;o.has(v)?S=o.get(v):S={},Object.assign(S,{[p]:w}),o.set(v,S)})}}),Array.from(o.values())}function qk(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Xv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Jv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function dge(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 Zn=e=>{var t=sn(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},nd=e=>e.tooltip.settings.axisId;function Fk(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var fge=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ja(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];st(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 wo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function hge(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Kk(e){let t,n,r;e.length!==2?(t=wo,n=(u,d)=>wo(e(u),d),r=(u,d)=>e(u)-d):(t=e===wo||e===hge?e:pge,n=e,r=e);function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function o(u,d,f=0,p=u.length){const m=i(u,d,f,p-1);return m>f&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:o,right:a}}function pge(){return 0}function e6(e){return e===null?NaN:+e}function*mge(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const gge=Kk(wo),Lh=gge.right;Kk(e6).center;class gD extends Map{constructor(t,n=xge){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(yD(this,t))}has(t){return super.has(yD(this,t))}set(t,n){return super.set(yge(this,t),n)}delete(t){return super.delete(vge(this,t))}}function yD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function yge({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function vge({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function xge(e){return e!==null&&typeof e=="object"?e.valueOf():e}function bge(e=wo){if(e===wo)return t6;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 t6(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const wge=Math.sqrt(50),Sge=Math.sqrt(10),jge=Math.sqrt(2);function vy(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>=wge?10:a>=Sge?5:a>=jge?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/o,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*o,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?vy(e,t,n*2):[u,d,f]}function yj(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?vy(t,e,n):vy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(o<0)for(let f=0;f<u;++f)d[f]=(a-f)/-o;else for(let f=0;f<u;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<u;++f)d[f]=(i+f)/-o;else for(let f=0;f<u;++f)d[f]=(i+f)*o;return d}function vj(e,t,n){return t=+t,e=+e,n=+n,vy(e,t,n)[2]}function xj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?vj(t,e,n):vj(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function vD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function xD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function n6(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?t6:bge(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),w=Math.min(r,Math.floor(t+(d-f)*m/d+y));n6(e,t,v,w,i)}const a=e[t];let o=n,u=r;for(xf(e,n,t),i(e[r],a)>0&&xf(e,n,r);o<u;){for(xf(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?xf(e,n,u):(++u,xf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function xf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Nge(e,t,n){if(e=Float64Array.from(mge(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xD(e);if(t>=1)return vD(e);var r,i=(r-1)*t,a=Math.floor(i),o=vD(n6(e,a).subarray(0,a+1)),u=xD(e.subarray(a+1));return o+(u-o)*(i-a)}}function kge(e,t,n=e6){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function Cge(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 Ii(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ws(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 bj=Symbol("implicit");function Hk(){var e=new gD,t=[],n=[],r=bj;function i(a){let o=e.get(a);if(o===void 0){if(r!==bj)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 gD;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 Hk(t,n).unknown(r)},Ii.apply(i,arguments),i}function Gk(){var e=Hk().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,w=v?i:r,S=v?r:i;a=(S-w)/Math.max(1,y-d+f*2),u&&(a=Math.floor(a)),w+=(S-w-a*(y-d))*p,o=a*(1-d),u&&(w=Math.round(w),o=Math.round(o));var j=Cge(y).map(function(k){return w+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(u=!!y,m()):u},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return Gk(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Ii.apply(m(),arguments)}function r6(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return r6(t())},e}function _ge(){return r6(Gk.apply(null,arguments).paddingInner(1))}function Vk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function i6(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $h(){}var ch=.7,xy=1/ch,bu="\\s*([+-]?\\d+)\\s*",uh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Na="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Age=/^#([0-9a-f]{3,8})$/,Oge=new RegExp(`^rgb\\(${bu},${bu},${bu}\\)$`),Ege=new RegExp(`^rgb\\(${Na},${Na},${Na}\\)$`),zge=new RegExp(`^rgba\\(${bu},${bu},${bu},${uh}\\)$`),Tge=new RegExp(`^rgba\\(${Na},${Na},${Na},${uh}\\)$`),Pge=new RegExp(`^hsl\\(${uh},${Na},${Na}\\)$`),Rge=new RegExp(`^hsla\\(${uh},${Na},${Na},${uh}\\)$`),bD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Vk($h,dh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wD,formatHex:wD,formatHex8:Dge,formatHsl:Mge,formatRgb:SD,toString:SD});function wD(){return this.rgb().formatHex()}function Dge(){return this.rgb().formatHex8()}function Mge(){return a6(this).formatHsl()}function SD(){return this.rgb().formatRgb()}function dh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Age.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jD(t):n===3?new Lr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hm(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=Oge.exec(e))?new Lr(t[1],t[2],t[3],1):(t=Ege.exec(e))?new Lr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zge.exec(e))?Hm(t[1],t[2],t[3],t[4]):(t=Tge.exec(e))?Hm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Pge.exec(e))?CD(t[1],t[2]/100,t[3]/100,1):(t=Rge.exec(e))?CD(t[1],t[2]/100,t[3]/100,t[4]):bD.hasOwnProperty(e)?jD(bD[e]):e==="transparent"?new Lr(NaN,NaN,NaN,0):null}function jD(e){return new Lr(e>>16&255,e>>8&255,e&255,1)}function Hm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lr(e,t,n,r)}function Ige(e){return e instanceof $h||(e=dh(e)),e?(e=e.rgb(),new Lr(e.r,e.g,e.b,e.opacity)):new Lr}function wj(e,t,n,r){return arguments.length===1?Ige(e):new Lr(e,t,n,r??1)}function Lr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Vk(Lr,wj,i6($h,{brighter(e){return e=e==null?xy:Math.pow(xy,e),new Lr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ch:Math.pow(ch,e),new Lr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lr(El(this.r),El(this.g),El(this.b),by(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:ND,formatHex:ND,formatHex8:Lge,formatRgb:kD,toString:kD}));function ND(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}`}function Lge(){return`#${bl(this.r)}${bl(this.g)}${bl(this.b)}${bl((isNaN(this.opacity)?1:this.opacity)*255)}`}function kD(){const e=by(this.opacity);return`${e===1?"rgb(":"rgba("}${El(this.r)}, ${El(this.g)}, ${El(this.b)}${e===1?")":`, ${e})`}`}function by(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function El(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bl(e){return e=El(e),(e<16?"0":"")+e.toString(16)}function CD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wi(e,t,n,r)}function a6(e){if(e instanceof Wi)return new Wi(e.h,e.s,e.l,e.opacity);if(e instanceof $h||(e=dh(e)),!e)return new Wi;if(e instanceof Wi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,u=a-i,d=(a+i)/2;return u?(t===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-t)/u+2:o=(t-n)/u+4,u/=d<.5?a+i:2-a-i,o*=60):u=d>0&&d<1?0:o,new Wi(o,u,d,e.opacity)}function $ge(e,t,n,r){return arguments.length===1?a6(e):new Wi(e,t,n,r??1)}function Wi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vk(Wi,$ge,i6($h,{brighter(e){return e=e==null?xy:Math.pow(xy,e),new Wi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ch:Math.pow(ch,e),new Wi(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 Lr(CS(e>=240?e-240:e+120,i,r),CS(e,i,r),CS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wi(_D(this.h),Gm(this.s),Gm(this.l),by(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=by(this.opacity);return`${e===1?"hsl(":"hsla("}${_D(this.h)}, ${Gm(this.s)*100}%, ${Gm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _D(e){return e=(e||0)%360,e<0?e+360:e}function Gm(e){return Math.max(0,Math.min(1,e||0))}function CS(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 Zk=e=>()=>e;function Bge(e,t){return function(n){return e+n*t}}function Uge(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 qge(e){return(e=+e)==1?s6:function(t,n){return n-t?Uge(t,n,e):Zk(isNaN(t)?n:t)}}function s6(e,t){var n=t-e;return n?Bge(e,n):Zk(isNaN(e)?t:e)}const AD=(function e(t){var n=qge(t);function r(i,a){var o=n((i=wj(i)).r,(a=wj(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=s6(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function Fge(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 Kge(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hge(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]=rd(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Gge(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function wy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vge(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]=rd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Sj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_S=new RegExp(Sj.source,"g");function Zge(e){return function(){return e}}function Yge(e){return function(t){return e(t)+""}}function Wge(e,t){var n=Sj.lastIndex=_S.lastIndex=0,r,i,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(r=Sj.exec(e))&&(i=_S.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,d.push({i:o,x:wy(r,i)})),n=_S.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?Yge(d[0].x):Zge(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function rd(e,t){var n=typeof t,r;return t==null||n==="boolean"?Zk(t):(n==="number"?wy:n==="string"?(r=dh(t))?(t=r,AD):Wge:t instanceof dh?AD:t instanceof Date?Gge:Kge(t)?Fge:Array.isArray(t)?Hge:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vge:wy)(e,t)}function Yk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Qge(e,t){t===void 0&&(t=e,e=rd);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var u=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[u](o-u)}}function Xge(e){return function(){return e}}function Sy(e){return+e}var OD=[0,1];function br(e){return e}function jj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Xge(isNaN(t)?NaN:.5)}function Jge(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function eye(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=jj(i,r),a=n(o,a)):(r=jj(r,i),a=n(a,o)),function(u){return a(r(u))}}function tye(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]=jj(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(u){var d=Lh(e,u,1,r)-1;return a[d](i[d](u))}}function Bh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function e0(){var e=OD,t=OD,n=rd,r,i,a,o=br,u,d,f;function p(){var y=Math.min(e.length,t.length);return o!==br&&(o=Jge(e[0],e[y-1])),u=y>2?tye:eye,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=u(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=u(t,e.map(r),wy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Sy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=Yk,p()},m.clamp=function(y){return arguments.length?(o=y?!0:br,p()):o!==br},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function Wk(){return e0()(br,br)}function nye(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jy(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 Du(e){return e=jy(Math.abs(e)),e?e[1]:NaN}function rye(e,t){return function(n,r){for(var i=n.length,a=[],o=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function iye(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var aye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fh(e){if(!(t=aye.exec(e)))throw new Error("invalid format: "+e);var t;return new Qk({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]})}fh.prototype=Qk.prototype;function Qk(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+""}Qk.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 sye(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 Ny;function oye(e,t){var n=jy(e,t);if(!n)return Ny=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Ny=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")+jy(e,Math.max(0,t+a-1))[0]}function ED(e,t){var n=jy(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 zD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:nye,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)=>ED(e*100,t),r:ED,s:oye,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function TD(e){return e}var PD=Array.prototype.map,RD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lye(e){var t=e.grouping===void 0||e.thousands===void 0?TD:rye(PD.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?TD:iye(PD.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=fh(m);var v=m.fill,w=m.align,S=m.sign,j=m.symbol,k=m.zero,O=m.width,_=m.comma,C=m.precision,T=m.trim,E=m.type;E==="n"?(_=!0,E="g"):zD[E]||(C===void 0&&(C=12),T=!0,E="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var A=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),P=(j==="$"?r:/[%p]/.test(E)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),$=zD[E],F=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function U(B){var V=A,ee=P,Q,K,te;if(E==="c")ee=$(B)+ee,B="";else{B=+B;var le=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),C),T&&(B=sye(B)),le&&+B==0&&S!=="+"&&(le=!1),V=(le?S==="("?S:u:S==="-"||S==="("?"":S)+V,ee=(E==="s"&&!isNaN(B)&&Ny!==void 0?RD[8+Ny/3]:"")+ee+(le&&S==="("?")":""),F){for(Q=-1,K=B.length;++Q<K;)if(te=B.charCodeAt(Q),48>te||te>57){ee=(te===46?i+B.slice(Q+1):B.slice(Q))+ee,B=B.slice(0,Q);break}}}_&&!k&&(B=t(B,1/0));var je=V.length+B.length+ee.length,L=je<O?new Array(O-je+1).join(v):"";switch(_&&k&&(B=t(L+B,L.length?O-ee.length:1/0),L=""),w){case"<":B=V+B+ee+L;break;case"=":B=V+L+B+ee;break;case"^":B=L.slice(0,je=L.length>>1)+V+B+ee+L.slice(je);break;default:B=L+V+B+ee;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(Du(y)/3)))*3,w=Math.pow(10,-v),S=f((m=fh(m),m.type="f",m),{suffix:RD[8+v/3]});return function(j){return S(w*j)}}return{format:f,formatPrefix:p}}var Vm,Xk,o6;cye({thousands:",",grouping:[3],currency:["$",""]});function cye(e){return Vm=lye(e),Xk=Vm.format,o6=Vm.formatPrefix,Vm}function uye(e){return Math.max(0,-Du(Math.abs(e)))}function dye(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Du(t)/3)))*3-Du(Math.abs(e)))}function fye(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Du(t)-Du(e))+1}function l6(e,t,n,r){var i=xj(e,t,n),a;switch(r=fh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=dye(i,o))&&(r.precision=a),o6(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=fye(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=uye(i))&&(r.precision=a-(r.type==="%")*2);break}}return Xk(r)}function Ro(e){var t=e.domain;return e.ticks=function(n){var r=t();return yj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return l6(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],u=r[a],d,f,p=10;for(u<o&&(f=o,o=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=vj(o,u,n),f===d)return r[i]=o,r[a]=u,t(r);if(f>0)o=Math.floor(o/f)*f,u=Math.ceil(u/f)*f;else if(f<0)o=Math.ceil(o*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function c6(){var e=Wk();return e.copy=function(){return Bh(e,c6())},Ii.apply(e,arguments),Ro(e)}function u6(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,Sy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return u6(e).unknown(t)},e=arguments.length?Array.from(e,Sy):[0,1],Ro(n)}function d6(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 DD(e){return Math.log(e)}function MD(e){return Math.exp(e)}function hye(e){return-Math.log(-e)}function pye(e){return-Math.exp(-e)}function mye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gye(e){return e===10?mye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function yye(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 ID(e){return(t,n)=>-e(-t,n)}function Jk(e){const t=e(DD,MD),n=t.domain;let r=10,i,a;function o(){return i=yye(r),a=gye(r),n()[0]<0?(i=ID(i),a=ID(a),e(hye,pye)):e(DD,MD),t}return t.base=function(u){return arguments.length?(r=+u,o()):r},t.domain=function(u){return arguments.length?(n(u),o()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let y=i(f),v=i(p),w,S;const j=u==null?10:+u;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(w=1;w<r;++w)if(S=y<0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;k.push(S)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(S=y>0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;k.push(S)}k.length*2<j&&(k=yj(f,p,j))}else k=yj(y,v,Math.min(v-y,j)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=fh(d)).precision==null&&(d.trim=!0),d=Xk(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(d6(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function f6(){const e=Jk(e0()).domain([1,10]);return e.copy=()=>Bh(e,f6()).base(e.base()),Ii.apply(e,arguments),e}function LD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $D(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function eC(e){var t=1,n=e(LD(t),$D(t));return n.constant=function(r){return arguments.length?e(LD(t=+r),$D(t)):t},Ro(n)}function h6(){var e=eC(e0());return e.copy=function(){return Bh(e,h6()).constant(e.constant())},Ii.apply(e,arguments)}function BD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vye(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xye(e){return e<0?-e*e:e*e}function tC(e){var t=e(br,br),n=1;function r(){return n===1?e(br,br):n===.5?e(vye,xye):e(BD(n),BD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ro(t)}function nC(){var e=tC(e0());return e.copy=function(){return Bh(e,nC()).exponent(e.exponent())},Ii.apply(e,arguments),e}function bye(){return nC.apply(null,arguments).exponent(.5)}function UD(e){return Math.sign(e)*e*e}function wye(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function p6(){var e=Wk(),t=[0,1],n=!1,r;function i(a){var o=wye(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(UD(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,Sy)).map(UD)),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 p6(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ii.apply(i,arguments),Ro(i)}function m6(){var e=[],t=[],n=[],r;function i(){var o=0,u=Math.max(1,t.length);for(n=new Array(u-1);++o<u;)n[o-1]=kge(e,o/u);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Lh(n,o)]}return a.invertExtent=function(o){var u=t.indexOf(o);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let u of o)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(wo),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 m6().domain(e).range(t).unknown(r)},Ii.apply(a,arguments)}function g6(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[Lh(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return g6().domain([e,t]).range(i).unknown(a)},Ii.apply(Ro(o),arguments)}function y6(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Lh(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 y6().domain(e).range(t).unknown(n)},Ii.apply(i,arguments)}const AS=new Date,OS=new Date;function Un(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<o);return d},i.filter=a=>Un(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(AS.setTime(+a),OS.setTime(+o),e(AS),e(OS),Math.floor(n(AS,OS))),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 ky=Un(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ky.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Un(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ky);ky.range;const ls=1e3,Ci=ls*60,cs=Ci*60,ps=cs*24,rC=ps*7,qD=ps*30,ES=ps*365,wl=Un(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ls)},(e,t)=>(t-e)/ls,e=>e.getUTCSeconds());wl.range;const iC=Un(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls)},(e,t)=>{e.setTime(+e+t*Ci)},(e,t)=>(t-e)/Ci,e=>e.getMinutes());iC.range;const aC=Un(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ci)},(e,t)=>(t-e)/Ci,e=>e.getUTCMinutes());aC.range;const sC=Un(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls-e.getMinutes()*Ci)},(e,t)=>{e.setTime(+e+t*cs)},(e,t)=>(t-e)/cs,e=>e.getHours());sC.range;const oC=Un(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*cs)},(e,t)=>(t-e)/cs,e=>e.getUTCHours());oC.range;const Uh=Un(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ci)/ps,e=>e.getDate()-1);Uh.range;const t0=Un(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ps,e=>e.getUTCDate()-1);t0.range;const v6=Un(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ps,e=>Math.floor(e/ps));v6.range;function nc(e){return Un(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())*Ci)/rC)}const n0=nc(0),Cy=nc(1),Sye=nc(2),jye=nc(3),Mu=nc(4),Nye=nc(5),kye=nc(6);n0.range;Cy.range;Sye.range;jye.range;Mu.range;Nye.range;kye.range;function rc(e){return Un(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)/rC)}const r0=rc(0),_y=rc(1),Cye=rc(2),_ye=rc(3),Iu=rc(4),Aye=rc(5),Oye=rc(6);r0.range;_y.range;Cye.range;_ye.range;Iu.range;Aye.range;Oye.range;const lC=Un(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());lC.range;const cC=Un(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());cC.range;const ms=Un(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());ms.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Un(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)});ms.range;const gs=Un(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());gs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Un(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)});gs.range;function x6(e,t,n,r,i,a){const o=[[wl,1,ls],[wl,5,5*ls],[wl,15,15*ls],[wl,30,30*ls],[a,1,Ci],[a,5,5*Ci],[a,15,15*Ci],[a,30,30*Ci],[i,1,cs],[i,3,3*cs],[i,6,6*cs],[i,12,12*cs],[r,1,ps],[r,2,2*ps],[n,1,rC],[t,1,qD],[t,3,3*qD],[e,1,ES]];function u(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return y?w.reverse():w}function d(f,p,m){const y=Math.abs(p-f)/m,v=Kk(([,,j])=>j).right(o,y);if(v===o.length)return e.every(xj(f/ES,p/ES,m));if(v===0)return ky.every(Math.max(xj(f,p,m),1));const[w,S]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return w.every(S)}return[u,d]}const[Eye,zye]=x6(gs,cC,r0,v6,oC,aC),[Tye,Pye]=x6(ms,lC,n0,Uh,sC,iC);function zS(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 TS(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 bf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Rye(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,u=e.months,d=e.shortMonths,f=wf(i),p=Sf(i),m=wf(a),y=Sf(a),v=wf(o),w=Sf(o),S=wf(u),j=Sf(u),k=wf(d),O=Sf(d),_={a:te,A:le,b:je,B:L,c:null,d:ZD,e:ZD,f:rve,g:hve,G:mve,H:eve,I:tve,j:nve,L:b6,m:ive,M:ave,p:I,q,Q:QD,s:XD,S:sve,u:ove,U:lve,V:cve,w:uve,W:dve,x:null,X:null,y:fve,Y:pve,Z:gve,"%":WD},C={a:R,A:G,b:ie,B:ne,c:null,d:YD,e:YD,f:bve,g:Eve,G:Tve,H:yve,I:vve,j:xve,L:S6,m:wve,M:Sve,p:Ce,q:Se,Q:QD,s:XD,S:jve,u:Nve,U:kve,V:Cve,w:_ve,W:Ave,x:null,X:null,y:Ove,Y:zve,Z:Pve,"%":WD},T={a:F,A:U,b:B,B:V,c:ee,d:GD,e:GD,f:Wye,g:HD,G:KD,H:VD,I:VD,j:Gye,L:Yye,m:Hye,M:Vye,p:$,q:Kye,Q:Xye,s:Jye,S:Zye,u:$ye,U:Bye,V:Uye,w:Lye,W:qye,x:Q,X:K,y:HD,Y:KD,Z:Fye,"%":Qye};_.x=E(n,_),_.X=E(r,_),_.c=E(t,_),C.x=E(n,C),C.X=E(r,C),C.c=E(t,C);function E(J,pe){return function(Oe){var W=[],Fe=-1,Te=0,it=J.length,Ze,Lt,Rt;for(Oe instanceof Date||(Oe=new Date(+Oe));++Fe<it;)J.charCodeAt(Fe)===37&&(W.push(J.slice(Te,Fe)),(Lt=FD[Ze=J.charAt(++Fe)])!=null?Ze=J.charAt(++Fe):Lt=Ze==="e"?" ":"0",(Rt=pe[Ze])&&(Ze=Rt(Oe,Lt)),W.push(Ze),Te=Fe+1);return W.push(J.slice(Te,Fe)),W.join("")}}function A(J,pe){return function(Oe){var W=bf(1900,void 0,1),Fe=P(W,J,Oe+="",0),Te,it;if(Fe!=Oe.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(pe&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=TS(bf(W.y,0,1)),it=Te.getUTCDay(),Te=it>4||it===0?_y.ceil(Te):_y(Te),Te=t0.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=zS(bf(W.y,0,1)),it=Te.getDay(),Te=it>4||it===0?Cy.ceil(Te):Cy(Te),Te=Uh.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),it="Z"in W?TS(bf(W.y,0,1)).getUTCDay():zS(bf(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(it+5)%7:W.w+W.U*7-(it+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,TS(W)):zS(W)}}function P(J,pe,Oe,W){for(var Fe=0,Te=pe.length,it=Oe.length,Ze,Lt;Fe<Te;){if(W>=it)return-1;if(Ze=pe.charCodeAt(Fe++),Ze===37){if(Ze=pe.charAt(Fe++),Lt=T[Ze in FD?pe.charAt(Fe++):Ze],!Lt||(W=Lt(J,Oe,W))<0)return-1}else if(Ze!=Oe.charCodeAt(W++))return-1}return W}function $(J,pe,Oe){var W=f.exec(pe.slice(Oe));return W?(J.p=p.get(W[0].toLowerCase()),Oe+W[0].length):-1}function F(J,pe,Oe){var W=v.exec(pe.slice(Oe));return W?(J.w=w.get(W[0].toLowerCase()),Oe+W[0].length):-1}function U(J,pe,Oe){var W=m.exec(pe.slice(Oe));return W?(J.w=y.get(W[0].toLowerCase()),Oe+W[0].length):-1}function B(J,pe,Oe){var W=k.exec(pe.slice(Oe));return W?(J.m=O.get(W[0].toLowerCase()),Oe+W[0].length):-1}function V(J,pe,Oe){var W=S.exec(pe.slice(Oe));return W?(J.m=j.get(W[0].toLowerCase()),Oe+W[0].length):-1}function ee(J,pe,Oe){return P(J,t,pe,Oe)}function Q(J,pe,Oe){return P(J,n,pe,Oe)}function K(J,pe,Oe){return P(J,r,pe,Oe)}function te(J){return o[J.getDay()]}function le(J){return a[J.getDay()]}function je(J){return d[J.getMonth()]}function L(J){return u[J.getMonth()]}function I(J){return i[+(J.getHours()>=12)]}function q(J){return 1+~~(J.getMonth()/3)}function R(J){return o[J.getUTCDay()]}function G(J){return a[J.getUTCDay()]}function ie(J){return d[J.getUTCMonth()]}function ne(J){return u[J.getUTCMonth()]}function Ce(J){return i[+(J.getUTCHours()>=12)]}function Se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var pe=E(J+="",_);return pe.toString=function(){return J},pe},parse:function(J){var pe=A(J+="",!1);return pe.toString=function(){return J},pe},utcFormat:function(J){var pe=E(J+="",C);return pe.toString=function(){return J},pe},utcParse:function(J){var pe=A(J+="",!0);return pe.toString=function(){return J},pe}}}var FD={"-":"",_:" ",0:"0"},Yn=/^\s*\d+/,Dye=/^%/,Mye=/[\\^$*+?|[\]().{}]/g;function _t(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 Iye(e){return e.replace(Mye,"\\$&")}function wf(e){return new RegExp("^(?:"+e.map(Iye).join("|")+")","i")}function Sf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Lye(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $ye(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Bye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Uye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function qye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KD(e,t,n){var r=Yn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function HD(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Fye(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 Kye(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Hye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function GD(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Gye(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function VD(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Vye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Zye(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Yye(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Wye(e,t,n){var r=Yn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Qye(e,t,n){var r=Dye.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Xye(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Jye(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ZD(e,t){return _t(e.getDate(),t,2)}function eve(e,t){return _t(e.getHours(),t,2)}function tve(e,t){return _t(e.getHours()%12||12,t,2)}function nve(e,t){return _t(1+Uh.count(ms(e),e),t,3)}function b6(e,t){return _t(e.getMilliseconds(),t,3)}function rve(e,t){return b6(e,t)+"000"}function ive(e,t){return _t(e.getMonth()+1,t,2)}function ave(e,t){return _t(e.getMinutes(),t,2)}function sve(e,t){return _t(e.getSeconds(),t,2)}function ove(e){var t=e.getDay();return t===0?7:t}function lve(e,t){return _t(n0.count(ms(e)-1,e),t,2)}function w6(e){var t=e.getDay();return t>=4||t===0?Mu(e):Mu.ceil(e)}function cve(e,t){return e=w6(e),_t(Mu.count(ms(e),e)+(ms(e).getDay()===4),t,2)}function uve(e){return e.getDay()}function dve(e,t){return _t(Cy.count(ms(e)-1,e),t,2)}function fve(e,t){return _t(e.getFullYear()%100,t,2)}function hve(e,t){return e=w6(e),_t(e.getFullYear()%100,t,2)}function pve(e,t){return _t(e.getFullYear()%1e4,t,4)}function mve(e,t){var n=e.getDay();return e=n>=4||n===0?Mu(e):Mu.ceil(e),_t(e.getFullYear()%1e4,t,4)}function gve(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+_t(t/60|0,"0",2)+_t(t%60,"0",2)}function YD(e,t){return _t(e.getUTCDate(),t,2)}function yve(e,t){return _t(e.getUTCHours(),t,2)}function vve(e,t){return _t(e.getUTCHours()%12||12,t,2)}function xve(e,t){return _t(1+t0.count(gs(e),e),t,3)}function S6(e,t){return _t(e.getUTCMilliseconds(),t,3)}function bve(e,t){return S6(e,t)+"000"}function wve(e,t){return _t(e.getUTCMonth()+1,t,2)}function Sve(e,t){return _t(e.getUTCMinutes(),t,2)}function jve(e,t){return _t(e.getUTCSeconds(),t,2)}function Nve(e){var t=e.getUTCDay();return t===0?7:t}function kve(e,t){return _t(r0.count(gs(e)-1,e),t,2)}function j6(e){var t=e.getUTCDay();return t>=4||t===0?Iu(e):Iu.ceil(e)}function Cve(e,t){return e=j6(e),_t(Iu.count(gs(e),e)+(gs(e).getUTCDay()===4),t,2)}function _ve(e){return e.getUTCDay()}function Ave(e,t){return _t(_y.count(gs(e)-1,e),t,2)}function Ove(e,t){return _t(e.getUTCFullYear()%100,t,2)}function Eve(e,t){return e=j6(e),_t(e.getUTCFullYear()%100,t,2)}function zve(e,t){return _t(e.getUTCFullYear()%1e4,t,4)}function Tve(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Iu(e):Iu.ceil(e),_t(e.getUTCFullYear()%1e4,t,4)}function Pve(){return"+0000"}function WD(){return"%"}function QD(e){return+e}function XD(e){return Math.floor(+e/1e3)}var Yc,N6,k6;Rve({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 Rve(e){return Yc=Rye(e),N6=Yc.format,Yc.parse,k6=Yc.utcFormat,Yc.utcParse,Yc}function Dve(e){return new Date(e)}function Mve(e){return e instanceof Date?+e:+new Date(+e)}function uC(e,t,n,r,i,a,o,u,d,f){var p=Wk(),m=p.invert,y=p.domain,v=f(".%L"),w=f(":%S"),S=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),O=f("%b %d"),_=f("%B"),C=f("%Y");function T(E){return(d(E)<E?v:u(E)<E?w:o(E)<E?S:a(E)<E?j:r(E)<E?i(E)<E?k:O:n(E)<E?_:C)(E)}return p.invert=function(E){return new Date(m(E))},p.domain=function(E){return arguments.length?y(Array.from(E,Mve)):y().map(Dve)},p.ticks=function(E){var A=y();return e(A[0],A[A.length-1],E??10)},p.tickFormat=function(E,A){return A==null?T:f(A)},p.nice=function(E){var A=y();return(!E||typeof E.range!="function")&&(E=t(A[0],A[A.length-1],E??10)),E?y(d6(A,E)):p},p.copy=function(){return Bh(p,uC(e,t,n,r,i,a,o,u,d,f))},p}function Ive(){return Ii.apply(uC(Tye,Pye,ms,lC,n0,Uh,sC,iC,wl,N6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Lve(){return Ii.apply(uC(Eye,zye,gs,cC,r0,t0,oC,aC,wl,k6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function i0(){var e=0,t=1,n,r,i,a,o=br,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(o=m,f):o};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,o=m(v,w),f):[o(0),o(1)]}}return f.range=p(rd),f.rangeRound=p(Yk),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 Do(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function C6(){var e=Ro(i0()(br));return e.copy=function(){return Do(e,C6())},ws.apply(e,arguments)}function _6(){var e=Jk(i0()).domain([1,10]);return e.copy=function(){return Do(e,_6()).base(e.base())},ws.apply(e,arguments)}function A6(){var e=eC(i0());return e.copy=function(){return Do(e,A6()).constant(e.constant())},ws.apply(e,arguments)}function dC(){var e=tC(i0());return e.copy=function(){return Do(e,dC()).exponent(e.exponent())},ws.apply(e,arguments)}function $ve(){return dC.apply(null,arguments).exponent(.5)}function O6(){var e=[],t=br;function n(r){if(r!=null&&!isNaN(r=+r))return t((Lh(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(wo),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)=>Nge(e,a/r))},n.copy=function(){return O6(t).domain(e)},ws.apply(n,arguments)}function a0(){var e=0,t=.5,n=1,r=1,i,a,o,u,d,f=br,p,m=!1,y;function v(S){return isNaN(S=+S)?y:(S=.5+((S=+p(S))-a)*(r*S<r*a?u:d),f(m?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),a=p(t=+t),o=p(n=+n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(m=!!S,v):m},v.interpolator=function(S){return arguments.length?(f=S,v):f};function w(S){return function(j){var k,O,_;return arguments.length?([k,O,_]=j,f=Qge(S,[k,O,_]),v):[f(0),f(.5),f(1)]}}return v.range=w(rd),v.rangeRound=w(Yk),v.unknown=function(S){return arguments.length?(y=S,v):y},function(S){return p=S,i=S(e),a=S(t),o=S(n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function E6(){var e=Ro(a0()(br));return e.copy=function(){return Do(e,E6())},ws.apply(e,arguments)}function z6(){var e=Jk(a0()).domain([.1,1,10]);return e.copy=function(){return Do(e,z6()).base(e.base())},ws.apply(e,arguments)}function T6(){var e=eC(a0());return e.copy=function(){return Do(e,T6()).constant(e.constant())},ws.apply(e,arguments)}function fC(){var e=tC(a0());return e.copy=function(){return Do(e,fC()).exponent(e.exponent())},ws.apply(e,arguments)}function Bve(){return fC.apply(null,arguments).exponent(.5)}const P6=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Gk,scaleDiverging:E6,scaleDivergingLog:z6,scaleDivergingPow:fC,scaleDivergingSqrt:Bve,scaleDivergingSymlog:T6,scaleIdentity:u6,scaleImplicit:bj,scaleLinear:c6,scaleLog:f6,scaleOrdinal:Hk,scalePoint:_ge,scalePow:nC,scaleQuantile:m6,scaleQuantize:g6,scaleRadial:p6,scaleSequential:C6,scaleSequentialLog:_6,scaleSequentialPow:dC,scaleSequentialQuantile:O6,scaleSequentialSqrt:$ve,scaleSequentialSymlog:A6,scaleSqrt:bye,scaleSymlog:h6,scaleThreshold:y6,scaleTime:Ive,scaleUtc:Lve,tickFormat:l6},Symbol.toStringTag,{value:"Module"}));function Uve(e){var t=P6;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Oh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function JD(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Uve(e);if(r!=null)return r.domain(t).range(n),r}}function hC(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?JD(e.scale,n,r):JD(t,n,r)}function qve(e){return"scale".concat(Oh(e))}function Fve(e){return qve(e)in P6}var R6=(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 Fve(r)?r:"point"}};function Kve(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 D6(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,u,d=Kve(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function Hve(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):D6(e,void 0)}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ay(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){Gve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gve(e,t,n){return(t=Vve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vve(e){var t=Zve(e,"string");return typeof t=="symbol"?t:t+""}function Zve(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 Nj=[0,"auto"],Ln={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"},M6=(e,t)=>e.cartesianAxis.xAxis[t],Ra=(e,t)=>{var n=M6(e,t);return n??Ln},$n={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Nj,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:Th},I6=(e,t)=>e.cartesianAxis.yAxis[t],Da=(e,t)=>{var n=I6(e,t);return n??$n},Yve={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:""},pC=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Yve},Cr=(e,t,n)=>{switch(t){case"xAxis":return Ra(e,n);case"yAxis":return Da(e,n);case"zAxis":return pC(e,n);case"angleAxis":return Lk(e,n);case"radiusAxis":return $k(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Wve=(e,t,n)=>{switch(t){case"xAxis":return Ra(e,n);case"yAxis":return Da(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},qh=(e,t,n)=>{switch(t){case"xAxis":return Ra(e,n);case"yAxis":return Da(e,n);case"angleAxis":return Lk(e,n);case"radiusAxis":return $k(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},L6=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function $6(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 B6=e=>e.graphicalItems.cartesianItems,Qve=oe([Vn,Qv],$6),U6=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),id=oe([B6,Cr,Qve],U6,{memoizeOptions:{resultEqualityCheck:Jv}}),q6=oe([id],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(qk)),F6=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Xve=oe([id],F6),K6=e=>e.map(t=>t.data).filter(Boolean).flat(1),Jve=oe([id],e=>e.some(t=>!t.data)),H6=oe([id],K6,{memoizeOptions:{resultEqualityCheck:Jv}}),G6=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},mC=oe([H6,Gv],G6),e0e=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Gn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Gn(i,r)}))):e.map(r=>({value:r})),V6=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:u,dataEndIndex:d}=r,f=e0e(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(u,d+1),m=p.map(y=>({value:Gn(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},Fh=oe([mC,Cr,id,Gv,Jve,H6],V6);function wu(e){if(zi(e)||e instanceof Date){var t=Number(e);if(st(t))return t}}function tM(e){if(Array.isArray(e)){var t=[wu(e[0]),wu(e[1])];return ja(t)?t:void 0}var n=wu(e);if(n!=null)return[n,n]}function za(e){return e.map(wu).filter(Ir)}function t0e(e,t){var n=wu(e),r=wu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var n0e=oe([Fh],e=>e?.map(t=>t.value).sort(t0e));function Z6(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function r0e(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Aa(t))r=t;else if(Array.isArray(t)){var i=za(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:za(n.flatMap(a=>{var o=Gn(e,a.dataKey),u,d;if(Array.isArray(o)?[u,d]=o:u=d=o,!(!st(u)||!st(d)))return[r-u,r+d]}))}var qn=e=>{var t=Zn(e),n=nd(e);return qh(e,t,n)},Lu=oe([qn],e=>e?.dataKey),i0e=oe([q6,Gv,qn],JB),Y6=(e,t,n,r)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var d=o[u.stackId];return d==null&&(d=[]),d.push(u),o[u.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[u,d]=o,f=r?[...d].reverse():d,p=f.map(Uk);return[u,{stackedData:Ife(e,p,n),graphicalItems:f}]}))},W6=oe([i0e,q6,Vv,GB],Y6),Q6=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Ufe(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},a0e=oe([Cr],e=>e.allowDataOverflow),gC=e=>{var t;if(e==null||!("domain"in e))return Nj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=za(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:Nj},X6=oe([Cr],gC),J6=oe([X6,a0e],DB),s0e=oe([W6,ra,Vn,J6],Q6,{memoizeOptions:{resultEqualityCheck:Xv}}),yC=e=>e.errorBars,o0e=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Z6(n,r)),Oy=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),u=Math.max(...a);return[o,u]}},eU=function(t,n,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>Z6(a,v));m.forEach(v=>{var w,S=Gn(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=r0e(v,S,y);if(j.length>=2){var k=Math.min(...j),O=Math.max(...j);(u==null||k<u)&&(u=k),(d==null||O>d)&&(d=O)}var _=tM(S);_!=null&&(u=u==null?_[0]:Math.min(u,_[0]),d=d==null?_[1]:Math.max(d,_[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=tM(Gn(f,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),st(u)&&st(d))return[u,d]},l0e=oe([mC,Cr,Xve,yC,Vn,Wme],eU,{memoizeOptions:{resultEqualityCheck:Xv}});function c0e(e){var{value:t}=e;if(zi(t)||t instanceof Date)return t}var u0e=(e,t,n)=>{var r=e.map(c0e).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&c3(r))?RB(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},tU=e=>e.referenceElements.dots,ad=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),d0e=oe([tU,Vn,Qv],ad),nU=e=>e.referenceElements.areas,f0e=oe([nU,Vn,Qv],ad),rU=e=>e.referenceElements.lines,h0e=oe([rU,Vn,Qv],ad),iU=(e,t)=>{if(e!=null){var n=za(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},p0e=oe(d0e,Vn,iU),aU=(e,t)=>{if(e!=null){var n=za(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)]}},m0e=oe([f0e,Vn],aU);function g0e(e){var t;if(e.x!=null)return za([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:za(n)}function y0e(e){var t;if(e.y!=null)return za([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:za(n)}var sU=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?g0e(r):y0e(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},v0e=oe([h0e,Vn],sU),x0e=oe(p0e,v0e,m0e,(e,t,n)=>Oy(e,n,t)),oU=(e,t,n,r,i,a,o,u)=>{if(n!=null)return n;var d=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",f=d?Oy(r,a,i):Oy(a,i);return Xme(t,f,e.allowDataOverflow)},b0e=oe([Cr,X6,J6,s0e,l0e,x0e,sn,Vn],oU,{memoizeOptions:{resultEqualityCheck:Xv}}),w0e=[0,1],lU=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:u,type:d}=e,f=Pa(t,a);if(f&&u==null){var p;return RB(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?u0e(r,e,f):i==="expand"&&!f?w0e:o}},vC=oe([Cr,sn,mC,Fh,Vv,Vn,b0e],lU),sd=oe([Cr,L6,Dk],R6),cU=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=gC(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ja(e)){if(a)return dD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return fD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ja(e))return dD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ja(e))return fD(e,t.tickCount,t.allowDecimals,"adaptive")}}},xC=oe([vC,qh,sd],cU),uU=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ja(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,u),Math.max(d,f)]}return t},S0e=oe([Cr,vC,xC,Vn],uU),j0e=oe(Fh,Cr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(za(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],f=r[u+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/o}}),dU=oe(j0e,sn,rge,ar,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!st(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=_o(n,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),N0e=(e,t,n)=>{var r=Ra(e,t);return r==null||typeof r.padding!="string"?0:dU(e,"xAxis",t,n,r.padding)},k0e=(e,t,n)=>{var r=Da(e,t);return r==null||typeof r.padding!="string"?0:dU(e,"yAxis",t,n,r.padding)},C0e=oe(Ra,N0e,(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}}),_0e=oe(Da,k0e,(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}}),A0e=oe([ar,C0e,qv,Uv,(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]}),O0e=oe([ar,sn,_0e,qv,Uv,(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]}),Kh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return A0e(e,n,r);case"yAxis":return O0e(e,n,r);case"zAxis":return(i=pC(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return WB(e);case"radiusAxis":return QB(e,n);default:return}},fU=oe([Cr,Kh],Zv),E0e=oe([sd,S0e],fge),bC=oe([Cr,sd,E0e,fU],hC),hU=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Pa(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},wC=oe([sn,Fh,qh,Vn],hU),$u=oe([bC],Fk);oe([bC],Hve);oe([bC,n0e],D6);oe([id,yC,Vn],o0e);function pU(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var s0=(e,t)=>t,o0=(e,t,n)=>n,z0e=oe($v,s0,o0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(pU)),T0e=oe(Bv,s0,o0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(pU)),mU=(e,t)=>({width:e.width,height:t.height}),P0e=(e,t)=>{var n=typeof t.width=="number"?t.width:Th;return{width:n,height:e.height}},R0e=oe(ar,Ra,mU),D0e=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},M0e=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},I0e=oe(bs,ar,z0e,s0,o0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=mU(t,u);o==null&&(o=D0e(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),L0e=oe(xs,ar,T0e,s0,o0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=P0e(t,u);o==null&&(o=M0e(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),$0e=(e,t)=>{var n=Ra(e,t);if(n!=null)return I0e(e,n.orientation,n.mirror)},B0e=oe([ar,Ra,$0e,(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}}}),U0e=(e,t)=>{var n=Da(e,t);if(n!=null)return L0e(e,n.orientation,n.mirror)},q0e=oe([ar,Da,U0e,(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}}}),F0e=oe(ar,Da,(e,t)=>{var n=typeof t.width=="number"?t.width:Th;return{width:n,height:e.height}}),gU=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,u=Pa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&u&&a==="category"&&i&&c3(f))return d}},SC=oe([sn,Fh,Cr,Vn],gU),nM=oe([sn,Wve,sd,$u,SC,wC,Kh,xC,Vn],(e,t,n,r,i,a,o,u,d)=>{if(t!=null){var f=Pa(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:u,range:o,realScaleType:n,scale:r}}}),K0e=(e,t,n,r,i,a,o,u,d)=>{if(!(t==null||r==null)){var f=Pa(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?Ni(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,k)=>{var O=o?o.indexOf(j):j,_=r.map(O);return st(_)?{index:k,coordinate:_+w,value:j,offset:w}:null}).filter(Ir):f&&u?u.map((j,k)=>{var O=r.map(j);return st(O)?{coordinate:O+w,value:j,index:k,offset:w}:null}).filter(Ir):r.ticks?r.ticks(y).map((j,k)=>{var O=r.map(j);return st(O)?{coordinate:O+w,value:j,index:k,offset:w}:null}).filter(Ir):r.domain().map((j,k)=>{var O=r.map(j);return st(O)?{coordinate:O+w,value:o?o[j]:j,index:k,offset:w}:null}).filter(Ir)}},yU=oe([sn,qh,sd,$u,xC,Kh,SC,wC,Vn],K0e),H0e=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Pa(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?Ni(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var y=n.map(p);return st(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Ir):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return st(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Ir):n.domain().map((p,m)=>{var y=n.map(p);return st(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Ir)}},vU=oe([sn,qh,$u,Kh,SC,wC,Vn],H0e),xU=oe(Cr,$u,(e,t)=>{if(!(e==null||t==null))return Ay(Ay({},e),{},{scale:t})}),G0e=oe([Cr,sd,vC,fU],hC),V0e=oe([G0e],Fk);oe((e,t,n)=>pC(e,n),V0e,(e,t)=>{if(!(e==null||t==null))return Ay(Ay({},e),{},{scale:t})});var Z0e=oe([sn,$v,Bv],(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}}),Y0e=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};oe([Y0e],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 bU=e=>e.options.defaultTooltipEventType,wU=e=>e.options.validateTooltipEventTypes;function SU(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Hh(e,t){var n=bU(e),r=wU(e);return SU(t,n,r)}function W0e(e){return Ue(t=>Hh(t,e))}var jU=(e,t)=>{var n,r=Number(t);if(!(Aa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Q0e=e=>e.tooltip.settings,oo={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},X0e={itemInteraction:{click:oo,hover:oo},axisInteraction:{click:oo,hover:oo},keyboardInteraction:oo,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}},NU=mr({name:"tooltip",initialState:X0e,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Xt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Xt()},removeTooltipEntrySettings:{reducer(e,t){var n=ki(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Xt()},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:J0e,replaceTooltipEntrySettings:exe,removeTooltipEntrySettings:txe,setTooltipSettingsState:nxe,setActiveMouseOverItemIndex:rxe,mouseLeaveItem:XCe,mouseLeaveChart:kU,setActiveClickItemIndex:JCe,setMouseOverAxisIndex:CU,setMouseClickAxisIndex:ixe,setSyncInteraction:Of,setKeyboardInteraction:Ey}=NU.actions,axe=NU.reducer;function rM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rM(Object(n),!0).forEach(function(r){sxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sxe(e,t,n){return(t=oxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oxe(e){var t=lxe(e,"string");return typeof t=="symbol"?t:t+""}function lxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cxe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function uxe(e){return e.index!=null}var _U=(e,t,n,r)=>{if(t==null)return oo;var i=cxe(e,t,n);if(i==null)return oo;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(uxe(i)){if(a)return Zm(Zm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Zm(Zm({},oo),{},{coordinate:i.coordinate})};function dxe(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 fxe(e,t){var n=dxe(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 hxe(e,t,n){if(n==null||t==null)return!0;var r=Gn(e,t);return r==null||!ja(n)?!0:fxe(r,n)}var Bf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!st(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(o,Math.min(a,u)),f=t[d];return f==null||hxe(f,n,r)?String(d):null},AU=(e,t,n,r,i,a,o)=>{if(a!=null){var u=o[0],d=u?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},OU=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},EU=e=>e.options.tooltipPayloadSearcher,od=e=>e.tooltip;function iM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){pxe(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 pxe(e,t,n){return(t=mxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mxe(e){var t=gxe(e,"string");return typeof t=="symbol"?t:t+""}function gxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yxe(e){if(typeof e=="string"||typeof e=="number")return e}function vxe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function xxe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function sM(e){if(typeof e=="string")return e}function bxe(e){if(!(e==null||typeof e!="object")){var t="name"in e?yxe(e.name):void 0,n="unit"in e?vxe(e.unit):void 0,r="dataKey"in e?xxe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?sM(e.color):void 0,o="fill"in e?sM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function wxe(e,t){return e??t}var zU=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:S,settings:j}=v,k=wxe(S,u),O=Array.isArray(k)?sB(k,f,p):k,_=(w=j?.dataKey)!==null&&w!==void 0?w:r,C=j?.nameKey,T;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&o==="axis"?T=u3(O,r,i):T=a(O,t,d,C),Array.isArray(T))T.forEach(A=>{var P,$,F=bxe(A),U=F?.name,B=F?.dataKey,V=F?.payload,ee=aM(aM({},j),{},{name:U,unit:F?.unit,color:(P=F?.color)!==null&&P!==void 0?P:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});y.push(JP({tooltipEntrySettings:ee,dataKey:B,payload:V,value:Gn(V,B),name:U==null?void 0:String(U)}))});else{var E;y.push(JP({tooltipEntrySettings:j,dataKey:_,payload:T,value:Gn(T,_),name:(E=Gn(T,C))!==null&&E!==void 0?E:j?.name}))}return y},m)}},jC=oe([qn,L6,Dk],R6),Sxe=oe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),jxe=oe([Zn,nd],$6),ic=oe([Sxe,qn,jxe],U6,{memoizeOptions:{resultEqualityCheck:Jv}}),Nxe=oe([ic],e=>e.filter(qk)),TU=oe([ic],K6,{memoizeOptions:{resultEqualityCheck:Jv}}),kxe=oe([ic],e=>e.some(t=>!t.data)),Hl=oe([TU,ra],G6),Cxe=oe([Nxe,ra,qn],JB),NC=oe([Hl,qn,ic,ra,kxe,TU],V6),PU=oe([qn],gC),_xe=oe([qn],e=>e.allowDataOverflow),RU=oe([PU,_xe],DB),Axe=oe([ic],e=>e.filter(qk)),Oxe=oe([Cxe,Axe,Vv,GB],Y6),Exe=oe([Oxe,ra,Zn,RU],Q6),zxe=oe([ic],F6),Txe=oe([Hl,qn,zxe,yC,Zn,Qme],eU,{memoizeOptions:{resultEqualityCheck:Xv}}),Pxe=oe([tU,Zn,nd],ad),Rxe=oe([Pxe,Zn],iU),Dxe=oe([nU,Zn,nd],ad),Mxe=oe([Dxe,Zn],aU),Ixe=oe([rU,Zn,nd],ad),Lxe=oe([Ixe,Zn],sU),$xe=oe([Rxe,Lxe,Mxe],Oy),Bxe=oe([qn,PU,RU,Exe,Txe,$xe,sn,Zn],oU),Bu=oe([qn,sn,Hl,NC,Vv,Zn,Bxe],lU),Uxe=oe([Bu,qn,jC],cU),qxe=oe([qn,Bu,Uxe,Zn],uU),DU=e=>{var t=Zn(e),n=nd(e),r=!1;return Kh(e,t,n,r)},MU=oe([qn,DU],Zv),Fxe=oe([qn,jC,qxe,MU],hC),IU=oe([Fxe],Fk),Kxe=oe([sn,NC,qn,Zn],gU),Hxe=oe([sn,NC,qn,Zn],hU),Gxe=(e,t,n,r,i,a,o,u)=>{if(t){var{type:d}=t,f=Pa(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=u==="angleAxis"&&i!=null&&i?.length>=2?Ni(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var w=r.map(y);return st(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(Ir):r.domain().map((y,v)=>{var w=r.map(y);return st(w)?{coordinate:w+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Ir)}}},Ss=oe([sn,qn,jC,IU,DU,Kxe,Hxe,Zn],Gxe),kC=oe([bU,wU,Q0e],(e,t,n)=>SU(n.shared,e,t)),LU=e=>e.tooltip.settings.trigger,CC=e=>e.tooltip.settings.defaultIndex,Gh=oe([od,kC,LU,CC],_U),hh=oe([Gh,Hl,Lu,Bu],Bf),$U=oe([Ss,hh],jU),Vxe=oe([Gh],e=>{if(e)return e.dataKey}),Zxe=oe([Gh],e=>{if(e)return e.graphicalItemId}),BU=oe([od,kC,LU,CC],OU),Yxe=oe([xs,bs,sn,ar,Ss,CC,BU],AU),Wxe=oe([Gh,Yxe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Qxe=oe([Gh],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Xxe=oe([BU,hh,ra,Lu,$U,EU,kC],zU),Jxe=oe([Xxe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function oM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oM(Object(n),!0).forEach(function(r){ebe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ebe(e,t,n){return(t=tbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tbe(e){var t=nbe(e,"string");return typeof t=="symbol"?t:t+""}function nbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rbe=()=>Ue(qn),ibe=()=>{var e=rbe(),t=Ue(Ss),n=Ue(IU);return ay(!e||!n?void 0:lM(lM({},e),{},{scale:n}),t)};function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){abe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function abe(e,t,n){return(t=sbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sbe(e){var t=obe(e,"string");return typeof t=="symbol"?t:t+""}function obe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lbe=(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}},cbe=(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 Wc(Wc(Wc({},r),rr(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:d}=r;return Wc(Wc(Wc({},r),rr(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function ube(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 UU=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<o;u++){var d,f,p,m,y,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[u])===null||p===void 0?void 0:p.coordinate,S=u>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[u+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||S==null))if(Ni(w-v)!==Ni(S-w)){var k=[];if(Ni(S-w)===Ni(i[1]-i[0])){j=S;var O=w+i[1]-i[0];k[0]=Math.min(O,(O+v)/2),k[1]=Math.max(O,(O+v)/2)}else{j=v;var _=S+i[1]-i[0];k[0]=Math.min(w,(_+w)/2),k[1]=Math.max(w,(_+w)/2)}var C=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}else{var E=Math.min(v,S),A=Math.max(v,S);if(e>(E+w)/2&&e<=(A+w)/2){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}}else if(t)for(var $=0;$<o;$++){var F=t[$];if(F!=null){var U=t[$+1],B=t[$-1];if($===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||$===o-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<o-1&&B!=null&&U!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},qU=()=>Ue(Dk),_C=(e,t)=>t,FU=(e,t,n)=>n,AC=(e,t,n,r)=>r,dbe=oe(Ss,e=>Ov(e,t=>t.coordinate)),OC=oe([od,_C,FU,AC],_U),EC=oe([OC,Hl,Lu,Bu],Bf),fbe=(e,t,n)=>{if(t!=null){var r=od(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},KU=oe([od,_C,FU,AC],OU),zy=oe([xs,bs,sn,ar,Ss,AC,KU],AU),hbe=oe([OC,zy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),HU=oe([Ss,EC],jU),pbe=oe([KU,EC,ra,Lu,HU,EU,_C],zU),mbe=oe([OC,EC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),gbe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&ube(e,o)){var u=qfe(e,t),d=UU(u,a,i,n,r),f=lbe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},ybe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var u=Lme(e,n);if(u){var d=Ffe(u,t),f=UU(d,o,a,r,i),p=cbe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},vbe=(e,t,n,r,i,a,o,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?gbe(e,t,r,i,a,o,u):ybe(e,t,n,r,i,a,o)},xbe=oe(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}}),bbe=oe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(hr)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:dge}});function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){wbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wbe(e,t,n){return(t=Sbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sbe(e){var t=jbe(e,"string");return typeof t=="symbol"?t:t+""}function jbe(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 Nbe={},kbe={zIndexMap:Object.values(hr).reduce((e,t)=>dM(dM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Nbe)},Cbe=new Set(Object.values(hr));function _be(e){return Cbe.has(e)}var GU=mr({name:"zIndex",initialState:kbe,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:Xt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!_be(n)&&delete e.zIndexMap[n])},prepare:Xt()},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:Xt()},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:Xt()}}}),{registerZIndexPortal:Abe,unregisterZIndexPortal:PS,registerZIndexPortalElement:Obe,unregisterZIndexPortalElement:Ebe}=GU.actions,zbe=GU.reducer;function Ma(e){var{zIndex:t,children:n}=e,r=She(),i=r&&t!==void 0&&t!==0,a=kr(),o=x.useRef(void 0),u=x.useRef(new Set),d=hn(),f=Ue(m=>xbe(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(PS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(u.current.has(t)||(d(Abe({zIndex:t})),u.current.add(t)),f){o.current=f;var y=u.current;y.forEach(v=>{v!==t&&(d(PS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(y=>{d(PS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?Zl.createPortal(n,p):null}function kj(){return kj=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},kj.apply(null,arguments)}function fM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ym(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){Tbe(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 Tbe(e,t,n){return(t=Pbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pbe(e){var t=Rbe(e,"string");return typeof t=="symbol"?t:t+""}function Rbe(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 Dbe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Mbe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,S,j;if(p==="ScatterChart")w=m,S=Wpe,j=hr.cursorLine;else if(p==="BarChart")w=Qpe(u,m,a,o),S=Ame,j=hr.cursorRectangle;else if(u==="radial"&&h3(m)){var{cx:k,cy:O,radius:_,startAngle:C,endAngle:T}=TB(m);w={cx:k,cy:O,startAngle:C,endAngle:T,innerRadius:_,outerRadius:_},S=qme,j=hr.cursorLine}else w={points:Fme(u,m,a)},S=gg,j=hr.cursorLine;var E=typeof d=="object"&&"className"in d?d.className:void 0,A=Ym(Ym(Ym(Ym({stroke:"#ccc",pointerEvents:"none"},a),w),Nv(d)),{},{payload:y,payloadIndex:v,className:zt("recharts-tooltip-cursor",E)});return x.createElement(Ma,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(Dbe,{cursor:d,cursorComp:S,cursorProps:A}))}function Ibe(e){var t=ibe(),n=mB(),r=Ju(),i=qU();return t==null||n==null||r==null||i==null?null:x.createElement(Mbe,kj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var VU=x.createContext(null),Lbe=()=>x.useContext(VU),RS={exports:{}},hM;function $be(){return hM||(hM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,v=m.length,w=new Array(v);y<v;y++)w[y]=m[y].fn;return w},u.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,y,v,w){var S=n?n+f:f;if(!this._events[S])return!1;var j=this._events[S],k=arguments.length,O,_;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,w),!0}for(_=1,O=new Array(k-1);_<k;_++)O[_-1]=arguments[_];j.fn.apply(j.context,O)}else{var C=j.length,T;for(_=0;_<C;_++)switch(j[_].once&&this.removeListener(f,j[_].fn,void 0,!0),k){case 1:j[_].fn.call(j[_].context);break;case 2:j[_].fn.call(j[_].context,p);break;case 3:j[_].fn.call(j[_].context,p,m);break;case 4:j[_].fn.call(j[_].context,p,m,y);break;default:if(!O)for(T=1,O=new Array(k-1);T<k;T++)O[T-1]=arguments[T];j[_].fn.apply(j[_].context,O)}}return!0},u.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&o(this,v);else{for(var S=0,j=[],k=w.length;S<k;S++)(w[S].fn!==p||y&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(RS)),RS.exports}var Bbe=$be();const Ube=Ta(Bbe);var ph=new Ube,Cj="recharts.syncEvent.tooltip",pM="recharts.syncEvent.brush",qbe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Aa(n))return e[n]}},Fbe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},ZU=mr({name:"options",initialState:Fbe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Kbe=ZU.reducer,{createEventEmitter:Hbe}=ZU.actions;function Gbe(e){return e.tooltip.syncInteraction}var Vbe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},YU=mr({name:"chartData",initialState:Vbe,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:mM,setDataStartEndIndexes:Zbe,setComputedData:e_e}=YU.actions,Ybe=YU.reducer,Wbe=["x","y"];function gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){Qbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qbe(e,t,n){return(t=Xbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xbe(e){var t=Jbe(e,"string");return typeof t=="symbol"?t:t+""}function Jbe(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 ewe(e,t){if(e==null)return{};var n,r,i=twe(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 twe(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 nwe(){var e=Ue(Mk),t=Ue(Ik),n=hn(),r=Ue(VB),i=Ue(Ss),a=Ju(),o=Ph(),u=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return Xu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(Of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:S}=v,j=ewe(v,Wbe),{x:k,y:O,width:_,height:C}=p.payload.sourceViewBox,T=Qc(Qc({},j),{},{x:o.x+(_?(w-k)/_:0)*o.width,y:o.y+(C?(S-O)/C:0)*o.height});n(Qc(Qc({},p),{},{payload:Qc(Qc({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var E;if(typeof r=="function"){var A={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},P=r(i,A);E=i[P]}else r==="value"&&(E=i.find(K=>String(K.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||o==null){n(Of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(E==null){n(Of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:U}=$,B=Math.min(F,o.x+o.width),V=Math.min(U,o.y+o.height),ee={x:a==="horizontal"?E.coordinate:B,y:a==="horizontal"?V:E.coordinate},Q=Of({active:p.payload.active,coordinate:ee,dataKey:p.payload.dataKey,index:String(E.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Q)}}};return ph.on(Cj,d),()=>{ph.off(Cj,d)}},[u,n,t,e,r,i,a,o])}function rwe(){var e=Ue(Mk),t=Ue(Ik),n=hn();x.useEffect(()=>{if(e==null)return Xu;var r=(i,a,o)=>{t!==o&&e===i&&n(Zbe(a))};return ph.on(pM,r),()=>{ph.off(pM,r)}},[n,t,e])}function iwe(){var e=hn();x.useEffect(()=>{e(Hbe())},[e]),nwe(),rwe()}function awe(e,t,n,r,i,a){var o=Ue(w=>fbe(w,e,t)),u=Ue(Zxe),d=Ue(Ik),f=Ue(Mk),p=Ue(VB),m=Ue(Gbe),y=m?.sourceViewBox!=null,v=Ph();x.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=Of({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});ph.emit(Cj,f,w,d)}},[y,n,o,u,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 vM(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){swe(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 swe(e,t,n){return(t=owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function owe(e){var t=lwe(e,"string");return typeof t=="symbol"?t:t+""}function lwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cwe(e){return e.dataKey}function uwe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(kpe,t)}var xM=[],dwe={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 Ty(e){var t,n,r=Nr(e,dwe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:k,shared:O,trigger:_,defaultIndex:C,portal:T,axisId:E}=r,A=hn(),P=typeof C=="number"?String(C):C;x.useEffect(()=>{A(nxe({shared:O,trigger:_,axisId:E,active:i,defaultIndex:P}))},[A,O,_,E,i,P]);var $=Ph(),F=CB(),U=W0e(O),{activeIndex:B,isActive:V}=(t=Ue(Se=>mbe(Se,U,_,P)))!==null&&t!==void 0?t:{},ee=Ue(Se=>pbe(Se,U,_,P)),Q=Ue(Se=>HU(Se,U,_,P)),K=Ue(Se=>hbe(Se,U,_,P)),te=ee,le=Lbe(),je=(n=i??V)!==null&&n!==void 0?n:!1,[L,I]=E3([te,je]),q=U==="axis"?Q:void 0;awe(U,_,K,q,B,je);var R=T??le;if(R==null||$==null||U==null)return null;var G=te??xM;je||(G=xM),f&&G.length&&(G=k3(G.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),y,cwe));var ie=G.length>0,ne=vM(vM({},r),{},{payload:G,label:q,active:je,activeIndex:B,coordinate:K,accessibilityLayer:F}),Ce=x.createElement(Mpe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:p,active:je,coordinate:K,hasPayload:ie,offset:m,position:v,reverseDirection:w,useTranslate3d:S,viewBox:$,wrapperStyle:j,lastBoundingBox:L,innerRef:I,hasPortalFromProps:!!T},uwe(d,ne));return x.createElement(x.Fragment,null,Zl.createPortal(Ce,R),je&&x.createElement(Ibe,{cursor:k,tooltipEventType:U,coordinate:K,payload:G,index:B}))}function fwe(e,t,n){return(t=hwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hwe(e){var t=pwe(e,"string");return typeof t=="symbol"?t:t+""}function pwe(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 mwe{constructor(t){fwe(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 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 gwe(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){ywe(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 ywe(e,t,n){return(t=vwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vwe(e){var t=xwe(e,"string");return typeof t=="symbol"?t:t+""}function xwe(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 bwe={cacheSize:2e3,enableCache:!0},WU=gwe({},bwe),wM=new mwe(WU.cacheSize),wwe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},SM="recharts_measurement_span";function Swe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(u)}var jM=(e,t)=>{try{var n=document.getElementById(SM);n||(n=document.createElement("span"),n.setAttribute("id",SM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,wwe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Uf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ih.isSsr)return{width:0,height:0};if(!WU.enableCache)return jM(t,n);var r=Swe(t,n),i=wM.get(r);if(i)return i;var a=jM(t,n);return wM.set(r,a),a},QU;function jwe(e,t,n){return(t=Nwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nwe(e){var t=kwe(e,"string");return typeof t=="symbol"?t:t+""}function kwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,kM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cwe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,_we=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Awe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Owe=["cm","mm","pt","pc","in","Q","px"];function Ewe(e){return Owe.includes(e)}var uu="NaN";function zwe(e,t){return e*Awe[t]}class nr{static parse(t){var n,[,r,i]=(n=_we.exec(t))!==null&&n!==void 0?n:[];return r==null?nr.NaN:new nr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Aa(t)&&(this.unit=""),n!==""&&!Cwe.test(n)&&(this.num=NaN,this.unit=""),Ewe(n)&&(this.num=zwe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new nr(NaN,""):new nr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new nr(NaN,""):new nr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new nr(NaN,""):new nr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new nr(NaN,""):new nr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Aa(this.num)}}QU=nr;jwe(nr,"NaN",new QU(NaN,""));function XU(e){if(e==null||e.includes(uu))return uu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=NM.exec(t))!==null&&n!==void 0?n:[],o=nr.parse(r??""),u=nr.parse(a??""),d=i==="*"?o.multiply(u):o.divide(u);if(d.isNaN())return uu;t=t.replace(NM,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=kM.exec(t))!==null&&f!==void 0?f:[],v=nr.parse(p??""),w=nr.parse(y??""),S=m==="+"?v.add(w):v.subtract(w);if(S.isNaN())return uu;t=t.replace(kM,S.toString())}return t}var CM=/\(([^()]*)\)/;function Twe(e){for(var t=e,n;(n=CM.exec(t))!=null;){var[,r]=n;t=t.replace(CM,XU(r))}return t}function Pwe(e){var t=e.replace(/\s+/g,"");return t=Twe(t),t=XU(t),t}function Rwe(e){try{return Pwe(e)}catch{return uu}}function DS(e){var t=Rwe(e.slice(5,-1));return t===uu?"":t}var Dwe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Mwe=["dx","dy","angle","className","breakAll"];function _j(){return _j=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},_j.apply(null,arguments)}function _M(e,t){if(e==null)return{};var n,r,i=Iwe(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 Iwe(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 JU=/[ \f\n\r\t\v\u2028\u2029]+/,e8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];ir(t)||(n?i=t.toString().split(""):i=t.toString().split(JU));var a=i.map(u=>({word:u,width:Uf(u,r).width})),o=n?0:Uf(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function t8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Lwe(e){return ir(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var n8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(o),d.width+=u+n;else{var f={words:[o],width:u};i.push(f)}return i},[]),r8=e=>e.reduce((t,n)=>t.width>n.width?t:n),$we="…",AM=(e,t,n,r,i,a,o,u)=>{var d=e.slice(0,t),f=e8({breakAll:n,style:r,children:d+$we});if(!f)return[!1,[]];var p=n8(f.wordsWithComputedWidth,a,o,u),m=p.length>i||r8(p).width>Number(a);return[m,p]},Bwe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:u,breakAll:d}=e,f=Le(a),p=String(o),m=n8(t,r,n,i);if(!f||i)return m;var y=m.length>a||r8(m).width>Number(r);if(!y)return m;for(var v=0,w=p.length-1,S=0,j;v<=w&&S<=p.length-1;){var k=Math.floor((v+w)/2),O=k-1,[_,C]=AM(p,O,d,u,a,r,n,i),[T]=AM(p,k,d,u,a,r,n,i);if(!_&&!T&&(v=k+1),_&&T&&(w=k-1),!_&&T){j=C;break}S++}return j||m},OM=e=>{var t=ir(e)?[]:e.toString().split(JU);return[{words:t,width:void 0}]},Uwe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Ih.isSsr){var u,d,f=e8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return OM(r);return Bwe({breakAll:a,children:r,maxLines:o,style:i},u,d,t,!!n)}return OM(r)},i8="#808080",qwe={angle:0,breakAll:!1,capHeight:"0.71em",fill:i8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},zC=x.forwardRef((e,t)=>{var n=Nr(e,qwe),{x:r,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=_M(n,Dwe),y=x.useMemo(()=>Uwe({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:w,angle:S,className:j,breakAll:k}=m,O=_M(m,Mwe);if(!zi(r)||!zi(i)||y.length===0)return null;var _=Number(r)+(Le(v)?v:0),C=Number(i)+(Le(w)?w:0);if(!st(_)||!st(C))return null;var T;switch(p){case"start":T=DS("calc(".concat(o,")"));break;case"middle":T=DS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:T=DS("calc(".concat(y.length-1," * -").concat(a,")"));break}var E=[],A=y[0];if(d&&A!=null){var P=A.width,{width:$}=m;E.push("scale(".concat(Le($)&&Le(P)?$/P:1,")"))}return S&&E.push("rotate(".concat(S,", ").concat(_,", ").concat(C,")")),E.length&&(O.transform=E.join(" ")),x.createElement("text",_j({},Ur(O),{ref:t,x:_,y:C,className:zt("recharts-text",j),textAnchor:f,fill:u.includes("url")?i8:u}),y.map((F,U)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:_,dy:U===0?T:a,key:"".concat(B,"-").concat(U)},B)}))});zC.displayName="Text";function EM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EM(Object(n),!0).forEach(function(r){Fwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fwe(e,t,n){return(t=Kwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kwe(e){var t=Hwe(e,"string");return typeof t=="symbol"?t:t+""}function Hwe(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 Gwe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:u,upperWidth:d,lowerWidth:f}=kk(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=p+d/2,S=u>=0?1:-1,j=S*r,k=S>0?"end":"start",O=S>0?"start":"end",_=d>=0?1:-1,C=_*r,T=_>0?"end":"start",E=_>0?"start":"end",A=i;if(n==="top"){var P={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return A&&(P.height=Math.max(o-A.y,0),P.width=d),P}if(n==="bottom"){var $={x:m+f/2,y:o+u+j,horizontalAnchor:"middle",verticalAnchor:O};return A&&($.height=Math.max(A.y+A.height-(o+u),0),$.width=f),$}if(n==="left"){var F={x:y-C,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return A&&(F.width=Math.max(F.x-A.x,0),F.height=u),F}if(n==="right"){var U={x:y+v+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"};return A&&(U.width=Math.max(A.x+A.width-U.x,0),U.height=u),U}var B=A?{width:v,height:u}:{};return n==="insideLeft"?ha({x:y+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"},B):n==="insideRight"?ha({x:y+v-C,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"},B):n==="insideTop"?ha({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:O},B):n==="insideBottom"?ha({x:m+f/2,y:o+u-j,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?ha({x:p+C,y:o+j,horizontalAnchor:E,verticalAnchor:O},B):n==="insideTopRight"?ha({x:p+d-C,y:o+j,horizontalAnchor:T,verticalAnchor:O},B):n==="insideBottomLeft"?ha({x:m+C,y:o+u-j,horizontalAnchor:E,verticalAnchor:k},B):n==="insideBottomRight"?ha({x:m+f-C,y:o+u-j,horizontalAnchor:T,verticalAnchor:k},B):n&&typeof n=="object"&&(Le(n.x)||Bl(n.x))&&(Le(n.y)||Bl(n.y))?ha({x:a+_o(n.x,v),y:o+_o(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},B):ha({x:w,y:o+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},Vwe=["labelRef"],Zwe=["content"];function zM(e,t){if(e==null)return{};var n,r,i=Ywe(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 Ywe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(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){Wwe(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 Wwe(e,t,n){return(t=Qwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qwe(e){var t=Xwe(e,"string");return typeof t=="symbol"?t:t+""}function Xwe(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 ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ss.apply(null,arguments)}var a8=x.createContext(null),s8=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:u}=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(a8.Provider,{value:d},u)},o8=()=>{var e=x.useContext(a8),t=Ph();return e||(t?kk(t):void 0)},Jwe=x.createContext(null),eSe=()=>{var e=x.useContext(Jwe),t=Ue(XB);return e||t},tSe=e=>{var{value:t,formatter:n}=e,r=ir(e.children)?t:e.children;return typeof n=="function"?n(r):r},TC=e=>e!=null&&typeof e=="function",nSe=(e,t)=>{var n=Ni(t-e),r=Math.min(Math.abs(t-e),360);return n*r},rSe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,S=nSe(m,y),j=S>=0?1:-1,k,O;switch(t){case"insideStart":k=m+j*a,O=v;break;case"insideEnd":k=y-j*a,O=!v;break;case"end":k=y+j*a,O=v;break;default:throw new Error("Unsupported position ".concat(t))}O=S<=0?O:!O;var _=rr(u,d,w,k),C=rr(u,d,w,k+(O?1:-1)*359),T="M".concat(_.x,",").concat(_.y,`
288
+ A`).concat(w,",").concat(w,",0,1,").concat(O?0:1,`,
289
+ `).concat(C.x,",").concat(C.y),E=ir(e.id)?eh("recharts-radial-line-"):e.id;return x.createElement("text",ss({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:E,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(E)},n))},iSe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=rr(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+o)/2,{x:v,y:w}=rr(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},yg=e=>e!=null&&"cx"in e&&Le(e.cx),aSe={angle:0,offset:5,zIndex:hr.label,position:"middle",textBreakAll:!1};function sSe(e){if(!yg(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 ao(e){var t=Nr(e,aSe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=eSe(),y=o8(),v=i==="center"?y:m??y,w,S,j;n==null?w=v:yg(n)?w=n:w=kk(n);var k=sSe(w);if(!w||ir(a)&&ir(o)&&!x.isValidElement(u)&&typeof u!="function")return null;var O=Ef(Ef({},t),{},{viewBox:w});if(x.isValidElement(u)){var{labelRef:_}=O,C=zM(O,Vwe);return x.cloneElement(u,C)}if(typeof u=="function"){var{content:T}=O,E=zM(O,Zwe);if(S=x.createElement(u,E),x.isValidElement(S))return S}else S=tSe(t);var A=Ur(t);if(yg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return rSe(t,i,S,A,w);j=iSe(w,t.offset,t.position)}else{if(!k)return null;var P=Gwe({viewBox:k,position:i,offset:t.offset,parentViewBox:yg(r)?void 0:r});j=Ef(Ef({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return x.createElement(Ma,{zIndex:t.zIndex},x.createElement(zC,ss({ref:p,className:zt("recharts-label",d)},A,j,{textAnchor:t8(A.textAnchor)?A.textAnchor:j.textAnchor,breakAll:f}),S))}ao.displayName="Label";var oSe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(ao,ss({key:"label-implicit"},r)):zi(e)?x.createElement(ao,ss({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===ao?x.cloneElement(e,Ef({key:"label-implicit"},r)):x.createElement(ao,ss({key:"label-implicit",content:e},r)):TC(e)?x.createElement(ao,ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(ao,ss({},e,{key:"label-implicit"},r)):null};function l8(e){var{label:t,labelRef:n}=e,r=o8();return oSe(t,r,n)||null}var lSe=["valueAccessor"],cSe=["dataKey","clockWise","id","textBreakAll","zIndex"];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 PM(e,t){if(e==null)return{};var n,r,i=uSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dSe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Lwe(t))return t},c8=x.createContext(void 0),fSe=c8.Provider,u8=x.createContext(void 0);u8.Provider;function hSe(){return x.useContext(c8)}function pSe(){return x.useContext(u8)}function vg(e){var{valueAccessor:t=dSe}=e,n=PM(e,lSe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:u}=n,d=PM(n,cSe),f=hSe(),p=pSe(),m=f||p;return!m||!m.length?null:x.createElement(Ma,{zIndex:u??hr.label},x.createElement(Xi,{className:"recharts-label-list"},m.map((y,v)=>{var w,S=ir(r)?t(y,v):Gn(y.payload,r),j=ir(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(ao,Py({key:"label-".concat(v)},Ur(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}vg.displayName="LabelList";function mSe(e){var{label:t}=e;return t?t===!0?x.createElement(vg,{key:"labelList-implicit"}):x.isValidElement(t)||TC(t)?x.createElement(vg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(vg,Py({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Aj(){return Aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aj.apply(null,arguments)}var d8=e=>{var{cx:t,cy:n,r,className:i}=e,a=zt("recharts-dot",i);return Le(t)&&Le(n)&&Le(r)?x.createElement("circle",Aj({},Qi(e),mk(e),{className:a,cx:t,cy:n,r})):null},gSe={radiusAxis:{},angleAxis:{}},f8=mr({name:"polarAxis",initialState:gSe,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:t_e,removeRadiusAxis:n_e,addAngleAxis:r_e,removeAngleAxis:i_e}=f8.actions,ySe=f8.reducer;function vSe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var h8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function xSe(e){var{tooltipEntrySettings:t}=e,n=hn(),r=kr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(J0e(t)):i.current!==t&&n(exe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(txe(i.current)),i.current=null)},[n]),null}function bSe(e){var{legendPayload:t}=e,n=hn(),r=kr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Mhe(t)):i.current!==t&&n(Ihe({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Lhe(i.current)),i.current=null)},[n]),null}var MS,wSe=()=>{var[e]=x.useState(()=>eh("uid-"));return e},SSe=(MS=Fy.useId)!==null&&MS!==void 0?MS:wSe;function jSe(e,t){var n=SSe();return t||(e?"".concat(e,"-").concat(n):n)}var NSe=x.createContext(void 0),kSe=e=>{var{id:t,type:n,children:r}=e,i=jSe("recharts-".concat(n),t);return x.createElement(NSe.Provider,{value:i},r(i))},CSe={cartesianItems:[],polarItems:[]},p8=mr({name:"graphicalItems",initialState:CSe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Xt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Xt()},removeCartesianGraphicalItem:{reducer(e,t){var n=ki(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Xt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Xt()},removePolarGraphicalItem:{reducer(e,t){var n=ki(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Xt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Xt()}}}),{addCartesianGraphicalItem:_Se,replaceCartesianGraphicalItem:ASe,removeCartesianGraphicalItem:OSe,addPolarGraphicalItem:a_e,removePolarGraphicalItem:s_e,replacePolarGraphicalItem:o_e}=p8.actions,ESe=p8.reducer,zSe=e=>{var t=hn(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(_Se(e)):n.current!==e&&t(ASe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(OSe(n.current)),n.current=null)},[t]),null},TSe=x.memo(zSe),PSe=["points"];function RM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){RSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RSe(e,t,n){return(t=DSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DSe(e){var t=MSe(e,"string");return typeof t=="symbol"?t:t+""}function MSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ry(){return Ry=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},Ry.apply(null,arguments)}function ISe(e,t){if(e==null)return{};var n,r,i=LSe(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 LSe(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 $Se(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=zt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,u=ISe(a,PSe);return x.createElement(d8,Ry({},u,{className:i}))}function BSe(e,t){return e==null?!1:t?!0:e.length===1}function USe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:d,zIndex:f=hr.scatter}=e;if(!BSe(t,n))return null;var p=h8(n),m=Nce(n),y=t.map((w,S)=>{var j,k,O=IS(IS(IS({r:3},o),m),{},{index:S,cx:(j=w.x)!==null&&j!==void 0?j:void 0,cy:(k=w.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:w.value,payload:w.payload,points:t});return x.createElement($Se,{key:"dot-".concat(S),option:n,dotProps:O,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(Ma,{zIndex:f},x.createElement(Xi,Ry({className:r},v),y))}function DM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DM(Object(n),!0).forEach(function(r){qSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qSe(e,t,n){return(t=FSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FSe(e){var t=KSe(e,"string");return typeof t=="symbol"?t:t+""}function KSe(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 m8=0,HSe={xAxis:{},yAxis:{},zAxis:{}},g8=mr({name:"cartesianAxis",initialState:HSe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Xt()},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:Xt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Xt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Xt()},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:Xt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Xt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Xt()},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:Xt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Xt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...o,r].slice(-3);e.yAxis[n]=MM(MM({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:GSe,replaceXAxis:VSe,removeXAxis:ZSe,addYAxis:YSe,replaceYAxis:WSe,removeYAxis:QSe,addZAxis:l_e,replaceZAxis:c_e,removeZAxis:u_e,updateYAxisWidth:XSe}=g8.actions,JSe=g8.reducer,e1e=oe([ar],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),t1e=oe([e1e,xs,bs],(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)}}),PC=()=>Ue(t1e),n1e=()=>Ue(Jxe);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 LS(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){r1e(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 r1e(e,t,n){return(t=i1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i1e(e){var t=a1e(e,"string");return typeof t=="symbol"?t:t+""}function a1e(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 s1e=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=LS(LS(LS({},u),Nv(i)),mk(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(d8,d),x.createElement(Xi,{className:"recharts-active-dot",clipPath:o},f)};function LM(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=hr.activeDot}=e,u=Ue(hh),d=n1e();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return ir(f)?null:x.createElement(Ma,{zIndex:o},x.createElement(s1e,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var o1e=e=>{var{chartData:t}=e,n=hn(),r=kr();return x.useEffect(()=>r?()=>{}:(n(mM(t)),()=>{n(mM(void 0))}),[t,n,r]),null},$M={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},y8=mr({name:"brush",initialState:$M,reducers:{setBrushSettings(e,t){return t.payload==null?$M:t.payload}}}),{setBrushSettings:d_e}=y8.actions,l1e=y8.reducer,c1e=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},u1e=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return c1e({x:t,y:n},{x:r,y:i})};function d1e(e){return(e%180+180)%180}var f1e=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=d1e(i),o=a*Math.PI/180,u=Math.atan(r/n),d=o>u&&o<Math.PI-u?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},h1e={dots:[],areas:[],lines:[]},v8=mr({name:"referenceElements",initialState:h1e,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:f_e,removeDot:h_e,addArea:p_e,removeArea:m_e,addLine:p1e,removeLine:m1e}=v8.actions,g1e=v8.reducer,x8=x.createContext(void 0),y1e=e=>{var{children:t}=e,[n]=x.useState("".concat(eh("recharts"),"-clip")),r=PC();if(r==null)return null;var{x:i,y:a,width:o,height:u}=r;return x.createElement(x8.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:u,width:o}))),t)},v1e=()=>x.useContext(x8);class x1e{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:a}=n;return{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:a,fallback:o}=n,u,d;return o==="rangeMin"?u=this.yAxisScale.rangeMin():o==="rangeMax"?u=this.yAxisScale.rangeMax():u=0,o==="rangeMin"?d=this.xAxisScale.rangeMin():o==="rangeMax"?d=this.xAxisScale.rangeMax():d=0,{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:d,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:u}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),a=r==null||this.yAxisScale.isInRange(r);return i&&a}}function 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){b1e(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 b1e(e,t,n){return(t=w1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w1e(e){var t=S1e(e,"string");return typeof t=="symbol"?t:t+""}function S1e(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 Dy(){return Dy=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},Dy.apply(null,arguments)}var j1e=(e,t)=>{var n;if(x.isValidElement(e))n=x.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!st(t.x1)||!st(t.y1)||!st(t.x2)||!st(t.y2))return null;n=x.createElement("line",Dy({},t,{className:"recharts-reference-line-line"}))}return n},N1e=(e,t,n,r,i,a)=>{var{x:o,width:u}=a,d=i.map(e,{position:n});if(!st(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:o+u,y:d},{x:o,y:d}];return r==="left"?f.reverse():f},k1e=(e,t,n,r,i,a)=>{var{y:o,height:u}=a,d=i.map(e,{position:n});if(!st(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:d,y:o+u},{x:d,y:o}];return r==="top"?f.reverse():f},C1e=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(a=>!r.isInRange(a))?null:i},_1e=(e,t,n,r,i,a,o)=>{var{x:u,y:d,segment:f,ifOverflow:p}=o,m=zi(u),y=zi(d);return y?N1e(d,p,r,a,t,n):m?k1e(u,p,r,i,e,n):f!=null&&f.length===2?C1e(f,p,r,new x1e({x:e,y:t})):null};function A1e(e){var t=hn();return x.useEffect(()=>(t(p1e(e)),()=>{t(m1e(e))})),null}function O1e(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:a}=e,o=kr(),u=v1e(),d=Ue(A=>Ra(A,t)),f=Ue(A=>Da(A,n)),p=Ue(A=>$u(A,"xAxis",t,o)),m=Ue(A=>$u(A,"yAxis",n,o)),y=Ph();if(!u||!y||d==null||f==null||p==null||m==null)return null;var v=_1e(p,m,y,e.position,d.orientation,f.orientation,e);if(!v)return null;var w=v[0],S=v[1];if(w==null||S==null)return null;var{x:j,y:k}=w,{x:O,y:_}=S,C=a==="hidden"?"url(#".concat(u,")"):void 0,T=UM(UM({clipPath:C},Ur(e)),{},{x1:j,y1:k,x2:O,y2:_}),E=u1e({x1:j,y1:k,x2:O,y2:_});return x.createElement(Ma,{zIndex:e.zIndex},x.createElement(Xi,{className:zt("recharts-reference-line",i)},j1e(r,T),x.createElement(s8,Dy({},E,{lowerWidth:E.width,upperWidth:E.width}),x.createElement(l8,{label:e.label}),e.children)))}var E1e={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:hr.line};function b8(e){var t=Nr(e,E1e);return x.createElement(x.Fragment,null,x.createElement(A1e,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),x.createElement(O1e,t))}b8.displayName="ReferenceLine";function w8(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 z1e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return f1e(r,n)}function T1e(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:u}=e;return t===1?{start:r?i:a,end:r?i+o:a+u}:{start:r?i+o:a+u,end:r?i:a}}function mh(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 P1e(e,t){return w8(e,t+1)}function R1e(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:u}=t,d=0,f=1,p=o,m=function(){var w=r?.[d];if(w===void 0)return{v:w8(r,f)};var S=d,j,k=()=>(j===void 0&&(j=n(w,S)),j),O=w.coordinate,_=d===0||mh(e,O,k,p,u);_||(d=0,p=o,f+=1),_&&(p=O+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function D1e(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:u,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=u,y=!0,v=function(){var C=r[S];if(C==null)return 0;var T=S,E,A=()=>(E===void 0&&(E=n(C,T)),E),P=C.coordinate,$=S===p||mh(e,P,A,m,d);if(!$)return y=!1,1;$&&(m=P+e*(A()/2+i))},w,S=p;S<o&&(w=v(),!(w!==0&&w===1));S+=f);if(y){for(var j=[],k=p;k<o;k+=f){var O=r[k];O!=null&&j.push(O)}return j}}return[]}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 lr(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){M1e(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 M1e(e,t,n){return(t=I1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I1e(e){var t=L1e(e,"string");return typeof t=="symbol"?t:t+""}function L1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $1e(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:u}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var w=v,S,j=()=>(S===void 0&&(S=n(v,y)),S);if(y===o-1){var k=e*(w.coordinate+e*j()/2-d);a[y]=w=lr(lr({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[y]=w=lr(lr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var O=mh(e,w.tickCoord,j,u,d);O&&(d=w.tickCoord-e*(j()/2+i),a[y]=lr(lr({},w),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function B1e(e,t,n,r,i,a){var o=(r||[]).slice(),u=o.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),y=e*(p.coordinate+e*m/2-f);if(o[u-1]=p=lr(lr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=mh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[u-1]=lr(lr({},p),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(O){var _=o[O];if(_==null)return 1;var C=_,T,E=()=>(T===void 0&&(T=n(_,O)),T);if(O===0){var A=e*(C.coordinate-e*E()/2-d);o[O]=C=lr(lr({},C),{},{tickCoord:A<0?C.coordinate-A*e:C.coordinate})}else o[O]=C=lr(lr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var P=mh(e,C.tickCoord,E,d,f);P&&(d=C.tickCoord+e*(E()/2+i),o[O]=lr(lr({},C),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return o}function RC(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Le(d)||Ih.isSsr){var y;return(y=P1e(i,Le(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=u==="top"||u==="bottom"?"width":"height",S=p&&w==="width"?Uf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(T,E)=>{var A=typeof f=="function"?f(T.value,E):T.value;return w==="width"?z1e(Uf(A,{fontSize:t,letterSpacing:n}),S,m):Uf(A,{fontSize:t,letterSpacing:n})[w]},k=i[0],O=i[1],_=i.length>=2&&k!=null&&O!=null?Ni(O.coordinate-k.coordinate):1,C=T1e(a,_,w);return d==="equidistantPreserveStart"?R1e(_,C,j,i,o):d==="equidistantPreserveEnd"?D1e(_,C,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=B1e(_,C,j,i,o,d==="preserveStartEnd"):v=$1e(_,C,j,i,o),v.filter(T=>T.isShow))}var U1e=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+u+(n?r:0);return Math.round(f)}return 0},q1e={xAxis:{},yAxis:{}},S8=mr({name:"renderedTicks",initialState:q1e,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:F1e,removeRenderedTicks:K1e}=S8.actions,H1e=S8.reducer,G1e=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function V1e(e,t){if(e==null)return{};var n,r,i=Z1e(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 Z1e(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 Gl(){return Gl=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},Gl.apply(null,arguments)}function FM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gn(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){Y1e(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 Y1e(e,t,n){return(t=W1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1e(e){var t=Q1e(e,"string");return typeof t=="symbol"?t:t+""}function Q1e(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 fs={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:hr.axis};function X1e(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=gn(gn(gn({},d),Qi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=gn(gn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=gn(gn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",Gl({},f,{className:zt("recharts-cartesian-axis-line",Av(u,"className"))}))}function J1e(e,t,n,r,i,a,o,u,d){var f,p,m,y,v,w,S=u?-1:1,j=e.tickSize||o,k=Le(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!u*i,m=y-S*j,w=m-S*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!u*r,f=p-S*j,v=f-S*d,w=k;break;case"right":m=y=e.coordinate,p=t+ +u*r,f=p+S*j,v=f+S*d,w=k;break;default:f=p=e.coordinate,y=n+ +u*i,m=y+S*j,w=m+S*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:w}}}function eje(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function tje(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function nje(e){var{option:t,tickProps:n,value:r}=e,i,a=zt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,gn(gn({},n),{},{className:a}));else if(typeof t=="function")i=t(gn(gn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=zt(o,vSe(t))),i=x.createElement(zC,Gl({},n,{className:o}),r)}return i}function rje(e){var{ticks:t,axisType:n,axisId:r}=e,i=hn();return x.useEffect(()=>{if(r==null||n==null)return Xu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(F1e({ticks:a,axisId:r,axisType:n})),()=>{i(K1e({axisId:r,axisType:n}))}},[i,t,r,n]),null}var ije=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:S,tickSize:j,tickMargin:k,fontSize:O,letterSpacing:_,getTicksConfig:C,events:T,axisType:E,axisId:A}=e,P=RC(gn(gn({},C),{},{ticks:n}),O,_),$=Qi(C),F=Nv(r),U=t8($.textAnchor)?$.textAnchor:eje(p,m),B=tje(p,m),V={};typeof i=="object"&&(V=i);var ee=gn(gn({},$),{},{fill:"none"},V),Q=P.map(le=>gn({entry:le},J1e(le,y,v,w,S,p,j,m,k))),K=Q.map(le=>{var{entry:je,line:L}=le;return x.createElement(Xi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(je.value,"-").concat(je.coordinate,"-").concat(je.tickCoord)},i&&x.createElement("line",Gl({},ee,L,{className:zt("recharts-cartesian-axis-tick-line",Av(i,"className"))})))}),te=Q.map((le,je)=>{var L,I,{entry:q,tick:R}=le,G=gn(gn(gn(gn({verticalAnchor:B},$),{},{textAnchor:U,stroke:"none",fill:a},R),{},{index:je,payload:q,visibleTicksCount:P.length,tickFormatter:o,padding:d},f),{},{angle:(L=(I=f?.angle)!==null&&I!==void 0?I:$.angle)!==null&&L!==void 0?L:0}),ie=gn(gn({},G),F);return x.createElement(Xi,Gl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},p3(T,q,je)),r&&x.createElement(nje,{option:r,tickProps:ie,value:"".concat(typeof o=="function"?o(q.value,je):q.value).concat(u||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},x.createElement(rje,{ticks:P,axisId:A,axisType:E}),te.length>0&&x.createElement(Ma,{zIndex:hr.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},te)),K.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},K))}),aje=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:u,axisType:d,axisId:f}=e,p=V1e(e,G1e),[m,y]=x.useState(""),[v,w]=x.useState(""),S=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return U1e({ticks:S.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=x.useCallback(k=>{if(k){var O=k.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=O;var _=O[0];if(_){var C=window.getComputedStyle(_),T=C.fontSize,E=C.letterSpacing;(T!==m||E!==v)&&(y(T),w(E))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(Ma,{zIndex:e.zIndex},x.createElement(Xi,{className:zt("recharts-cartesian-axis",a)},x.createElement(X1e,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Qi(e)}),x.createElement(ije,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(s8,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(l8,{label:e.label,labelRef:e.labelRef}),e.children)))}),DC=x.forwardRef((e,t)=>{var n=Nr(e,fs);return x.createElement(aje,Gl({},n,{ref:t}))});DC.displayName="CartesianAxis";var sje=["x1","y1","x2","y2","key"],oje=["offset"],lje=["xAxisId","yAxisId"],cje=["xAxisId","yAxisId"];function KM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(n),!0).forEach(function(r){uje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uje(e,t,n){return(t=dje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dje(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)}function Sl(){return Sl=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},Sl.apply(null,arguments)}function My(e,t){if(e==null)return{};var n,r,i=hje(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 hje(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 pje=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:u}=e;return x.createElement("rect",{x:r,y:i,ry:u,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function j8(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:u,y2:d,key:f}=n,p=My(n,sje),m=(i=Qi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=My(m,oje);r=x.createElement("line",Sl({},v,{x1:a,y1:o,x2:u,y2:d,fill:"none",key:f}))}return r}function mje(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=My(e,lje),d=i.map((f,p)=>{var m=fr(fr({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(j8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function gje(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=My(e,cje),d=i.map((f,p)=>{var m=fr(fr({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(j8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function yje(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%t.length;return x.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:S,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function vje(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%n.length;return x.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:S,height:u,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var xje=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return oB(RC(fr(fr(fr({},fs),n),{},{ticks:lB(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},bje=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return oB(RC(fr(fr(fr({},fs),n),{},{ticks:lB(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},wje={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:hr.grid};function N8(e){var t=Ck(),n=_k(),r=mB(),i=fr(fr({},Nr(e,wje)),{},{x:Le(e.x)?e.x:r.left,y:Le(e.y)?e.y:r.top,width:Le(e.width)?e.width:r.width,height:Le(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=kr(),S=Ue($=>nM($,"xAxis",a,w)),j=Ue($=>nM($,"yAxis",o,w));if(!Oa(f)||!Oa(p)||!Le(u)||!Le(d))return null;var k=i.verticalCoordinatesGenerator||xje,O=i.horizontalCoordinatesGenerator||bje,{horizontalPoints:_,verticalPoints:C}=i;if((!_||!_.length)&&typeof O=="function"){var T=y&&y.length,E=O({yAxis:j?fr(fr({},j),{},{ticks:T?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},T?!0:m);sy(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(_=E)}if((!C||!C.length)&&typeof k=="function"){var A=v&&v.length,P=k({xAxis:S?fr(fr({},S),{},{ticks:A?v:S.ticks}):void 0,width:t??f,height:n??p,offset:r},A?!0:m);sy(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(C=P)}return x.createElement(Ma,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(pje,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(yje,Sl({},i,{horizontalPoints:_})),x.createElement(vje,Sl({},i,{verticalPoints:C})),x.createElement(mje,Sl({},i,{offset:r,horizontalPoints:_,xAxis:S,yAxis:j})),x.createElement(gje,Sl({},i,{offset:r,verticalPoints:C,xAxis:S,yAxis:j}))))}N8.displayName="CartesianGrid";var Sje={},k8=mr({name:"errorBars",initialState:Sje,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:g_e,replaceErrorBar:y_e,removeErrorBar:v_e}=k8.actions,jje=k8.reducer;function C8(e,t){var n,r,i=Ue(f=>Ra(f,e)),a=Ue(f=>Da(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Ln.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:$n.allowDataOverflow,d=o||u;return{needClip:d,needClipX:o,needClipY:u}}function Nje(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=PC(),{needClipX:a,needClipY:o,needClip:u}=C8(t,n);if(!u||!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}))}function kje(e){var t=Nv(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(u)||u<0)&&(u=r),{r:o,strokeWidth:u}}return{r:n,strokeWidth:r}}function MC(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:m8}function IC(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:m8}var _8=(e,t,n)=>xU(e,"xAxis",MC(e,t),n),A8=(e,t,n)=>vU(e,"xAxis",MC(e,t),n),O8=(e,t,n)=>xU(e,"yAxis",IC(e,t),n),E8=(e,t,n)=>vU(e,"yAxis",IC(e,t),n),Cje=oe([sn,_8,O8,A8,E8],(e,t,n,r,i)=>Pa(e,"xAxis")?ay(t,r,!1):ay(n,i,!1)),_je=(e,t)=>t,z8=oe([B6,_je],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),T8=e=>{var t=sn(e),n=Pa(t,"xAxis");return n?"yAxis":"xAxis"},Aje=(e,t)=>{var n=T8(e);return n==="yAxis"?IC(e,t):MC(e,t)},Oje=(e,t,n)=>W6(e,T8(e),Aje(e,t),n),Eje=oe([z8,Oje],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Uk(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),zje=oe([sn,_8,O8,A8,E8,Eje,Yme,Cje,z8,ige],(e,t,n,r,i,a,o,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return Qje({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:u})}}),Tje=["id"],Pje=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function zl(){return zl=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},zl.apply(null,arguments)}function P8(e,t){if(e==null)return{};var n,r,i=Rje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function 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 du(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){Dje(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 Dje(e,t,n){return(t=Mje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mje(e){var t=Ije(e,"string");return typeof t=="symbol"?t:t+""}function Ije(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 Iy(e,t){return e&&e!=="none"?e:t}var Lje=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Iy(r,i),value:cB(n,t),payload:e}]},$je=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Xu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:cB(o,t),hide:u,type:f,color:Iy(r,a),unit:d,graphicalItemId:p}};return x.createElement(xSe,{tooltipEntrySettings:m})});function Bje(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,u=Qi(r);return x.createElement(USe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function Uje(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,u,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return du(du({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(fSe,{value:t?i:void 0},n)}function GM(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=P8(a,Tje),v=Qi(y),w=Ur(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Xi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(gg,zl({},w,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(gg,zl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(gg,zl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:n}))),x.createElement(Bje,{points:t,props:y,clipPathId:i}))}function qje(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!st(u)||!st(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Le(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Le(p)?x.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function Fje(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!st(u)||!st(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Le(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Le(p)?x.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function Kje(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(qje,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(Fje,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Hje(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:o,baseLine:u}),[o,u]),S=zB(w,"recharts-area-"),j=Ak(),[k,O]=x.useState(!1),_=!k,C=x.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),T=x.useCallback(()=>{typeof y=="function"&&y(),O(!0)},[y]);if(j==null)return null;var E=i.current,A=a.current;return x.createElement(Uje,{showLabels:_,points:o},r.children,x.createElement(EB,{animationId:S,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:T,key:S},P=>{if(E){var $=E.length/o.length,F=P===1?o:o.map((B,V)=>{var ee=Math.floor(V*$);if(E[ee]){var Q=E[ee];return du(du({},B),{},{x:ya(Q.x,B.x,P),y:ya(Q.y,B.y,P)})}return B}),U;return Le(u)?U=ya(A,u,P):ir(u)||Aa(u)?U=ya(A,0,P):U=u.map((B,V)=>{var ee=Math.floor(V*$);if(Array.isArray(A)&&A[ee]){var Q=A[ee];return du(du({},B),{},{x:ya(Q.x,B.x,P),y:ya(Q.y,B.y,P)})}return B}),P>0&&(i.current=F,a.current=U),x.createElement(GM,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=o,a.current=u),x.createElement(Xi,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(Kje,{alpha:P,points:o,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(Xi,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(GM,{points:o,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(mSe,{label:r.label}))}function Gje(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(Hje,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Vje extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var S=zt("recharts-area",i),j=y,{r:k,strokeWidth:O}=kje(n),_=h8(n),C=k*2+O,T=u?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return x.createElement(Ma,{zIndex:w},x.createElement(Xi,{className:S},u&&x.createElement("defs",null,x.createElement(Nje,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:o-C/2,y:a-C/2,width:p+C,height:m+C}))),x.createElement(Gje,{needClip:u,clipPathId:j,props:this.props})),x.createElement(LM,{points:r,mainColor:Iy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&x.createElement(LM,{points:v,mainColor:Iy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var Zje={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:hr.area};function Yje(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:S}=e,j=P8(e,Pje),k=Ju(),O=qU(),{needClip:_}=C8(w,S),C=kr(),{points:T,isRange:E,baseLine:A}=(t=Ue(V=>zje(V,e.id,C)))!==null&&t!==void 0?t:{},P=PC();if(k!=="horizontal"&&k!=="vertical"||P==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=P;return!T||!T.length?null:x.createElement(Vje,zl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:A,connectNulls:o,dot:u,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:E,legendType:y,needClip:_,points:T,stroke:v,width:F,left:U,top:B,xAxisId:w,yAxisId:S}))}var Wje=(e,t,n,r,i)=>{var a=n??t;if(Le(a))return a;var o=e==="horizontal"?i:r,u=o.scale.domain();if(o.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function Qje(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,S=Wje(a,o,n,u,d),j=a==="horizontal",k=!1,O=f.map((C,T)=>{var E,A,P,$;if(w)$=i[p+T];else{var F=Gn(C,r);Array.isArray(F)?($=F,k=!0):$=[S,F]}var U=(E=(A=$)===null||A===void 0?void 0:A[1])!==null&&E!==void 0?E:null,B=U==null||w&&!t&&Gn(C,r)==null;if(j){var V;return{x:WP({axis:u,ticks:m,bandSize:v,entry:C,index:T}),y:B?null:(V=d.scale.map(U))!==null&&V!==void 0?V:null,value:$,payload:C}}return{x:B?null:(P=u.scale.map(U))!==null&&P!==void 0?P:null,y:WP({axis:d,ticks:y,bandSize:v,entry:C,index:T}),value:$,payload:C}}),_;return w||k?_=O.map(C=>{var T,E=Array.isArray(C.value)?C.value[0]:null;if(j){var A;return{x:C.x,y:E!=null&&C.y!=null&&(A=d.scale.map(E))!==null&&A!==void 0?A:null,payload:C.payload}}return{x:E!=null&&(T=u.scale.map(E))!==null&&T!==void 0?T:null,y:C.y,payload:C.payload}}):_=j?d.scale.map(S):u.scale.map(S),{points:O,baseLine:_??0,isRange:k}}function Xje(e){var t=Nr(e,Zje),n=kr();return x.createElement(kSe,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(bSe,{legendPayload:Lje(t)}),x.createElement($je,{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(TSe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Lfe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(Yje,zl({},t,{id:r}))))}var jl=x.memo(Xje,Mh);jl.displayName="Area";var Jje=["domain","range"],eNe=["domain","range"];function VM(e,t){if(e==null)return{};var n,r,i=tNe(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 tNe(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 ZM(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 R8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=VM(e,Jje),{domain:a,range:o}=t,u=VM(t,eNe);return!ZM(n,a)||!ZM(r,o)?!1:Mh(i,u)}var nNe=["type"],rNe=["dangerouslySetInnerHTML","ticks","scale"],iNe=["id","scale"];function Oj(){return Oj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oj.apply(null,arguments)}function 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 WM(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){aNe(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 aNe(e,t,n){return(t=sNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sNe(e){var t=oNe(e,"string");return typeof t=="symbol"?t:t+""}function oNe(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 Ej(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 cNe(e){var t=hn(),n=x.useRef(null),r=Ak(),{type:i}=e,a=Ej(e,nNe),o=Yv(r,"xAxis",i),u=x.useMemo(()=>{if(o!=null)return WM(WM({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(GSe(u)):n.current!==u&&t(VSe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(ZSe(n.current)),n.current=null)},[t]),null}var uNe=e=>{var{xAxisId:t,className:n}=e,r=Ue(dB),i=kr(),a="xAxis",o=Ue(k=>yU(k,a,t,i)),u=Ue(k=>R0e(k,t)),d=Ue(k=>B0e(k,t)),f=Ue(k=>M6(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=Ej(e,rNe),{id:w,scale:S}=f,j=Ej(f,iNe);return x.createElement(DC,Oj({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:zt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},dNe={allowDataOverflow:Ln.allowDataOverflow,allowDecimals:Ln.allowDecimals,allowDuplicatedCategory:Ln.allowDuplicatedCategory,angle:Ln.angle,axisLine:fs.axisLine,height:Ln.height,hide:!1,includeHidden:Ln.includeHidden,interval:Ln.interval,label:!1,minTickGap:Ln.minTickGap,mirror:Ln.mirror,orientation:Ln.orientation,padding:Ln.padding,reversed:Ln.reversed,scale:Ln.scale,tick:Ln.tick,tickCount:Ln.tickCount,tickLine:fs.tickLine,tickSize:fs.tickSize,type:Ln.type,niceTicks:Ln.niceTicks,xAxisId:0},fNe=e=>{var t=Nr(e,dNe);return x.createElement(x.Fragment,null,x.createElement(cNe,{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(uNe,t))},gh=x.memo(fNe,R8);gh.displayName="XAxis";var hNe=["type"],pNe=["dangerouslySetInnerHTML","ticks","scale"],mNe=["id","scale"];function zj(){return zj=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},zj.apply(null,arguments)}function QM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XM(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){gNe(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 gNe(e,t,n){return(t=yNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yNe(e){var t=vNe(e,"string");return typeof t=="symbol"?t:t+""}function vNe(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 Tj(e,t){if(e==null)return{};var n,r,i=xNe(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 xNe(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 bNe(e){var t=hn(),n=x.useRef(null),r=Ak(),{type:i}=e,a=Tj(e,hNe),o=Yv(r,"yAxis",i),u=x.useMemo(()=>{if(o!=null)return XM(XM({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(YSe(u)):n.current!==u&&t(WSe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(QSe(n.current)),n.current=null)},[t]),null}function wNe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),u=Ue(dB),d=kr(),f=hn(),p="yAxis",m=Ue(E=>F0e(E,t)),y=Ue(E=>q0e(E,t)),v=Ue(E=>yU(E,p,t,d)),w=Ue(E=>I6(E,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||TC(i)||x.isValidElement(i)||w==null)){var E=a.current;if(E){var A=E.getCalculatedWidth();Math.round(m.width)!==Math.round(A)&&f(XSe({id:t,width:A}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:k}=e,O=Tj(e,pNe),{id:_,scale:C}=w,T=Tj(w,mNe);return x.createElement(DC,zj({},O,T,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:zt("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var SNe={allowDataOverflow:$n.allowDataOverflow,allowDecimals:$n.allowDecimals,allowDuplicatedCategory:$n.allowDuplicatedCategory,angle:$n.angle,axisLine:fs.axisLine,hide:!1,includeHidden:$n.includeHidden,interval:$n.interval,label:!1,minTickGap:$n.minTickGap,mirror:$n.mirror,orientation:$n.orientation,padding:$n.padding,reversed:$n.reversed,scale:$n.scale,tick:$n.tick,tickCount:$n.tickCount,tickLine:fs.tickLine,tickSize:fs.tickSize,type:$n.type,niceTicks:$n.niceTicks,width:$n.width,yAxisId:0},jNe=e=>{var t=Nr(e,SNe);return x.createElement(x.Fragment,null,x.createElement(bNe,{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(wNe,t))},yh=x.memo(jNe,R8);yh.displayName="YAxis";var NNe=(e,t)=>t,LC=oe([NNe,sn,XB,Zn,MU,Ss,dbe,ar],vbe);function kNe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function $C(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(kNe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(u,d)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var D8=ri("mouseClick"),M8=zh();M8.startListening({actionCreator:D8,effect:(e,t)=>{var n=e.payload,r=LC(t.getState(),$C(n));r?.activeIndex!=null&&t.dispatch(ixe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Pj=ri("mouseMove"),I8=zh(),Xc=null,al=null,$S=null;I8.startListening({actionCreator:Pj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Xc!==null&&(cancelAnimationFrame(Xc),Xc=null),al!==null&&(typeof i!="number"||!o)&&(clearTimeout(al),al=null),$S=$C(n);var u=()=>{var d=t.getState(),f=Hh(d,d.tooltip.settings.shared);if(!$S){Xc=null,al=null;return}if(f==="axis"){var p=LC(d,$S);p?.activeIndex!=null?t.dispatch(CU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(kU())}Xc=null,al=null};if(!o){u();return}i==="raf"?Xc=requestAnimationFrame(u):typeof i=="number"&&al===null&&(al=setTimeout(u,i))}});function CNe(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 JM={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},L8=mr({name:"rootProps",initialState:JM,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:JM.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}}}),_Ne=L8.reducer,{updateOptions:ANe}=L8.actions,ONe=null,ENe={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)},$8=mr({name:"polarOptions",initialState:ONe,reducers:ENe}),{updatePolarOptions:x_e}=$8.actions,zNe=$8.reducer,B8=ri("keyDown"),U8=ri("focus"),q8=ri("blur"),l0=zh(),Jc=null,sl=null,Wm=null;l0.startListening({actionCreator:B8,effect:(e,t)=>{Wm=e.payload,Jc!==null&&(cancelAnimationFrame(Jc),Jc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");sl!==null&&(typeof r!="number"||!a)&&(clearTimeout(sl),sl=null);var o=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=Wm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=Bf(f,Hl(u),Lu(u),Bu(u)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=Ss(u),S=Hl(u),j=Hh(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=zy(u,j,"hover",String(f.index));t.dispatch(Ey({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var O=Z0e(u),_=O==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,T;if(v){var E=Lu(u),A=Bu(u),P=C*_,$=ee=>({active:!1,index:String(ee),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,P>0){for(var F=0;F<S.length;F++)if(Bf($(F),S,E,A)!=null){T=F;break}}else for(var U=S.length-1;U>=0;U--)if(Bf($(U),S,E,A)!=null){T=U;break}if(T<0)return}else{T=y+C*_;var B=w?.length||S.length;if(B===0||T>=B||T<0)return}var V=zy(u,j,"hover",String(T));t.dispatch(Ey({active:!0,activeIndex:T.toString(),activeCoordinate:V}))}finally{Jc=null,sl=null}};if(!a){o();return}r==="raf"?Jc=requestAnimationFrame(o):typeof r=="number"&&sl===null&&(o(),Wm=null,sl=setTimeout(()=>{Wm?o():(sl=null,Jc=null)},r))}});l0.startListening({actionCreator:U8,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=Hh(n,n.tooltip.settings.shared),u=zy(n,o,"hover",String(a));t.dispatch(Ey({active:!0,activeIndex:a,activeCoordinate:u}))}}}});l0.startListening({actionCreator:q8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Ey({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function F8(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 xi=ri("externalEvent"),K8=zh(),Qm=new Map,jf=new Map,BS=new Map;K8.startListening({actionCreator:xi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=F8(r);BS.set(i,{handler:n,reactEvent:a});var o=Qm.get(i);o!==void 0&&(cancelAnimationFrame(o),Qm.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),y=jf.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),jf.delete(i));var v=()=>{var j=BS.get(i);try{if(!j)return;var{handler:k,reactEvent:O}=j,_=t.getState(),C={activeCoordinate:Wxe(_),activeDataKey:Vxe(_),activeIndex:hh(_),activeLabel:$U(_),activeTooltipIndex:hh(_),isTooltipActive:Qxe(_)};k&&k(C,O)}finally{Qm.delete(i),jf.delete(i),BS.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);Qm.set(i,w)}else if(typeof d=="number"){if(!jf.has(i)){v();var S=setTimeout(v,d);jf.set(i,S)}}else v()}}});var TNe=oe([od],e=>e.tooltipItemPayloads),PNe=oe([TNe,(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)}}}),H8=ri("touchMove"),G8=zh(),ol=null,eo=null,eI=null,Nf=null;G8.startListening({actionCreator:H8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Nf=F8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");ol!==null&&(cancelAnimationFrame(ol),ol=null),eo!==null&&(typeof i!="number"||!o)&&(clearTimeout(eo),eo=null),eI=Array.from(n.touches).map(d=>$C({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Nf!=null){var d=t.getState(),f=Hh(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=eI)===null||p===void 0?void 0:p[0];if(m==null){ol=null,eo=null;return}var y=LC(d,m);y?.activeIndex!=null&&t.dispatch(CU({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=Nf.touches[0];if(document.elementFromPoint==null||w==null)return;var S=document.elementFromPoint(w.clientX,w.clientY);if(!S||!S.getAttribute)return;var j=S.getAttribute(Hfe),k=(v=S.getAttribute(Gfe))!==null&&v!==void 0?v:void 0,O=ic(d).find(T=>T.id===k);if(j==null||O==null||k==null)return;var{dataKey:_}=O,C=PNe(d,j,k);t.dispatch(rxe({activeDataKey:_,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}ol=null,eo=null}};if(!o){u();return}i==="raf"?ol=requestAnimationFrame(u):typeof i=="number"&&eo===null&&(u(),Nf=null,eo=setTimeout(()=>{Nf?u():(eo=null,ol=null)},i))}}});var V8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Z8=mr({name:"eventSettings",initialState:V8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:RNe}=Z8.actions,DNe=Z8.reducer,MNe=T3({brush:l1e,cartesianAxis:JSe,chartData:Ybe,errorBars:jje,eventSettings:DNe,graphicalItems:ESe,layout:Ofe,legend:$he,options:Kbe,polarAxis:ySe,polarOptions:zNe,referenceElements:g1e,renderedTicks:H1e,rootProps:_Ne,tooltip:axe,zIndex:zbe}),INe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return efe({reducer:MNe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([M8.middleware,I8.middleware,l0.middleware,K8.middleware,G8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(V3({type:"raf"}))},devTools:{serialize:{replacer:CNe},name:"recharts-".concat(n)}})};function LNe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=kr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=INe(t,r));var o=yk;return x.createElement(rpe,{context:o,store:a.current},n)}function $Ne(e){var{layout:t,margin:n}=e,r=hn(),i=kr();return x.useEffect(()=>{i||(r(Cfe(t)),r(kfe(n)))},[r,i,t,n]),null}var BNe=x.memo($Ne,Mh);function UNe(e){var t=hn();return x.useEffect(()=>{t(ANe(e))},[t,e]),null}var qNe=e=>{var t=hn();return x.useEffect(()=>{t(RNe(e))},[t,e]),null},FNe=x.memo(qNe,Mh);function tI(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=hn();return x.useLayoutEffect(()=>(r.current&&i(Obe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Ebe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function nI(e){var{children:t,isPanorama:n}=e,r=Ue(bbe);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(tI,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(tI,{key:o,zIndex:o,isPanorama:n})))}var KNe=["children"];function HNe(e,t){if(e==null)return{};var n,r,i=GNe(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 GNe(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 Ly(){return Ly=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ly.apply(null,arguments)}var VNe={width:"100%",height:"100%",display:"block"},ZNe=x.forwardRef((e,t)=>{var n=Ck(),r=_k(),i=CB();if(!Oa(n)||!Oa(r))return null;var{children:a,otherAttributes:o,title:u,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),x.createElement(lk,Ly({},o,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:VNe,ref:t}),a)}),YNe=e=>{var{children:t}=e,n=Ue(qv);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(lk,{width:r,height:i,x:o,y:a},t)},rI=x.forwardRef((e,t)=>{var{children:n}=e,r=HNe(e,KNe),i=kr();return i?x.createElement(YNe,null,x.createElement(nI,{isPanorama:!0},n)):x.createElement(ZNe,Ly({ref:t},r),x.createElement(nI,{isPanorama:!1},n))});function WNe(){var e=hn(),[t,n]=x.useState(null),r=Ue(Kfe);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;st(a)&&a!==r&&e(Afe(a))}},[t,e,r]),n}function iI(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 QNe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){XNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XNe(e,t,n){return(t=JNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JNe(e){var t=eke(e,"string");return typeof t=="symbol"?t:t+""}function eke(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(){return So=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},So.apply(null,arguments)}var tke=()=>(iwe(),null);function $y(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var nke=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:$y((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:$y((r=e.style)===null||r===void 0?void 0:r.height)}),u=x.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=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();u(p,m);var y=w=>{var S=w[0];if(S!=null){var{width:j,height:k}=S.contentRect;u(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,u]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),x.createElement(x.Fragment,null,x.createElement(Rh,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",So({ref:d},e)))}),rke=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:$y(n),containerHeight:$y(r)}),o=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),u=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(Rh,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",So({ref:u},e)))}),ike=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Rh,{width:n,height:r}),x.createElement("div",So({ref:t},e)))}),ake=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(rke,So({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(ike,So({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Rh,{width:n,height:r}),x.createElement("div",So({ref:t},e)))});function ske(e){return e?nke:ake}var oke=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:j,width:k,responsive:O,dispatchTouchEvents:_=!0}=e,C=x.useRef(null),T=hn(),[E,A]=x.useState(null),[P,$]=x.useState(null),F=WNe(),U=Nk(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,ee=x.useCallback(pe=>{F(pe),typeof t=="function"&&t(pe),A(pe),$(pe),pe!=null&&(C.current=pe)},[F,t,A,$]),Q=x.useCallback(pe=>{T(D8(pe)),T(xi({handler:a,reactEvent:pe}))},[T,a]),K=x.useCallback(pe=>{T(Pj(pe)),T(xi({handler:f,reactEvent:pe}))},[T,f]),te=x.useCallback(pe=>{T(kU()),T(xi({handler:p,reactEvent:pe}))},[T,p]),le=x.useCallback(pe=>{T(Pj(pe)),T(xi({handler:m,reactEvent:pe}))},[T,m]),je=x.useCallback(()=>{T(U8())},[T]),L=x.useCallback(()=>{T(q8())},[T]),I=x.useCallback(pe=>{T(B8(pe.key))},[T]),q=x.useCallback(pe=>{T(xi({handler:o,reactEvent:pe}))},[T,o]),R=x.useCallback(pe=>{T(xi({handler:u,reactEvent:pe}))},[T,u]),G=x.useCallback(pe=>{T(xi({handler:d,reactEvent:pe}))},[T,d]),ie=x.useCallback(pe=>{T(xi({handler:y,reactEvent:pe}))},[T,y]),ne=x.useCallback(pe=>{T(xi({handler:S,reactEvent:pe}))},[T,S]),Ce=x.useCallback(pe=>{_&&T(H8(pe)),T(xi({handler:w,reactEvent:pe}))},[T,_,w]),Se=x.useCallback(pe=>{T(xi({handler:v,reactEvent:pe}))},[T,v]),J=ske(O);return x.createElement(VU.Provider,{value:E},x.createElement(H$.Provider,{value:P},x.createElement(J,{width:B??j?.width,height:V??j?.height,className:zt("recharts-wrapper",r),style:QNe({position:"relative",cursor:"default",width:B,height:V},j),onClick:Q,onContextMenu:q,onDoubleClick:R,onFocus:je,onBlur:L,onKeyDown:I,onMouseDown:G,onMouseEnter:K,onMouseLeave:te,onMouseMove:le,onMouseUp:ie,onTouchEnd:Se,onTouchMove:Ce,onTouchStart:ne,ref:ee},x.createElement(tke,null),n)))}),lke=["width","height","responsive","children","className","style","compact","title","desc"];function cke(e,t){if(e==null)return{};var n,r,i=uke(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 uke(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 dke=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:u,compact:d,title:f,desc:p}=e,m=cke(e,lke),y=Qi(m);return d?x.createElement(x.Fragment,null,x.createElement(Rh,{width:n,height:r}),x.createElement(rI,{otherAttributes:y,title:f,desc:p},a)):x.createElement(oke,{className:o,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(rI,{otherAttributes:y,title:f,desc:p,ref:t},x.createElement(y1e,null,a)))});function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rj.apply(null,arguments)}function 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 fke(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){hke(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 hke(e,t,n){return(t=pke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pke(e){var t=mke(e,"string");return typeof t=="symbol"?t:t+""}function mke(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 gke={top:5,right:5,bottom:5,left:5},yke=fke({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:gke,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},V8),vke=x.forwardRef(function(t,n){var r,i=Nr(t.categoricalChartProps,yke),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(LNe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(o1e,{chartData:f.data}),x.createElement(BNe,{layout:i.layout,margin:i.margin}),x.createElement(FNe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(UNe,{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(dke,Rj({},i,{ref:n})))}),xke=["axis"],By=x.forwardRef((e,t)=>x.createElement(vke,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:xke,tooltipPayloadSearcher:qbe,categoricalChartProps:e,ref:t}));const Su={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},po={fill:"#71717a",fontSize:11},bke="#27272a",vh="#27272a",mo=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function Y8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function Uy(e){return Y8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function qy(e){const t=Y8(e);return`${t.getMonth()+1}/${t.getDate()}`}const wke=["7d","30d","90d","all"],Ske=["gap","cited","uncited"],W8={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"},jke={[uo.mentioned]:"Mentioned",[uo.cited]:"Cited"};function Nke({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(uo.mentioned),[a,o]=x.useState(null),[u,d,f]=kI({queries:[{queryKey:He.analytics.metrics(e,t),queryFn:()=>Z7(e,t),staleTime:Pf},{queryKey:He.analytics.gaps(e,t),queryFn:()=>Y7(e,t),staleTime:Pf},{queryKey:He.analytics.sources(e,t),queryFn:()=>W7(e,t),staleTime:Pf}]}),p=u.data??null,m=d.data??null,y=f.data??null,v=u.isLoading||d.isLoading||f.isLoading;if(x.useEffect(()=>{o(null)},[r]),v&&!p)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const w=r===uo.mentioned,S=p?w?p.overall.mentionRate:p.overall.citationRate:0,j=p?w?p.overall.mentionedCount:p.overall.cited:0,k=p?.overall.total??0,O=p?w?p.mentionTrend:p.trend:"stable",_=O==="improving"?"positive":O==="declining"?"negative":"neutral",C=m?w?m.mentionedKeywords:m.cited:[],T=m?w?m.mentionGap:m.gap:[],E=m?w?m.notMentioned:m.uncited:[];return l.jsxs(l.Fragment,{children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:w?"Mention Metrics":"Citation Metrics"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:[w?"Answer-Mention Trends":"Source-Citation Trends",l.jsx(Tn,{text:w?"Percentage of queries where your brand or domain is mentioned in the AI-generated answer text. A higher rate means AI engines are actively naming your brand in their prose when answering user questions.":"Percentage of queries where your domain appears in the AI provider's source/reference links. This measures whether your pages are used as grounding sources, not whether your brand is named in the answer."})]})]}),l.jsx("div",{className:"sidebar-tabs ml-2",children:[uo.mentioned,uo.cited].map(A=>l.jsx("button",{type:"button",className:`sidebar-tab ${r===A?"sidebar-tab--active":""}`,onClick:()=>i(A),children:jke[A]},A))})]}),l.jsx("div",{className:"flex gap-1",children:wke.map(A=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===A?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(A),children:A==="all"?"All":A},A))})]}),p&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(q$,{value:`${Math.round(S*100)}`,label:w?"Mention Rate":"Citation Rate",delta:`${j} / ${k}`,tone:_,description:`Trend: ${O}`,isNumeric:!0}),l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),l.jsx(wt,{tone:_,children:O})]}),Object.keys(p.byProvider).length>0&&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("th",{className:"text-left py-1 font-medium",children:"Provider"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),l.jsx("th",{className:"text-right py-1 font-medium",children:w?"Mentioned / Total":"Cited / Total"})]})}),l.jsx("tbody",{children:Object.entries(p.byProvider).map(([A,P])=>{const $=w?P.mentionRate:P.citationRate,F=w?P.mentionedCount:P.cited;return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300",children:A}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[($*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[F," / ",P.total]})]},A)})})]})]})]}),p.buckets.length>=1&&l.jsx(kke,{buckets:p.buckets,keywordChanges:p.keywordChanges??[],metricMode:r})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",l.jsx(Tn,{text:w?"Classification based on the most recent completed run. Mentioned: your brand was named in the AI answer text. Gap: a competitor was cited but your brand was not mentioned. Not Mentioned: your brand was not mentioned and no competitors were cited.":"Classification based on the most recent completed run. Cited: your domain appeared in the AI provider's source links. Gap: a competitor was cited but you were not. Not Cited: neither your domain nor competitors appeared in sources. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),m&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-1 mb-4",children:Ske.map(A=>{const P=A==="cited"?C.length:A==="gap"?T.length:E.length,$=a===A,F=A==="gap"?"Gap":A==="cited"?w?"Mentioned":"Cited":w?"Not Mentioned":"Not Cited";return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${$?A==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":A==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>o($?null:A),children:[F," (",P,")"]},A)})}),l.jsx(Cke,{citedRows:C,gapRows:T,uncitedRows:E,filter:a,metricMode:r})]})]}),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:"Source Intelligence"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",l.jsx(Tn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),y&&y.overall.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(_ke,{categories:y.overall}),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("th",{className:"text-left py-1 font-medium",children:"Category"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),l.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),l.jsx("tbody",{children:y.overall.map(A=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[l.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${W8[A.category]??"bg-zinc-600"}`}),A.label]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:A.count}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(A.percentage*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:A.topDomains.slice(0,3).map(P=>P.domain).join(", ")})]},A.category))})]})]}),y&&y.overall.length===0&&l.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function kke({buckets:e,keywordChanges:t,metricMode:n}){const r=n===uo.mentioned,i=r?"mentionRate":"citationRate",a=r?"Mention Rate":"Citation Rate",o=e.map(d=>({date:d.startDate,mentionRate:Math.round(d.mentionRate*1e3)/10,citationRate:Math.round(d.citationRate*1e3)/10,keywordCount:d.keywordCount??0})),u=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const d=new Date(e[0].startDate).getTime(),f=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const m=new Date(p.date).getTime();return m>=d&&m<=f}).map(p=>{const m=new Date(p.date).getTime();let y=e[0].startDate,v=Math.abs(m-new Date(y).getTime());for(const w of e){const S=Math.abs(m-new Date(w.startDate).getTime());S<v&&(y=w.startDate,v=S)}return{...p,date:y}})},[e,t]);return l.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[l.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),l.jsx("div",{className:"h-40",role:"img","aria-label":`${a} trend chart`,children:l.jsx(oy,{width:"100%",height:"100%",children:l.jsxs(By,{data:o,margin:{top:8,right:8,bottom:0,left:0},children:[l.jsx(N8,{strokeDasharray:"3 3",stroke:bke,vertical:!1}),l.jsx(gh,{dataKey:"date",tick:po,tickLine:!1,axisLine:{stroke:vh},tickFormatter:qy}),l.jsx(yh,{tick:po,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:d=>`${d}%`,width:40}),l.jsx(Ty,{...Su,labelFormatter:Uy,formatter:(d,f)=>{const p=typeof d=="number"?d:Number(d??0);return String(f)===i?[`${p.toFixed(1)}%`,a]:[String(p),String(f)]}}),u.map(d=>l.jsx(b8,{x:d.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:d.label,position:"top",fill:"#71717a",fontSize:9}},d.date)),l.jsx(jl,{type:"monotone",dataKey:i,stroke:mo[0],fill:mo[0],fillOpacity:.15,strokeWidth:2,dot:{fill:mo[0],r:3,strokeWidth:0},activeDot:{fill:mo[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Cke({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const a=i===uo.mentioned,o=x.useMemo(()=>{const u=[...t.map(d=>({...d,_sort:0})),...e.map(d=>({...d,_sort:1})),...n.map(d=>({...d,_sort:2}))];return r?u.filter(d=>d.category===r):u.sort((d,f)=>d._sort-f._sort)},[e,t,n,r]);return o.length===0?l.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",r?` with status "${r}"`:"","."]}):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("th",{className:"text-left py-1 font-medium",children:"Keyword"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-1 font-medium",children:a?"Providers Mentioning":"Providers Citing"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),l.jsx("tbody",{children:o.map(u=>{const d=u.category==="cited"?"positive":u.category==="gap"?"caution":"neutral",f=u.category==="gap"?"Gap":u.category==="cited"?a?"Mentioned":"Cited":a?"Not Mentioned":"Not Cited",p=a?u.consistency.mentionedRuns:u.consistency.citedRuns;return l.jsxs("tr",{className:`border-t border-zinc-800/40 ${u.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[l.jsx("td",{className:"py-1.5 text-zinc-200",children:u.keyword}),l.jsx("td",{className:"py-1.5",children:l.jsx(wt,{tone:d,children:f})}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.providers.length>0?u.providers.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.competitorsCiting.length>0?u.competitorsCiting.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:u.consistency.totalRuns>0?`${p}/${u.consistency.totalRuns} runs`:"—"})]},u.keywordId)})})]})}function _ke({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:l.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const r=n.count/t*100;return r<.5?null:l.jsx("div",{className:`${W8[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Ake=6,Uu="__other__",ju="_socialTotal";function Oke(e,t=Ake){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),u=new Map;for(const p of e){let m=u.get(p.date);m||(m={date:p.date,[ju]:0},u.set(p.date,m));const y=a.has(p.source)?p.source:Uu;m[y]=(m[y]??0)+p.sessions,m[ju]=(m[ju]??0)+p.sessions}const d=[...u.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return o>0&&f.push(Uu),{data:d,sources:f,otherCount:o}}function Nu(e){return e.replace(/\+/g," ")}function Q8(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const Eke=["7d","30d","90d","all"],so=mo,Dj="#71717a",X8="#52525b",kf=25;function Xm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function zke(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 Tke({projectName:e}){const t=Pi(),[n,r]=x.useState(null),[i,a]=x.useState(null),[o,u]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(null),[w,S]=x.useState(null),[j,k]=x.useState("sessions"),[O,_]=x.useState("desc"),[C,T]=x.useState("sessions"),[E,A]=x.useState("desc"),[P,$]=x.useState("sessions"),[F,U]=x.useState("desc"),[B,V]=x.useState("sessions"),[ee,Q]=x.useState("desc"),[K,te]=x.useState([]),[le,je]=x.useState([]),[L,I]=x.useState([]),[q,R]=x.useState(!1),[G,ie]=x.useState("30d");async function ne(de){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:He.traffic.status(e),queryFn:()=>Q7(e),staleTime:of});if(de.current)return;if(r(ze),!ze.connected){a(null),te([]),je([]),I([]),u(!1);return}const[fe,Ve,Dn,ai]=await Promise.all([t.fetchQuery({queryKey:He.traffic.summary(e,G),queryFn:()=>X7(e,void 0,G),staleTime:of}),t.fetchQuery({queryKey:He.traffic.aiHistory(e,G),queryFn:()=>eG(e,G).catch(()=>[]),staleTime:of}),t.fetchQuery({queryKey:He.traffic.sessionHistory(e,G),queryFn:()=>nG(e,G).catch(()=>[]),staleTime:of}),t.fetchQuery({queryKey:He.traffic.socialHistory(e,G),queryFn:()=>tG(e,G).catch(()=>[]),staleTime:of})]);if(de.current)return;a(fe),te(Ve),je(Dn),I(ai),u(!1)}catch(ze){if(de.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const de={current:!1};return ne(de),()=>{de.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),S(null);try{const de=await rL(e);S(`Synced ${de.rowCount.toLocaleString()} page rows, ${de.aiReferralCount.toLocaleString()} AI and ${de.socialReferralCount.toLocaleString()} social referral rows (${de.days} days)`),await t.invalidateQueries({queryKey:He.traffic.project(e)}),await ne({current:!1})}catch(de){v(de instanceof Error?de.message:"Sync failed")}finally{f(!1)}}async function Se(){m(!0),v(null),S(null);try{await rG(e),await t.invalidateQueries({queryKey:He.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),S("GA4 disconnected")}catch(de){v(de instanceof Error?de.message:"Disconnect failed")}finally{m(!1)}}function J(de){j===de?_(ze=>ze==="desc"?"asc":"desc"):(k(de),_("desc"))}function pe(de){C===de?A(ze=>ze==="desc"?"asc":"desc"):(T(de),A("desc"))}function Oe(de){P===de?U(ze=>ze==="desc"?"asc":"desc"):($(de),U("desc"))}function W(de){B===de?Q(ze=>ze==="desc"?"asc":"desc"):(V(de),Q("desc"))}const Fe=x.useMemo(()=>i?.topPages?[...i.topPages].sort((de,ze)=>{const fe=de[j],Ve=ze[j];return typeof fe=="string"&&typeof Ve=="string"?O==="asc"?fe.localeCompare(Ve):Ve.localeCompare(fe):O==="asc"?fe-Ve:Ve-fe}):[],[i?.topPages,j,O]),Te=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((de,ze)=>{const fe=de[C],Ve=ze[C];return typeof fe=="string"&&typeof Ve=="string"?E==="asc"?fe.localeCompare(Ve):Ve.localeCompare(fe):E==="asc"?fe-Ve:Ve-fe}):[],[i?.aiReferrals,C,E]),it=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((de,ze)=>{const fe=de[B],Ve=ze[B];return typeof fe=="string"&&typeof Ve=="string"?ee==="asc"?fe.localeCompare(Ve):Ve.localeCompare(fe):ee==="asc"?fe-Ve:Ve-fe}):[],[i?.aiReferralLandingPages,B,ee]),Ze=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((de,ze)=>{const fe=de[P],Ve=ze[P];return typeof fe=="string"&&typeof Ve=="string"?F==="asc"?fe.localeCompare(Ve):Ve.localeCompare(fe):F==="asc"?fe-Ve:Ve-fe}):[],[i?.socialReferrals,P,F]),{socialChartData:Lt,socialChartSources:Rt,socialOtherCount:en}=x.useMemo(()=>{const de=Oke(L);return{socialChartData:de.data,socialChartSources:de.sources,socialOtherCount:de.otherCount}},[L]),{chartData:we,chartSources:Je,dateRange:ot}=x.useMemo(()=>{const de=[...new Set(K.map(Yt=>Yt.source))],ze=new Map;for(const Yt of le)ze.set(Yt.date,{_totalSessions:Yt.sessions,_organicSessions:Yt.organicSessions});const fe=new Map;for(const Yt of K){const bn=`${Yt.date}::${Yt.source}`,_r=fe.get(bn)??0;fe.set(bn,Math.max(_r,Yt.sessions))}for(const[Yt,bn]of fe){const[_r,Li]=Yt.split("::");let ia=ze.get(_r);ia||(ia={_totalSessions:0,_organicSessions:0},ze.set(_r,ia)),ia[Li]=(ia[Li]??0)+bn}const Ve=[...ze.entries()].sort(([Yt],[bn])=>Yt.localeCompare(bn)).map(([Yt,bn])=>({date:Yt,...bn})),Dn=Ve.map(Yt=>Yt.date),ai=Dn.length>0?{start:Dn[0],end:Dn[Dn.length-1]}:null;return{chartData:Ve,chartSources:de,dateRange:ai}},[K,le]);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(Pke,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:He.traffic.project(e)}),await ne({current:!1})))()}});const Fn=i?.organicSharePctDisplay??"0%",et=i?.totalOrganicSessions??0,St=i?.aiSessionsDeduped??0,ce=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",De=i?new Set(i.aiReferrals.map(de=>de.source.toLowerCase())).size:0,Ge=Te[0]??null,ht=i?.totalDirectSessions??0,on=i?.directSharePctDisplay??"0%",xn=i?.socialSessions??0,ln=i?.socialSharePctDisplay??"0%",Ye=i?new Set(i.socialReferrals.map(de=>de.source.toLowerCase())).size:0,$t=Ze[0]??null;return l.jsxs(l.Fragment,{children:[y&&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:y}),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(xe,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[l.jsx(O2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),l.jsxs(xe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:Se,children:[l.jsx(NV,{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(Tn,{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:Eke.map(de=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===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:()=>ie(de),children:de==="all"?"All":de},de))})]}),i?l.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[l.jsx(US,{value:Xm(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),l.jsx(US,{value:Xm(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Fn} of total`,tone:"positive"}),l.jsx(US,{value:Xm(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(xe,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[l.jsx(O2,{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(Tn,{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)."})]})]}),ot&&l.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(ot.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(ot.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),we.length>0&&l.jsxs($e,{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:Je.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Je.length===0&&l.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Je.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(oy,{width:"100%",height:"100%",children:l.jsxs(By,{data:we,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(gh,{dataKey:"date",tick:po,tickLine:!1,axisLine:{stroke:vh},tickFormatter:qy}),l.jsx(yh,{tick:po,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(Ty,{...Su,labelFormatter:Uy,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Ve=String(ze??"");return Ve==="_totalSessions"?[fe,"Total Sessions"]:Ve==="_organicSessions"?[fe,"Organic Sessions"]:[fe,Ve]}}),l.jsx(NB,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:de=>de==="_totalSessions"?"Total Sessions":de==="_organicSessions"?"Organic Sessions":de}),l.jsx(jl,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Je.map((de,ze)=>l.jsx(jl,{type:"monotone",dataKey:de,stackId:"ai",stroke:so[ze%so.length],fill:so[ze%so.length],fillOpacity:.4,strokeWidth:1.5},de))]})})})]}),l.jsxs($e,{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(pa,{label:"Organic",value:Fn,hint:`${et.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),l.jsx(pa,{label:"Social",value:ln,hint:`${xn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),l.jsx(pa,{label:"Direct",value:on,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(pa,{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($e,{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?`${De} 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(or,{label:"Source",sortKey:"source",current:C,dir:E,onSort:pe,align:"left"}),l.jsx(or,{label:"Medium",sortKey:"medium",current:C,dir:E,onSort:pe,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:C,dir:E,onSort:pe,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(or,{label:"Users",sortKey:"users",current:C,dir:E,onSort:pe,align:"right"})]})}),l.jsx("tbody",{children:Te.map(de=>l.jsx(Dke,{referral:de,totalSessions:St},`${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($e,{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:it.length>0?`${it.length} rows`:"No landing-page rows"})]}),it.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(or,{label:"Landing Page",sortKey:"landingPage",current:B,dir:ee,onSort:W,align:"left"}),l.jsx(or,{label:"Source",sortKey:"source",current:B,dir:ee,onSort:W,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:B,dir:ee,onSort:W,align:"right"}),l.jsx(or,{label:"Users",sortKey:"users",current:B,dir:ee,onSort:W,align:"right"})]})}),l.jsx("tbody",{children:it.map(de=>l.jsx(Mke,{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(Tn,{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."})]})]}),Lt.length>0&&l.jsxs($e,{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"})]}),en>0&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Rt.length-1," sources · ",en," more grouped as Other"]})]}),l.jsx("div",{className:"h-64",children:l.jsx(oy,{width:"100%",height:"100%",children:l.jsxs(By,{data:Lt,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(gh,{dataKey:"date",tick:po,tickLine:!1,axisLine:{stroke:vh},tickFormatter:qy}),l.jsx(yh,{tick:po,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(Ty,{...Su,labelFormatter:Uy,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Ve=String(ze??"");if(Ve===ju)return[fe,"Total Social"];if(Ve===Uu){const Dn=`Other (${en} source${en===1?"":"s"})`;return[fe,Dn]}return[fe,Nu(Ve)]}}),l.jsx(jl,{type:"monotone",dataKey:ju,stroke:X8,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Rt.map((de,ze)=>{const Ve=de===Uu?Dj:so[ze%so.length];return l.jsx(jl,{type:"monotone",dataKey:de,stackId:"social",stroke:Ve,fill:Ve,fillOpacity:.4,strokeWidth:1.5},de)})]})})}),l.jsx(Lke,{sources:Rt,otherCount:en})]}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[l.jsxs($e,{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(pa,{label:"Social Sessions",value:Xm(xn),hint:`${xn.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),l.jsx(pa,{label:"Share of Traffic",value:ln,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),l.jsx(pa,{label:"Platforms",value:String(Ye),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."})]}),$t&&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:`${$t.source} via ${$t.medium}`,children:Q8(Nu($t.source),64)}),l.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:$t.medium,children:["via ",Nu($t.medium)," · ",$t.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(pa,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),l.jsx(pa,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),l.jsx(pa,{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($e,{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?Ze.length>kf&&!q?`Top ${kf} of ${Ze.length}`:`${Ze.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-[40%]"}),l.jsx("col",{className:"w-[28%]"}),l.jsx("col",{className:"w-[12%]"}),l.jsx("col",{className:"w-[8%]"}),l.jsx("col",{className:"w-[6%]"}),l.jsx("col",{className:"w-[6%]"})]}),l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(or,{label:"Source",sortKey:"source",current:P,dir:F,onSort:Oe,align:"left"}),l.jsx(or,{label:"Medium",sortKey:"medium",current:P,dir:F,onSort:Oe,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:P,dir:F,onSort:Oe,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(or,{label:"Users",sortKey:"users",current:P,dir:F,onSort:Oe,align:"right"})]})}),l.jsx("tbody",{children:(q?Ze:Ze.slice(0,kf)).map(de=>l.jsx(Ike,{referral:de,totalSessions:xn},`${de.source}:${de.medium}:${de.channelGroup}`))})]})}),Ze.length>kf&&l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("button",{type:"button",onClick:()=>R(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:q?`Show top ${kf}`:`Show all ${Ze.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(Tn,{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(or,{label:"Landing Page",sortKey:"landingPage",current:j,dir:O,onSort:J,align:"left"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:j,dir:O,onSort:J,align:"right"}),l.jsx(or,{label:"Organic",sortKey:"organicSessions",current:j,dir:O,onSort:J,align:"right"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),l.jsx(or,{label:"Users",sortKey:"users",current:j,dir:O,onSort:J,align:"right"})]})}),l.jsx("tbody",{children:Fe.map(de=>l.jsx(Rke,{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 ${zke(i.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function Pke({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[o,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),y=x.useRef(null),v=x.useCallback(S=>{const j=S.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const O=k.result;try{const _=JSON.parse(O);if(!_.client_email||!_.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),u(null);return}u(O)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),u(null)}},k.onerror=()=>{m("Failed to read file."),u(null)},k.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 J7(e,{propertyId:n.trim(),keyJson:o});try{await rL(e)}catch{}t()}catch(S){m(S instanceof Error?S.message:"Failed to connect GA4")}finally{f(!1)}}return l.jsxs($e,{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:S=>r(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),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:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[l.jsx(CV,{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(xe,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function or({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 J8={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function US({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 ${J8[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function pa({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(Tn,{text:i})]}),l.jsx("p",{className:`text-xl font-semibold tabular-nums ${J8[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Rke({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 eq={session:"Session",first_user:"First Visit",manual_utm:"UTM"},tq={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 Dke({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=eq[e.sourceDimension]??e.sourceDimension,i=tq[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 Mke({row:e}){const t=eq[e.sourceDimension]??e.sourceDimension,n=tq[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 Ike({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Nu(e.source),a=Nu(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 Lke({sources:e,otherCount:t}){const n=[{key:ju,color:X8,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===Uu)n.push({key:Uu,color:Dj,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Nu(i);n.push({key:i,color:so[r%so.length]??Dj,label:Q8(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 Vh(e){e.invalidateQueries({queryKey:He.runs.all}),e.invalidateQueries({queryKey:He.projects.all})}function $ke(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Bke(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 c0(e,t){d5({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),gt({title:$ke(e.kind),detail:Bke(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function Uke(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){gt({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)d5({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=zJ({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});gt({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 u0(e,t){if(e instanceof Oi&&e.code==="RUN_IN_PROGRESS"){gt({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}gt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function nq(){const e=Pi();return xh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>l7(t,n),onSuccess:(t,n)=>{Vh(e),c0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{u0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function qke(){const e=Pi();return xh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>_7(t),onSuccess:t=>{Vh(e),Uke(t)},onError:t=>{gt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Fke(){const e=Pi();return xh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>JI(t,n),onSuccess:(t,n)=>{Vh(e),c0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{u0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function Kke(){const e=Pi();return xh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>B7(t),onSuccess:(t,n)=>{Vh(e),c0(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{u0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Hke(){const e=Pi();return xh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>L7(t,n),onSuccess:(t,n)=>{Vh(e),c0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{u0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const Gke=["7d","30d","90d","all"];function Vke({projectName:e}){const t=Pi(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[o,u]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[y,v]=x.useState([]),[w,S]=x.useState(null),[j,k]=x.useState(""),[O,_]=x.useState(""),[C,T]=x.useState("30"),[E,A]=x.useState(!1),[P,$]=x.useState("30d"),[F,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(""),[ee,Q]=x.useState(!0),[K,te]=x.useState(!1),[le,je]=x.useState(!1),[L,I]=x.useState(!1),[q,R]=x.useState(!1),[G,ie]=x.useState(!1),[ne,Ce]=x.useState(!1),[Se,J]=x.useState(null),[pe,Oe]=x.useState(!1),[W,Fe]=x.useState(!1),[Te,it]=x.useState(null),[Ze,Lt]=x.useState(""),[Rt,en]=x.useState(!1),[we,Je]=x.useState(!1),[ot,Fn]=x.useState("indexed"),[et,St]=x.useState(null),ce=x.useMemo(()=>{if(!et)return d;const{key:Z,dir:ke}=et;return[...d].sort((Xe,jt)=>{const wn=Z===fo.CTR?Number.isFinite(Xe.ctr)?Xe.ctr:0:Xe[Z],aa=Z===fo.CTR?Number.isFinite(jt.ctr)?jt.ctr:0:jt[Z];return ke==="asc"?wn-aa:aa-wn})},[d,et]),[Ne,De]=x.useState([]),[Ge,ht]=x.useState(null),[on,xn]=x.useState(!1),[ln,Ye]=x.useState(null),[$t,de]=x.useState(null),ze=i.find(Z=>Z.connectionType==="gsc"),fe=d.length>0||p.length>0||y.length>0,Ve=Fke(),Dn=Kke(),ai=Hke();async function Yt(Z){if(!Z){u([]),k("");return}je(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:He.gsc.properties(e),queryFn:()=>E7(e),staleTime:dr});u(ke),k(Z.propertyId??ke[0]?.siteUrl??"")}catch(ke){u([]),Ye(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{je(!1)}}async function bn(){R(!0);try{const Z={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:P},ke=await t.fetchQuery({queryKey:He.gsc.performance(e,Z),queryFn:()=>P7(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:parseInt(F.limit,10)||20,window:P}),staleTime:dr});f(ke)}catch(Z){f([]),Ye(Z instanceof Error?Z.message:"Failed to load GSC performance data")}finally{R(!1)}}async function _r(){ie(!0);try{const Z=B.trim()||void 0,[ke,Xe]=await Promise.all([t.fetchQuery({queryKey:He.gsc.inspections(e,Z),queryFn:()=>D7(e,{url:Z,limit:20}),staleTime:dr}),t.fetchQuery({queryKey:He.gsc.deindexed(e),queryFn:()=>M7(e),staleTime:dr})]);m(ke),v(Xe)}catch(Z){m([]),v([]),Ye(Z instanceof Error?Z.message:"Failed to load GSC inspection history")}finally{ie(!1)}}async function Li(){Oe(!0);try{const[Z,ke]=await Promise.all([t.fetchQuery({queryKey:He.gsc.coverage(e),queryFn:()=>iN(e),staleTime:dr}),t.fetchQuery({queryKey:He.gsc.coverageHistory(e),queryFn:()=>I7(e).catch(()=>[]),staleTime:dr})]);J(Z),De(ke)}catch(Z){J(null),De([]),Ye(Z instanceof Error?Z.message:"Failed to load coverage data")}finally{Oe(!1)}}async function ia(Z){xn(!0),Ye(null);try{const ke=await j2(e,{urls:Z}),{succeeded:Xe,failed:jt,total:wn}=ke.summary;gt({title:"Indexing requested",detail:jt===0?`${Xe} URL${Xe!==1?"s":""} submitted for indexing.`:`${Xe}/${wn} submitted successfully, ${jt} failed.`,tone:jt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){Ye(ke instanceof Error?ke.message:"Failed to request indexing")}finally{xn(!1)}}async function Yh(){xn(!0),Ye(null);try{const Z=await j2(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:Xe,total:jt}=Z.summary;gt({title:"Indexing requested",detail:Xe===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${jt} submitted successfully, ${Xe} failed.`,tone:Xe===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to request indexing")}finally{xn(!1)}}async function js(){if(Ze.trim()){en(!0),Ye(null);try{await T7(e,"gsc",Ze.trim()),await t.invalidateQueries({queryKey:He.gsc.project(e)}),a(Z=>Z.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ze.trim()}:ke)),gt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Lt("")}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to save sitemap URL")}finally{en(!1)}}}async function Ns(){Ye(null);try{const Z=await Dn.mutateAsync({projectName:e,projectLabel:e});it(Z.sitemaps),a(ke=>ke.map(Xe=>Xe.connectionType==="gsc"?{...Xe,sitemapUrl:Z.primarySitemapUrl}:Xe))}catch{}}async function d0(){Fe(!0),Ye(null);try{const Z=await $7(e);t.setQueryData(He.gsc.sitemaps(e),Z),it(Z.sitemaps),Z.sitemaps.length===0&&de("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to list sitemaps")}finally{Fe(!1)}}async function cd(){Q(!0),Ye(null);try{const[Z,ke]=await Promise.all([rN().catch(()=>null),t.fetchQuery({queryKey:He.gsc.connections(e),queryFn:()=>XI(e).catch(()=>[]),staleTime:dr})]);r(!!Z?.google?.configured),a(ke);const Xe=ke.find(jt=>jt.connectionType==="gsc");await Promise.all([Yt(Xe),bn(),_r(),Li()])}finally{Q(!1)}}x.useEffect(()=>{cd()},[e]),x.useEffect(()=>{bn()},[P]);async function Wh(){if(!n){Ye("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}te(!0),Ye(null),de(null);try{const{authUrl:Z}=await A7(e,"gsc");if(!Z.startsWith("https://accounts.google.com/")){Ye("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Z,"_blank","width=600,height=700");if(!ke){window.location.assign(Z);return}de("Finish the Google consent flow in the popup, then close it to refresh this project.");const Xe=window.setInterval(()=>{ke.closed&&(window.clearInterval(Xe),de(null),t.invalidateQueries({queryKey:He.gsc.project(e)}),cd())},1e3)}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to start OAuth flow")}finally{te(!1)}}async function Qh(){Ye(null),de(null);try{await O7(e,"gsc"),await t.invalidateQueries({queryKey:He.gsc.project(e)}),a(Z=>Z.filter(ke=>ke.connectionType!=="gsc")),u([]),k("")}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to disconnect")}}async function ud(){if(j){I(!0),Ye(null);try{await z7(e,"gsc",j),await t.invalidateQueries({queryKey:He.gsc.project(e)}),a(Z=>Z.map(ke=>ke.connectionType==="gsc"?{...ke,propertyId:j}:ke)),gt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Z){Ye(Z instanceof Error?Z.message:"Failed to save GSC property")}finally{I(!1)}}}async function dd(){Ye(null),de(null);try{await Ve.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(C,10)||void 0,full:E||void 0}}),await t.invalidateQueries({queryKey:He.gsc.project(e)})}catch{}}async function fd(){if(O.trim()){Ce(!0),Ye(null),de(null);try{const Z=await R7(e,O.trim());await t.invalidateQueries({queryKey:He.gsc.project(e)}),S(Z),_(""),await _r()}catch(Z){Ye(Z instanceof Error?Z.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:Gke.map(Z=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${P===Z?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(Z),children:Z==="all"?"All":Z},Z))}),ze&&l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{bn()},children:q?"Refreshing…":"Refresh data"})]})]}),ln&&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:[ln,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ye(null),children:"×"})]}),$t&&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:[$t,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>de(null),children:"×"})]}),ee?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs($e,{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(wt,{tone:ze?"positive":n?"caution":"negative",children:ze?"Connected":n?"Ready to connect":"App credentials missing"})]}),ze?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:ze.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Qh,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:ze.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:ze.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:Gi(ze.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(xe,{type:"button",variant:"outline",size:"sm",disabled:K,onClick:Wh,children:K?"Opening…":"Connect Google Search Console"}):l.jsx(xe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(Kt,{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."})]})]})]}),ze&&!ze.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(xe,{type:"button",size:"sm",disabled:Dn.isPending||!ze.propertyId,onClick:Ns,children:Dn.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:Ze,onChange:Z=>Lt(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&void js()}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:Rt||!Ze.trim(),onClick:js,children:Rt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ze||fe)&&l.jsxs(l.Fragment,{children:[l.jsxs($e,{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:[Se&&Se.notIndexed.length>0&&l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:on,onClick:()=>{Yh()},children:on?"Requesting…":`Request indexing (${Se.notIndexed.length})`}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:()=>{Li()},children:pe?"Loading…":"Refresh coverage"})]})]}),Se&&Se.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Z=Se.summary.indexed+Se.summary.notIndexed,ke=Z>0?Se.summary.indexed/Z:0,Xe=Z>0?Se.summary.notIndexed/Z:0,jt=54,wn=2*Math.PI*jt,aa=wn*(1-ke),Ia=wn*Xe,ks=wn*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:jt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:jt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:wn,strokeDashoffset:aa,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),Se.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:jt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ia} ${wn-Ia}`,strokeDashoffset:-ks,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:Se.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:Se.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(Se.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(Se.reasonGroups??[]).length," ",(Se.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),Se.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:Se.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(Z=>{const ke=Z==="indexed"?Se.indexed.length:Z==="notIndexed"?Se.notIndexed.length:Se.deindexed.length,Xe=Z==="indexed"?"Indexed":Z==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ot===Z?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Fn(Z),ht(null)},children:[Xe," (",ke,")"]},Z)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ot==="indexed"&&Se.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:Se.indexed.map(Z=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),l.jsx("td",{className:"text-zinc-400",children:Z.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Z.crawlTime?Z.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:Z.isMobileFriendly===!0?"Yes":Z.isMobileFriendly===!1?"No":"—"})]},Z.id))})]}),ot==="notIndexed"&&!Ge&&(Se.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:(Se.reasonGroups??[]).map(Z=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>ht(Z.reason),children:[l.jsx("td",{className:"text-zinc-200",children:Z.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.count})]},Z.reason))})]}),ot==="notIndexed"&&!Ge&&(Se.reasonGroups??[]).length===0&&Se.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:Se.notIndexed.map(Z=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),l.jsx("td",{className:"text-zinc-400",children:Z.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Z.coverageState??"Unknown"})]},Z.id))})]}),ot==="notIndexed"&&Ge&&(()=>{const Z=(Se.reasonGroups??[]).find(ke=>ke.reason===Ge);return Z?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:Z.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Z.count," affected page",Z.count!==1?"s":""]})]}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:on,onClick:()=>{ia(Z.urls.map(ke=>ke.url))},children:on?"Requesting…":`Request indexing (${Z.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:Z.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:on,onClick:()=>{ia([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),ot==="deindexed"&&Se.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:Se.deindexed.map((Z,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),l.jsx("td",{className:"text-zinc-400",children:Z.previousState}),l.jsx("td",{className:"text-zinc-400",children:Z.currentState}),l.jsx("td",{className:"text-zinc-400",children:Z.transitionDate.split("T")[0]})]},`${Z.url}-${ke}`))})]}),(ot==="indexed"&&Se.indexed.length===0||ot==="notIndexed"&&!Ge&&Se.notIndexed.length===0||ot==="deindexed"&&Se.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($e,{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(xe,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{bn()},children:q?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Z=new Map;for(const dt of d){const Bt=Z.get(dt.date);Bt?(Bt.clicks+=dt.clicks,Bt.impressions+=dt.impressions):Z.set(dt.date,{clicks:dt.clicks,impressions:dt.impressions})}const ke=[...Z.entries()].sort(([dt],[Bt])=>dt.localeCompare(Bt));if(ke.length===0)return null;const Xe=Math.max(...ke.map(([,dt])=>dt.impressions),1),jt=ke.reduce((dt,[,Bt])=>dt+Bt.clicks,0),wn=ke.reduce((dt,[,Bt])=>dt+Bt.impressions,0),aa=wn>0?(jt/wn*100).toFixed(1):"0.0",Ia=700,ks=220,gr={top:12,bottom:36,left:48,right:12},Mo=Ia-gr.left-gr.right,sa=ks-gr.top-gr.bottom,si=Mo/ke.length,$i=Math.max(Math.min(si*.35,24),4),Cs=Math.max($i*.15,1),_s=dt=>{if(dt<=0)return 1;const Bt=Math.pow(10,Math.floor(Math.log10(dt))),Ar=dt/Bt,Bi=Ar<=1.5?1.5:Ar<=3?3:Ar<=5?5:10;return Math.ceil(Bi*Bt)},cn=4,Io=Math.ceil(_s(Xe)/cn)*cn,Xh=Array.from({length:cn+1},(dt,Bt)=>Io/cn*Bt),La=dt=>dt>=1e3?`${(dt/1e3).toFixed(dt>=1e4?0:1)}k`:String(dt);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:jt.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:wn.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[aa,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ia} / ${ks}`},children:l.jsxs("svg",{viewBox:`0 0 ${Ia} ${ks}`,className:"h-full w-full",children:[Xh.map((dt,Bt)=>{const Ar=gr.top+sa-dt/Io*sa;return l.jsxs("g",{children:[l.jsx("line",{x1:gr.left,y1:Ar,x2:Ia-gr.right,y2:Ar,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:gr.left-6,y:Ar+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:La(dt)})]},`t-${Bt}`)}),ke.map(([dt,Bt],Ar)=>{const Bi=gr.left+si*Ar+si/2,ac=Bt.impressions/Io*sa,Lo=Bt.clicks/Io*sa;return l.jsxs("g",{children:[l.jsx("title",{children:`${dt}
290
+ Clicks: ${Bt.clicks}
291
+ Impressions: ${Bt.impressions}
292
+ CTR: ${Bt.impressions>0?(Bt.clicks/Bt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:Bi-$i-Cs/2,y:gr.top+sa-ac,width:$i,height:Math.max(ac,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:Bi+Cs/2,y:gr.top+sa-Lo,width:$i,height:Math.max(Lo,1),rx:2,fill:"#10b981",opacity:.85})]},dt)}),(()=>{const dt=Math.min(ke.length,7);return Array.from({length:dt},(Bt,Ar)=>{const Bi=ke.length===1?0:Math.round(Ar/(dt-1)*(ke.length-1)),ac=gr.left+si*Bi+si/2;return l.jsx("text",{x:ac,y:ks-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[Bi][0].slice(5)},`xl-${Bi}`)})})()]})})]})})(),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:F.startDate,onChange:Z=>U(ke=>({...ke,startDate:Z.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:F.endDate,onChange:Z=>U(ke=>({...ke,endDate:Z.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:F.query,onChange:Z=>U(ke=>({...ke,query:Z.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:F.page,onChange:Z=>U(ke=>({...ke,page:Z.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:F.limit,onChange:Z=>U(ke=>({...ke,limit:Z.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(fo).map(Z=>l.jsx("th",{className:"text-right","aria-sort":et?.key===Z?et.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:()=>St(ke=>ke?.key===Z?ke.dir==="desc"?{key:Z,dir:"asc"}:null:{key:Z,dir:"desc"}),children:[mJ[Z],et?.key===Z?et.dir==="desc"?" ↓":" ↑":""]})},Z))]})}),l.jsx("tbody",{children:ce.map((Z,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:Z.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Z.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Z.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Z.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Z.ctr)?Z.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Z.position.toFixed(1)})]},`${Z.date}:${Z.query}:${Z.page}:${ke}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs($e,{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:Z=>_(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&void fd()}),l.jsx(xe,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!O.trim(),onClick:fd,children:ne?"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:tz(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:Gi(w.crawlTime)})]})]})]}),l.jsxs($e,{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(xe,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{_r()},children:G?"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:Z=>V(Z.target.value)}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{_r()},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(Z=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),l.jsx("td",{className:"text-zinc-300",children:Z.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Z.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Z.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:tz(Z.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:Gi(Z.inspectedAt)})]},Z.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs($e,{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"})]})}),y.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:y.map(Z=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Z.url}),l.jsx("td",{className:"text-zinc-400",children:Z.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:Z.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Gi(Z.transitionDate)})]},`${Z.url}:${Z.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ze&&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:()=>Je(Z=>!Z),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 ${we?"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"})]})}),we&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs($e,{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:le||o.length===0,onChange:Z=>k(Z.target.value),children:o.length===0?l.jsx("option",{value:"",children:le?"Loading properties…":"No properties available"}):o.map(Z=>l.jsxs("option",{value:Z.siteUrl,children:[Z.siteUrl," · ",Z.permissionLevel]},Z.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:le,onClick:()=>{Yt(ze)},children:le?"Refreshing…":"Refresh properties"}),l.jsx(xe,{type:"button",size:"sm",disabled:!j||L,onClick:ud,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($e,{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:C,onChange:Z=>T(Z.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:Z=>A(Z.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(xe,{type:"button",size:"sm",disabled:Ve.isPending||!ze.propertyId,onClick:dd,children:Ve.isPending?"Queueing…":"Queue sync"}),!ze.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs($e,{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:[ze.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:ze.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:W||!ze.propertyId,onClick:()=>{d0()},children:W?"Loading…":"Browse sitemaps from GSC"}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:Dn.isPending||!ze.propertyId,onClick:Ns,children:Dn.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."}),Te&&Te.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 (",Te.length,")"]}),Te.map(Z=>{const ke=Z.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:Z.path}),Z.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Z.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:()=>Lt(Z.path),children:"Use"})]})]},Z.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:ze.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ze,onChange:Z=>Lt(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&Ze.trim()&&void js()}),l.jsx(xe,{type:"button",size:"sm",disabled:Rt||!Ze.trim(),onClick:js,children:Rt?"Saving…":ze.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(xe,{type:"button",size:"sm",variant:"outline",disabled:ai.isPending||!ze.propertyId,onClick:async()=>{const ke=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ze.sitemapUrl||void 0;Ye(null),de(null);try{await ai.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ke}})}catch{}},children:ai.isPending?"Queueing…":"Inspect sitemap"})]}),!ze.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function qS({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(cL,{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 ll=50;function eu(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Jm(e){return e.toLocaleString()}function Zke(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function Yke(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 Wke(e){const t=e.filter(n=>n.kind===Gt["backlink-extract"]&&!bN(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function Qke(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 Xke({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,o]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState(null),[m,y]=x.useState(null),[v,w]=x.useState(Date.now()),[S,j]=x.useState(0),[k,O]=x.useState(!0),[_,C]=x.useState(!1),[T,E]=x.useState(null),A=x.useRef(null),P=x.useCallback(async()=>{O(!0),E(null);try{const[le,je,L,I,q]=await Promise.all([iL().catch(()=>null),pG(e,{excludeCrawlers:!0}).catch(()=>null),mG(e,{limit:ll,offset:S,excludeCrawlers:!0}).catch(G=>{if(G instanceof Oi&&G.code==="NOT_FOUND")return null;throw G}),gG(e).catch(()=>[]),r7(e).catch(()=>[])]);d(le),n(je),i(L),o(I);const R=Wke(q);p(R),A.current=R?.id??null}catch(le){E(le instanceof Error?le.message:"Failed to load backlinks")}finally{O(!1)}},[e,S]);x.useEffect(()=>{P()},[P]),x.useEffect(()=>{if(!f)return;const le=f.id;let je=!1;const L=async()=>{try{const q=await Rl(le);if(je)return;bN(q.status)?(p(null),y(q),await P()):p(R=>R?.id===q.id?{...R,...q}:R)}catch{}},I=window.setInterval(()=>{L()},3e3);return()=>{je=!0,window.clearInterval(I)}},[f,P]),x.useEffect(()=>{if(!f)return;const le=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(le)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const le=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(le)},[m]);async function $(){C(!0),E(null);try{const le=await yG(e);p(le),A.current=le.id}catch(le){le instanceof Oi&&le.code==="MISSING_DEPENDENCY"?E("DuckDB is not installed. Visit the Backlinks admin page to install it."):E(le instanceof Error?le.message:"Failed to trigger extract")}finally{C(!1)}}const F=x.useMemo(()=>a.slice().sort((le,je)=>le.queriedAt.localeCompare(je.queriedAt)).map(le=>({date:le.queriedAt,linkingDomains:le.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,ee=B>ll,Q=Math.floor(S/ll)+1,K=Math.max(1,Math.ceil(B/ll));return x.useEffect(()=>{S>0&&S>=B&&j(0)},[S,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."]})]})}),T&&l.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:T})}),f&&l.jsx($e,{className:"surface-card p-4 mb-4 border-sky-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(dL,{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(wt,{tone:"neutral",children:f.status}),l.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[Qke(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($e,{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(lL,{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:gJ(m.error)}):m.status!=="failed"?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),te()]});function te(){if(k)return l.jsx($e,{className:"surface-card p-6",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const le=t!==null&&t.totalLinkingDomains>0,je=m?.status==="failed",L=t!==null&&t.totalLinkingDomains===0&&!je,I=u?.status==="ready",q=u?.status==="failed",R=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return le?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:Jm(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:Jm(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:Zke(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 ",Yke(t.queriedAt),V>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&l.jsxs($e,{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(oy,{width:"100%",height:"100%",children:l.jsxs(By,{data:F,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:mo[0],stopOpacity:.4}),l.jsx("stop",{offset:"100%",stopColor:mo[0],stopOpacity:0})]})}),l.jsx(gh,{dataKey:"date",tick:po,stroke:vh,tickFormatter:qy}),l.jsx(yh,{tick:po,stroke:vh,allowDecimals:!1}),l.jsx(Ty,{contentStyle:Su.contentStyle,labelStyle:Su.labelStyle,itemStyle:Su.itemStyle,labelFormatter:Uy}),l.jsx(jl,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:mo[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"}),ee&&l.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Q," of ",K," · ",Jm(B)," total"]})]}),l.jsx($e,{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(G=>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:G.linkingDomain}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Jm(G.numHosts)})]},G.linkingDomain)),U.length===0&&l.jsx("tr",{children:l.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:V>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${V} hidden).`:"No referring domains in this release."})})]})]})}),ee&&l.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:S===0,onClick:()=>j(G=>Math.max(0,G-ll)),children:"Previous"}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:S+ll>=B,onClick:()=>j(G=>G+ll),children:"Next"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(xe,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:$,children:[l.jsx(oN,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),l.jsxs(qS,{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(xe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:eu("/backlinks"),children:"Open admin"})})]})]}):l.jsx($e,{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(uL,{className:"h-5 w-5","aria-hidden":!0})}),l.jsxs("div",{className:"flex-1",children:[!u&&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(xe,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:eu("/backlinks"),children:"Set up backlinks"})})})]}),R&&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 (",u.status,u.phaseDetail?` — ${u.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),l.jsx("div",{className:"mt-4",children:l.jsx(xe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:eu("/backlinks"),children:"View sync status"})})})]}),q&&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:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),l.jsx("div",{className:"mt-4",children:l.jsx(xe,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:eu("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&!R&&!L&&!je&&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:u.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(xe,{type:"button",size:"sm",disabled:_||f!==null,onClick:$,children:[l.jsx(Og,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Run extract"]}),l.jsxs(qS,{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"}),"."]})]})]})]}),je&&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:u?.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(xe,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:eu("/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(xe,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:eu("/backlinks"),children:"Go to Backlinks admin"})}),l.jsxs(xe,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:$,children:[l.jsx(Og,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),l.jsxs(qS,{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 Jke({projectName:e}){const t=Sa({queryKey:He.citationVisibility(e),queryFn:()=>aG(e),staleTime:Pf}),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-keywords"?"Add keywords 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(Tn,{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 keyword in the latest snapshot per (keyword × 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(Tn,{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(eCe,{data:n}),l.jsx(tCe,{data:n}),n.competitorGaps.length>0&&l.jsx(aCe,{data:n})]})}function eCe({data:e}){const{totalKeywords:t,keywordsCitedAndMentioned:n,keywordsCitedOnly:r,keywordsMentionedOnly:i,keywordsInvisible:a}=e.summary;return l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[l.jsx(eg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),l.jsx(eg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),l.jsx(eg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),l.jsx(eg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function eg({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 tCe({data:e}){const t=x.useMemo(()=>{const n=new Set;for(const r of e.byKeyword)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byKeyword]);return e.byKeyword.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No keyword coverage rows."}):l.jsxs("div",{children:[l.jsx(nCe,{}),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:"Keyword"}),t.map(n=>l.jsx("th",{className:"text-center",children:l.jsx(Ml,{provider:n})},n)),l.jsx("th",{className:"text-right",children:"Cite"}),l.jsx("th",{className:"text-right",children:"Ment"})]})}),l.jsx("tbody",{children:e.byKeyword.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:n.keyword}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return l.jsx("td",{className:"text-center",children:i==null?l.jsx(dV,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):l.jsx(rCe,{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.keywordId))})]})})]})}function nCe(){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 rCe({provider:e}){const t=iCe(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 iCe(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 aCe({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(Tn,{text:"Keywords where the project is not cited but a configured competitor is. Each row maps to one (keyword, engine) pair — the same keyword 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:"Keyword"}),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.keyword}),l.jsx("td",{children:l.jsx(Ml,{provider:t.provider})}),l.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.keywordId}::${t.provider}`))})]})})]})}function sCe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,o]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,y]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[S,j]=x.useState(e.language),[k,O]=x.useState(e.ownedDomains??[]),[_,C]=x.useState(""),[T,E]=x.useState(null),[A,P]=x.useState(!1),[$,F]=x.useState(!1),[U,B]=x.useState(""),[V,ee]=x.useState(""),[Q,K]=x.useState(""),[te,le]=x.useState(""),[je,L]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]))},[e,r]);function I(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),O(e.ownedDomains??[]),C("")}function q(){const W=_.trim();W&&(k.includes(W)||O([...k,W]),C(""))}function R(W){O(k.filter(Fe=>Fe!==W))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!S.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:S.trim()}),i(!1),gt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(W){d(W instanceof Error?W.message:"Failed to save")}finally{o(!1)}}}async function ie(){const W=U.trim(),Fe=V.trim(),Te=Q.trim(),it=te.trim();if(!(!W||!Fe||!Te||!it)){P(!0),E(null);try{const Ze={label:W,city:Fe,region:Te,country:it};je.trim()&&(Ze.timezone=je.trim()),await c7(e.name,Ze),n(),B(""),ee(""),K(""),le(""),L(""),F(!1),gt({title:"Location added",detail:`${W} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${W}`,dedupeMode:"drop"})}catch(Ze){E(Ze instanceof Error?Ze.message:"Failed to add location")}finally{P(!1)}}}async function ne(W){P(!0),E(null);try{await u7(e.name,W),n(),gt({title:"Location removed",detail:`${W} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${W}`,dedupeMode:"drop"})}catch(Fe){E(Fe instanceof Error?Fe.message:"Failed to remove location")}finally{P(!1)}}async function Ce(W){P(!0),E(null);try{await d7(e.name,W),n(),gt({title:"Default location updated",detail:`${W} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Fe){E(Fe instanceof Error?Fe.message:"Failed to set default location")}finally{P(!1)}}const Se=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),J="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",Oe=U.trim()&&V.trim()&&Q.trim()&&te.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(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&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:[u,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:J,type:"text",value:f,onChange:W=>p(W.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Canonical domain"}),l.jsx("input",{className:J,type:"text",value:m,onChange:W=>y(W.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Country"}),l.jsx("input",{className:J,type:"text",value:v,onChange:W=>w(W.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:pe,children:"Language"}),l.jsx("input",{className:J,type:"text",value:S,onChange:W=>j(W.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:k.map(W=>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:[W,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>R(W),"aria-label":`Remove ${W}`,children:"×"})]},W))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${J} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:W=>C(W.target.value),onKeyDown:W=>W.key==="Enter"&&(W.preventDefault(),q())}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:q,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(xe,{type:"button",disabled:a||!Se||!f.trim()||!m.trim(),onClick:G,children:a?"Saving...":"Save changes"}),l.jsx(xe,{type:"button",variant:"outline",disabled:a,onClick:I,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(W=>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:W},W))}):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:[T&&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:[T,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(W=>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 ${W.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:[W.label,W.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:W.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[W.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:A,onClick:()=>Ce(W.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${W.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:A,onClick:()=>ne(W.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${W.label}`,children:"Remove"})]})})]},W.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?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:J,type:"text",value:U,onChange:W=>B(W.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:J,type:"text",value:V,onChange:W=>ee(W.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:J,type:"text",value:Q,onChange:W=>K(W.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:J,type:"text",value:te,onChange:W=>le(W.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:J,type:"text",value:je,onChange:W=>L(W.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(xe,{type:"button",size:"sm",disabled:A||!Oe,onClick:ie,children:A?"Adding...":"Add location"}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{F(!1),E(null)},children:"Cancel"})]})]}):l.jsx(xe,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const oCe=[{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"}],sI=["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 lCe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState("daily"),[u,d]=x.useState(6),[f,p]=x.useState(""),[m,y]=x.useState("UTC"),[v,w]=x.useState(!1),[S,j]=x.useState(""),[k,O]=x.useState(!1),[_,C]=x.useState(!1),[T,E]=x.useState(null);x.useEffect(()=>{x7(e).then(n).catch(()=>n(null))},[e]);const A=()=>{if(t&&t!=="loading"){const U=xJ(t.preset??null,t.cronExpr);o(U.freq),d(U.hour),p(U.customCron);const B=sI.includes(t.timezone);y(B?t.timezone:"Other"),w(!B),j(B?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),w(!1),j("");E(null),i(!0)},P=async()=>{O(!0),E(null);try{const B={timezone:v?S.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=vJ(a,u);const V=await w2(e,B);n(V),i(!1),gt({title:"Schedule saved",detail:$b(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){E(U instanceof Error?U.message:"Failed to save schedule")}finally{O(!1)}},$=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),gt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:$b(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)}}},F=async()=>{C(!0),E(null);try{await b7(e),n(null),i(!1),gt({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{C(!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(xe,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&l.jsx($e,{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($e,{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:$b(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(wt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),l.jsx(xe,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:F,children:_?"Removing...":"Remove"})]})]}),T&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),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:oCe.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:u,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:p1(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),y("Other")):(w(!1),y(U.target.value))},children:[sI.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:S,onChange:U=>j(U.target.value)})]}),T&&l.jsx("p",{className:"text-rose-400 text-sm",children:T}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),E(null)},children:"Cancel"}),l.jsx(xe,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:P,children:k?"Saving...":"Save schedule"})]})]})]})}const cCe=[{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 uCe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState(""),[u,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,y]=x.useState(null),[v,w]=x.useState({});x.useEffect(()=>{w7(e).then(n).catch(()=>n([]))},[e]);const S=_=>{d(C=>C.includes(_)?C.filter(T=>T!==_):[...C,_])},j=async()=>{if(!(!a.trim()||u.length===0)){p(!0),y(null);try{const _=await S7(e,{channel:"webhook",url:a.trim(),events:u});n(C=>C==="loading"?[_]:[...C,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),gt({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},k=async _=>{try{await j7(e,_),n(C=>C==="loading"?C:C.filter(T=>T.id!==_)),gt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}},O=async _=>{w(C=>({...C,[_]:{state:"testing"}}));try{const C=await N7(e,_);w(T=>({...T,[_]:{state:C.ok?"ok":"fail",status:C.status}})),C.ok&&gt({title:"Test notification sent",detail:`Webhook returned status ${C.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{w(C=>({...C,[_]:{state:"fail"}}))}};return 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(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(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:_=>o(_.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:cCe.map(_=>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:u.includes(_.value),onChange:()=>S(_.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.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(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),l.jsx(xe,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:j,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&l.jsx($e,{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(_=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-keyword-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:_.urlHost,children:_.urlDisplay??_.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(C=>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:C.replace("."," ")},C))})}),l.jsx("td",{children:l.jsx(wt,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const C=v[_.id],T=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return l.jsx(wt,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:T})})(),l.jsx(xe,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>O(_.id),children:"Test"}),l.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(_.id),children:"Remove"})]})})]},_.id))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function dCe({projectName:e,refreshNonce:t}){const n=Pi(),[r,i]=x.useState(null),[a,o]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState([]),[m,y]=x.useState([]),[v,w]=x.useState(null),[S,j]=x.useState(""),[k,O]=x.useState(""),[_,C]=x.useState(""),[T,E]=x.useState(!0),[A,P]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){E(!0),F(null);try{const I=await n.fetchQuery({queryKey:He.bing.status(e),queryFn:()=>eL(e),staleTime:dr});if(i(I),I.connected){const[q,R,G,ie]=await Promise.all([n.fetchQuery({queryKey:He.bing.coverage(e),queryFn:()=>aN(e).catch(()=>null),staleTime:dr}),n.fetchQuery({queryKey:He.bing.inspections(e),queryFn:()=>tL(e).catch(()=>[]),staleTime:dr}),n.fetchQuery({queryKey:He.bing.performance(e),queryFn:()=>G7(e).catch(()=>[]),staleTime:dr}),I.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:He.bing.sites(e),queryFn:()=>K7(e).then(ne=>ne.sites).catch(()=>[]),staleTime:dr})]);d(q),p(R),y(G),o(ie)}else d(null),p([]),y([]),o([])}catch(I){F(I instanceof Error?I.message:"Failed to load Bing data")}finally{E(!1)}}async function ee(){if(k.trim()){F(null);try{const I=await q7(e,k.trim());await n.invalidateQueries({queryKey:He.bing.project(e)}),O(""),I.availableSites.length>0&&o(I.availableSites),await V()}catch(I){F(I instanceof Error?I.message:"Failed to connect")}}}async function Q(){try{await F7(e),await n.invalidateQueries({queryKey:He.bing.project(e)}),i(null),o([]),d(null),p([]),y([]),w(null),C(""),F(null)}catch(I){F(I instanceof Error?I.message:"Failed to disconnect")}}async function K(){if(_)try{await H7(e,_),await n.invalidateQueries({queryKey:He.bing.project(e)}),await V()}catch(I){F(I instanceof Error?I.message:"Failed to set site")}}async function te(){if(S.trim())try{const I=await nL(e,S.trim());await n.invalidateQueries({queryKey:He.bing.project(e)}),w(I),p(q=>[I,...q])}catch(I){F(I instanceof Error?I.message:"Inspection failed")}}async function le(I){P(!0),F(null);try{const q=await N2(e,{urls:[I]}),{succeeded:R,failed:G,total:ie}=q.summary;gt({title:"Bing submission requested",detail:G===0?`${R} URL submitted to Bing.`:`${R}/${ie} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}catch(q){const R=q instanceof Error?q.message:"Submission failed";F(R),gt({title:"Bing submission failed",detail:R,tone:"negative",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}finally{P(!1)}}async function je(){P(!0),F(null),gt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const I=await N2(e,{allUnindexed:!0}),{succeeded:q,failed:R,total:G}=I.summary;gt({title:"Bing submissions requested",detail:R===0?`${q}/${G} URL${G!==1?"s":""} submitted to Bing.`:`${q}/${G} submitted successfully, ${R} failed.`,tone:R===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){const q=I instanceof Error?I.message:"Batch submission failed";F(q),gt({title:"Bing submissions failed",detail:q,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{P(!1)}}if(T)return l.jsx($e,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return l.jsxs($e,{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(wt,{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:k,onChange:I=>O(I.target.value),onKeyDown:I=>I.key==="Enter"&&ee()}),l.jsx(xe,{size:"sm",disabled:!k.trim(),onClick:ee,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"})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return l.jsxs($e,{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(wt,{tone:"positive",children:"Connected"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:Q,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?Gi(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:_,onChange:I=>C(I.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(I=>l.jsxs("option",{value:I.url,children:[I.url,I.verified?" (verified)":""]},I.url))]}),l.jsx(xe,{size:"sm",disabled:!_,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."})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});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($e,{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(wt,{tone:"positive",children:"Connected"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),$&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),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?Gi(r.updatedAt):"—"})]})]})]})]}),l.jsxs($e,{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:u?.lastInspectedAt?`Last inspected ${Gi(u.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:L.map(I=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===I.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(I.key),children:I.label},I.key))}),U==="coverage"&&u&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[l.jsx(Dm,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),l.jsx(Dm,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),l.jsx(Dm,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),l.jsx(Dm,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.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 (",u.notIndexed.length,")"]}),l.jsx(xe,{size:"sm",variant:"ghost",disabled:A,onClick:je,children:A?"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:u.notIndexed.map(I=>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:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.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:A,onClick:()=>le(I.url),children:"Submit"})})]},I.id))})]})})]}),(u.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 (",(u.unknown??[]).length,")"]}),l.jsx(xe,{size:"sm",variant:"ghost",disabled:A,onClick:je,children:A?"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:(u.unknown??[]).map(I=>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:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?Gi(I.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:A,onClick:()=>le(I.url),children:"Submit"})})]},I.id))})]})})]}),u.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.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:u.indexed.map(I=>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:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?Gi(I.lastCrawledDate):"—"})]},I.id))})]})})]})]}),U==="coverage"&&!u&&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:S,onChange:I=>j(I.target.value),onKeyDown:I=>I.key==="Enter"&&te()}),l.jsx(xe,{size:"sm",disabled:!S.trim(),onClick:te,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(I=>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:I.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(wt,{tone:I.inIndex?"positive":"negative",children:I.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:Gi(I.inspectedAt)})]},I.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:ym[fo.Clicks]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:ym[fo.Impressions]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:ym[fo.CTR]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:ym[fo.Position]})]})}),l.jsx("tbody",{children:m.map((I,q)=>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:I.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:I.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.averagePosition.toFixed(1)})]},q))})]})})})]})]})}function fCe({projectName:e}){const t=Pi(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[o,u]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,y]=x.useState(!1),[v,w]=x.useState(null),[S,j]=x.useState(null),[k,O]=x.useState(!1),[_,C]=x.useState(null),[T,E]=x.useState(null),[A,P]=x.useState(0);async function $(q=!1){q||a(!0),f(null);try{const[R,G,ie]=await Promise.all([rN().catch(()=>null),t.fetchQuery({queryKey:He.gsc.connections(e),queryFn:()=>XI(e).catch(()=>[]),staleTime:dr}),t.fetchQuery({queryKey:He.bing.status(e),queryFn:()=>eL(e).catch(()=>null),staleTime:dr})]),ne=G.find(J=>J.connectionType==="gsc")??null;y(!!R?.google?.configured),O(!!R?.bing?.configured),w(ne),C(ie);const[Ce,Se]=await Promise.all([ne?t.fetchQuery({queryKey:He.gsc.coverage(e),queryFn:()=>iN(e).catch(()=>null),staleTime:dr}):Promise.resolve(null),ie?.connected?t.fetchQuery({queryKey:He.bing.coverage(e),queryFn:()=>aN(e).catch(()=>null),staleTime:dr}):Promise.resolve(null)]);j(Ce),E(Se)}catch(R){f(R instanceof Error?R.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(o!=="idle")return;p.current?.abort();const q=new AbortController;p.current=q;const R=q.signal;u("syncing"),f(null);const G=[];try{async function ie(){if(!v)return;const J=await JI(e);if(!J?.id)return;const pe=2e3,W=Date.now()+12e4;for(;Date.now()<W;){if(R.aborted||(await new Promise(Te=>setTimeout(Te,pe)),R.aborted))return;const Fe=await Rl(J.id).catch(()=>null);if(!Fe)break;if(["completed","failed","cancelled"].includes(Fe.status)){Fe.status!=="completed"&&G.push(`Google sync ${Fe.status}`);break}}}const ne=10;async function Ce(){if(!_?.connected)return;const J=await tL(e).catch(()=>[]),pe=[...new Set(J.map(Oe=>Oe.url))];if(pe.length!==0)for(let Oe=0;Oe<pe.length;Oe+=ne){if(R.aborted)return;const W=pe.slice(Oe,Oe+ne),Te=(await Promise.allSettled(W.map(it=>nL(e,it)))).filter(it=>it.status==="rejected").length;Te>0&&G.push(`${Te} Bing inspection(s) failed`)}}const Se=await Promise.allSettled([ie(),Ce()]);for(const J of Se)J.status==="rejected"&&G.push(J.reason instanceof Error?J.reason.message:"Sync failed");if(R.aborted)return;u("reloading"),await Promise.all([t.invalidateQueries({queryKey:He.gsc.project(e)}),t.invalidateQueries({queryKey:He.bing.project(e)})]),await $(!0),P(J=>J+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(ie){R.aborted||f(ie instanceof Error?ie.message:"Refresh failed")}finally{R.aborted||u("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const U=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",V=S?`${S.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",ee=S?`${S.summary.notIndexed} not indexed${S.summary.deindexed>0?` · ${S.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Q=S?.lastInspectedAt??v?.updatedAt??null,K=_?.connected?"positive":k?"caution":"negative",te=_?.connected?"Connected":k?"Ready to connect":"Needs setup",le=T?`${T.summary.percentage}% indexed`:_?.connected?"Awaiting coverage":"No coverage data",je=T?T.summary.notIndexed+(T.summary.unknown??0):0,L=T?`${je} not in index`:_?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",I=T?.lastInspectedAt??_?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs($e,{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(xe,{type:"button",variant:"outline",size:"sm",disabled:i||o!=="idle",onClick:()=>{F()},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(TT,{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…":V,note:i?"Loading overview…":ee,updatedAt:Q,active:n==="google",onClick:()=>r("google")}),l.jsx(TT,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":te,tone:i?"neutral":K,targetLabel:"Selected site",targetValue:_?.siteUrl??"No site selected",coverageValue:i?"Loading…":le,note:i?"Loading overview…":L,updatedAt:I,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(([q,R])=>l.jsx("button",{type:"button",role:"tab","aria-selected":n===q,className:`project-subnav-link ${n===q?"project-subnav-link-active":""}`,onClick:()=>r(q),children:R},q))}),n==="google"&&l.jsx(Vke,{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(dCe,{projectName:e,refreshNonce:A})]})]})}function hCe({insights:e}){const{openEvidence:t}=Hu(),[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(bh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),l.jsx(wt,{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((u,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(B1,{state:u.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.keyword}),l.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&l.jsx(Ml,{provider:u.provider})})]}),u.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(u.evidenceId)},children:"View →"})]},u.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Zh({tab:e}){const{projectId:t}=Zy({from:"/projects/$projectId"}),n=Oo(),{dashboard:r,isLoading:i,refetch:a}=Jl();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(we=>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"})]},we))}),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(we=>l.jsx("div",{className:"skeleton-text-sm w-full"},we))})]})]});const o=Cne(r,t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,y]=x.useState(!1),[v,w]=x.useState(""),[S,j]=x.useState(!1),[k,O]=x.useState(!1),[_,C]=x.useState(""),[T,E]=x.useState(!1),[A,P]=x.useState(!1),[$,F]=x.useState(""),[U,B]=x.useState(!1),[V,ee]=x.useState(void 0),[Q,K]=x.useState(!1),[te,le]=x.useState(null),[je,L]=x.useState(!1),I=o?.visibilityEvidence??[],q=o?.project.name??"",R=o?.project.displayName||o?.project.name||q,G=nq(),ie=x.useMemo(()=>new Set(I.map(we=>we.location??"")),[I]),ne=ie.has(""),Ce=x.useMemo(()=>[...ie].filter(Boolean),[ie]);x.useEffect(()=>{if(V===void 0||V===""||!q){le(null),L(!1);return}L(!0),WI(q,V).then(we=>{le(we),L(!1)}).catch(()=>{le(null),L(!1)})},[V,q]);const Se=x.useMemo(()=>{if(!te)return null;const we=new Map;for(const Je of te){for(const[ot,Fn]of Object.entries(Je.providerRuns??{}))we.set(`${Je.keyword}::${ot}`,Fn.map(et=>({runId:et.runId,citationState:et.citationState,createdAt:et.createdAt,answerMentioned:et.answerMentioned,visibilityState:et.visibilityState,visibilityTransition:et.visibilityTransition})));(!Je.providerRuns||Object.keys(Je.providerRuns).length===0)&&we.set(`${Je.keyword}::`,Je.runs.map(ot=>({runId:ot.runId,citationState:ot.citationState,createdAt:ot.createdAt,answerMentioned:ot.answerMentioned,visibilityState:ot.visibilityState,visibilityTransition:ot.visibilityTransition})))}return we},[te]),J=x.useMemo(()=>{const we=V!==void 0?I.filter(Je=>V===""?!Je.location:Je.location===V):I;return Se?we.map(Je=>{const ot=Se.get(`${Je.keyword}::${Je.provider}`)??Se.get(`${Je.keyword}::`);return ot?{...Je,runHistory:ot}:Je}):we},[I,V,Se]);if(!o)return l.jsx("div",{className:"page-container",children:l.jsxs($e,{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(xe,{asChild:!0,children:l.jsx(Kt,{to:"/",children:"Return to overview"})})]})});async function pe(){try{await G.mutateAsync({projectName:q,projectLabel:R,sourceAction:"project-run"}),a()}catch{}}async function Oe(){p(!0);try{await f7(q),gt({title:"Project deleted",detail:`${R} was removed.`,tone:"positive",dedupeKey:`project:delete:${q}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(we){console.error("Failed to delete project:",we)}finally{p(!1)}}async function W(){try{const we=await h7(q),Je=typeof we=="string"?we:JSON.stringify(we,null,2),ot=new Blob([Je],{type:"text/yaml"}),Fn=URL.createObjectURL(ot),et=document.createElement("a");et.href=Fn,et.download=`${q}.yaml`,et.click()}catch(we){gt({title:"Export failed",detail:we instanceof Error?we.message:"Could not export project YAML.",tone:"negative"})}}async function Fe(){const we=v.split(`
293
+ `).map(Je=>Je.trim()).filter(Boolean);if(we.length!==0){j(!0);try{await s7(q,we),a(),w(""),y(!1)}finally{j(!1)}}}async function Te(){const we=_.trim();if(we){E(!0);try{const ot=(await YI(q)).map(et=>et.domain),Fn=[...new Set([...ot,we])];await QI(q,Fn),a(),C(""),O(!1)}finally{E(!1)}}}async function it(){const we=$.trim();if(we){B(!0);try{const Je=o?.project.ownedDomains??[];await b2(q,[...Je,we]),a(),F(""),P(!1)}finally{B(!1)}}}async function Ze(we){B(!0);try{const Je=o?.project.ownedDomains??[];await b2(q,Je.filter(ot=>ot!==we)),a()}finally{B(!1)}}async function Lt(we,Je){await o7(we,Je),a()}const Rt=we=>!Number.isNaN(Number.parseInt(we,10)),en=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${o.project.id}/analytics`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return l.jsxs("div",{className:"page-container",children:[u?l.jsxs($e,{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 key phrases, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xe,{type:"button",variant:"destructive",disabled:f,onClick:Oe,children:f?"Deleting...":"Yes, delete project"}),l.jsx(xe,{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&&!A&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>P(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),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(we=>l.jsx("span",{className:"tag",children:we},we))]}),((o.project.ownedDomains??[]).length>0||A)&&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(we=>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:[we,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Ze(we),"aria-label":`Remove ${we}`,children:"×"})]},we)),A?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:$,onChange:we=>F(we.target.value),onKeyDown:we=>we.key==="Enter"&&it(),autoFocus:!0}),l.jsx(xe,{type:"button",size:"sm",disabled:!$.trim()||U,onClick:it,children:U?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{P(!1),F("")},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:()=>P(!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(xe,{type:"button",variant:"outline",size:"icon",onClick:W,"aria-label":"Export project as YAML",children:l.jsx(oN,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(xe,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:l.jsx(hL,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(xe,{type:"button",disabled:G.isPending,onClick:pe,children:G.isPending?"Starting...":"Run now"})]})]})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:en.map(we=>l.jsx(Kt,{to:we.href,className:`project-subnav-link ${we.key===e?"project-subnav-link-active":""}`,"aria-current":we.key===e?"page":void 0,children:we.label},we.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(q$,{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:Rt(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 Key Phrases",l.jsx(Tn,{text:"Tracked key phrases 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.gapKeyPhrases.value}),l.jsxs("span",{className:"text-zinc-600",children:[" / ",o.keywordCounts.total]})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapKeyPhrases.tone}`,style:{width:o.gapKeyPhrases.progress!==void 0?`${o.gapKeyPhrases.progress*100}%`:"0%"}})}),l.jsx("p",{className:"metric-card-detail",children:o.gapKeyPhrases.delta}),l.jsx("p",{className:"metric-card-sub",children:o.gapKeyPhrases.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",l.jsx(Tn,{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(Tn,{text:"Keyword-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(Jke,{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(Tn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),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 key phrases"})]})}),l.jsx("tbody",{children:o.providerScores.map(we=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Ml,{provider:we.provider}),we.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:we.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${we.score>=70?"text-emerald-400":we.score>=40?"text-amber-400":"text-rose-400"}`,children:[we.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[we.cited," of ",we.total]})]},`${we.provider}::${we.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(hCe,{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:"Key phrase citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(we=>we.keyword)).size," key phrases tracked"]}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add key phrases"})]})]}),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 key phrases, one per line",value:v,onChange:we=>w(we.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(we=>we.trim()).length," key phrases"]}),l.jsx(xe,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:Fe,children:S?"Adding...":"Add key phrases"})]})]}),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 ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{ee(void 0)},children:"All locations"}),o.project.locations.map(we=>ie.has(we.label)&&l.jsx("button",{className:`filter-chip ${V===we.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===we.label,onClick:()=>{ee(we.label),K(!1)},children:we.label},we.label)),ne&&l.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{ee(""),K(!1)},children:"No location"}),Ce.length>1&&V===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${Q?"filter-chip-active":""}`,type:"button","aria-pressed":Q,onClick:()=>K(we=>!we),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(xce,{evidence:J})]}),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(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&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:_,onChange:we=>C(we.target.value),onKeyDown:we=>we.key==="Enter"&&Te()}),l.jsx(xe,{type:"button",size:"sm",disabled:!_.trim()||T,onClick:Te,children:T?"Adding...":"Add"})]}),l.jsx(bce,{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(we=>l.jsx(U$,{run:we},we.id))})]}),l.jsx(sCe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Lt,onRefresh:()=>{a()}}),l.jsx(lCe,{projectName:o.project.name}),l.jsx(uCe,{projectName:o.project.name})]}):e==="analytics"?l.jsx(Nke,{projectName:o.project.name}):e==="traffic"?l.jsx(Tke,{projectName:o.project.name}):e==="inbound"?l.jsx(Xke,{projectName:o.project.name}):l.jsx(fCe,{projectName:o.project.name})]})}function pCe(){const{dashboard:e,isLoading:t}=Jl(),n=qke();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),u=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(xe,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},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":tv(d)},d))}),l.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>l.jsx(U$,{run:d},d.id)):l.jsxs($e,{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 mCe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[S,j]=x.useState(""),[k,O]=x.useState(!1),[_,C]=x.useState(null),[T,E]=x.useState(!1),A=i?u.trim().length>0:a.trim().length>0;async function P(){if(A){O(!0),C(null),E(!1);try{const F=Q=>{const K=parseInt(Q.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},U={},B=F(m);B!==void 0&&(U.maxConcurrency=B);const V=F(v);V!==void 0&&(U.maxRequestsPerMinute=V);const ee=F(S);ee!==void 0&&(U.maxRequestsPerDay=ee),await y7(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),o(""),d(""),p(""),y(""),w(""),j(""),E(!0),gt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){C(F instanceof Error?F.message:"Failed to update provider")}finally{O(!1)}}}const $=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:u,onChange:F=>d(F.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:F=>o(F.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:$,value:f,onChange:F=>p(F.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:F=>y(F.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:F=>w(F.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:S,onChange:F=>j(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&l.jsx("p",{className:"text-xs text-rose-400",children:_}),T&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(xe,{type:"button",size:"sm",disabled:!A||k,onClick:P,children:k?"Saving...":"Save"})]})}function gCe({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,o]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await v7({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),gt({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."]}),u&&l.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(xe,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function yCe(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[o,u]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{S2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),l.jsxs($e,{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(wt,{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(y=>l.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.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(xe,{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 y=>{y.preventDefault(),m(!0);try{await U7(o,parseInt(d,10)||9222);const v=await S2().catch(()=>null);v&&t(v),a(!1),gt({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:y=>u(y.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:y=>f(y.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(xe,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const vCe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function xCe(){const e=Sh(),{dashboard:t}=Jl(),n=t?.settings??e?.dashboard?.settings,a=cv(!e,e?.health).data??e?.health??vCe,[o,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(""),[w,S]=x.useState(!1),[j,k]=x.useState(null),[O,_]=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(C=>l.jsxs($e,{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:C.displayName??C.name})]}),l.jsx(wt,{tone:C.state==="ready"?"positive":"caution",children:C.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:C.model})]}),C.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:C.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o===C.name?null:C.name),children:o===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===C.name&&l.jsx(mCe,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{u(null)}})]},C.name)),l.jsxs($e,{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(wt,{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(xe,{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(gCe,{onSaved:()=>{f(!1)}})]}),l.jsxs($e,{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(wt,{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(xe,{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:y,onChange:C=>v(C.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(xe,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){S(!0),k(null),_(!1);try{await V7(y.trim()),v(""),_(!0),m(!1),gt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){k(C instanceof Error?C.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),l.jsx(yCe,{}),l.jsxs($e,{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(wt,{tone:Dg(a.apiStatus),title:Co(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(wt,{tone:Dg(a.workerStatus),title:Co(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs($e,{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(C=>l.jsx("li",{children:C},C))}),l.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const bCe=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function wCe({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 SCe(){const e=Sh(),{dashboard:t,isLoading:n,refetch:r}=Jl(),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=cv(!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=kJ(i.setup,d,a),p=Oo(),[m,y]=x.useState(0),[v,w]=x.useState(""),[S,j]=x.useState(""),[k,O]=x.useState(""),[_,C]=x.useState("US"),[T,E]=x.useState("en"),[A,P]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState(null),[V,ee]=x.useState(null),[Q,K]=x.useState(!1),[te,le]=x.useState(""),[je,L]=x.useState(!1),[I,q]=x.useState(null),[R,G]=x.useState(!1),ie=a.providerStatuses.filter(fe=>fe.state==="ready"),[ne,Ce]=x.useState(ie[0]?.name??""),[Se,J]=x.useState(5),[pe,Oe]=x.useState(!1),[W,Fe]=x.useState(null),[Te,it]=x.useState(""),[Ze,Lt]=x.useState(!1),[Rt,en]=x.useState(null),[we,Je]=x.useState(!1),[ot,Fn]=x.useState(!1),[et,St]=x.useState(!1),ce=nq(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),De=te.split(`
295
+ `).map(fe=>fe.trim()).filter(Boolean),Ge=Te.split(`
296
+ `).map(fe=>fe.trim()).filter(Boolean),ht=f.healthChecks.some(fe=>fe.id==="api"&&fe.state==="ready"),on=async()=>{if(!(!Ne||!k)){K(!0),ee(null);try{const fe=await Wy(Ne,{displayName:S||v,canonicalDomain:k,country:_,language:T,autoExtractBacklinks:A});F(Ne),B(fe.id),gt({title:"Project created",detail:`${fe.displayName||fe.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${fe.name}`,dedupeMode:"drop"}),r(),y(2)}catch(fe){ee(fe instanceof Error?fe.message:"Failed to create project")}finally{K(!1)}}},xn=async()=>{if(!$)return;const fe=De;if(fe.length!==0){G(!0),q(null);try{await a7($,fe),L(!0),r(),y(3)}catch(Ve){q(Ve instanceof Error?Ve.message:"Failed to save key phrases")}finally{G(!1)}}},ln=async()=>{if(!(!$||!ne)){Oe(!0),Fe(null);try{const fe=await k7($,ne,Se);if(fe.keywords.length>0){const Ve=te?te.trimEnd()+`
297
+ `+fe.keywords.join(`
298
+ `):fe.keywords.join(`
299
+ `);le(Ve)}}catch(fe){Fe(fe instanceof Error?fe.message:"Failed to generate key phrases")}finally{Oe(!1)}}},Ye=async()=>{if(!$)return;const fe=Ge;if(fe.length!==0){Je(!0),en(null);try{await QI($,fe),Lt(!0),r(),y(4)}catch(Ve){en(Ve instanceof Error?Ve.message:"Failed to save competitors")}finally{Je(!1)}}},$t=async()=>{if($){St(!0);try{await ce.mutateAsync({projectName:$,projectLabel:S||v||$,sourceAction:"setup-launch"}),Fn(!0),r()}catch{}finally{St(!1)}}},de=()=>y(fe=>Math.max(0,fe-1)),ze=(()=>{switch(m){case 0:return l.jsxs($e,{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(Kt,{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(wt,{tone:fe.state==="ready"?"positive":"caution",title:fe.id==="api"?Co(d.apiStatus):fe.id==="worker"?Co(d.workerStatus):fe.detail,children:fe.state==="ready"?"Ready":"Attention"})]},fe.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(xe,{type:"button",disabled:!ht,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs($e,{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"})]}),$?l.jsx(wt,{tone:"positive",children:"Created"}):null]}),$?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:$})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",onClick:()=>y(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:S,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:k,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:_,onChange:fe=>C(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:T,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:A,onChange:fe=>P(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(Kt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?l.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",disabled:!Ne||!k||Q,onClick:on,children:Q?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs($e,{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 key phrases"})]}),je?l.jsxs(wt,{tone:"positive",children:[De.length," saved"]}):l.jsxs(wt,{tone:"neutral",children:[De.length," key phrase",De.length!==1?"s":""]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),je?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:De.map(fe=>l.jsx("li",{children:fe},fe))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[ie.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:ne,onChange:fe=>Ce(fe.target.value),children:ie.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:Se,onChange:fe=>J(Number(fe.target.value)),children:[3,5,10,15,20].map(fe=>l.jsx("option",{value:fe,children:fe},fe))})]}),l.jsx(xe,{type:"button",variant:"outline",disabled:pe||!ne,onClick:ln,children:pe?"Analyzing site...":"Generate"})]}),W?l.jsx("p",{className:"text-rose-400 text-sm",children:W}):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:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
300
+ best invisalign downtown brooklyn
301
+ pediatric dentist brooklyn heights`,value:te,onChange:fe=>le(fe.target.value)})]}),I?l.jsx("p",{className:"text-rose-400 text-sm",children:I}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",disabled:De.length===0||R,onClick:xn,children:R?"Saving...":`Save ${De.length} key phrase${De.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs($e,{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"})]}),Ze?l.jsx(wt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ze?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(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",onClick:()=>y(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:Te,onChange:fe=>it(fe.target.value)})]}),Rt?l.jsx("p",{className:"text-rose-400 text-sm",children:Rt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(xe,{type:"button",disabled:Ge.length===0||we,onClick:Ye,children:we?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs($e,{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"})]}),ot?l.jsx(wt,{tone:"positive",children:"Queued"}):null]}),ot?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(xe,{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:$}),"."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:de,children:"Back"}),l.jsx(xe,{type:"button",disabled:et,onClick:$t,children:et?"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 key phrases, add competitors, and launch the first run."})]})}),l.jsx(wCe,{current:m,labels:bCe}),l.jsx("section",{className:"setup-wizard",children:ze})]})}function tu({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(cL,{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 jCe="https://commoncrawl.org/web-graphs";function FS(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 tg(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 KS(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function NCe(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[o,u]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[y,v]=x.useState(!1),[w,S]=x.useState(!1),[j,k]=x.useState(""),[O,_]=x.useState(!1),[C,T]=x.useState(null),[E,A]=x.useState(null),P=x.useCallback(async()=>{m(!0),T(null);try{const[V,ee,Q,K,te]=await Promise.all([oG(),iL().catch(()=>null),cG().catch(()=>[]),dG().catch(()=>[]),fG().catch(()=>null)]);t(V),r(ee),a(Q),u(K),f(te)}catch(V){T(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{P()},[P]);async function $(){v(!0),T(null),A(null);try{const V=await lG();A(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await P()}catch(V){T(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=j.trim()||void 0;S(!0),T(null),A(null);try{const ee=await uG(V);A(V?`Queued sync for ${ee.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${ee.release}. Download + query runs in the background.`),k(""),_(!1),await P()}catch(ee){ee instanceof Oi&&ee.code==="MISSING_DEPENDENCY"?T("DuckDB is not installed. Install it first."):T(ee instanceof Error?ee.message:"Failed to trigger sync")}finally{S(!1)}}async function U(V){T(null),A(null);try{await hG(V),A(`Pruned cached release ${V}.`),await P()}catch(ee){T(ee instanceof Error?ee.message:"Failed to prune release")}}const B=n?.status==="ready"&&o.every(V=>V.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($e,{className:"surface-card p-4 mb-6 border-amber-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Eg,{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($e,{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."]})]})]})]})]}),C&&l.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:C})}),E&&l.jsx($e,{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(tu,{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(wt,{tone:"positive",children:"Installed"}):l.jsx(wt,{tone:"caution",children:"Not installed"})]}),l.jsx($e,{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(lL,{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(BG,{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(xe,{type:"button",size:"sm",disabled:y,onClick:$,children:[l.jsx(oN,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"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(tu,{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(wt,{tone:KS(n.status),children:n.status})]}),l.jsxs($e,{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(tu,{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:tg(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:tg(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(Eg,{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 ",FS(d.vertexBytes),", edges ",FS(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:jCe,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(VG,{className:"h-3 w-3","aria-hidden":!0})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs(xe,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[l.jsx(Og,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),l.jsxs(tu,{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:V=>k(V.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:()=>{k(""),_(!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:()=>_(!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(tu,{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($e,{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(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:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:V.syncStatus?l.jsx(wt,{tone:KS(V.syncStatus),children:V.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:FS(V.bytes)}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:tg(V.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(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>U(V.release),children:[l.jsx(hL,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),l.jsx(tu,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},V.release)),o.length===0&&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($e,{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(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:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(wt,{tone:KS(V.status),children:V.status})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:tg(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function kCe(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs($e,{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(xe,{asChild:!0,children:l.jsx(Kt,{to:"/",children:"Return to overview"})})]})})})}function CCe(){return l.jsx(nle,{children:l.jsx(tle,{})})}const Ai=IH()({component:CCe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),_Ce=qr({getParentRoute:()=>Ai,path:"/",component:ale,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(He.projects.all);if(t&&t.length===0)throw Gj({to:"/setup"})}}),ACe=qr({getParentRoute:()=>Ai,path:"/projects",component:yce}),ld=qr({getParentRoute:()=>Ai,path:"/projects/$projectId",component:()=>l.jsx(tN,{})}),OCe=qr({getParentRoute:()=>ld,path:"/",component:()=>l.jsx(Zh,{tab:"overview"})}),ECe=qr({getParentRoute:()=>ld,path:"/search-console",component:()=>l.jsx(Zh,{tab:"search-console"})}),zCe=qr({getParentRoute:()=>ld,path:"/analytics",component:()=>l.jsx(Zh,{tab:"analytics"})}),TCe=qr({getParentRoute:()=>ld,path:"/traffic",component:()=>l.jsx(Zh,{tab:"traffic"})}),PCe=qr({getParentRoute:()=>ld,path:"/inbound",component:()=>l.jsx(Zh,{tab:"inbound"})}),RCe=qr({getParentRoute:()=>Ai,path:"/runs",component:pCe}),DCe=qr({getParentRoute:()=>Ai,path:"/settings",component:xCe,beforeLoad:({context:e})=>{}}),MCe=qr({getParentRoute:()=>Ai,path:"/setup",component:SCe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(He.projects.all);if(t&&t.length>0)throw Gj({to:"/"})}}),ICe=qr({getParentRoute:()=>Ai,path:"/backlinks",component:NCe}),LCe=qr({getParentRoute:()=>Ai,path:"*",component:kCe}),$Ce=Ai.addChildren([_Ce,ACe,ld.addChildren([OCe,ECe,zCe,TCe,PCe]),RCe,DCe,MCe,ICe,LCe]);function BCe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const oI=BCe(),UCe=oI==="/"?"":oI.replace(/\/$/,"");function qCe(e,t){return VH({routeTree:$Ce,basepath:UCe||"/",context:{queryClient:e},...t?.initialEntries})}const rq=kG(),FCe=qCe(rq),iq=document.getElementById("root");if(!iq)throw new Error("Expected #root element for web app bootstrap.");function KCe(){const[e,t]=x.useState(x2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[o,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(x2())return;let y=!1;return p7().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const p=async y=>{if(y.preventDefault(),!n.trim()||n.trim().length<8){u("Password must be at least 8 characters");return}if(n!==i){u("Passwords do not match");return}f(!0),u(null);try{if(!(await m7(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof Oi||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await g7(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof Oi||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?l.jsx(G9,{client:rq,children:l.jsx(WH,{router:FCe})}):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($e,{className:"surface-card w-full",children:e==="checking"?l.jsx(cg,{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(z1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),l.jsx(T1,{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(cg,{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:y=>r(y.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:y=>a(y.target.value),placeholder:"Re-enter password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(xe,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs(z1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),l.jsx(T1,{children:"Sign in to Canonry"}),l.jsx(P1,{children:"Enter your dashboard password to continue."})]}),l.jsx(cg,{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:y=>r(y.target.value),placeholder:"Dashboard password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(xe,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}w9.createRoot(iq).render(l.jsx(x.StrictMode,{children:l.jsx(KCe,{})}));