@ainyc/canonry 4.12.1 → 4.13.1

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 d9(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 za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hb={exports:{}},Zd={};var SO;function f9(){if(SO)return Zd;SO=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 Zd.Fragment=t,Zd.jsx=n,Zd.jsxs=n,Zd}var jO;function h9(){return jO||(jO=1,hb.exports=f9()),hb.exports}var l=h9(),pb={exports:{}},nt={};var NO;function p9(){if(NO)return nt;NO=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 S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function k(I,U,D){this.props=I,this.context=U,this.refs=j,this.updater=D||S}k.prototype.isReactComponent={},k.prototype.setState=function(I,U){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,U,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=k.prototype;function _(I,U,D){this.props=I,this.context=U,this.refs=j,this.updater=D||S}var A=_.prototype=new O;A.constructor=_,w(A,k.prototype),A.isPureReactComponent=!0;var T=Array.isArray;function C(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function B(I,U,D){var G=D.ref;return{$$typeof:e,type:I,key:U,ref:G!==void 0?G:null,props:D}}function F(I,U){return B(I.type,U,I.props)}function q(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function $(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(D){return U[D]})}var V=/\/+/g;function te(I,U){return typeof I=="object"&&I!==null&&I.key!=null?$(""+I.key):U.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(C,C):(I.status="pending",I.then(function(U){I.status==="pending"&&(I.status="fulfilled",I.value=U)},function(U){I.status==="pending"&&(I.status="rejected",I.reason=U)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function H(I,U,D,G,ae){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,H(Ce(I._payload),U,D,G,ae)}}if(Ce)return ae=ae(I),Ce=G===""?"."+te(I,0):G,T(ae)?(D="",Ce!=null&&(D=Ce.replace(V,"$&/")+"/"),H(ae,U,D,"",function(me){return me})):ae!=null&&(q(ae)&&(ae=F(ae,D+(ae.key==null||I&&I.key===ae.key?"":(""+ae.key).replace(V,"$&/")+"/")+Ce)),U.push(ae)),1;Ce=0;var Se=G===""?".":G+":";if(T(I))for(var X=0;X<I.length;X++)G=I[X],ne=Se+te(G,X),Ce+=H(G,U,D,ne,ae);else if(X=v(I),typeof X=="function")for(I=X.call(I),X=0;!(G=I.next()).done;)G=G.value,ne=Se+te(G,X++),Ce+=H(G,U,D,ne,ae);else if(ne==="object"){if(typeof I.then=="function")return H(W(I),U,D,G,ae);throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function ee(I,U,D){if(I==null)return I;var G=[],ae=0;return H(I,G,"","",function(ne){return U.call(D,ne,ae++)}),G}function le(I){if(I._status===-1){var U=I._result;U=U(),U.then(function(D){(I._status===0||I._status===-1)&&(I._status=1,I._result=D)},function(D){(I._status===0||I._status===-1)&&(I._status=2,I._result=D)}),I._status===-1&&(I._status=0,I._result=U)}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 U=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(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},L={map:ee,forEach:function(I,U,D){ee(I,function(){U.apply(this,arguments)},D)},count:function(I){var U=0;return ee(I,function(){U++}),U},toArray:function(I){return ee(I,function(U){return U})||[]},only:function(I){if(!q(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return nt.Activity=m,nt.Children=L,nt.Component=k,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=_,nt.StrictMode=r,nt.Suspense=d,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,nt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return z.H.useMemoCache(I)}},nt.cache=function(I){return function(){return I.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(I,U,D){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var G=w({},I.props),ae=I.key;if(U!=null)for(ne in U.key!==void 0&&(ae=""+U.key),U)!R.call(U,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&U.ref===void 0||(G[ne]=U[ne]);var ne=arguments.length-2;if(ne===1)G.children=D;else if(1<ne){for(var Ce=Array(ne),Se=0;Se<ne;Se++)Ce[Se]=arguments[Se+2];G.children=Ce}return B(I.type,ae,G)},nt.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},nt.createElement=function(I,U,D){var G,ae={},ne=null;if(U!=null)for(G in U.key!==void 0&&(ne=""+U.key),U)R.call(U,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ae[G]=U[G]);var Ce=arguments.length-2;if(Ce===1)ae.children=D;else if(1<Ce){for(var Se=Array(Ce),X=0;X<Ce;X++)Se[X]=arguments[X+2];ae.children=Se}if(I&&I.defaultProps)for(G in Ce=I.defaultProps,Ce)ae[G]===void 0&&(ae[G]=Ce[G]);return B(I,ne,ae)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(I){return{$$typeof:u,render:I}},nt.isValidElement=q,nt.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:le}},nt.memo=function(I,U){return{$$typeof:f,type:I,compare:U===void 0?null:U}},nt.startTransition=function(I){var U=z.T,D={};z.T=D;try{var G=I(),ae=z.S;ae!==null&&ae(D,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(C,je)}catch(ne){je(ne)}finally{U!==null&&D.types!==null&&(U.types=D.types),z.T=U}},nt.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},nt.use=function(I){return z.H.use(I)},nt.useActionState=function(I,U,D){return z.H.useActionState(I,U,D)},nt.useCallback=function(I,U){return z.H.useCallback(I,U)},nt.useContext=function(I){return z.H.useContext(I)},nt.useDebugValue=function(){},nt.useDeferredValue=function(I,U){return z.H.useDeferredValue(I,U)},nt.useEffect=function(I,U){return z.H.useEffect(I,U)},nt.useEffectEvent=function(I){return z.H.useEffectEvent(I)},nt.useId=function(){return z.H.useId()},nt.useImperativeHandle=function(I,U,D){return z.H.useImperativeHandle(I,U,D)},nt.useInsertionEffect=function(I,U){return z.H.useInsertionEffect(I,U)},nt.useLayoutEffect=function(I,U){return z.H.useLayoutEffect(I,U)},nt.useMemo=function(I,U){return z.H.useMemo(I,U)},nt.useOptimistic=function(I,U){return z.H.useOptimistic(I,U)},nt.useReducer=function(I,U,D){return z.H.useReducer(I,U,D)},nt.useRef=function(I){return z.H.useRef(I)},nt.useState=function(I){return z.H.useState(I)},nt.useSyncExternalStore=function(I,U,D){return z.H.useSyncExternalStore(I,U,D)},nt.useTransition=function(){return z.H.useTransition()},nt.version="19.2.4",nt}var kO;function Iu(){return kO||(kO=1,pb.exports=p9()),pb.exports}var b=Iu();const Si=za(b),Py=d9({__proto__:null,default:Si},[b]);var mb={exports:{}},Yd={},gb={exports:{}},yb={};var CO;function m9(){return CO||(CO=1,(function(e){function t(H,ee){var le=H.length;H.push(ee);e:for(;0<le;){var je=le-1>>>1,L=H[je];if(0<i(L,ee))H[je]=ee,H[le]=L,le=je;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ee=H[0],le=H.pop();if(le!==ee){H[0]=le;e:for(var je=0,L=H.length,I=L>>>1;je<I;){var U=2*(je+1)-1,D=H[U],G=U+1,ae=H[G];if(0>i(D,le))G<L&&0>i(ae,D)?(H[je]=ae,H[G]=le,je=G):(H[je]=D,H[U]=le,je=U);else if(G<L&&0>i(ae,le))H[je]=ae,H[G]=le,je=G;else break e}}return ee}function i(H,ee){var le=H.sortIndex-ee.sortIndex;return le!==0?le:H.id-ee.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,S=!1,w=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function A(H){for(var ee=n(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=H)r(f),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(f)}}function T(H){if(w=!1,A(H),!S)if(n(d)!==null)S=!0,C||(C=!0,$());else{var ee=n(f);ee!==null&&W(T,ee.startTime-H)}}var C=!1,z=-1,R=5,B=-1;function F(){return j?!0:!(e.unstable_now()-B<R)}function q(){if(j=!1,C){var H=e.unstable_now();B=H;var ee=!0;try{e:{S=!1,w&&(w=!1,O(z),z=-1),v=!0;var le=y;try{t:{for(A(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var je=m.callback;if(typeof je=="function"){m.callback=null,y=m.priorityLevel;var L=je(m.expirationTime<=H);if(H=e.unstable_now(),typeof L=="function"){m.callback=L,A(H),ee=!0;break t}m===n(d)&&r(d),A(H)}else r(d);m=n(d)}if(m!==null)ee=!0;else{var I=n(f);I!==null&&W(T,I.startTime-H),ee=!1}}break e}finally{m=null,y=le,v=!1}ee=void 0}}finally{ee?$():C=!1}}}var $;if(typeof _=="function")$=function(){_(q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,te=V.port2;V.port1.onmessage=q,$=function(){te.postMessage(null)}}else $=function(){k(q,0)};function W(H,ee){z=k(function(){H(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var ee=3;break;default:ee=y}var le=y;y=ee;try{return H()}finally{y=le}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var le=y;y=H;try{return ee()}finally{y=le}},e.unstable_scheduleCallback=function(H,ee,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,H){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,H={id:p++,callback:ee,priorityLevel:H,startTime:le,expirationTime:L,sortIndex:-1},le>je?(H.sortIndex=le,t(f,H),n(d)===null&&H===n(f)&&(w?(O(z),z=-1):w=!0,W(T,le-je))):(H.sortIndex=L,t(d,H),S||v||(S=!0,C||(C=!0,$()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var ee=y;return function(){var le=y;y=ee;try{return H.apply(this,arguments)}finally{y=le}}}})(yb)),yb}var _O;function g9(){return _O||(_O=1,gb.exports=m9()),gb.exports}var vb={exports:{}},sr={};var AO;function y9(){if(AO)return sr;AO=1;var e=Iu();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 EO;function uI(){if(EO)return vb.exports;EO=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(),vb.exports=y9(),vb.exports}var OO;function v9(){if(OO)return Yd;OO=1;var e=g9(),t=Iu(),n=uI();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 x=h.return;if(x===null)break;var N=x.alternate;if(N===null){if(g=x.return,g!==null){h=g;continue}break}if(x.child===N.child){for(N=x.child;N;){if(N===h)return d(x),s;if(N===g)return d(x),c;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=x,g=N;else{for(var E=!1,M=x.child;M;){if(M===h){E=!0,h=x,g=N;break}if(M===g){E=!0,g=x,h=N;break}M=M.sibling}if(!E){for(M=N.child;M;){if(M===h){E=!0,h=N,g=x;break}if(M===g){E=!0,g=N,h=x;break}M=M.sibling}if(!E)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s: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"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=q&&s[q]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function te(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case C:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case S:return"Portal";case _:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case A:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case z:return c=s.displayName||null,c!==null?c:te(s.type)||"Memo";case R:c=s._payload,s=s._init;try{return te(s(c))}catch{}}return null}var W=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},je=[],L=-1;function I(s){return{current:s}}function U(s){0>L||(s.current=je[L],je[L]=null,L--)}function D(s,c){L++,je[L]=s.current,s.current=c}var G=I(null),ae=I(null),ne=I(null),Ce=I(null);function Se(s,c){switch(D(ne,c),D(ae,s),D(G,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?KE(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=KE(c),s=GE(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(G),D(G,s)}function X(){U(G),U(ae),U(ne)}function me(s){s.memoizedState!==null&&D(Ce,s);var c=G.current,h=GE(c,s.type);c!==h&&(D(ae,s),D(G,h))}function Ee(s){ae.current===s&&(U(G),U(ae)),Ce.current===s&&(U(Ce),Kd._currentValue=le)}var Y,Fe;function Te(s){if(Y===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Y=c&&c[1]||"",Fe=-1<h.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Y+s+Fe}var it=!1;function Ge(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(de){var se=de}Reflect.construct(s,[],be)}else{try{be.call()}catch(de){se=de}s.call(be.prototype)}}else{try{throw Error()}catch(de){se=de}(be=s())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(de){if(de&&se&&typeof de.stack=="string")return[de.stack,se.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),E=N[0],M=N[1];if(E&&M){var K=E.split(`
4
+ `),ie=M.split(`
5
+ `);for(x=g=0;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;for(;x<ie.length&&!ie[x].includes("DetermineComponentFrameRoot");)x++;if(g===K.length||x===ie.length)for(g=K.length-1,x=ie.length-1;1<=g&&0<=x&&K[g]!==ie[x];)x--;for(;1<=g&&0<=x;g--,x--)if(K[g]!==ie[x]){if(g!==1||x!==1)do if(g--,x--,0>x||K[g]!==ie[x]){var ge=`
6
+ `+K[g].replace(" at new "," at ");return s.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",s.displayName)),ge}while(1<=g&&0<=x);break}}}finally{it=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Te(h):""}function $t(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 Ge(s.type,!1);case 11:return Ge(s.type.render,!1);case 1:return Ge(s.type,!0);case 31:return Te("Activity");default:return""}}function Dt(s){try{var c="",h=null;do c+=$t(s,h),h=s,s=s.return;while(s);return c}catch(g){return`
7
+ Error generating stack: `+g.message+`
8
+ `+g.stack}}var tn=Object.prototype.hasOwnProperty,Zt=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,Xe=e.unstable_shouldYield,Ot=e.unstable_requestPaint,ft=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,De=e.unstable_NormalPriority,Ke=e.unstable_LowPriority,dt=e.unstable_IdlePriority,ln=e.log,xn=e.unstable_setDisableYieldValue,cn=null,Ze=null;function Bt(s){if(typeof ln=="function"&&xn(s),Ze&&typeof Ze.setStrictMode=="function")try{Ze.setStrictMode(cn,s)}catch{}}var fe=Math.clz32?Math.clz32:Ve,ze=Math.log,he=Math.LN2;function Ve(s){return s>>>=0,s===0?32:31-(ze(s)/he|0)|0}var Rn=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 jr(s,c,h){var g=s.pendingLanes;if(g===0)return 0;var x=0,N=s.suspendedLanes,E=s.pingedLanes;s=s.warmLanes;var M=g&134217727;return M!==0?(g=M&~N,g!==0?x=bn(g):(E&=M,E!==0?x=bn(E):h||(h=M&~s,h!==0&&(x=bn(h))))):(M=g&~N,M!==0?x=bn(M):E!==0?x=bn(E):h||(h=g&~s,h!==0&&(x=bn(h)))),x===0?0:c!==0&&c!==x&&(c&N)===0&&(N=x&-x,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:x}function Mi(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function na(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 Bh(){var s=Yt;return Yt<<=1,(Yt&62914560)===0&&(Yt=4194304),s}function ws(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Ss(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function a0(s,c,h,g,x,N){var E=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var M=s.entanglements,K=s.expirationTimes,ie=s.hiddenUpdates;for(h=E&~h;0<h;){var ge=31-fe(h),be=1<<ge;M[ge]=0,K[ge]=-1;var se=ie[ge];if(se!==null)for(ie[ge]=null,ge=0;ge<se.length;ge++){var de=se[ge];de!==null&&(de.lane&=-536870913)}h&=~be}g!==0&&id(s,g,0),N!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=N&~(E&~c))}function id(s,c,h){s.pendingLanes|=c,s.suspendedLanes&=~c;var g=31-fe(c);s.entangledLanes|=c,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function Uh(s,c){var h=s.entangledLanes|=c;for(s=s.entanglements;h;){var g=31-fe(h),x=1<<g;x&c|s[g]&c&&(s[g]|=c),h&=~x}}function qh(s,c){var h=c&-c;return h=(h&42)!==0?1:ad(h),(h&(s.suspendedLanes|c))!==0?0:h}function ad(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 sd(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function od(){var s=ee.p;return s!==0?s:(s=window.event,s===void 0?32:mO(s.type))}function Q(s,c){var h=ee.p;try{return ee.p=s,c()}finally{ee.p=h}}var ke=Math.random().toString(36).slice(2),tt="__reactFiber$"+ke,wt="__reactProps$"+ke,wn="__reactContainer$"+ke,ra="__reactEvents$"+ke,Ra="__reactListeners$"+ke,js="__reactHandles$"+ke,pr="__reactResources$"+ke,Po="__reactMarker$"+ke;function ia(s){delete s[tt],delete s[wt],delete s[ra],delete s[Ra],delete s[js]}function si(s){var c=s[tt];if(c)return c;for(var h=s.parentNode;h;){if(c=h[wn]||h[tt]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(s=JE(s);s!==null;){if(h=s[tt])return h;s=JE(s)}return c}s=h,h=s.parentNode}return null}function Ii(s){if(s=s[tt]||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 Ns(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function ks(s){var c=s[pr];return c||(c=s[pr]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function un(s){s[Po]=!0}var Ro=new Set,Fh={};function Da(s,c){ct(s,c),ct(s+"Capture",c)}function ct(s,c){for(Fh[s]=c,s=0;s<c.length;s++)Ro.add(c[s])}var Ut=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]*$"),Nr={},Li={};function tc(s){return tn.call(Li,s)?!0:tn.call(Nr,s)?!1:Ut.test(s)?Li[s]=!0:(Nr[s]=!0,!1)}function Do(s,c,h){if(tc(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 Hh(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 Ma(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 IC(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function i8(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 x=g.get,N=g.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return x.call(this)},set:function(E){h=""+E,N.call(this,E)}}),Object.defineProperty(s,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function s0(s){if(!s._valueTracker){var c=IC(s)?"checked":"value";s._valueTracker=i8(s,c,""+s[c])}}function LC(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return s&&(g=IC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(c.setValue(s),!0):!1}function Kh(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 a8=/[\n"\\]/g;function li(s){return s.replace(a8,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function o0(s,c,h,g,x,N,E,M){s.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?s.type=E:s.removeAttribute("type"),c!=null?E==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+oi(c)):s.value!==""+oi(c)&&(s.value=""+oi(c)):E!=="submit"&&E!=="reset"||s.removeAttribute("value"),c!=null?l0(s,E,oi(c)):h!=null?l0(s,E,oi(h)):g!=null&&s.removeAttribute("value"),x==null&&N!=null&&(s.defaultChecked=!!N),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+oi(M):s.removeAttribute("name")}function $C(s,c,h,g,x,N,E,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)){s0(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??x,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=M?s.checked:!!g,s.defaultChecked=!!g,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.name=E),s0(s)}function l0(s,c,h){c==="number"&&Kh(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function nc(s,c,h,g){if(s=s.options,c){c={};for(var x=0;x<h.length;x++)c["$"+h[x]]=!0;for(h=0;h<s.length;h++)x=c.hasOwnProperty("$"+s[h].value),s[h].selected!==x&&(s[h].selected=x),x&&g&&(s[h].defaultSelected=!0)}else{for(h=""+oi(h),c=null,x=0;x<s.length;x++){if(s[x].value===h){s[x].selected=!0,g&&(s[x].defaultSelected=!0);return}c!==null||s[x].disabled||(c=s[x])}c!==null&&(c.selected=!0)}}function BC(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 UC(s,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(r(92));if(W(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),s0(s)}function rc(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var s8=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 qC(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||s8.has(c)?c==="float"?s.cssFloat=h:s[c]=(""+h).trim():s[c]=h+"px"}function FC(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 x in c)g=c[x],c.hasOwnProperty(x)&&h[x]!==g&&qC(s,x,g)}else for(var N in c)c.hasOwnProperty(N)&&qC(s,N,c[N])}function c0(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 o8=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"]]),l8=/^[\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 Gh(s){return l8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ia(){}var u0=null;function d0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var ic=null,ac=null;function HC(s){var c=Ii(s);if(c&&(s=c.stateNode)){var h=s[wt]||null;e:switch(s=c.stateNode,c.type){case"input":if(o0(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 x=g[wt]||null;if(!x)throw Error(r(90));o0(g,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===s.form&&LC(g)}break e;case"textarea":BC(s,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&nc(s,!!h.multiple,c,!1)}}}var f0=!1;function KC(s,c,h){if(f0)return s(c,h);f0=!0;try{var g=s(c);return g}finally{if(f0=!1,(ic!==null||ac!==null)&&(Pp(),ic&&(c=ic,s=ac,ac=ic=null,HC(c),s)))for(c=0;c<s.length;c++)HC(s[c])}}function ld(s,c){var h=s.stateNode;if(h===null)return null;var g=h[wt]||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 La=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h0=!1;if(La)try{var cd={};Object.defineProperty(cd,"passive",{get:function(){h0=!0}}),window.addEventListener("test",cd,cd),window.removeEventListener("test",cd,cd)}catch{h0=!1}var Cs=null,p0=null,Vh=null;function GC(){if(Vh)return Vh;var s,c=p0,h=c.length,g,x="value"in Cs?Cs.value:Cs.textContent,N=x.length;for(s=0;s<h&&c[s]===x[s];s++);var E=h-s;for(g=1;g<=E&&c[h-g]===x[N-g];g++);return Vh=x.slice(s,1<g?1-g:void 0)}function Qh(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 Zh(){return!0}function VC(){return!1}function kr(s){function c(h,g,x,N,E){this._reactName=h,this._targetInst=x,this.type=g,this.nativeEvent=N,this.target=E,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)?Zh:VC,this.isPropagationStopped=VC,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=Zh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Zh)},persist:function(){},isPersistent:Zh}),c}var Mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yh=kr(Mo),ud=m({},Mo,{view:0,detail:0}),c8=kr(ud),m0,g0,dd,Wh=m({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v0,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!==dd&&(dd&&s.type==="mousemove"?(m0=s.screenX-dd.screenX,g0=s.screenY-dd.screenY):g0=m0=0,dd=s),m0)},movementY:function(s){return"movementY"in s?s.movementY:g0}}),QC=kr(Wh),u8=m({},Wh,{dataTransfer:0}),d8=kr(u8),f8=m({},ud,{relatedTarget:0}),y0=kr(f8),h8=m({},Mo,{animationName:0,elapsedTime:0,pseudoElement:0}),p8=kr(h8),m8=m({},Mo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),g8=kr(m8),y8=m({},Mo,{data:0}),ZC=kr(y8),v8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},x8={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"},b8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w8(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=b8[s])?!!c[s]:!1}function v0(){return w8}var S8=m({},ud,{key:function(s){if(s.key){var c=v8[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Qh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?x8[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v0,charCode:function(s){return s.type==="keypress"?Qh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Qh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),j8=kr(S8),N8=m({},Wh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),YC=kr(N8),k8=m({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v0}),C8=kr(k8),_8=m({},Mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),A8=kr(_8),E8=m({},Wh,{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}),O8=kr(E8),z8=m({},Mo,{newState:0,oldState:0}),T8=kr(z8),P8=[9,13,27,32],x0=La&&"CompositionEvent"in window,fd=null;La&&"documentMode"in document&&(fd=document.documentMode);var R8=La&&"TextEvent"in window&&!fd,WC=La&&(!x0||fd&&8<fd&&11>=fd),XC=" ",JC=!1;function e_(s,c){switch(s){case"keyup":return P8.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function t_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var sc=!1;function D8(s,c){switch(s){case"compositionend":return t_(c);case"keypress":return c.which!==32?null:(JC=!0,XC);case"textInput":return s=c.data,s===XC&&JC?null:s;default:return null}}function M8(s,c){if(sc)return s==="compositionend"||!x0&&e_(s,c)?(s=GC(),Vh=p0=Cs=null,sc=!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 WC&&c.locale!=="ko"?null:c.data;default:return null}}var I8={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 n_(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!I8[s.type]:c==="textarea"}function r_(s,c,h,g){ic?ac?ac.push(g):ac=[g]:ic=g,c=Bp(c,"onChange"),0<c.length&&(h=new Yh("onChange","change",null,h,g),s.push({event:h,listeners:c}))}var hd=null,pd=null;function L8(s){$E(s,0)}function Xh(s){var c=Ns(s);if(LC(c))return s}function i_(s,c){if(s==="change")return c}var a_=!1;if(La){var b0;if(La){var w0="oninput"in document;if(!w0){var s_=document.createElement("div");s_.setAttribute("oninput","return;"),w0=typeof s_.oninput=="function"}b0=w0}else b0=!1;a_=b0&&(!document.documentMode||9<document.documentMode)}function o_(){hd&&(hd.detachEvent("onpropertychange",l_),pd=hd=null)}function l_(s){if(s.propertyName==="value"&&Xh(pd)){var c=[];r_(c,pd,s,d0(s)),KC(L8,c)}}function $8(s,c,h){s==="focusin"?(o_(),hd=c,pd=h,hd.attachEvent("onpropertychange",l_)):s==="focusout"&&o_()}function B8(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Xh(pd)}function U8(s,c){if(s==="click")return Xh(c)}function q8(s,c){if(s==="input"||s==="change")return Xh(c)}function F8(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Ur=typeof Object.is=="function"?Object.is:F8;function md(s,c){if(Ur(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 x=h[g];if(!tn.call(c,x)||!Ur(s[x],c[x]))return!1}return!0}function c_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function u_(s,c){var h=c_(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=c_(h)}}function d_(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?d_(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function f_(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=Kh(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=Kh(s.document)}return c}function S0(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 H8=La&&"documentMode"in document&&11>=document.documentMode,oc=null,j0=null,gd=null,N0=!1;function h_(s,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;N0||oc==null||oc!==Kh(g)||(g=oc,"selectionStart"in g&&S0(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}),gd&&md(gd,g)||(gd=g,g=Bp(j0,"onSelect"),0<g.length&&(c=new Yh("onSelect","select",null,c,h),s.push({event:c,listeners:g}),c.target=oc)))}function Io(s,c){var h={};return h[s.toLowerCase()]=c.toLowerCase(),h["Webkit"+s]="webkit"+c,h["Moz"+s]="moz"+c,h}var lc={animationend:Io("Animation","AnimationEnd"),animationiteration:Io("Animation","AnimationIteration"),animationstart:Io("Animation","AnimationStart"),transitionrun:Io("Transition","TransitionRun"),transitionstart:Io("Transition","TransitionStart"),transitioncancel:Io("Transition","TransitionCancel"),transitionend:Io("Transition","TransitionEnd")},k0={},p_={};La&&(p_=document.createElement("div").style,"AnimationEvent"in window||(delete lc.animationend.animation,delete lc.animationiteration.animation,delete lc.animationstart.animation),"TransitionEvent"in window||delete lc.transitionend.transition);function Lo(s){if(k0[s])return k0[s];if(!lc[s])return s;var c=lc[s],h;for(h in c)if(c.hasOwnProperty(h)&&h in p_)return k0[s]=c[h];return s}var m_=Lo("animationend"),g_=Lo("animationiteration"),y_=Lo("animationstart"),K8=Lo("transitionrun"),G8=Lo("transitionstart"),V8=Lo("transitioncancel"),v_=Lo("transitionend"),x_=new Map,C0="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(" ");C0.push("scrollEnd");function $i(s,c){x_.set(s,c),Da(c,[s])}var Jh=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=[],cc=0,_0=0;function ep(){for(var s=cc,c=_0=cc=0;c<s;){var h=ci[c];ci[c++]=null;var g=ci[c];ci[c++]=null;var x=ci[c];ci[c++]=null;var N=ci[c];if(ci[c++]=null,g!==null&&x!==null){var E=g.pending;E===null?x.next=x:(x.next=E.next,E.next=x),g.pending=x}N!==0&&b_(h,x,N)}}function tp(s,c,h,g){ci[cc++]=s,ci[cc++]=c,ci[cc++]=h,ci[cc++]=g,_0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function A0(s,c,h,g){return tp(s,c,h,g),np(s)}function $o(s,c){return tp(s,null,null,c),np(s)}function b_(s,c,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var x=!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||(x=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,x&&c!==null&&(x=31-fe(h),s=N.hiddenUpdates,g=s[x],g===null?s[x]=[c]:g.push(c),c.lane=h|536870912),N):null}function np(s){if(50<Ld)throw Ld=0,Ix=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var uc={};function Q8(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 qr(s,c,h,g){return new Q8(s,c,h,g)}function E0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function $a(s,c){var h=s.alternate;return h===null?(h=qr(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 w_(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 rp(s,c,h,g,x,N){var E=0;if(g=s,typeof s=="function")E0(s)&&(E=1);else if(typeof s=="string")E=JF(s,h,G.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=qr(31,h,c,x),s.elementType=B,s.lanes=N,s;case w:return Bo(h.children,x,N,c);case j:E=8,x|=24;break;case k:return s=qr(12,h,c,x|2),s.elementType=k,s.lanes=N,s;case T:return s=qr(13,h,c,x),s.elementType=T,s.lanes=N,s;case C:return s=qr(19,h,c,x),s.elementType=C,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:E=10;break e;case O:E=9;break e;case A:E=11;break e;case z:E=14;break e;case R:E=16,g=null;break e}E=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return c=qr(E,h,c,x),c.elementType=s,c.type=g,c.lanes=N,c}function Bo(s,c,h,g){return s=qr(7,s,g,c),s.lanes=h,s}function O0(s,c,h){return s=qr(6,s,null,c),s.lanes=h,s}function S_(s){var c=qr(18,null,null,0);return c.stateNode=s,c}function z0(s,c,h){return c=qr(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var j_=new WeakMap;function ui(s,c){if(typeof s=="object"&&s!==null){var h=j_.get(s);return h!==void 0?h:(c={value:s,source:c,stack:Dt(c)},j_.set(s,c),c)}return{value:s,source:c,stack:Dt(c)}}var dc=[],fc=0,ip=null,yd=0,di=[],fi=0,_s=null,aa=1,sa="";function Ba(s,c){dc[fc++]=yd,dc[fc++]=ip,ip=s,yd=c}function N_(s,c,h){di[fi++]=aa,di[fi++]=sa,di[fi++]=_s,_s=s;var g=aa;s=sa;var x=32-fe(g)-1;g&=~(1<<x),h+=1;var N=32-fe(c)+x;if(30<N){var E=x-x%5;N=(g&(1<<E)-1).toString(32),g>>=E,x-=E,aa=1<<32-fe(c)+x|h<<x|g,sa=N+s}else aa=1<<N|h<<x|g,sa=s}function T0(s){s.return!==null&&(Ba(s,1),N_(s,1,0))}function P0(s){for(;s===ip;)ip=dc[--fc],dc[fc]=null,yd=dc[--fc],dc[fc]=null;for(;s===_s;)_s=di[--fi],di[fi]=null,sa=di[--fi],di[fi]=null,aa=di[--fi],di[fi]=null}function k_(s,c){di[fi++]=aa,di[fi++]=sa,di[fi++]=_s,aa=c.id,sa=c.overflow,_s=s}var Qn=null,Wt=null,xt=!1,As=null,hi=!1,R0=Error(r(519));function Es(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vd(ui(c,s)),R0}function C_(s){var c=s.stateNode,h=s.type,g=s.memoizedProps;switch(c[tt]=s,c[wt]=g,h){case"dialog":pt("cancel",c),pt("close",c);break;case"iframe":case"object":case"embed":pt("load",c);break;case"video":case"audio":for(h=0;h<Bd.length;h++)pt(Bd[h],c);break;case"source":pt("error",c);break;case"img":case"image":case"link":pt("error",c),pt("load",c);break;case"details":pt("toggle",c);break;case"input":pt("invalid",c),$C(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":pt("invalid",c);break;case"textarea":pt("invalid",c),UC(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||FE(c.textContent,h)?(g.popover!=null&&(pt("beforetoggle",c),pt("toggle",c)),g.onScroll!=null&&pt("scroll",c),g.onScrollEnd!=null&&pt("scrollend",c),g.onClick!=null&&(c.onclick=Ia),c=!0):c=!1,c||Es(s,!0)}function __(s){for(Qn=s.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:Qn=Qn.return}}function hc(s){if(s!==Qn)return!1;if(!xt)return __(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")||Xx(s.type,s.memoizedProps)),h=!h),h&&Wt&&Es(s),__(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Wt=XE(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Wt=XE(s)}else c===27?(c=Wt,Fs(s.type)?(s=rb,rb=null,Wt=s):Wt=c):Wt=Qn?mi(s.stateNode.nextSibling):null;return!0}function Uo(){Wt=Qn=null,xt=!1}function D0(){var s=As;return s!==null&&(Er===null?Er=s:Er.push.apply(Er,s),As=null),s}function vd(s){As===null?As=[s]:As.push(s)}var M0=I(null),qo=null,Ua=null;function Os(s,c,h){D(M0,c._currentValue),c._currentValue=h}function qa(s){s._currentValue=M0.current,U(M0)}function I0(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 L0(s,c,h,g){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var N=x.dependencies;if(N!==null){var E=x.child;N=N.firstContext;e:for(;N!==null;){var M=N;N=x;for(var K=0;K<c.length;K++)if(M.context===c[K]){N.lanes|=h,M=N.alternate,M!==null&&(M.lanes|=h),I0(N.return,h,s),g||(E=null);break e}N=M.next}}else if(x.tag===18){if(E=x.return,E===null)throw Error(r(341));E.lanes|=h,N=E.alternate,N!==null&&(N.lanes|=h),I0(E,h,s),E=null}else E=x.child;if(E!==null)E.return=x;else for(E=x;E!==null;){if(E===s){E=null;break}if(x=E.sibling,x!==null){x.return=E.return,E=x;break}E=E.return}x=E}}function pc(s,c,h,g){s=null;for(var x=c,N=!1;x!==null;){if(!N){if((x.flags&524288)!==0)N=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var E=x.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var M=x.type;Ur(x.pendingProps.value,E.value)||(s!==null?s.push(M):s=[M])}}else if(x===Ce.current){if(E=x.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Kd):s=[Kd])}x=x.return}s!==null&&L0(c,s,h,g),c.flags|=262144}function ap(s){for(s=s.firstContext;s!==null;){if(!Ur(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Fo(s){qo=s,Ua=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Zn(s){return A_(qo,s)}function sp(s,c){return qo===null&&Fo(s),A_(s,c)}function A_(s,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},Ua===null){if(s===null)throw Error(r(308));Ua=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else Ua=Ua.next=c;return h}var Z8=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()})}},Y8=e.unstable_scheduleCallback,W8=e.unstable_NormalPriority,_n={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $0(){return{controller:new Z8,data:new Map,refCount:0}}function xd(s){s.refCount--,s.refCount===0&&Y8(W8,function(){s.controller.abort()})}var bd=null,B0=0,mc=0,gc=null;function X8(s,c){if(bd===null){var h=bd=[];B0=0,mc=Fx(),gc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return B0++,c.then(E_,E_),c}function E_(){if(--B0===0&&bd!==null){gc!==null&&(gc.status="fulfilled");var s=bd;bd=null,mc=0,gc=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function J8(s,c){var h=[],g={status:"pending",value:null,reason:null,then:function(x){h.push(x)}};return s.then(function(){g.status="fulfilled",g.value=c;for(var x=0;x<h.length;x++)(0,h[x])(c)},function(x){for(g.status="rejected",g.reason=x,x=0;x<h.length;x++)(0,h[x])(void 0)}),g}var O_=H.S;H.S=function(s,c){hE=ft(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&X8(s,c),O_!==null&&O_(s,c)};var Ho=I(null);function U0(){var s=Ho.current;return s!==null?s:qt.pooledCache}function op(s,c){c===null?D(Ho,Ho.current):D(Ho,c.pool)}function z_(){var s=U0();return s===null?null:{parent:_n._currentValue,pool:s}}var yc=Error(r(460)),q0=Error(r(474)),lp=Error(r(542)),cp={then:function(){}};function T_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function P_(s,c,h){switch(h=s[h],h===void 0?s.push(c):h!==c&&(c.then(Ia,Ia),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,D_(s),s;default:if(typeof c.status=="string")c.then(Ia,Ia);else{if(s=qt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(g){if(c.status==="pending"){var x=c;x.status="fulfilled",x.value=g}},function(g){if(c.status==="pending"){var x=c;x.status="rejected",x.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,D_(s),s}throw Go=c,yc}}function Ko(s){try{var c=s._init;return c(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Go=h,yc):h}}var Go=null;function R_(){if(Go===null)throw Error(r(459));var s=Go;return Go=null,s}function D_(s){if(s===yc||s===lp)throw Error(r(483))}var vc=null,wd=0;function up(s){var c=wd;return wd+=1,vc===null&&(vc=[]),P_(vc,s,c)}function Sd(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function dp(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 M_(s){function c(J,Z){if(s){var re=J.deletions;re===null?(J.deletions=[Z],J.flags|=16):re.push(Z)}}function h(J,Z){if(!s)return null;for(;Z!==null;)c(J,Z),Z=Z.sibling;return null}function g(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function x(J,Z){return J=$a(J,Z),J.index=0,J.sibling=null,J}function N(J,Z,re){return J.index=re,s?(re=J.alternate,re!==null?(re=re.index,re<Z?(J.flags|=67108866,Z):re):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function E(J){return s&&J.alternate===null&&(J.flags|=67108866),J}function M(J,Z,re,ve){return Z===null||Z.tag!==6?(Z=O0(re,J.mode,ve),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function K(J,Z,re,ve){var He=re.type;return He===w?ge(J,Z,re.props.children,ve,re.key):Z!==null&&(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&Ko(He)===Z.type)?(Z=x(Z,re.props),Sd(Z,re),Z.return=J,Z):(Z=rp(re.type,re.key,re.props,null,J.mode,ve),Sd(Z,re),Z.return=J,Z)}function ie(J,Z,re,ve){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=z0(re,J.mode,ve),Z.return=J,Z):(Z=x(Z,re.children||[]),Z.return=J,Z)}function ge(J,Z,re,ve,He){return Z===null||Z.tag!==7?(Z=Bo(re,J.mode,ve,He),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function be(J,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=O0(""+Z,J.mode,re),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return re=rp(Z.type,Z.key,Z.props,null,J.mode,re),Sd(re,Z),re.return=J,re;case S:return Z=z0(Z,J.mode,re),Z.return=J,Z;case R:return Z=Ko(Z),be(J,Z,re)}if(W(Z)||$(Z))return Z=Bo(Z,J.mode,re,null),Z.return=J,Z;if(typeof Z.then=="function")return be(J,up(Z),re);if(Z.$$typeof===_)return be(J,sp(J,Z),re);dp(J,Z)}return null}function se(J,Z,re,ve){var He=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return He!==null?null:M(J,Z,""+re,ve);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===He?K(J,Z,re,ve):null;case S:return re.key===He?ie(J,Z,re,ve):null;case R:return re=Ko(re),se(J,Z,re,ve)}if(W(re)||$(re))return He!==null?null:ge(J,Z,re,ve,null);if(typeof re.then=="function")return se(J,Z,up(re),ve);if(re.$$typeof===_)return se(J,Z,sp(J,re),ve);dp(J,re)}return null}function de(J,Z,re,ve,He){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return J=J.get(re)||null,M(Z,J,""+ve,He);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return J=J.get(ve.key===null?re:ve.key)||null,K(Z,J,ve,He);case S:return J=J.get(ve.key===null?re:ve.key)||null,ie(Z,J,ve,He);case R:return ve=Ko(ve),de(J,Z,re,ve,He)}if(W(ve)||$(ve))return J=J.get(re)||null,ge(Z,J,ve,He,null);if(typeof ve.then=="function")return de(J,Z,re,up(ve),He);if(ve.$$typeof===_)return de(J,Z,re,sp(Z,ve),He);dp(Z,ve)}return null}function Re(J,Z,re,ve){for(var He=null,Nt=null,$e=Z,st=Z=0,vt=null;$e!==null&&st<re.length;st++){$e.index>st?(vt=$e,$e=null):vt=$e.sibling;var kt=se(J,$e,re[st],ve);if(kt===null){$e===null&&($e=vt);break}s&&$e&&kt.alternate===null&&c(J,$e),Z=N(kt,Z,st),Nt===null?He=kt:Nt.sibling=kt,Nt=kt,$e=vt}if(st===re.length)return h(J,$e),xt&&Ba(J,st),He;if($e===null){for(;st<re.length;st++)$e=be(J,re[st],ve),$e!==null&&(Z=N($e,Z,st),Nt===null?He=$e:Nt.sibling=$e,Nt=$e);return xt&&Ba(J,st),He}for($e=g($e);st<re.length;st++)vt=de($e,J,st,re[st],ve),vt!==null&&(s&&vt.alternate!==null&&$e.delete(vt.key===null?st:vt.key),Z=N(vt,Z,st),Nt===null?He=vt:Nt.sibling=vt,Nt=vt);return s&&$e.forEach(function(Qs){return c(J,Qs)}),xt&&Ba(J,st),He}function Ye(J,Z,re,ve){if(re==null)throw Error(r(151));for(var He=null,Nt=null,$e=Z,st=Z=0,vt=null,kt=re.next();$e!==null&&!kt.done;st++,kt=re.next()){$e.index>st?(vt=$e,$e=null):vt=$e.sibling;var Qs=se(J,$e,kt.value,ve);if(Qs===null){$e===null&&($e=vt);break}s&&$e&&Qs.alternate===null&&c(J,$e),Z=N(Qs,Z,st),Nt===null?He=Qs:Nt.sibling=Qs,Nt=Qs,$e=vt}if(kt.done)return h(J,$e),xt&&Ba(J,st),He;if($e===null){for(;!kt.done;st++,kt=re.next())kt=be(J,kt.value,ve),kt!==null&&(Z=N(kt,Z,st),Nt===null?He=kt:Nt.sibling=kt,Nt=kt);return xt&&Ba(J,st),He}for($e=g($e);!kt.done;st++,kt=re.next())kt=de($e,J,st,kt.value,ve),kt!==null&&(s&&kt.alternate!==null&&$e.delete(kt.key===null?st:kt.key),Z=N(kt,Z,st),Nt===null?He=kt:Nt.sibling=kt,Nt=kt);return s&&$e.forEach(function(u9){return c(J,u9)}),xt&&Ba(J,st),He}function Lt(J,Z,re,ve){if(typeof re=="object"&&re!==null&&re.type===w&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var He=re.key;Z!==null;){if(Z.key===He){if(He=re.type,He===w){if(Z.tag===7){h(J,Z.sibling),ve=x(Z,re.props.children),ve.return=J,J=ve;break e}}else if(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&Ko(He)===Z.type){h(J,Z.sibling),ve=x(Z,re.props),Sd(ve,re),ve.return=J,J=ve;break e}h(J,Z);break}else c(J,Z);Z=Z.sibling}re.type===w?(ve=Bo(re.props.children,J.mode,ve,re.key),ve.return=J,J=ve):(ve=rp(re.type,re.key,re.props,null,J.mode,ve),Sd(ve,re),ve.return=J,J=ve)}return E(J);case S:e:{for(He=re.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){h(J,Z.sibling),ve=x(Z,re.children||[]),ve.return=J,J=ve;break e}else{h(J,Z);break}else c(J,Z);Z=Z.sibling}ve=z0(re,J.mode,ve),ve.return=J,J=ve}return E(J);case R:return re=Ko(re),Lt(J,Z,re,ve)}if(W(re))return Re(J,Z,re,ve);if($(re)){if(He=$(re),typeof He!="function")throw Error(r(150));return re=He.call(re),Ye(J,Z,re,ve)}if(typeof re.then=="function")return Lt(J,Z,up(re),ve);if(re.$$typeof===_)return Lt(J,Z,sp(J,re),ve);dp(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Z!==null&&Z.tag===6?(h(J,Z.sibling),ve=x(Z,re),ve.return=J,J=ve):(h(J,Z),ve=O0(re,J.mode,ve),ve.return=J,J=ve),E(J)):h(J,Z)}return function(J,Z,re,ve){try{wd=0;var He=Lt(J,Z,re,ve);return vc=null,He}catch($e){if($e===yc||$e===lp)throw $e;var Nt=qr(29,$e,null,J.mode);return Nt.lanes=ve,Nt.return=J,Nt}}}var Vo=M_(!0),I_=M_(!1),zs=!1;function F0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function H0(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 Ts(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ps(s,c,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(At&2)!==0){var x=g.pending;return x===null?c.next=c:(c.next=x.next,x.next=c),g.pending=c,c=np(s),b_(s,null,h),c}return tp(s,g,c,h),np(s)}function jd(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,Uh(s,h)}}function K0(s,c){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var x=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var E={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?x=N=E:N=N.next=E,h=h.next}while(h!==null);N===null?x=N=c:N=N.next=c}else x=N=c;h={baseState:g.baseState,firstBaseUpdate:x,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 G0=!1;function Nd(){if(G0){var s=gc;if(s!==null)throw s}}function kd(s,c,h,g){G0=!1;var x=s.updateQueue;zs=!1;var N=x.firstBaseUpdate,E=x.lastBaseUpdate,M=x.shared.pending;if(M!==null){x.shared.pending=null;var K=M,ie=K.next;K.next=null,E===null?N=ie:E.next=ie,E=K;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,M=ge.lastBaseUpdate,M!==E&&(M===null?ge.firstBaseUpdate=ie:M.next=ie,ge.lastBaseUpdate=K))}if(N!==null){var be=x.baseState;E=0,ge=ie=K=null,M=N;do{var se=M.lane&-536870913,de=se!==M.lane;if(de?(yt&se)===se:(g&se)===se){se!==0&&se===mc&&(G0=!0),ge!==null&&(ge=ge.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=s,Ye=M;se=c;var Lt=h;switch(Ye.tag){case 1:if(Re=Ye.payload,typeof Re=="function"){be=Re.call(Lt,be,se);break e}be=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ye.payload,se=typeof Re=="function"?Re.call(Lt,be,se):Re,se==null)break e;be=m({},be,se);break e;case 2:zs=!0}}se=M.callback,se!==null&&(s.flags|=64,de&&(s.flags|=8192),de=x.callbacks,de===null?x.callbacks=[se]:de.push(se))}else de={lane:se,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ge===null?(ie=ge=de,K=be):ge=ge.next=de,E|=se;if(M=M.next,M===null){if(M=x.shared.pending,M===null)break;de=M,M=de.next,de.next=null,x.lastBaseUpdate=de,x.shared.pending=null}}while(!0);ge===null&&(K=be),x.baseState=K,x.firstBaseUpdate=ie,x.lastBaseUpdate=ge,N===null&&(x.shared.lanes=0),Ls|=E,s.lanes=E,s.memoizedState=be}}function L_(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function $_(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)L_(h[s],c)}var xc=I(null),fp=I(0);function B_(s,c){s=Wa,D(fp,s),D(xc,c),Wa=s|c.baseLanes}function V0(){D(fp,Wa),D(xc,xc.current)}function Q0(){Wa=fp.current,U(xc),U(fp)}var Fr=I(null),pi=null;function Rs(s){var c=s.alternate;D(Sn,Sn.current&1),D(Fr,s),pi===null&&(c===null||xc.current!==null||c.memoizedState!==null)&&(pi=s)}function Z0(s){D(Sn,Sn.current),D(Fr,s),pi===null&&(pi=s)}function U_(s){s.tag===22?(D(Sn,Sn.current),D(Fr,s),pi===null&&(pi=s)):Ds()}function Ds(){D(Sn,Sn.current),D(Fr,Fr.current)}function Hr(s){U(Fr),pi===s&&(pi=null),U(Sn)}var Sn=I(0);function hp(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||tb(h)||nb(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 Fa=0,at=null,Mt=null,An=null,pp=!1,bc=!1,Qo=!1,mp=0,Cd=0,wc=null,eF=0;function pn(){throw Error(r(321))}function Y0(s,c){if(c===null)return!1;for(var h=0;h<c.length&&h<s.length;h++)if(!Ur(s[h],c[h]))return!1;return!0}function W0(s,c,h,g,x,N){return Fa=N,at=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=s===null||s.memoizedState===null?NA:fx,Qo=!1,N=h(g,x),Qo=!1,bc&&(N=F_(c,h,g,x)),q_(s),N}function q_(s){H.H=Ed;var c=Mt!==null&&Mt.next!==null;if(Fa=0,An=Mt=at=null,pp=!1,Cd=0,wc=null,c)throw Error(r(300));s===null||En||(s=s.dependencies,s!==null&&ap(s)&&(En=!0))}function F_(s,c,h,g){at=s;var x=0;do{if(bc&&(wc=null),Cd=0,bc=!1,25<=x)throw Error(r(301));if(x+=1,An=Mt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=kA,N=c(h,g)}while(bc);return N}function tF(){var s=H.H,c=s.useState()[0];return c=typeof c.then=="function"?_d(c):c,s=s.useState()[0],(Mt!==null?Mt.memoizedState:null)!==s&&(at.flags|=1024),c}function X0(){var s=mp!==0;return mp=0,s}function J0(s,c,h){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~h}function ex(s){if(pp){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}pp=!1}Fa=0,An=Mt=at=null,bc=!1,Cd=mp=0,wc=null}function mr(){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(Mt===null){var s=at.alternate;s=s!==null?s.memoizedState:null}else s=Mt.next;var c=An===null?at.memoizedState:An.next;if(c!==null)An=c,Mt=s;else{if(s===null)throw at.alternate===null?Error(r(467)):Error(r(310));Mt=s,s={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},An===null?at.memoizedState=An=s:An=An.next=s}return An}function gp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _d(s){var c=Cd;return Cd+=1,wc===null&&(wc=[]),s=P_(wc,s,c),c=at,(An===null?c.memoizedState:An.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?NA:fx),s}function yp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return _d(s);if(s.$$typeof===_)return Zn(s)}throw Error(r(438,String(s)))}function tx(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(x){return x.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=gp(),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 Ha(s,c){return typeof c=="function"?c(s):c}function vp(s){var c=jn();return nx(c,Mt,s)}function nx(s,c,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var x=s.baseQueue,N=g.pending;if(N!==null){if(x!==null){var E=x.next;x.next=N.next,N.next=E}c.baseQueue=x=N,g.pending=null}if(N=s.baseState,x===null)s.memoizedState=N;else{c=x.next;var M=E=null,K=null,ie=c,ge=!1;do{var be=ie.lane&-536870913;if(be!==ie.lane?(yt&be)===be:(Fa&be)===be){var se=ie.revertLane;if(se===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),be===mc&&(ge=!0);else if((Fa&se)===se){ie=ie.next,se===mc&&(ge=!0);continue}else be={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(M=K=be,E=N):K=K.next=be,at.lanes|=se,Ls|=se;be=ie.action,Qo&&h(N,be),N=ie.hasEagerState?ie.eagerState:h(N,be)}else se={lane:be,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(M=K=se,E=N):K=K.next=se,at.lanes|=be,Ls|=be;ie=ie.next}while(ie!==null&&ie!==c);if(K===null?E=N:K.next=M,!Ur(N,s.memoizedState)&&(En=!0,ge&&(h=gc,h!==null)))throw h;s.memoizedState=N,s.baseState=E,s.baseQueue=K,g.lastRenderedState=N}return x===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function rx(s){var c=jn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,x=h.pending,N=c.memoizedState;if(x!==null){h.pending=null;var E=x=x.next;do N=s(N,E.action),E=E.next;while(E!==x);Ur(N,c.memoizedState)||(En=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,g]}function H_(s,c,h){var g=at,x=jn(),N=xt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var E=!Ur((Mt||x).memoizedState,h);if(E&&(x.memoizedState=h,En=!0),x=x.queue,sx(V_.bind(null,g,x,s),[s]),x.getSnapshot!==c||E||An!==null&&An.memoizedState.tag&1){if(g.flags|=2048,Sc(9,{destroy:void 0},G_.bind(null,g,x,h,c),null),qt===null)throw Error(r(349));N||(Fa&127)!==0||K_(g,c,h)}return h}function K_(s,c,h){s.flags|=16384,s={getSnapshot:c,value:h},c=at.updateQueue,c===null?(c=gp(),at.updateQueue=c,c.stores=[s]):(h=c.stores,h===null?c.stores=[s]:h.push(s))}function G_(s,c,h,g){c.value=h,c.getSnapshot=g,Q_(c)&&Z_(s)}function V_(s,c,h){return h(function(){Q_(c)&&Z_(s)})}function Q_(s){var c=s.getSnapshot;s=s.value;try{var h=c();return!Ur(s,h)}catch{return!0}}function Z_(s){var c=$o(s,2);c!==null&&Or(c,s,2)}function ix(s){var c=mr();if(typeof s=="function"){var h=s;if(s=h(),Qo){Bt(!0);try{h()}finally{Bt(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:s},c}function Y_(s,c,h,g){return s.baseState=h,nx(s,Mt,typeof g=="function"?g:Ha)}function nF(s,c,h,g,x){if(wp(s))throw Error(r(485));if(s=c.action,s!==null){var N={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){N.listeners.push(E)}};H.T!==null?h(!0):N.isTransition=!1,g(N),h=c.pending,h===null?(N.next=c.pending=N,W_(c,N)):(N.next=h.next,c.pending=h.next=N)}}function W_(s,c){var h=c.action,g=c.payload,x=s.state;if(c.isTransition){var N=H.T,E={};H.T=E;try{var M=h(x,g),K=H.S;K!==null&&K(E,M),X_(s,c,M)}catch(ie){ax(s,c,ie)}finally{N!==null&&E.types!==null&&(N.types=E.types),H.T=N}}else try{N=h(x,g),X_(s,c,N)}catch(ie){ax(s,c,ie)}}function X_(s,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){J_(s,c,g)},function(g){return ax(s,c,g)}):J_(s,c,h)}function J_(s,c,h){c.status="fulfilled",c.value=h,eA(c),s.state=h,c=s.pending,c!==null&&(h=c.next,h===c?s.pending=null:(h=h.next,c.next=h,W_(s,h)))}function ax(s,c,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,eA(c),c=c.next;while(c!==g)}s.action=null}function eA(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function tA(s,c){return c}function nA(s,c){if(xt){var h=qt.formState;if(h!==null){e:{var g=at;if(xt){if(Wt){t:{for(var x=Wt,N=hi;x.nodeType!==8;){if(!N){x=null;break t}if(x=mi(x.nextSibling),x===null){x=null;break t}}N=x.data,x=N==="F!"||N==="F"?x:null}if(x){Wt=mi(x.nextSibling),g=x.data==="F!";break e}}Es(g)}g=!1}g&&(c=h[0])}}return h=mr(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tA,lastRenderedState:c},h.queue=g,h=wA.bind(null,at,g),g.dispatch=h,g=ix(!1),N=dx.bind(null,at,!1,g.queue),g=mr(),x={state:c,dispatch:null,action:s,pending:null},g.queue=x,h=nF.bind(null,at,x,N,h),x.dispatch=h,g.memoizedState=s,[c,h,!1]}function rA(s){var c=jn();return iA(c,Mt,s)}function iA(s,c,h){if(c=nx(s,c,tA)[0],s=vp(Ha)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=_d(c)}catch(E){throw E===yc?lp:E}else g=c;c=jn();var x=c.queue,N=x.dispatch;return h!==c.memoizedState&&(at.flags|=2048,Sc(9,{destroy:void 0},rF.bind(null,x,h),null)),[g,N,s]}function rF(s,c){s.action=c}function aA(s){var c=jn(),h=Mt;if(h!==null)return iA(c,h,s);jn(),c=c.memoizedState,h=jn();var g=h.queue.dispatch;return h.memoizedState=s,[c,g,!1]}function Sc(s,c,h,g){return s={tag:s,create:h,deps:g,inst:c,next:null},c=at.updateQueue,c===null&&(c=gp(),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 sA(){return jn().memoizedState}function xp(s,c,h,g){var x=mr();at.flags|=s,x.memoizedState=Sc(1|c,{destroy:void 0},h,g===void 0?null:g)}function bp(s,c,h,g){var x=jn();g=g===void 0?null:g;var N=x.memoizedState.inst;Mt!==null&&g!==null&&Y0(g,Mt.memoizedState.deps)?x.memoizedState=Sc(c,N,h,g):(at.flags|=s,x.memoizedState=Sc(1|c,N,h,g))}function oA(s,c){xp(8390656,8,s,c)}function sx(s,c){bp(2048,8,s,c)}function iF(s){at.flags|=4;var c=at.updateQueue;if(c===null)c=gp(),at.updateQueue=c,c.events=[s];else{var h=c.events;h===null?c.events=[s]:h.push(s)}}function lA(s){var c=jn().memoizedState;return iF({ref:c,nextImpl:s}),function(){if((At&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function cA(s,c){return bp(4,2,s,c)}function uA(s,c){return bp(4,4,s,c)}function dA(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 fA(s,c,h){h=h!=null?h.concat([s]):null,bp(4,4,dA.bind(null,c,s),h)}function ox(){}function hA(s,c){var h=jn();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&Y0(c,g[1])?g[0]:(h.memoizedState=[s,c],s)}function pA(s,c){var h=jn();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&Y0(c,g[1]))return g[0];if(g=s(),Qo){Bt(!0);try{s()}finally{Bt(!1)}}return h.memoizedState=[g,c],g}function lx(s,c,h){return h===void 0||(Fa&1073741824)!==0&&(yt&261930)===0?s.memoizedState=c:(s.memoizedState=h,s=mE(),at.lanes|=s,Ls|=s,h)}function mA(s,c,h,g){return Ur(h,c)?h:xc.current!==null?(s=lx(s,h,g),Ur(s,c)||(En=!0),s):(Fa&42)===0||(Fa&1073741824)!==0&&(yt&261930)===0?(En=!0,s.memoizedState=h):(s=mE(),at.lanes|=s,Ls|=s,c)}function gA(s,c,h,g,x){var N=ee.p;ee.p=N!==0&&8>N?N:8;var E=H.T,M={};H.T=M,dx(s,!1,c,h);try{var K=x(),ie=H.S;if(ie!==null&&ie(M,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ge=J8(K,g);Ad(s,c,ge,Vr(s))}else Ad(s,c,g,Vr(s))}catch(be){Ad(s,c,{then:function(){},status:"rejected",reason:be},Vr())}finally{ee.p=N,E!==null&&M.types!==null&&(E.types=M.types),H.T=E}}function aF(){}function cx(s,c,h,g){if(s.tag!==5)throw Error(r(476));var x=yA(s).queue;gA(s,x,c,le,h===null?aF:function(){return vA(s),h(g)})}function yA(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:Ha,lastRenderedState:le},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function vA(s){var c=yA(s);c.next===null&&(c=s.alternate.memoizedState),Ad(s,c.next.queue,{},Vr())}function ux(){return Zn(Kd)}function xA(){return jn().memoizedState}function bA(){return jn().memoizedState}function sF(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=Vr();s=Ts(h);var g=Ps(c,s,h);g!==null&&(Or(g,c,h),jd(g,c,h)),c={cache:$0()},s.payload=c;return}c=c.return}}function oF(s,c,h){var g=Vr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},wp(s)?SA(c,h):(h=A0(s,c,h,g),h!==null&&(Or(h,s,g),jA(h,c,g)))}function wA(s,c,h){var g=Vr();Ad(s,c,h,g)}function Ad(s,c,h,g){var x={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(wp(s))SA(c,x);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var E=c.lastRenderedState,M=N(E,h);if(x.hasEagerState=!0,x.eagerState=M,Ur(M,E))return tp(s,c,x,0),qt===null&&ep(),!1}catch{}if(h=A0(s,c,x,g),h!==null)return Or(h,s,g),jA(h,c,g),!0}return!1}function dx(s,c,h,g){if(g={lane:2,revertLane:Fx(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},wp(s)){if(c)throw Error(r(479))}else c=A0(s,h,g,2),c!==null&&Or(c,s,2)}function wp(s){var c=s.alternate;return s===at||c!==null&&c===at}function SA(s,c){bc=pp=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function jA(s,c,h){if((h&4194048)!==0){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Uh(s,h)}}var Ed={readContext:Zn,use:yp,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};Ed.useEffectEvent=pn;var NA={readContext:Zn,use:yp,useCallback:function(s,c){return mr().memoizedState=[s,c===void 0?null:c],s},useContext:Zn,useEffect:oA,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,xp(4194308,4,dA.bind(null,c,s),h)},useLayoutEffect:function(s,c){return xp(4194308,4,s,c)},useInsertionEffect:function(s,c){xp(4,2,s,c)},useMemo:function(s,c){var h=mr();c=c===void 0?null:c;var g=s();if(Qo){Bt(!0);try{s()}finally{Bt(!1)}}return h.memoizedState=[g,c],g},useReducer:function(s,c,h){var g=mr();if(h!==void 0){var x=h(c);if(Qo){Bt(!0);try{h(c)}finally{Bt(!1)}}}else x=c;return g.memoizedState=g.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},g.queue=s,s=s.dispatch=oF.bind(null,at,s),[g.memoizedState,s]},useRef:function(s){var c=mr();return s={current:s},c.memoizedState=s},useState:function(s){s=ix(s);var c=s.queue,h=wA.bind(null,at,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:ox,useDeferredValue:function(s,c){var h=mr();return lx(h,s,c)},useTransition:function(){var s=ix(!1);return s=gA.bind(null,at,s.queue,!0,!1),mr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var g=at,x=mr();if(xt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),qt===null)throw Error(r(349));(yt&127)!==0||K_(g,c,h)}x.memoizedState=h;var N={value:h,getSnapshot:c};return x.queue=N,oA(V_.bind(null,g,N,s),[s]),g.flags|=2048,Sc(9,{destroy:void 0},G_.bind(null,g,N,h,c),null),h},useId:function(){var s=mr(),c=qt.identifierPrefix;if(xt){var h=sa,g=aa;h=(g&~(1<<32-fe(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=mp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=eF++,c="_"+c+"r_"+h.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:ux,useFormState:nA,useActionState:nA,useOptimistic:function(s){var c=mr();c.memoizedState=c.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=dx.bind(null,at,!0,h),h.dispatch=c,[s,c]},useMemoCache:tx,useCacheRefresh:function(){return mr().memoizedState=sF.bind(null,at)},useEffectEvent:function(s){var c=mr(),h={impl:s};return c.memoizedState=h,function(){if((At&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},fx={readContext:Zn,use:yp,useCallback:hA,useContext:Zn,useEffect:sx,useImperativeHandle:fA,useInsertionEffect:cA,useLayoutEffect:uA,useMemo:pA,useReducer:vp,useRef:sA,useState:function(){return vp(Ha)},useDebugValue:ox,useDeferredValue:function(s,c){var h=jn();return mA(h,Mt.memoizedState,s,c)},useTransition:function(){var s=vp(Ha)[0],c=jn().memoizedState;return[typeof s=="boolean"?s:_d(s),c]},useSyncExternalStore:H_,useId:xA,useHostTransitionStatus:ux,useFormState:rA,useActionState:rA,useOptimistic:function(s,c){var h=jn();return Y_(h,Mt,s,c)},useMemoCache:tx,useCacheRefresh:bA};fx.useEffectEvent=lA;var kA={readContext:Zn,use:yp,useCallback:hA,useContext:Zn,useEffect:sx,useImperativeHandle:fA,useInsertionEffect:cA,useLayoutEffect:uA,useMemo:pA,useReducer:rx,useRef:sA,useState:function(){return rx(Ha)},useDebugValue:ox,useDeferredValue:function(s,c){var h=jn();return Mt===null?lx(h,s,c):mA(h,Mt.memoizedState,s,c)},useTransition:function(){var s=rx(Ha)[0],c=jn().memoizedState;return[typeof s=="boolean"?s:_d(s),c]},useSyncExternalStore:H_,useId:xA,useHostTransitionStatus:ux,useFormState:aA,useActionState:aA,useOptimistic:function(s,c){var h=jn();return Mt!==null?Y_(h,Mt,s,c):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:tx,useCacheRefresh:bA};kA.useEffectEvent=lA;function hx(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 px={enqueueSetState:function(s,c,h){s=s._reactInternals;var g=Vr(),x=Ts(g);x.payload=c,h!=null&&(x.callback=h),c=Ps(s,x,g),c!==null&&(Or(c,s,g),jd(c,s,g))},enqueueReplaceState:function(s,c,h){s=s._reactInternals;var g=Vr(),x=Ts(g);x.tag=1,x.payload=c,h!=null&&(x.callback=h),c=Ps(s,x,g),c!==null&&(Or(c,s,g),jd(c,s,g))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var h=Vr(),g=Ts(h);g.tag=2,c!=null&&(g.callback=c),c=Ps(s,g,h),c!==null&&(Or(c,s,h),jd(c,s,h))}};function CA(s,c,h,g,x,N,E){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,E):c.prototype&&c.prototype.isPureReactComponent?!md(h,g)||!md(x,N):!0}function _A(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&&px.enqueueReplaceState(c,c.state,null)}function Zo(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 x in s)h[x]===void 0&&(h[x]=s[x])}return h}function AA(s){Jh(s)}function EA(s){console.error(s)}function OA(s){Jh(s)}function Sp(s,c){try{var h=s.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function zA(s,c,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function mx(s,c,h){return h=Ts(h),h.tag=3,h.payload={element:null},h.callback=function(){Sp(s,c)},h}function TA(s){return s=Ts(s),s.tag=3,s}function PA(s,c,h,g){var x=h.type.getDerivedStateFromError;if(typeof x=="function"){var N=g.value;s.payload=function(){return x(N)},s.callback=function(){zA(c,h,g)}}var E=h.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(s.callback=function(){zA(c,h,g),typeof x!="function"&&($s===null?$s=new Set([this]):$s.add(this));var M=g.stack;this.componentDidCatch(g.value,{componentStack:M!==null?M:""})})}function lF(s,c,h,g,x){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=h.alternate,c!==null&&pc(c,h,x,!0),h=Fr.current,h!==null){switch(h.tag){case 31:case 13:return pi===null?Rp():h.alternate===null&&mn===0&&(mn=3),h.flags&=-257,h.flags|=65536,h.lanes=x,g===cp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),Bx(s,g,x)),!1;case 22:return h.flags|=65536,g===cp?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)),Bx(s,g,x)),!1}throw Error(r(435,h.tag))}return Bx(s,g,x),Rp(),!1}if(xt)return c=Fr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=x,g!==R0&&(s=Error(r(422),{cause:g}),vd(ui(s,h)))):(g!==R0&&(c=Error(r(423),{cause:g}),vd(ui(c,h))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,g=ui(g,h),x=mx(s.stateNode,g,x),K0(s,x),mn!==4&&(mn=2)),!1;var N=Error(r(520),{cause:g});if(N=ui(N,h),Id===null?Id=[N]:Id.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=x&-x,h.lanes|=s,s=mx(h.stateNode,g,s),K0(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"&&($s===null||!$s.has(N))))return h.flags|=65536,x&=-x,h.lanes|=x,x=TA(x),PA(x,s,h,g),K0(h,x),!1}h=h.return}while(h!==null);return!1}var gx=Error(r(461)),En=!1;function Yn(s,c,h,g){c.child=s===null?I_(c,null,h,g):Vo(c,s.child,h,g)}function RA(s,c,h,g,x){h=h.render;var N=c.ref;if("ref"in g){var E={};for(var M in g)M!=="ref"&&(E[M]=g[M])}else E=g;return Fo(c),g=W0(s,c,h,E,N,x),M=X0(),s!==null&&!En?(J0(s,c,x),Ka(s,c,x)):(xt&&M&&T0(c),c.flags|=1,Yn(s,c,g,x),c.child)}function DA(s,c,h,g,x){if(s===null){var N=h.type;return typeof N=="function"&&!E0(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,MA(s,c,N,g,x)):(s=rp(h.type,null,g,c,c.mode,x),s.ref=c.ref,s.return=c,c.child=s)}if(N=s.child,!Nx(s,x)){var E=N.memoizedProps;if(h=h.compare,h=h!==null?h:md,h(E,g)&&s.ref===c.ref)return Ka(s,c,x)}return c.flags|=1,s=$a(N,g),s.ref=c.ref,s.return=c,c.child=s}function MA(s,c,h,g,x){if(s!==null){var N=s.memoizedProps;if(md(N,g)&&s.ref===c.ref)if(En=!1,c.pendingProps=g=N,Nx(s,x))(s.flags&131072)!==0&&(En=!0);else return c.lanes=s.lanes,Ka(s,c,x)}return yx(s,c,h,g,x)}function IA(s,c,h,g){var x=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,x=0;g!==null;)x=x|g.lanes|g.childLanes,g=g.sibling;g=x&~N}else g=0,c.child=null;return LA(s,c,N,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&op(c,N!==null?N.cachePool:null),N!==null?B_(c,N):V0(),U_(c);else return g=c.lanes=536870912,LA(s,c,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(op(c,N.cachePool),B_(c,N),Ds(),c.memoizedState=null):(s!==null&&op(c,null),V0(),Ds());return Yn(s,c,x,h),c.child}function Od(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function LA(s,c,h,g,x){var N=U0();return N=N===null?null:{parent:_n._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},s!==null&&op(c,null),V0(),U_(c),s!==null&&pc(s,c,g,!0),c.childLanes=x,null}function jp(s,c){return c=kp({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function $A(s,c,h){return Vo(c,s.child,null,h),s=jp(c,c.pendingProps),s.flags|=2,Hr(c),c.memoizedState=null,s}function cF(s,c,h){var g=c.pendingProps,x=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(xt){if(g.mode==="hidden")return s=jp(c,g),c.lanes=536870912,Od(null,s);if(Z0(c),(s=Wt)?(s=WE(s,hi),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:_s!==null?{id:aa,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},h=S_(s),h.return=c,c.child=h,Qn=c,Wt=null)):s=null,s===null)throw Es(c);return c.lanes=536870912,null}return jp(c,g)}var N=s.memoizedState;if(N!==null){var E=N.dehydrated;if(Z0(c),x)if(c.flags&256)c.flags&=-257,c=$A(s,c,h);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(En||pc(s,c,h,!1),x=(h&s.childLanes)!==0,En||x){if(g=qt,g!==null&&(E=qh(g,h),E!==0&&E!==N.retryLane))throw N.retryLane=E,$o(s,E),Or(g,s,E),gx;Rp(),c=$A(s,c,h)}else s=N.treeContext,Wt=mi(E.nextSibling),Qn=c,xt=!0,As=null,hi=!1,s!==null&&k_(c,s),c=jp(c,g),c.flags|=4096;return c}return s=$a(s.child,{mode:g.mode,children:g.children}),s.ref=c.ref,c.child=s,s.return=c,s}function Np(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 yx(s,c,h,g,x){return Fo(c),h=W0(s,c,h,g,void 0,x),g=X0(),s!==null&&!En?(J0(s,c,x),Ka(s,c,x)):(xt&&g&&T0(c),c.flags|=1,Yn(s,c,h,x),c.child)}function BA(s,c,h,g,x,N){return Fo(c),c.updateQueue=null,h=F_(c,g,h,x),q_(s),g=X0(),s!==null&&!En?(J0(s,c,N),Ka(s,c,N)):(xt&&g&&T0(c),c.flags|=1,Yn(s,c,h,N),c.child)}function UA(s,c,h,g,x){if(Fo(c),c.stateNode===null){var N=uc,E=h.contextType;typeof E=="object"&&E!==null&&(N=Zn(E)),N=new h(g,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=px,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=g,N.state=c.memoizedState,N.refs={},F0(c),E=h.contextType,N.context=typeof E=="object"&&E!==null?Zn(E):uc,N.state=c.memoizedState,E=h.getDerivedStateFromProps,typeof E=="function"&&(hx(c,h,E,g),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(E=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),E!==N.state&&px.enqueueReplaceState(N,N.state,null),kd(c,g,N,x),Nd(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(s===null){N=c.stateNode;var M=c.memoizedProps,K=Zo(h,M);N.props=K;var ie=N.context,ge=h.contextType;E=uc,typeof ge=="object"&&ge!==null&&(E=Zn(ge));var be=h.getDerivedStateFromProps;ge=typeof be=="function"||typeof N.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,ge||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M||ie!==E)&&_A(c,N,g,E),zs=!1;var se=c.memoizedState;N.state=se,kd(c,g,N,x),Nd(),ie=c.memoizedState,M||se!==ie||zs?(typeof be=="function"&&(hx(c,h,be,g),ie=c.memoizedState),(K=zs||CA(c,h,K,g,se,ie,E))?(ge||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=ie),N.props=g,N.state=ie,N.context=E,g=K):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{N=c.stateNode,H0(s,c),E=c.memoizedProps,ge=Zo(h,E),N.props=ge,be=c.pendingProps,se=N.context,ie=h.contextType,K=uc,typeof ie=="object"&&ie!==null&&(K=Zn(ie)),M=h.getDerivedStateFromProps,(ie=typeof M=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(E!==be||se!==K)&&_A(c,N,g,K),zs=!1,se=c.memoizedState,N.state=se,kd(c,g,N,x),Nd();var de=c.memoizedState;E!==be||se!==de||zs||s!==null&&s.dependencies!==null&&ap(s.dependencies)?(typeof M=="function"&&(hx(c,h,M,g),de=c.memoizedState),(ge=zs||CA(c,h,ge,g,se,de,K)||s!==null&&s.dependencies!==null&&ap(s.dependencies))?(ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,de,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,de,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&se===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&se===s.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=de),N.props=g,N.state=de,N.context=K,g=ge):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&se===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&se===s.memoizedState||(c.flags|=1024),g=!1)}return N=g,Np(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=Vo(c,s.child,null,x),c.child=Vo(c,null,h,x)):Yn(s,c,h,x),c.memoizedState=N.state,s=c.child):s=Ka(s,c,x),s}function qA(s,c,h,g){return Uo(),c.flags|=256,Yn(s,c,h,g),c.child}var vx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xx(s){return{baseLanes:s,cachePool:z_()}}function bx(s,c,h){return s=s!==null?s.childLanes&~h:0,c&&(s|=Gr),s}function FA(s,c,h){var g=c.pendingProps,x=!1,N=(c.flags&128)!==0,E;if((E=N)||(E=s!==null&&s.memoizedState===null?!1:(Sn.current&2)!==0),E&&(x=!0,c.flags&=-129),E=(c.flags&32)!==0,c.flags&=-33,s===null){if(xt){if(x?Rs(c):Ds(),(s=Wt)?(s=WE(s,hi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:_s!==null?{id:aa,overflow:sa}:null,retryLane:536870912,hydrationErrors:null},h=S_(s),h.return=c,c.child=h,Qn=c,Wt=null)):s=null,s===null)throw Es(c);return nb(s)?c.lanes=32:c.lanes=536870912,null}var M=g.children;return g=g.fallback,x?(Ds(),x=c.mode,M=kp({mode:"hidden",children:M},x),g=Bo(g,x,h,null),M.return=c,g.return=c,M.sibling=g,c.child=M,g=c.child,g.memoizedState=xx(h),g.childLanes=bx(s,E,h),c.memoizedState=vx,Od(null,g)):(Rs(c),wx(c,M))}var K=s.memoizedState;if(K!==null&&(M=K.dehydrated,M!==null)){if(N)c.flags&256?(Rs(c),c.flags&=-257,c=Sx(s,c,h)):c.memoizedState!==null?(Ds(),c.child=s.child,c.flags|=128,c=null):(Ds(),M=g.fallback,x=c.mode,g=kp({mode:"visible",children:g.children},x),M=Bo(M,x,h,null),M.flags|=2,g.return=c,M.return=c,g.sibling=M,c.child=g,Vo(c,s.child,null,h),g=c.child,g.memoizedState=xx(h),g.childLanes=bx(s,E,h),c.memoizedState=vx,c=Od(null,g));else if(Rs(c),nb(M)){if(E=M.nextSibling&&M.nextSibling.dataset,E)var ie=E.dgst;E=ie,g=Error(r(419)),g.stack="",g.digest=E,vd({value:g,source:null,stack:null}),c=Sx(s,c,h)}else if(En||pc(s,c,h,!1),E=(h&s.childLanes)!==0,En||E){if(E=qt,E!==null&&(g=qh(E,h),g!==0&&g!==K.retryLane))throw K.retryLane=g,$o(s,g),Or(E,s,g),gx;tb(M)||Rp(),c=Sx(s,c,h)}else tb(M)?(c.flags|=192,c.child=s.child,c=null):(s=K.treeContext,Wt=mi(M.nextSibling),Qn=c,xt=!0,As=null,hi=!1,s!==null&&k_(c,s),c=wx(c,g.children),c.flags|=4096);return c}return x?(Ds(),M=g.fallback,x=c.mode,K=s.child,ie=K.sibling,g=$a(K,{mode:"hidden",children:g.children}),g.subtreeFlags=K.subtreeFlags&65011712,ie!==null?M=$a(ie,M):(M=Bo(M,x,h,null),M.flags|=2),M.return=c,g.return=c,g.sibling=M,c.child=g,Od(null,g),g=c.child,M=s.child.memoizedState,M===null?M=xx(h):(x=M.cachePool,x!==null?(K=_n._currentValue,x=x.parent!==K?{parent:K,pool:K}:x):x=z_(),M={baseLanes:M.baseLanes|h,cachePool:x}),g.memoizedState=M,g.childLanes=bx(s,E,h),c.memoizedState=vx,Od(s.child,g)):(Rs(c),h=s.child,s=h.sibling,h=$a(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,s!==null&&(E=c.deletions,E===null?(c.deletions=[s],c.flags|=16):E.push(s)),c.child=h,c.memoizedState=null,h)}function wx(s,c){return c=kp({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function kp(s,c){return s=qr(22,s,null,c),s.lanes=0,s}function Sx(s,c,h){return Vo(c,s.child,null,h),s=wx(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function HA(s,c,h){s.lanes|=c;var g=s.alternate;g!==null&&(g.lanes|=c),I0(s.return,c,h)}function jx(s,c,h,g,x,N){var E=s.memoizedState;E===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:x,treeForkCount:N}:(E.isBackwards=c,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=h,E.tailMode=x,E.treeForkCount=N)}function KA(s,c,h){var g=c.pendingProps,x=g.revealOrder,N=g.tail;g=g.children;var E=Sn.current,M=(E&2)!==0;if(M?(E=E&1|2,c.flags|=128):E&=1,D(Sn,E),Yn(s,c,g,h),g=xt?yd:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&HA(s,h,c);else if(s.tag===19)HA(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(x){case"forwards":for(h=c.child,x=null;h!==null;)s=h.alternate,s!==null&&hp(s)===null&&(x=h),h=h.sibling;h=x,h===null?(x=c.child,c.child=null):(x=h.sibling,h.sibling=null),jx(c,!1,x,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,x=c.child,c.child=null;x!==null;){if(s=x.alternate,s!==null&&hp(s)===null){c.child=x;break}s=x.sibling,x.sibling=h,h=x,x=s}jx(c,!0,h,null,N,g);break;case"together":jx(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function Ka(s,c,h){if(s!==null&&(c.dependencies=s.dependencies),Ls|=c.lanes,(h&c.childLanes)===0)if(s!==null){if(pc(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=$a(s,s.pendingProps),c.child=h,h.return=c;s.sibling!==null;)s=s.sibling,h=h.sibling=$a(s,s.pendingProps),h.return=c;h.sibling=null}return c.child}function Nx(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&ap(s)))}function uF(s,c,h){switch(c.tag){case 3:Se(c,c.stateNode.containerInfo),Os(c,_n,s.memoizedState.cache),Uo();break;case 27:case 5:me(c);break;case 4:Se(c,c.stateNode.containerInfo);break;case 10:Os(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Z0(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Rs(c),c.flags|=128,null):(h&c.child.childLanes)!==0?FA(s,c,h):(Rs(c),s=Ka(s,c,h),s!==null?s.sibling:null);Rs(c);break;case 19:var x=(s.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(pc(s,c,h,!1),g=(h&c.childLanes)!==0),x){if(g)return KA(s,c,h);c.flags|=128}if(x=c.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),D(Sn,Sn.current),g)break;return null;case 22:return c.lanes=0,IA(s,c,h,c.pendingProps);case 24:Os(c,_n,s.memoizedState.cache)}return Ka(s,c,h)}function GA(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps)En=!0;else{if(!Nx(s,h)&&(c.flags&128)===0)return En=!1,uF(s,c,h);En=(s.flags&131072)!==0}else En=!1,xt&&(c.flags&1048576)!==0&&N_(c,yd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(s=Ko(c.elementType),c.type=s,typeof s=="function")E0(s)?(g=Zo(s,g),c.tag=1,c=UA(null,c,s,g,h)):(c.tag=0,c=yx(null,c,s,g,h));else{if(s!=null){var x=s.$$typeof;if(x===A){c.tag=11,c=RA(null,c,s,g,h);break e}else if(x===z){c.tag=14,c=DA(null,c,s,g,h);break e}}throw c=te(s)||s,Error(r(306,c,""))}}return c;case 0:return yx(s,c,c.type,c.pendingProps,h);case 1:return g=c.type,x=Zo(g,c.pendingProps),UA(s,c,g,x,h);case 3:e:{if(Se(c,c.stateNode.containerInfo),s===null)throw Error(r(387));g=c.pendingProps;var N=c.memoizedState;x=N.element,H0(s,c),kd(c,g,null,h);var E=c.memoizedState;if(g=E.cache,Os(c,_n,g),g!==N.cache&&L0(c,[_n],h,!0),Nd(),g=E.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:E.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=qA(s,c,g,h);break e}else if(g!==x){x=ui(Error(r(424)),c),vd(x),c=qA(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),Qn=c,xt=!0,As=null,hi=!0,h=I_(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Uo(),g===x){c=Ka(s,c,h);break e}Yn(s,c,g,h)}c=c.child}return c;case 26:return Np(s,c),s===null?(h=rO(c.type,null,c.pendingProps,null))?c.memoizedState=h:xt||(h=c.type,s=c.pendingProps,g=Up(ne.current).createElement(h),g[tt]=c,g[wt]=s,Wn(g,h,s),un(g),c.stateNode=g):c.memoizedState=rO(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return me(c),s===null&&xt&&(g=c.stateNode=eO(c.type,c.pendingProps,ne.current),Qn=c,hi=!0,x=Wt,Fs(c.type)?(rb=x,Wt=mi(g.firstChild)):Wt=x),Yn(s,c,c.pendingProps.children,h),Np(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&xt&&((x=g=Wt)&&(g=BF(g,c.type,c.pendingProps,hi),g!==null?(c.stateNode=g,Qn=c,Wt=mi(g.firstChild),hi=!1,x=!0):x=!1),x||Es(c)),me(c),x=c.type,N=c.pendingProps,E=s!==null?s.memoizedProps:null,g=N.children,Xx(x,N)?g=null:E!==null&&Xx(x,E)&&(c.flags|=32),c.memoizedState!==null&&(x=W0(s,c,tF,null,null,h),Kd._currentValue=x),Np(s,c),Yn(s,c,g,h),c.child;case 6:return s===null&&xt&&((s=h=Wt)&&(h=UF(h,c.pendingProps,hi),h!==null?(c.stateNode=h,Qn=c,Wt=null,s=!0):s=!1),s||Es(c)),null;case 13:return FA(s,c,h);case 4:return Se(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=Vo(c,null,g,h):Yn(s,c,g,h),c.child;case 11:return RA(s,c,c.type,c.pendingProps,h);case 7:return Yn(s,c,c.pendingProps,h),c.child;case 8:return Yn(s,c,c.pendingProps.children,h),c.child;case 12:return Yn(s,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,Os(c,c.type,g.value),Yn(s,c,g.children,h),c.child;case 9:return x=c.type._context,g=c.pendingProps.children,Fo(c),x=Zn(x),g=g(x),c.flags|=1,Yn(s,c,g,h),c.child;case 14:return DA(s,c,c.type,c.pendingProps,h);case 15:return MA(s,c,c.type,c.pendingProps,h);case 19:return KA(s,c,h);case 31:return cF(s,c,h);case 22:return IA(s,c,h,c.pendingProps);case 24:return Fo(c),g=Zn(_n),s===null?(x=U0(),x===null&&(x=qt,N=$0(),x.pooledCache=N,N.refCount++,N!==null&&(x.pooledCacheLanes|=h),x=N),c.memoizedState={parent:g,cache:x},F0(c),Os(c,_n,x)):((s.lanes&h)!==0&&(H0(s,c),kd(c,null,null,h),Nd()),x=s.memoizedState,N=c.memoizedState,x.parent!==g?(x={parent:g,cache:g},c.memoizedState=x,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=x),Os(c,_n,g)):(g=N.cache,Os(c,_n,g),g!==x.cache&&L0(c,[_n],h,!0))),Yn(s,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Ga(s){s.flags|=4}function kx(s,c,h,g,x){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(xE())s.flags|=8192;else throw Go=cp,q0}else s.flags&=-16777217}function VA(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!lO(c))if(xE())s.flags|=8192;else throw Go=cp,q0}function Cp(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?Bh():536870912,s.lanes|=c,Cc|=c)}function zd(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 Xt(s){var c=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(c)for(var x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags&65011712,g|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags,g|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=g,s.childLanes=h,c}function dF(s,c,h){var g=c.pendingProps;switch(P0(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(c),null;case 1:return Xt(c),null;case 3:return h=c.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),qa(_n),X(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(hc(c)?Ga(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,D0())),Xt(c),null;case 26:var x=c.type,N=c.memoizedState;return s===null?(Ga(c),N!==null?(Xt(c),VA(c,N)):(Xt(c),kx(c,x,null,g,h))):N?N!==s.memoizedState?(Ga(c),Xt(c),VA(c,N)):(Xt(c),c.flags&=-16777217):(s=s.memoizedProps,s!==g&&Ga(c),Xt(c),kx(c,x,s,g,h)),null;case 27:if(Ee(c),h=ne.current,x=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Ga(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Xt(c),null}s=G.current,hc(c)?C_(c):(s=eO(x,g,h),c.stateNode=s,Ga(c))}return Xt(c),null;case 5:if(Ee(c),x=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Ga(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return Xt(c),null}if(N=G.current,hc(c))C_(c);else{var E=Up(ne.current);switch(N){case 1:N=E.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:N=E.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":N=E.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":N=E.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":N=E.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?E.createElement("select",{is:g.is}):E.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?E.createElement(x,{is:g.is}):E.createElement(x)}}N[tt]=c,N[wt]=g;e:for(E=c.child;E!==null;){if(E.tag===5||E.tag===6)N.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===c)break e;for(;E.sibling===null;){if(E.return===null||E.return===c)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}c.stateNode=N;e:switch(Wn(N,x,g),x){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ga(c)}}return Xt(c),kx(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==g&&Ga(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(s=ne.current,hc(c)){if(s=c.stateNode,h=c.memoizedProps,g=null,x=Qn,x!==null)switch(x.tag){case 27:case 5:g=x.memoizedProps}s[tt]=c,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||FE(s.nodeValue,h)),s||Es(c,!0)}else s=Up(s).createTextNode(g),s[tt]=c,c.stateNode=s}return Xt(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(g=hc(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[tt]=c}else Uo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Xt(c),s=!1}else h=D0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(Hr(c),c):(Hr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Xt(c),null;case 13:if(g=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=hc(c),g!==null&&g.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=c.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[tt]=c}else Uo(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Xt(c),x=!1}else x=D0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return c.flags&256?(Hr(c),c):(Hr(c),null)}return Hr(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=c.child,x=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(x=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==x&&(g.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Cp(c,c.updateQueue),Xt(c),null);case 4:return X(),s===null&&Vx(c.stateNode.containerInfo),Xt(c),null;case 10:return qa(c.type),Xt(c),null;case 19:if(U(Sn),g=c.memoizedState,g===null)return Xt(c),null;if(x=(c.flags&128)!==0,N=g.rendering,N===null)if(x)zd(g,!1);else{if(mn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(N=hp(s),N!==null){for(c.flags|=128,zd(g,!1),s=N.updateQueue,c.updateQueue=s,Cp(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)w_(h,s),h=h.sibling;return D(Sn,Sn.current&1|2),xt&&Ba(c,g.treeForkCount),c.child}s=s.sibling}g.tail!==null&&ft()>zp&&(c.flags|=128,x=!0,zd(g,!1),c.lanes=4194304)}else{if(!x)if(s=hp(N),s!==null){if(c.flags|=128,x=!0,s=s.updateQueue,c.updateQueue=s,Cp(c,s),zd(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!xt)return Xt(c),null}else 2*ft()-g.renderingStartTime>zp&&h!==536870912&&(c.flags|=128,x=!0,zd(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=ft(),s.sibling=null,h=Sn.current,D(Sn,x?h&1|2:h&1),xt&&Ba(c,g.treeForkCount),s):(Xt(c),null);case 22:case 23:return Hr(c),Q0(),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&&(Xt(c),c.subtreeFlags&6&&(c.flags|=8192)):Xt(c),h=c.updateQueue,h!==null&&Cp(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&&U(Ho),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),qa(_n),Xt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function fF(s,c){switch(P0(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return qa(_n),X(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(Hr(c),c.alternate===null)throw Error(r(340));Uo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Hr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Uo()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return U(Sn),null;case 4:return X(),null;case 10:return qa(c.type),null;case 22:case 23:return Hr(c),Q0(),s!==null&&U(Ho),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return qa(_n),null;case 25:return null;default:return null}}function QA(s,c){switch(P0(c),c.tag){case 3:qa(_n),X();break;case 26:case 27:case 5:Ee(c);break;case 4:X();break;case 31:c.memoizedState!==null&&Hr(c);break;case 13:Hr(c);break;case 19:U(Sn);break;case 10:qa(c.type);break;case 22:case 23:Hr(c),Q0(),s!==null&&U(Ho);break;case 24:qa(_n)}}function Td(s,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var x=g.next;h=x;do{if((h.tag&s)===s){g=void 0;var N=h.create,E=h.inst;g=N(),E.destroy=g}h=h.next}while(h!==x)}}catch(M){Pt(c,c.return,M)}}function Ms(s,c,h){try{var g=c.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var N=x.next;g=N;do{if((g.tag&s)===s){var E=g.inst,M=E.destroy;if(M!==void 0){E.destroy=void 0,x=c;var K=h,ie=M;try{ie()}catch(ge){Pt(x,K,ge)}}}g=g.next}while(g!==N)}}catch(ge){Pt(c,c.return,ge)}}function ZA(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{$_(c,h)}catch(g){Pt(s,s.return,g)}}}function YA(s,c,h){h.props=Zo(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Pt(s,c,g)}}function Pd(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(x){Pt(s,c,x)}}function oa(s,c){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(x){Pt(s,c,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(x){Pt(s,c,x)}else h.current=null}function WA(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(x){Pt(s,s.return,x)}}function Cx(s,c,h){try{var g=s.stateNode;RF(g,s.type,h,c),g[wt]=c}catch(x){Pt(s,s.return,x)}}function XA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Fs(s.type)||s.tag===4}function _x(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||XA(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&&Fs(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 Ax(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=Ia));else if(g!==4&&(g===27&&Fs(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(Ax(s,c,h),s=s.sibling;s!==null;)Ax(s,c,h),s=s.sibling}function _p(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&&Fs(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(_p(s,c,h),s=s.sibling;s!==null;)_p(s,c,h),s=s.sibling}function JA(s){var c=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,x=c.attributes;x.length;)c.removeAttributeNode(x[0]);Wn(c,g,h),c[tt]=s,c[wt]=h}catch(N){Pt(s,s.return,N)}}var Va=!1,On=!1,Ex=!1,eE=typeof WeakSet=="function"?WeakSet:Set,qn=null;function hF(s,c){if(s=s.containerInfo,Yx=Qp,s=f_(s),S0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var x=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var E=0,M=-1,K=-1,ie=0,ge=0,be=s,se=null;t:for(;;){for(var de;be!==h||x!==0&&be.nodeType!==3||(M=E+x),be!==N||g!==0&&be.nodeType!==3||(K=E+g),be.nodeType===3&&(E+=be.nodeValue.length),(de=be.firstChild)!==null;)se=be,be=de;for(;;){if(be===s)break t;if(se===h&&++ie===x&&(M=E),se===N&&++ge===g&&(K=E),(de=be.nextSibling)!==null)break;be=se,se=be.parentNode}be=de}h=M===-1||K===-1?null:{start:M,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Wx={focusedElem:s,selectionRange:h},Qp=!1,qn=c;qn!==null;)if(c=qn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,qn=s;else for(;qn!==null;){switch(c=qn,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++)x=s[h],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=c,x=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Re=Zo(h.type,x);s=g.getSnapshotBeforeUpdate(Re,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ye){Pt(h,h.return,Ye)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,h=s.nodeType,h===9)eb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":eb(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,qn=s;break}qn=c.return}}function tE(s,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Za(s,h),g&4&&Td(5,h);break;case 1:if(Za(s,h),g&4)if(s=h.stateNode,c===null)try{s.componentDidMount()}catch(E){Pt(h,h.return,E)}else{var x=Zo(h.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(x,c,s.__reactInternalSnapshotBeforeUpdate)}catch(E){Pt(h,h.return,E)}}g&64&&ZA(h),g&512&&Pd(h,h.return);break;case 3:if(Za(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{$_(s,c)}catch(E){Pt(h,h.return,E)}}break;case 27:c===null&&g&4&&JA(h);case 26:case 5:Za(s,h),c===null&&g&4&&WA(h),g&512&&Pd(h,h.return);break;case 12:Za(s,h);break;case 31:Za(s,h),g&4&&iE(s,h);break;case 13:Za(s,h),g&4&&aE(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=SF.bind(null,h),qF(s,h))));break;case 22:if(g=h.memoizedState!==null||Va,!g){c=c!==null&&c.memoizedState!==null||On,x=Va;var N=On;Va=g,(On=c)&&!N?Ya(s,h,(h.subtreeFlags&8772)!==0):Za(s,h),Va=x,On=N}break;case 30:break;default:Za(s,h)}}function nE(s){var c=s.alternate;c!==null&&(s.alternate=null,nE(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&ia(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 nn=null,Cr=!1;function Qa(s,c,h){for(h=h.child;h!==null;)rE(s,c,h),h=h.sibling}function rE(s,c,h){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(cn,h)}catch{}switch(h.tag){case 26:On||oa(h,c),Qa(s,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:On||oa(h,c);var g=nn,x=Cr;Fs(h.type)&&(nn=h.stateNode,Cr=!1),Qa(s,c,h),qd(h.stateNode),nn=g,Cr=x;break;case 5:On||oa(h,c);case 6:if(g=nn,x=Cr,nn=null,Qa(s,c,h),nn=g,Cr=x,nn!==null)if(Cr)try{(nn.nodeType===9?nn.body:nn.nodeName==="HTML"?nn.ownerDocument.body:nn).removeChild(h.stateNode)}catch(N){Pt(h,c,N)}else try{nn.removeChild(h.stateNode)}catch(N){Pt(h,c,N)}break;case 18:nn!==null&&(Cr?(s=nn,ZE(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),Rc(s)):ZE(nn,h.stateNode));break;case 4:g=nn,x=Cr,nn=h.stateNode.containerInfo,Cr=!0,Qa(s,c,h),nn=g,Cr=x;break;case 0:case 11:case 14:case 15:Ms(2,h,c),On||Ms(4,h,c),Qa(s,c,h);break;case 1:On||(oa(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&YA(h,c,g)),Qa(s,c,h);break;case 21:Qa(s,c,h);break;case 22:On=(g=On)||h.memoizedState!==null,Qa(s,c,h),On=g;break;default:Qa(s,c,h)}}function iE(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Rc(s)}catch(h){Pt(c,c.return,h)}}}function aE(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Rc(s)}catch(h){Pt(c,c.return,h)}}function pF(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new eE),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new eE),c;default:throw Error(r(435,s.tag))}}function Ap(s,c){var h=pF(s);c.forEach(function(g){if(!h.has(g)){h.add(g);var x=jF.bind(null,s,g);g.then(x,x)}})}function _r(s,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var x=h[g],N=s,E=c,M=E;e:for(;M!==null;){switch(M.tag){case 27:if(Fs(M.type)){nn=M.stateNode,Cr=!1;break e}break;case 5:nn=M.stateNode,Cr=!1;break e;case 3:case 4:nn=M.stateNode.containerInfo,Cr=!0;break e}M=M.return}if(nn===null)throw Error(r(160));rE(N,E,x),nn=null,Cr=!1,N=x.alternate,N!==null&&(N.return=null),x.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)sE(c,s),c=c.sibling}var Bi=null;function sE(s,c){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:_r(c,s),Ar(s),g&4&&(Ms(3,s,s.return),Td(3,s),Ms(5,s,s.return));break;case 1:_r(c,s),Ar(s),g&512&&(On||h===null||oa(h,h.return)),g&64&&Va&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var x=Bi;if(_r(c,s),Ar(s),g&512&&(On||h===null||oa(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,x=x.ownerDocument||x;t:switch(g){case"title":N=x.getElementsByTagName("title")[0],(!N||N[Po]||N[tt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=x.createElement(g),x.head.insertBefore(N,x.querySelector("head > title"))),Wn(N,g,h),N[tt]=s,un(N),g=N;break e;case"link":var E=sO("link","href",x).get(g+(h.href||""));if(E){for(var M=0;M<E.length;M++)if(N=E[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)){E.splice(M,1);break t}}N=x.createElement(g),Wn(N,g,h),x.head.appendChild(N);break;case"meta":if(E=sO("meta","content",x).get(g+(h.content||""))){for(M=0;M<E.length;M++)if(N=E[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)){E.splice(M,1);break t}}N=x.createElement(g),Wn(N,g,h),x.head.appendChild(N);break;default:throw Error(r(468,g))}N[tt]=s,un(N),g=N}s.stateNode=g}else oO(x,s.type,s.stateNode);else s.stateNode=aO(x,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?oO(x,s.type,s.stateNode):aO(x,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Cx(s,s.memoizedProps,h.memoizedProps)}break;case 27:_r(c,s),Ar(s),g&512&&(On||h===null||oa(h,h.return)),h!==null&&g&4&&Cx(s,s.memoizedProps,h.memoizedProps);break;case 5:if(_r(c,s),Ar(s),g&512&&(On||h===null||oa(h,h.return)),s.flags&32){x=s.stateNode;try{rc(x,"")}catch(Re){Pt(s,s.return,Re)}}g&4&&s.stateNode!=null&&(x=s.memoizedProps,Cx(s,x,h!==null?h.memoizedProps:x)),g&1024&&(Ex=!0);break;case 6:if(_r(c,s),Ar(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(Hp=null,x=Bi,Bi=qp(c.containerInfo),_r(c,s),Bi=x,Ar(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Rc(c.containerInfo)}catch(Re){Pt(s,s.return,Re)}Ex&&(Ex=!1,oE(s));break;case 4:g=Bi,Bi=qp(s.stateNode.containerInfo),_r(c,s),Ar(s),Bi=g;break;case 12:_r(c,s),Ar(s);break;case 31:_r(c,s),Ar(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ap(s,g)));break;case 13:_r(c,s),Ar(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Op=ft()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ap(s,g)));break;case 22:x=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ie=Va,ge=On;if(Va=ie||x,On=ge||K,_r(c,s),On=ge,Va=ie,Ar(s),g&8192)e:for(c=s.stateNode,c._visibility=x?c._visibility&-2:c._visibility|1,x&&(h===null||K||Va||On||Yo(s)),h=null,c=s;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(N=K.stateNode,x)E=N.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{M=K.stateNode;var be=K.memoizedProps.style,se=be!=null&&be.hasOwnProperty("display")?be.display:null;M.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Re){Pt(K,K.return,Re)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=x?"":K.memoizedProps}catch(Re){Pt(K,K.return,Re)}}}else if(c.tag===18){if(h===null){K=c;try{var de=K.stateNode;x?YE(de,!0):YE(K.stateNode,!1)}catch(Re){Pt(K,K.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,Ap(s,h))));break;case 19:_r(c,s),Ar(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Ap(s,g)));break;case 30:break;case 21:break;default:_r(c,s),Ar(s)}}function Ar(s){var c=s.flags;if(c&2){try{for(var h,g=s.return;g!==null;){if(XA(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var x=h.stateNode,N=_x(s);_p(s,N,x);break;case 5:var E=h.stateNode;h.flags&32&&(rc(E,""),h.flags&=-33);var M=_x(s);_p(s,M,E);break;case 3:case 4:var K=h.stateNode.containerInfo,ie=_x(s);Ax(s,ie,K);break;default:throw Error(r(161))}}catch(ge){Pt(s,s.return,ge)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function oE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;oE(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function Za(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)tE(s,c.alternate,c),c=c.sibling}function Yo(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:Ms(4,c,c.return),Yo(c);break;case 1:oa(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&YA(c,c.return,h),Yo(c);break;case 27:qd(c.stateNode);case 26:case 5:oa(c,c.return),Yo(c);break;case 22:c.memoizedState===null&&Yo(c);break;case 30:Yo(c);break;default:Yo(c)}s=s.sibling}}function Ya(s,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,x=s,N=c,E=N.flags;switch(N.tag){case 0:case 11:case 15:Ya(x,N,h),Td(4,N);break;case 1:if(Ya(x,N,h),g=N,x=g.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ie){Pt(g,g.return,ie)}if(g=N,x=g.updateQueue,x!==null){var M=g.stateNode;try{var K=x.shared.hiddenCallbacks;if(K!==null)for(x.shared.hiddenCallbacks=null,x=0;x<K.length;x++)L_(K[x],M)}catch(ie){Pt(g,g.return,ie)}}h&&E&64&&ZA(N),Pd(N,N.return);break;case 27:JA(N);case 26:case 5:Ya(x,N,h),h&&g===null&&E&4&&WA(N),Pd(N,N.return);break;case 12:Ya(x,N,h);break;case 31:Ya(x,N,h),h&&E&4&&iE(x,N);break;case 13:Ya(x,N,h),h&&E&4&&aE(x,N);break;case 22:N.memoizedState===null&&Ya(x,N,h),Pd(N,N.return);break;case 30:break;default:Ya(x,N,h)}c=c.sibling}}function Ox(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&&xd(h))}function zx(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&xd(s))}function Ui(s,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)lE(s,c,h,g),c=c.sibling}function lE(s,c,h,g){var x=c.flags;switch(c.tag){case 0:case 11:case 15:Ui(s,c,h,g),x&2048&&Td(9,c);break;case 1:Ui(s,c,h,g);break;case 3:Ui(s,c,h,g),x&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&xd(s)));break;case 12:if(x&2048){Ui(s,c,h,g),s=c.stateNode;try{var N=c.memoizedProps,E=N.id,M=N.onPostCommit;typeof M=="function"&&M(E,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){Pt(c,c.return,K)}}else Ui(s,c,h,g);break;case 31:Ui(s,c,h,g);break;case 13:Ui(s,c,h,g);break;case 23:break;case 22:N=c.stateNode,E=c.alternate,c.memoizedState!==null?N._visibility&2?Ui(s,c,h,g):Rd(s,c):N._visibility&2?Ui(s,c,h,g):(N._visibility|=2,jc(s,c,h,g,(c.subtreeFlags&10256)!==0||!1)),x&2048&&Ox(E,c);break;case 24:Ui(s,c,h,g),x&2048&&zx(c.alternate,c);break;default:Ui(s,c,h,g)}}function jc(s,c,h,g,x){for(x=x&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=s,E=c,M=h,K=g,ie=E.flags;switch(E.tag){case 0:case 11:case 15:jc(N,E,M,K,x),Td(8,E);break;case 23:break;case 22:var ge=E.stateNode;E.memoizedState!==null?ge._visibility&2?jc(N,E,M,K,x):Rd(N,E):(ge._visibility|=2,jc(N,E,M,K,x)),x&&ie&2048&&Ox(E.alternate,E);break;case 24:jc(N,E,M,K,x),x&&ie&2048&&zx(E.alternate,E);break;default:jc(N,E,M,K,x)}c=c.sibling}}function Rd(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=s,g=c,x=g.flags;switch(g.tag){case 22:Rd(h,g),x&2048&&Ox(g.alternate,g);break;case 24:Rd(h,g),x&2048&&zx(g.alternate,g);break;default:Rd(h,g)}c=c.sibling}}var Dd=8192;function Nc(s,c,h){if(s.subtreeFlags&Dd)for(s=s.child;s!==null;)cE(s,c,h),s=s.sibling}function cE(s,c,h){switch(s.tag){case 26:Nc(s,c,h),s.flags&Dd&&s.memoizedState!==null&&e9(h,Bi,s.memoizedState,s.memoizedProps);break;case 5:Nc(s,c,h);break;case 3:case 4:var g=Bi;Bi=qp(s.stateNode.containerInfo),Nc(s,c,h),Bi=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Dd,Dd=16777216,Nc(s,c,h),Dd=g):Nc(s,c,h));break;default:Nc(s,c,h)}}function uE(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 Md(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];qn=g,fE(g,s)}uE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)dE(s),s=s.sibling}function dE(s){switch(s.tag){case 0:case 11:case 15:Md(s),s.flags&2048&&Ms(9,s,s.return);break;case 3:Md(s);break;case 12:Md(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Ep(s)):Md(s);break;default:Md(s)}}function Ep(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];qn=g,fE(g,s)}uE(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:Ms(8,c,c.return),Ep(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,Ep(c));break;default:Ep(c)}s=s.sibling}}function fE(s,c){for(;qn!==null;){var h=qn;switch(h.tag){case 0:case 11:case 15:Ms(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:xd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,qn=g;else e:for(h=s;qn!==null;){g=qn;var x=g.sibling,N=g.return;if(nE(g),g===h){qn=null;break e}if(x!==null){x.return=N,qn=x;break e}qn=N}}}var mF={getCacheForType:function(s){var c=Zn(_n),h=c.data.get(s);return h===void 0&&(h=s(),c.data.set(s,h)),h},cacheSignal:function(){return Zn(_n).controller.signal}},gF=typeof WeakMap=="function"?WeakMap:Map,At=0,qt=null,ht=null,yt=0,Tt=0,Kr=null,Is=!1,kc=!1,Tx=!1,Wa=0,mn=0,Ls=0,Wo=0,Px=0,Gr=0,Cc=0,Id=null,Er=null,Rx=!1,Op=0,hE=0,zp=1/0,Tp=null,$s=null,Dn=0,Bs=null,_c=null,Xa=0,Dx=0,Mx=null,pE=null,Ld=0,Ix=null;function Vr(){return(At&2)!==0&&yt!==0?yt&-yt:H.T!==null?Fx():od()}function mE(){if(Gr===0)if((yt&536870912)===0||xt){var s=ai;ai<<=1,(ai&3932160)===0&&(ai=262144),Gr=s}else Gr=536870912;return s=Fr.current,s!==null&&(s.flags|=32),Gr}function Or(s,c,h){(s===qt&&(Tt===2||Tt===9)||s.cancelPendingCommit!==null)&&(Ac(s,0),Us(s,yt,Gr,!1)),Ss(s,h),((At&2)===0||s!==qt)&&(s===qt&&((At&2)===0&&(Wo|=h),mn===4&&Us(s,yt,Gr,!1)),la(s))}function gE(s,c,h){if((At&6)!==0)throw Error(r(327));var g=!h&&(c&127)===0&&(c&s.expiredLanes)===0||Mi(s,c),x=g?xF(s,c):$x(s,c,!0),N=g;do{if(x===0){kc&&!g&&Us(s,c,0,!1);break}else{if(h=s.current.alternate,N&&!yF(h)){x=$x(s,c,!1),N=!1;continue}if(x===2){if(N=c,s.errorRecoveryDisabledLanes&N)var E=0;else E=s.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){c=E;e:{var M=s;x=Id;var K=M.current.memoizedState.isDehydrated;if(K&&(Ac(M,E).flags|=256),E=$x(M,E,!1),E!==2){if(Tx&&!K){M.errorRecoveryDisabledLanes|=N,Wo|=N,x=4;break e}N=Er,Er=x,N!==null&&(Er===null?Er=N:Er.push.apply(Er,N))}x=E}if(N=!1,x!==2)continue}}if(x===1){Ac(s,0),Us(s,c,0,!0);break}e:{switch(g=s,N=x,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Us(g,c,Gr,!Is);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(x=Op+300-ft(),10<x)){if(Us(g,c,Gr,!Is),jr(g,0,!0)!==0)break e;Xa=c,g.timeoutHandle=VE(yE.bind(null,g,h,Er,Tp,Rx,c,Gr,Wo,Cc,Is,N,"Throttled",-0,0),x);break e}yE(g,h,Er,Tp,Rx,c,Gr,Wo,Cc,Is,N,null,-0,0)}}break}while(!0);la(s)}function yE(s,c,h,g,x,N,E,M,K,ie,ge,be,se,de){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:Ia},cE(c,N,be);var Re=(N&62914560)===N?Op-ft():(N&4194048)===N?hE-ft():0;if(Re=t9(be,Re),Re!==null){Xa=N,s.cancelPendingCommit=Re(kE.bind(null,s,c,N,h,g,x,E,M,K,ge,be,null,se,de)),Us(s,N,E,!ie);return}}kE(s,c,N,h,g,x,E,M,K)}function yF(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 x=h[g],N=x.getSnapshot;x=x.value;try{if(!Ur(N(),x))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 Us(s,c,h,g){c&=~Px,c&=~Wo,s.suspendedLanes|=c,s.pingedLanes&=~c,g&&(s.warmLanes|=c),g=s.expirationTimes;for(var x=c;0<x;){var N=31-fe(x),E=1<<N;g[N]=-1,x&=~E}h!==0&&id(s,h,c)}function Pp(){return(At&6)===0?($d(0),!1):!0}function Lx(){if(ht!==null){if(Tt===0)var s=ht.return;else s=ht,Ua=qo=null,ex(s),vc=null,wd=0,s=ht;for(;s!==null;)QA(s.alternate,s),s=s.return;ht=null}}function Ac(s,c){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,IF(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),Xa=0,Lx(),qt=s,ht=h=$a(s.current,null),yt=c,Tt=0,Kr=null,Is=!1,kc=Mi(s,c),Tx=!1,Cc=Gr=Px=Wo=Ls=mn=0,Er=Id=null,Rx=!1,(c&8)!==0&&(c|=c&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=c;0<g;){var x=31-fe(g),N=1<<x;c|=s[x],g&=~N}return Wa=c,ep(),h}function vE(s,c){at=null,H.H=Ed,c===yc||c===lp?(c=R_(),Tt=3):c===q0?(c=R_(),Tt=4):Tt=c===gx?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Kr=c,ht===null&&(mn=1,Sp(s,ui(c,s.current)))}function xE(){var s=Fr.current;return s===null?!0:(yt&4194048)===yt?pi===null:(yt&62914560)===yt||(yt&536870912)!==0?s===pi:!1}function bE(){var s=H.H;return H.H=Ed,s===null?Ed:s}function wE(){var s=H.A;return H.A=mF,s}function Rp(){mn=4,Is||(yt&4194048)!==yt&&Fr.current!==null||(kc=!0),(Ls&134217727)===0&&(Wo&134217727)===0||qt===null||Us(qt,yt,Gr,!1)}function $x(s,c,h){var g=At;At|=2;var x=bE(),N=wE();(qt!==s||yt!==c)&&(Tp=null,Ac(s,c)),c=!1;var E=mn;e:do try{if(Tt!==0&&ht!==null){var M=ht,K=Kr;switch(Tt){case 8:Lx(),E=6;break e;case 3:case 2:case 9:case 6:Fr.current===null&&(c=!0);var ie=Tt;if(Tt=0,Kr=null,Ec(s,M,K,ie),h&&kc){E=0;break e}break;default:ie=Tt,Tt=0,Kr=null,Ec(s,M,K,ie)}}vF(),E=mn;break}catch(ge){vE(s,ge)}while(!0);return c&&s.shellSuspendCounter++,Ua=qo=null,At=g,H.H=x,H.A=N,ht===null&&(qt=null,yt=0,ep()),E}function vF(){for(;ht!==null;)SE(ht)}function xF(s,c){var h=At;At|=2;var g=bE(),x=wE();qt!==s||yt!==c?(Tp=null,zp=ft()+500,Ac(s,c)):kc=Mi(s,c);e:do try{if(Tt!==0&&ht!==null){c=ht;var N=Kr;t:switch(Tt){case 1:Tt=0,Kr=null,Ec(s,c,N,1);break;case 2:case 9:if(T_(N)){Tt=0,Kr=null,jE(c);break}c=function(){Tt!==2&&Tt!==9||qt!==s||(Tt=7),la(s)},N.then(c,c);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:T_(N)?(Tt=0,Kr=null,jE(c)):(Tt=0,Kr=null,Ec(s,c,N,7));break;case 5:var E=null;switch(ht.tag){case 26:E=ht.memoizedState;case 5:case 27:var M=ht;if(E?lO(E):M.stateNode.complete){Tt=0,Kr=null;var K=M.sibling;if(K!==null)ht=K;else{var ie=M.return;ie!==null?(ht=ie,Dp(ie)):ht=null}break t}}Tt=0,Kr=null,Ec(s,c,N,5);break;case 6:Tt=0,Kr=null,Ec(s,c,N,6);break;case 8:Lx(),mn=6;break e;default:throw Error(r(462))}}bF();break}catch(ge){vE(s,ge)}while(!0);return Ua=qo=null,H.H=g,H.A=x,At=h,ht!==null?0:(qt=null,yt=0,ep(),mn)}function bF(){for(;ht!==null&&!Xe();)SE(ht)}function SE(s){var c=GA(s.alternate,s,Wa);s.memoizedProps=s.pendingProps,c===null?Dp(s):ht=c}function jE(s){var c=s,h=c.alternate;switch(c.tag){case 15:case 0:c=BA(h,c,c.pendingProps,c.type,void 0,yt);break;case 11:c=BA(h,c,c.pendingProps,c.type.render,c.ref,yt);break;case 5:ex(c);default:QA(h,c),c=ht=w_(c,Wa),c=GA(h,c,Wa)}s.memoizedProps=s.pendingProps,c===null?Dp(s):ht=c}function Ec(s,c,h,g){Ua=qo=null,ex(c),vc=null,wd=0;var x=c.return;try{if(lF(s,x,c,h,yt)){mn=1,Sp(s,ui(h,s.current)),ht=null;return}}catch(N){if(x!==null)throw ht=x,N;mn=1,Sp(s,ui(h,s.current)),ht=null;return}c.flags&32768?(xt||g===1?s=!0:kc||(yt&536870912)!==0?s=!1:(Is=s=!0,(g===2||g===9||g===3||g===6)&&(g=Fr.current,g!==null&&g.tag===13&&(g.flags|=16384))),NE(c,s)):Dp(c)}function Dp(s){var c=s;do{if((c.flags&32768)!==0){NE(c,Is);return}s=c.return;var h=dF(c.alternate,c,Wa);if(h!==null){ht=h;return}if(c=c.sibling,c!==null){ht=c;return}ht=c=s}while(c!==null);mn===0&&(mn=5)}function NE(s,c){do{var h=fF(s.alternate,s);if(h!==null){h.flags&=32767,ht=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(s=s.sibling,s!==null)){ht=s;return}ht=s=h}while(s!==null);mn=6,ht=null}function kE(s,c,h,g,x,N,E,M,K){s.cancelPendingCommit=null;do Mp();while(Dn!==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|=_0,a0(s,h,N,E,M,K),s===qt&&(ht=qt=null,yt=0),_c=c,Bs=s,Xa=h,Dx=N,Mx=x,pE=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,NF(De,function(){return OE(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,x=ee.p,ee.p=2,E=At,At|=4;try{hF(s,c,h)}finally{At=E,ee.p=x,H.T=g}}Dn=1,CE(),_E(),AE()}}function CE(){if(Dn===1){Dn=0;var s=Bs,c=_c,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=ee.p;ee.p=2;var x=At;At|=4;try{sE(c,s);var N=Wx,E=f_(s.containerInfo),M=N.focusedElem,K=N.selectionRange;if(E!==M&&M&&M.ownerDocument&&d_(M.ownerDocument.documentElement,M)){if(K!==null&&S0(M)){var ie=K.start,ge=K.end;if(ge===void 0&&(ge=ie),"selectionStart"in M)M.selectionStart=ie,M.selectionEnd=Math.min(ge,M.value.length);else{var be=M.ownerDocument||document,se=be&&be.defaultView||window;if(se.getSelection){var de=se.getSelection(),Re=M.textContent.length,Ye=Math.min(K.start,Re),Lt=K.end===void 0?Ye:Math.min(K.end,Re);!de.extend&&Ye>Lt&&(E=Lt,Lt=Ye,Ye=E);var J=u_(M,Ye),Z=u_(M,Lt);if(J&&Z&&(de.rangeCount!==1||de.anchorNode!==J.node||de.anchorOffset!==J.offset||de.focusNode!==Z.node||de.focusOffset!==Z.offset)){var re=be.createRange();re.setStart(J.node,J.offset),de.removeAllRanges(),Ye>Lt?(de.addRange(re),de.extend(Z.node,Z.offset)):(re.setEnd(Z.node,Z.offset),de.addRange(re))}}}}for(be=[],de=M;de=de.parentNode;)de.nodeType===1&&be.push({element:de,left:de.scrollLeft,top:de.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}}Qp=!!Yx,Wx=Yx=null}finally{At=x,ee.p=g,H.T=h}}s.current=c,Dn=2}}function _E(){if(Dn===2){Dn=0;var s=Bs,c=_c,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=ee.p;ee.p=2;var x=At;At|=4;try{tE(s,c.alternate,c)}finally{At=x,ee.p=g,H.T=h}}Dn=3}}function AE(){if(Dn===4||Dn===3){Dn=0,Ot();var s=Bs,c=_c,h=Xa,g=pE;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Dn=5:(Dn=0,_c=Bs=null,EE(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&($s=null),sd(h),c=c.stateNode,Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(cn,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=H.T,x=ee.p,ee.p=2,H.T=null;try{for(var N=s.onRecoverableError,E=0;E<g.length;E++){var M=g[E];N(M.value,{componentStack:M.stack})}}finally{H.T=c,ee.p=x}}(Xa&3)!==0&&Mp(),la(s),x=s.pendingLanes,(h&261930)!==0&&(x&42)!==0?s===Ix?Ld++:(Ld=0,Ix=s):Ld=0,$d(0)}}function EE(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,xd(c)))}function Mp(){return CE(),_E(),AE(),OE()}function OE(){if(Dn!==5)return!1;var s=Bs,c=Dx;Dx=0;var h=sd(Xa),g=H.T,x=ee.p;try{ee.p=32>h?32:h,H.T=null,h=Mx,Mx=null;var N=Bs,E=Xa;if(Dn=0,_c=Bs=null,Xa=0,(At&6)!==0)throw Error(r(331));var M=At;if(At|=4,dE(N.current),lE(N,N.current,E,h),At=M,$d(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(cn,N)}catch{}return!0}finally{ee.p=x,H.T=g,EE(s,c)}}function zE(s,c,h){c=ui(h,c),c=mx(s.stateNode,c,2),s=Ps(s,c,2),s!==null&&(Ss(s,2),la(s))}function Pt(s,c,h){if(s.tag===3)zE(s,s,h);else for(;c!==null;){if(c.tag===3){zE(c,s,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&($s===null||!$s.has(g))){s=ui(h,s),h=TA(2),g=Ps(c,h,2),g!==null&&(PA(h,g,c,s),Ss(g,2),la(g));break}}c=c.return}}function Bx(s,c,h){var g=s.pingCache;if(g===null){g=s.pingCache=new gF;var x=new Set;g.set(c,x)}else x=g.get(c),x===void 0&&(x=new Set,g.set(c,x));x.has(h)||(Tx=!0,x.add(h),s=wF.bind(null,s,c,h),c.then(s,s))}function wF(s,c,h){var g=s.pingCache;g!==null&&g.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,qt===s&&(yt&h)===h&&(mn===4||mn===3&&(yt&62914560)===yt&&300>ft()-Op?(At&2)===0&&Ac(s,0):Px|=h,Cc===yt&&(Cc=0)),la(s)}function TE(s,c){c===0&&(c=Bh()),s=$o(s,c),s!==null&&(Ss(s,c),la(s))}function SF(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),TE(s,h)}function jF(s,c){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,x=s.memoizedState;x!==null&&(h=x.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),TE(s,h)}function NF(s,c){return Zt(s,c)}var Ip=null,Oc=null,Ux=!1,Lp=!1,qx=!1,qs=0;function la(s){s!==Oc&&s.next===null&&(Oc===null?Ip=Oc=s:Oc=Oc.next=s),Lp=!0,Ux||(Ux=!0,CF())}function $d(s,c){if(!qx&&Lp){qx=!0;do for(var h=!1,g=Ip;g!==null;){if(s!==0){var x=g.pendingLanes;if(x===0)var N=0;else{var E=g.suspendedLanes,M=g.pingedLanes;N=(1<<31-fe(42|s)+1)-1,N&=x&~(E&~M),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,ME(g,N))}else N=yt,N=jr(g,g===qt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Mi(g,N)||(h=!0,ME(g,N));g=g.next}while(h);qx=!1}}function kF(){PE()}function PE(){Lp=Ux=!1;var s=0;qs!==0&&MF()&&(s=qs);for(var c=ft(),h=null,g=Ip;g!==null;){var x=g.next,N=RE(g,c);N===0?(g.next=null,h===null?Ip=x:h.next=x,x===null&&(Oc=h)):(h=g,(s!==0||(N&3)!==0)&&(Lp=!0)),g=x}Dn!==0&&Dn!==5||$d(s),qs!==0&&(qs=0)}function RE(s,c){for(var h=s.suspendedLanes,g=s.pingedLanes,x=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var E=31-fe(N),M=1<<E,K=x[E];K===-1?((M&h)===0||(M&g)!==0)&&(x[E]=na(M,c)):K<=c&&(s.expiredLanes|=M),N&=~M}if(c=qt,h=yt,h=jr(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&&we(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Mi(s,h)){if(c=h&-h,c===s.callbackPriority)return c;switch(g!==null&&we(g),sd(h)){case 2:case 8:h=Ne;break;case 32:h=De;break;case 268435456:h=dt;break;default:h=De}return g=DE.bind(null,s),h=Zt(h,g),s.callbackPriority=c,s.callbackNode=h,c}return g!==null&&g!==null&&we(g),s.callbackPriority=2,s.callbackNode=null,2}function DE(s,c){if(Dn!==0&&Dn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Mp()&&s.callbackNode!==h)return null;var g=yt;return g=jr(s,s===qt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(gE(s,g,c),RE(s,ft()),s.callbackNode!=null&&s.callbackNode===h?DE.bind(null,s):null)}function ME(s,c){if(Mp())return null;gE(s,c,!0)}function CF(){LF(function(){(At&6)!==0?Zt(ue,kF):PE()})}function Fx(){if(qs===0){var s=mc;s===0&&(s=Rn,Rn<<=1,(Rn&261888)===0&&(Rn=256)),qs=s}return qs}function IE(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Gh(""+s)}function LE(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 _F(s,c,h,g,x){if(c==="submit"&&h&&h.stateNode===x){var N=IE((x[wt]||null).action),E=g.submitter;E&&(c=(c=E[wt]||null)?IE(c.formAction):E.getAttribute("formAction"),c!==null&&(N=c,E=null));var M=new Yh("action","action",null,g,x);s.push({event:M,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(qs!==0){var K=E?LE(x,E):new FormData(x);cx(h,{pending:!0,data:K,method:x.method,action:N},null,K)}}else typeof N=="function"&&(M.preventDefault(),K=E?LE(x,E):new FormData(x),cx(h,{pending:!0,data:K,method:x.method,action:N},N,K))},currentTarget:x}]})}}for(var Hx=0;Hx<C0.length;Hx++){var Kx=C0[Hx],AF=Kx.toLowerCase(),EF=Kx[0].toUpperCase()+Kx.slice(1);$i(AF,"on"+EF)}$i(m_,"onAnimationEnd"),$i(g_,"onAnimationIteration"),$i(y_,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(K8,"onTransitionRun"),$i(G8,"onTransitionStart"),$i(V8,"onTransitionCancel"),$i(v_,"onTransitionEnd"),ct("onMouseEnter",["mouseout","mouseover"]),ct("onMouseLeave",["mouseout","mouseover"]),ct("onPointerEnter",["pointerout","pointerover"]),ct("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bd="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(" "),OF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bd));function $E(s,c){c=(c&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],x=g.event;g=g.listeners;e:{var N=void 0;if(c)for(var E=g.length-1;0<=E;E--){var M=g[E],K=M.instance,ie=M.currentTarget;if(M=M.listener,K!==N&&x.isPropagationStopped())break e;N=M,x.currentTarget=ie;try{N(x)}catch(ge){Jh(ge)}x.currentTarget=null,N=K}else for(E=0;E<g.length;E++){if(M=g[E],K=M.instance,ie=M.currentTarget,M=M.listener,K!==N&&x.isPropagationStopped())break e;N=M,x.currentTarget=ie;try{N(x)}catch(ge){Jh(ge)}x.currentTarget=null,N=K}}}}function pt(s,c){var h=c[ra];h===void 0&&(h=c[ra]=new Set);var g=s+"__bubble";h.has(g)||(BE(c,s,2,!1),h.add(g))}function Gx(s,c,h){var g=0;c&&(g|=4),BE(h,s,g,c)}var $p="_reactListening"+Math.random().toString(36).slice(2);function Vx(s){if(!s[$p]){s[$p]=!0,Ro.forEach(function(h){h!=="selectionchange"&&(OF.has(h)||Gx(h,!1,s),Gx(h,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[$p]||(c[$p]=!0,Gx("selectionchange",!1,c))}}function BE(s,c,h,g){switch(mO(c)){case 2:var x=i9;break;case 8:x=a9;break;default:x=lb}h=x.bind(null,c,h,s),x=void 0,!h0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(x=!0),g?x!==void 0?s.addEventListener(c,h,{capture:!0,passive:x}):s.addEventListener(c,h,!0):x!==void 0?s.addEventListener(c,h,{passive:x}):s.addEventListener(c,h,!1)}function Qx(s,c,h,g,x){var N=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var E=g.tag;if(E===3||E===4){var M=g.stateNode.containerInfo;if(M===x)break;if(E===4)for(E=g.return;E!==null;){var K=E.tag;if((K===3||K===4)&&E.stateNode.containerInfo===x)return;E=E.return}for(;M!==null;){if(E=si(M),E===null)return;if(K=E.tag,K===5||K===6||K===26||K===27){g=N=E;continue e}M=M.parentNode}}g=g.return}KC(function(){var ie=N,ge=d0(h),be=[];e:{var se=x_.get(s);if(se!==void 0){var de=Yh,Re=s;switch(s){case"keypress":if(Qh(h)===0)break e;case"keydown":case"keyup":de=j8;break;case"focusin":Re="focus",de=y0;break;case"focusout":Re="blur",de=y0;break;case"beforeblur":case"afterblur":de=y0;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":de=QC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=d8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=C8;break;case m_:case g_:case y_:de=p8;break;case v_:de=A8;break;case"scroll":case"scrollend":de=c8;break;case"wheel":de=O8;break;case"copy":case"cut":case"paste":de=g8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=YC;break;case"toggle":case"beforetoggle":de=T8}var Ye=(c&4)!==0,Lt=!Ye&&(s==="scroll"||s==="scrollend"),J=Ye?se!==null?se+"Capture":null:se;Ye=[];for(var Z=ie,re;Z!==null;){var ve=Z;if(re=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||re===null||J===null||(ve=ld(Z,J),ve!=null&&Ye.push(Ud(Z,ve,re))),Lt)break;Z=Z.return}0<Ye.length&&(se=new de(se,Re,null,h,ge),be.push({event:se,listeners:Ye}))}}if((c&7)===0){e:{if(se=s==="mouseover"||s==="pointerover",de=s==="mouseout"||s==="pointerout",se&&h!==u0&&(Re=h.relatedTarget||h.fromElement)&&(si(Re)||Re[wn]))break e;if((de||se)&&(se=ge.window===ge?ge:(se=ge.ownerDocument)?se.defaultView||se.parentWindow:window,de?(Re=h.relatedTarget||h.toElement,de=ie,Re=Re?si(Re):null,Re!==null&&(Lt=a(Re),Ye=Re.tag,Re!==Lt||Ye!==5&&Ye!==27&&Ye!==6)&&(Re=null)):(de=null,Re=ie),de!==Re)){if(Ye=QC,ve="onMouseLeave",J="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=YC,ve="onPointerLeave",J="onPointerEnter",Z="pointer"),Lt=de==null?se:Ns(de),re=Re==null?se:Ns(Re),se=new Ye(ve,Z+"leave",de,h,ge),se.target=Lt,se.relatedTarget=re,ve=null,si(ge)===ie&&(Ye=new Ye(J,Z+"enter",Re,h,ge),Ye.target=re,Ye.relatedTarget=Lt,ve=Ye),Lt=ve,de&&Re)t:{for(Ye=zF,J=de,Z=Re,re=0,ve=J;ve;ve=Ye(ve))re++;ve=0;for(var He=Z;He;He=Ye(He))ve++;for(;0<re-ve;)J=Ye(J),re--;for(;0<ve-re;)Z=Ye(Z),ve--;for(;re--;){if(J===Z||Z!==null&&J===Z.alternate){Ye=J;break t}J=Ye(J),Z=Ye(Z)}Ye=null}else Ye=null;de!==null&&UE(be,se,de,Ye,!1),Re!==null&&Lt!==null&&UE(be,Lt,Re,Ye,!0)}}e:{if(se=ie?Ns(ie):window,de=se.nodeName&&se.nodeName.toLowerCase(),de==="select"||de==="input"&&se.type==="file")var Nt=i_;else if(n_(se))if(a_)Nt=q8;else{Nt=B8;var $e=$8}else de=se.nodeName,!de||de.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&c0(ie.elementType)&&(Nt=i_):Nt=U8;if(Nt&&(Nt=Nt(s,ie))){r_(be,Nt,h,ge);break e}$e&&$e(s,se,ie),s==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&l0(se,"number",se.value)}switch($e=ie?Ns(ie):window,s){case"focusin":(n_($e)||$e.contentEditable==="true")&&(oc=$e,j0=ie,gd=null);break;case"focusout":gd=j0=oc=null;break;case"mousedown":N0=!0;break;case"contextmenu":case"mouseup":case"dragend":N0=!1,h_(be,h,ge);break;case"selectionchange":if(H8)break;case"keydown":case"keyup":h_(be,h,ge)}var st;if(x0)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 sc?e_(s,h)&&(vt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(vt="onCompositionStart");vt&&(WC&&h.locale!=="ko"&&(sc||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&sc&&(st=GC()):(Cs=ge,p0="value"in Cs?Cs.value:Cs.textContent,sc=!0)),$e=Bp(ie,vt),0<$e.length&&(vt=new ZC(vt,s,null,h,ge),be.push({event:vt,listeners:$e}),st?vt.data=st:(st=t_(h),st!==null&&(vt.data=st)))),(st=R8?D8(s,h):M8(s,h))&&(vt=Bp(ie,"onBeforeInput"),0<vt.length&&($e=new ZC("onBeforeInput","beforeinput",null,h,ge),be.push({event:$e,listeners:vt}),$e.data=st)),_F(be,s,ie,h,ge)}$E(be,c)})}function Ud(s,c,h){return{instance:s,listener:c,currentTarget:h}}function Bp(s,c){for(var h=c+"Capture",g=[];s!==null;){var x=s,N=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||N===null||(x=ld(s,h),x!=null&&g.unshift(Ud(s,x,N)),x=ld(s,c),x!=null&&g.push(Ud(s,x,N))),s.tag===3)return g;s=s.return}return[]}function zF(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function UE(s,c,h,g,x){for(var N=c._reactName,E=[];h!==null&&h!==g;){var M=h,K=M.alternate,ie=M.stateNode;if(M=M.tag,K!==null&&K===g)break;M!==5&&M!==26&&M!==27||ie===null||(K=ie,x?(ie=ld(h,N),ie!=null&&E.unshift(Ud(h,ie,K))):x||(ie=ld(h,N),ie!=null&&E.push(Ud(h,ie,K)))),h=h.return}E.length!==0&&s.push({event:c,listeners:E})}var TF=/\r\n?/g,PF=/\u0000|\uFFFD/g;function qE(s){return(typeof s=="string"?s:""+s).replace(TF,`
9
+ `).replace(PF,"")}function FE(s,c){return c=qE(c),qE(s)===c}function It(s,c,h,g,x,N){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||rc(s,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&rc(s,""+g);break;case"className":Hh(s,"class",g);break;case"tabIndex":Hh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Hh(s,h,g);break;case"style":FC(s,g,N);break;case"data":if(c!=="object"){Hh(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=Gh(""+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"&&It(s,c,"name",x.name,x,null),It(s,c,"formEncType",x.formEncType,x,null),It(s,c,"formMethod",x.formMethod,x,null),It(s,c,"formTarget",x.formTarget,x,null)):(It(s,c,"encType",x.encType,x,null),It(s,c,"method",x.method,x,null),It(s,c,"target",x.target,x,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Gh(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Ia);break;case"onScroll":g!=null&&pt("scroll",s);break;case"onScrollEnd":g!=null&&pt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Gh(""+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":pt("beforetoggle",s),pt("toggle",s),Do(s,"popover",g);break;case"xlinkActuate":Ma(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ma(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ma(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ma(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ma(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ma(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ma(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ma(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ma(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Do(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=o8.get(h)||h,Do(s,h,g))}}function Zx(s,c,h,g,x,N){switch(h){case"style":FC(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(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?rc(s,g):(typeof g=="number"||typeof g=="bigint")&&rc(s,""+g);break;case"onScroll":g!=null&&pt("scroll",s);break;case"onScrollEnd":g!=null&&pt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fh.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(x=h.endsWith("Capture"),c=h.slice(2,x?h.length-7:void 0),N=s[wt]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(c,N,x),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(c,g,x);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Do(s,h,g)}}}function Wn(s,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pt("error",s),pt("load",s);var g=!1,x=!1,N;for(N in h)if(h.hasOwnProperty(N)){var E=h[N];if(E!=null)switch(N){case"src":g=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:It(s,c,N,E,h,null)}}x&&It(s,c,"srcSet",h.srcSet,h,null),g&&It(s,c,"src",h.src,h,null);return;case"input":pt("invalid",s);var M=N=E=x=null,K=null,ie=null;for(g in h)if(h.hasOwnProperty(g)){var ge=h[g];if(ge!=null)switch(g){case"name":x=ge;break;case"type":E=ge;break;case"checked":K=ge;break;case"defaultChecked":ie=ge;break;case"value":N=ge;break;case"defaultValue":M=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,c));break;default:It(s,c,g,ge,h,null)}}$C(s,N,M,K,ie,E,x,!1);return;case"select":pt("invalid",s),g=E=N=null;for(x in h)if(h.hasOwnProperty(x)&&(M=h[x],M!=null))switch(x){case"value":N=M;break;case"defaultValue":E=M;break;case"multiple":g=M;default:It(s,c,x,M,h,null)}c=N,h=E,s.multiple=!!g,c!=null?nc(s,!!g,c,!1):h!=null&&nc(s,!!g,h,!0);return;case"textarea":pt("invalid",s),N=x=g=null;for(E in h)if(h.hasOwnProperty(E)&&(M=h[E],M!=null))switch(E){case"value":g=M;break;case"defaultValue":x=M;break;case"children":N=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:It(s,c,E,M,h,null)}UC(s,g,x,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(g=h[K],g!=null)&&(K==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":It(s,c,K,g,h,null));return;case"dialog":pt("beforetoggle",s),pt("toggle",s),pt("cancel",s),pt("close",s);break;case"iframe":case"object":pt("load",s);break;case"video":case"audio":for(g=0;g<Bd.length;g++)pt(Bd[g],s);break;case"image":pt("error",s),pt("load",s);break;case"details":pt("toggle",s);break;case"embed":case"source":case"link":pt("error",s),pt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in h)if(h.hasOwnProperty(ie)&&(g=h[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:It(s,c,ie,g,h,null)}return;default:if(c0(c)){for(ge in h)h.hasOwnProperty(ge)&&(g=h[ge],g!==void 0&&Zx(s,c,ge,g,h,void 0));return}}for(M in h)h.hasOwnProperty(M)&&(g=h[M],g!=null&&It(s,c,M,g,h,null))}function RF(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 x=null,N=null,E=null,M=null,K=null,ie=null,ge=null;for(de in h){var be=h[de];if(h.hasOwnProperty(de)&&be!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":K=be;default:g.hasOwnProperty(de)||It(s,c,de,null,g,be)}}for(var se in g){var de=g[se];if(be=h[se],g.hasOwnProperty(se)&&(de!=null||be!=null))switch(se){case"type":N=de;break;case"name":x=de;break;case"checked":ie=de;break;case"defaultChecked":ge=de;break;case"value":E=de;break;case"defaultValue":M=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:de!==be&&It(s,c,se,de,g,be)}}o0(s,E,M,K,ie,ge,N,x);return;case"select":de=E=M=se=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":de=K;default:g.hasOwnProperty(N)||It(s,c,N,null,g,K)}for(x in g)if(N=g[x],K=h[x],g.hasOwnProperty(x)&&(N!=null||K!=null))switch(x){case"value":se=N;break;case"defaultValue":M=N;break;case"multiple":E=N;default:N!==K&&It(s,c,x,N,g,K)}c=M,h=E,g=de,se!=null?nc(s,!!h,se,!1):!!g!=!!h&&(c!=null?nc(s,!!h,c,!0):nc(s,!!h,h?[]:"",!1));return;case"textarea":de=se=null;for(M in h)if(x=h[M],h.hasOwnProperty(M)&&x!=null&&!g.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:It(s,c,M,null,g,x)}for(E in g)if(x=g[E],N=h[E],g.hasOwnProperty(E)&&(x!=null||N!=null))switch(E){case"value":se=x;break;case"defaultValue":de=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==N&&It(s,c,E,x,g,N)}BC(s,se,de);return;case"option":for(var Re in h)se=h[Re],h.hasOwnProperty(Re)&&se!=null&&!g.hasOwnProperty(Re)&&(Re==="selected"?s.selected=!1:It(s,c,Re,null,g,se));for(K in g)se=g[K],de=h[K],g.hasOwnProperty(K)&&se!==de&&(se!=null||de!=null)&&(K==="selected"?s.selected=se&&typeof se!="function"&&typeof se!="symbol":It(s,c,K,se,g,de));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in h)se=h[Ye],h.hasOwnProperty(Ye)&&se!=null&&!g.hasOwnProperty(Ye)&&It(s,c,Ye,null,g,se);for(ie in g)if(se=g[ie],de=h[ie],g.hasOwnProperty(ie)&&se!==de&&(se!=null||de!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,c));break;default:It(s,c,ie,se,g,de)}return;default:if(c0(c)){for(var Lt in h)se=h[Lt],h.hasOwnProperty(Lt)&&se!==void 0&&!g.hasOwnProperty(Lt)&&Zx(s,c,Lt,void 0,g,se);for(ge in g)se=g[ge],de=h[ge],!g.hasOwnProperty(ge)||se===de||se===void 0&&de===void 0||Zx(s,c,ge,se,g,de);return}}for(var J in h)se=h[J],h.hasOwnProperty(J)&&se!=null&&!g.hasOwnProperty(J)&&It(s,c,J,null,g,se);for(be in g)se=g[be],de=h[be],!g.hasOwnProperty(be)||se===de||se==null&&de==null||It(s,c,be,se,g,de)}function HE(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DF(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var x=h[g],N=x.transferSize,E=x.initiatorType,M=x.duration;if(N&&M&&HE(E)){for(E=0,M=x.responseEnd,g+=1;g<h.length;g++){var K=h[g],ie=K.startTime;if(ie>M)break;var ge=K.transferSize,be=K.initiatorType;ge&&HE(be)&&(K=K.responseEnd,E+=ge*(K<M?1:(M-ie)/(K-ie)))}if(--g,c+=8*(N+E)/(x.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 Yx=null,Wx=null;function Up(s){return s.nodeType===9?s:s.ownerDocument}function KE(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 GE(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 Xx(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 Jx=null;function MF(){var s=window.event;return s&&s.type==="popstate"?s===Jx?!1:(Jx=s,!0):(Jx=null,!1)}var VE=typeof setTimeout=="function"?setTimeout:void 0,IF=typeof clearTimeout=="function"?clearTimeout:void 0,QE=typeof Promise=="function"?Promise:void 0,LF=typeof queueMicrotask=="function"?queueMicrotask:typeof QE<"u"?function(s){return QE.resolve(null).then(s).catch($F)}:VE;function $F(s){setTimeout(function(){throw s})}function Fs(s){return s==="head"}function ZE(s,c){var h=c,g=0;do{var x=h.nextSibling;if(s.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(x),Rc(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")qd(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,qd(h);for(var N=h.firstChild;N;){var E=N.nextSibling,M=N.nodeName;N[Po]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=E}}else h==="body"&&qd(s.ownerDocument.body);h=x}while(h);Rc(c)}function YE(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 eb(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":eb(h),ia(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function BF(s,c,h,g){for(;s.nodeType===1;){var x=h;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Po])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!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var N=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=mi(s.nextSibling),s===null)break}return null}function UF(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 WE(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 tb(s){return s.data==="$?"||s.data==="$~"}function nb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function qF(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 rb=null;function XE(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 JE(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 eO(s,c,h){switch(c=Up(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 qd(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);ia(s)}var gi=new Map,tO=new Set;function qp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ja=ee.d;ee.d={f:FF,r:HF,D:KF,C:GF,L:VF,m:QF,X:YF,S:ZF,M:WF};function FF(){var s=Ja.f(),c=Pp();return s||c}function HF(s){var c=Ii(s);c!==null&&c.tag===5&&c.type==="form"?vA(c):Ja.r(s)}var zc=typeof document>"u"?null:document;function nO(s,c,h){var g=zc;if(g&&typeof c=="string"&&c){var x=li(c);x='link[rel="'+s+'"][href="'+x+'"]',typeof h=="string"&&(x+='[crossorigin="'+h+'"]'),tO.has(x)||(tO.add(x),s={rel:s,crossOrigin:h,href:c},g.querySelector(x)===null&&(c=g.createElement("link"),Wn(c,"link",s),un(c),g.head.appendChild(c)))}}function KF(s){Ja.D(s),nO("dns-prefetch",s,null)}function GF(s,c){Ja.C(s,c),nO("preconnect",s,c)}function VF(s,c,h){Ja.L(s,c,h);var g=zc;if(g&&s&&c){var x='link[rel="preload"][as="'+li(c)+'"]';c==="image"&&h&&h.imageSrcSet?(x+='[imagesrcset="'+li(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(x+='[imagesizes="'+li(h.imageSizes)+'"]')):x+='[href="'+li(s)+'"]';var N=x;switch(c){case"style":N=Tc(s);break;case"script":N=Pc(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(x)!==null||c==="style"&&g.querySelector(Fd(N))||c==="script"&&g.querySelector(Hd(N))||(c=g.createElement("link"),Wn(c,"link",s),un(c),g.head.appendChild(c)))}}function QF(s,c){Ja.m(s,c);var h=zc;if(h&&s){var g=c&&typeof c.as=="string"?c.as:"script",x='link[rel="modulepreload"][as="'+li(g)+'"][href="'+li(s)+'"]',N=x;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Pc(s)}if(!gi.has(N)&&(s=m({rel:"modulepreload",href:s},c),gi.set(N,s),h.querySelector(x)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Hd(N)))return}g=h.createElement("link"),Wn(g,"link",s),un(g),h.head.appendChild(g)}}}function ZF(s,c,h){Ja.S(s,c,h);var g=zc;if(g&&s){var x=ks(g).hoistableStyles,N=Tc(s);c=c||"default";var E=x.get(N);if(!E){var M={loading:0,preload:null};if(E=g.querySelector(Fd(N)))M.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":c},h),(h=gi.get(N))&&ib(s,h);var K=E=g.createElement("link");un(K),Wn(K,"link",s),K._p=new Promise(function(ie,ge){K.onload=ie,K.onerror=ge}),K.addEventListener("load",function(){M.loading|=1}),K.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Fp(E,c,g)}E={type:"stylesheet",instance:E,count:1,state:M},x.set(N,E)}}}function YF(s,c){Ja.X(s,c);var h=zc;if(h&&s){var g=ks(h).hoistableScripts,x=Pc(s),N=g.get(x);N||(N=h.querySelector(Hd(x)),N||(s=m({src:s,async:!0},c),(c=gi.get(x))&&ab(s,c),N=h.createElement("script"),un(N),Wn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(x,N))}}function WF(s,c){Ja.M(s,c);var h=zc;if(h&&s){var g=ks(h).hoistableScripts,x=Pc(s),N=g.get(x);N||(N=h.querySelector(Hd(x)),N||(s=m({src:s,async:!0,type:"module"},c),(c=gi.get(x))&&ab(s,c),N=h.createElement("script"),un(N),Wn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(x,N))}}function rO(s,c,h,g){var x=(x=ne.current)?qp(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Tc(h.href),h=ks(x).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=Tc(h.href);var N=ks(x).hoistableStyles,E=N.get(s);if(E||(x=x.ownerDocument||x,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,E),(N=x.querySelector(Fd(s)))&&!N._p&&(E.instance=N,E.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||XF(x,s,h,E.state))),c&&g===null)throw Error(r(528,""));return E}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=Pc(h),h=ks(x).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 Tc(s){return'href="'+li(s)+'"'}function Fd(s){return'link[rel="stylesheet"]['+s+"]"}function iO(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function XF(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}),Wn(c,"link",h),un(c),s.head.appendChild(c))}function Pc(s){return'[src="'+li(s)+'"]'}function Hd(s){return"script[async]"+s}function aO(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,un(g),g;var x=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),un(g),Wn(g,"style",x),Fp(g,h.precedence,s),c.instance=g;case"stylesheet":x=Tc(h.href);var N=s.querySelector(Fd(x));if(N)return c.state.loading|=4,c.instance=N,un(N),N;g=iO(h),(x=gi.get(x))&&ib(g,x),N=(s.ownerDocument||s).createElement("link"),un(N);var E=N;return E._p=new Promise(function(M,K){E.onload=M,E.onerror=K}),Wn(N,"link",g),c.state.loading|=4,Fp(N,h.precedence,s),c.instance=N;case"script":return N=Pc(h.src),(x=s.querySelector(Hd(N)))?(c.instance=x,un(x),x):(g=h,(x=gi.get(N))&&(g=m({},h),ab(g,x)),s=s.ownerDocument||s,x=s.createElement("script"),un(x),Wn(x,"link",g),s.head.appendChild(x),c.instance=x);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,Fp(g,h.precedence,s));return c.instance}function Fp(s,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=g.length?g[g.length-1]:null,N=x,E=0;E<g.length;E++){var M=g[E];if(M.dataset.precedence===c)N=M;else if(N!==x)break}N?N.parentNode.insertBefore(s,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(s,c.firstChild))}function ib(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function ab(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Hp=null;function sO(s,c,h){if(Hp===null){var g=new Map,x=Hp=new Map;x.set(h,g)}else x=Hp,g=x.get(h),g||(g=new Map,x.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),x=0;x<h.length;x++){var N=h[x];if(!(N[Po]||N[tt]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var E=N.getAttribute(c)||"";E=s+E;var M=g.get(E);M?M.push(N):g.set(E,[N])}}return g}function oO(s,c,h){s=s.ownerDocument||s,s.head.insertBefore(h,c==="title"?s.querySelector("head > title"):null)}function JF(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 lO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function e9(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 x=Tc(g.href),N=c.querySelector(Fd(x));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Kp.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=N,un(N);return}N=c.ownerDocument||c,g=iO(g),(x=gi.get(x))&&ib(g,x),N=N.createElement("link"),un(N);var E=N;E._p=new Promise(function(M,K){E.onload=M,E.onerror=K}),Wn(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=Kp.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var sb=0;function t9(s,c){return s.stylesheets&&s.count===0&&Vp(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Vp(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+c);0<s.imgBytes&&sb===0&&(sb=62500*DF());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Vp(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>sb?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(x)}}:null}function Kp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Gp=null;function Vp(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Gp=new Map,c.forEach(n9,s),Gp=null,Kp.call(s))}function n9(s,c){if(!(c.state.loading&4)){var h=Gp.get(s);if(h)var g=h.get(null);else{h=new Map,Gp.set(s,h);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<x.length;N++){var E=x[N];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(h.set(E.dataset.precedence,E),g=E)}g&&h.set(null,g)}x=c.instance,E=x.getAttribute("data-precedence"),N=h.get(E)||g,N===g&&h.set(null,x),h.set(E,x),this.count++,g=Kp.bind(this),x.addEventListener("load",g),x.addEventListener("error",g),N?N.parentNode.insertBefore(x,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),c.state.loading|=4}}var Kd={$$typeof:_,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function r9(s,c,h,g,x,N,E,M,K){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ws(0),this.hiddenUpdates=ws(null),this.identifierPrefix=g,this.onUncaughtError=x,this.onCaughtError=N,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function cO(s,c,h,g,x,N,E,M,K,ie,ge,be){return s=new r9(s,c,h,E,K,ie,ge,be,M),c=1,N===!0&&(c|=24),N=qr(3,null,null,c),s.current=N,N.stateNode=s,c=$0(),c.refCount++,s.pooledCache=c,c.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:c},F0(N),s}function uO(s){return s?(s=uc,s):uc}function dO(s,c,h,g,x,N){x=uO(x),g.context===null?g.context=x:g.pendingContext=x,g=Ts(c),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ps(s,g,c),h!==null&&(Or(h,s,c),jd(h,s,c))}function fO(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<c?h:c}}function ob(s,c){fO(s,c),(s=s.alternate)&&fO(s,c)}function hO(s){if(s.tag===13||s.tag===31){var c=$o(s,67108864);c!==null&&Or(c,s,67108864),ob(s,67108864)}}function pO(s){if(s.tag===13||s.tag===31){var c=Vr();c=ad(c);var h=$o(s,c);h!==null&&Or(h,s,c),ob(s,c)}}var Qp=!0;function i9(s,c,h,g){var x=H.T;H.T=null;var N=ee.p;try{ee.p=2,lb(s,c,h,g)}finally{ee.p=N,H.T=x}}function a9(s,c,h,g){var x=H.T;H.T=null;var N=ee.p;try{ee.p=8,lb(s,c,h,g)}finally{ee.p=N,H.T=x}}function lb(s,c,h,g){if(Qp){var x=cb(g);if(x===null)Qx(s,c,g,Zp,h),gO(s,g);else if(o9(x,s,c,h,g))g.stopPropagation();else if(gO(s,g),c&4&&-1<s9.indexOf(s)){for(;x!==null;){var N=Ii(x);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var E=bn(N.pendingLanes);if(E!==0){var M=N;for(M.pendingLanes|=2,M.entangledLanes|=2;E;){var K=1<<31-fe(E);M.entanglements[1]|=K,E&=~K}la(N),(At&6)===0&&(zp=ft()+500,$d(0))}}break;case 31:case 13:M=$o(N,2),M!==null&&Or(M,N,2),Pp(),ob(N,2)}if(N=cb(g),N===null&&Qx(s,c,g,Zp,h),N===x)break;x=N}x!==null&&g.stopPropagation()}else Qx(s,c,g,null,h)}}function cb(s){return s=d0(s),ub(s)}var Zp=null;function ub(s){if(Zp=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 Zp=s,null}function mO(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(Je()){case ue:return 2;case Ne:return 8;case De:case Ke:return 32;case dt:return 268435456;default:return 32}default:return 32}}var db=!1,Hs=null,Ks=null,Gs=null,Gd=new Map,Vd=new Map,Vs=[],s9="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 gO(s,c){switch(s){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Ks=null;break;case"mouseover":case"mouseout":Gs=null;break;case"pointerover":case"pointerout":Gd.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vd.delete(c.pointerId)}}function Qd(s,c,h,g,x,N){return s===null||s.nativeEvent!==N?(s={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[x]},c!==null&&(c=Ii(c),c!==null&&hO(c)),s):(s.eventSystemFlags|=g,c=s.targetContainers,x!==null&&c.indexOf(x)===-1&&c.push(x),s)}function o9(s,c,h,g,x){switch(c){case"focusin":return Hs=Qd(Hs,s,c,h,g,x),!0;case"dragenter":return Ks=Qd(Ks,s,c,h,g,x),!0;case"mouseover":return Gs=Qd(Gs,s,c,h,g,x),!0;case"pointerover":var N=x.pointerId;return Gd.set(N,Qd(Gd.get(N)||null,s,c,h,g,x)),!0;case"gotpointercapture":return N=x.pointerId,Vd.set(N,Qd(Vd.get(N)||null,s,c,h,g,x)),!0}return!1}function yO(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,Q(s.priority,function(){pO(h)});return}}else if(c===31){if(c=u(h),c!==null){s.blockedOn=c,Q(s.priority,function(){pO(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 Yp(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var h=cb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);u0=g,h.target.dispatchEvent(g),u0=null}else return c=Ii(h),c!==null&&hO(c),s.blockedOn=h,!1;c.shift()}return!0}function vO(s,c,h){Yp(s)&&h.delete(c)}function l9(){db=!1,Hs!==null&&Yp(Hs)&&(Hs=null),Ks!==null&&Yp(Ks)&&(Ks=null),Gs!==null&&Yp(Gs)&&(Gs=null),Gd.forEach(vO),Vd.forEach(vO)}function Wp(s,c){s.blockedOn===c&&(s.blockedOn=null,db||(db=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l9)))}var Xp=null;function xO(s){Xp!==s&&(Xp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Xp===s&&(Xp=null);for(var c=0;c<s.length;c+=3){var h=s[c],g=s[c+1],x=s[c+2];if(typeof g!="function"){if(ub(g||h)===null)continue;break}var N=Ii(h);N!==null&&(s.splice(c,3),c-=3,cx(N,{pending:!0,data:x,method:h.method,action:g},g,x))}}))}function Rc(s){function c(K){return Wp(K,s)}Hs!==null&&Wp(Hs,s),Ks!==null&&Wp(Ks,s),Gs!==null&&Wp(Gs,s),Gd.forEach(c),Vd.forEach(c);for(var h=0;h<Vs.length;h++){var g=Vs[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Vs.length&&(h=Vs[0],h.blockedOn===null);)yO(h),h.blockedOn===null&&Vs.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var x=h[g],N=h[g+1],E=x[wt]||null;if(typeof N=="function")E||xO(h);else if(E){var M=null;if(N&&N.hasAttribute("formAction")){if(x=N,E=N[wt]||null)M=E.formAction;else if(ub(x)!==null)continue}else M=E.action;typeof M=="function"?h[g+1]=M:(h.splice(g,3),g-=3),xO(h)}}}function bO(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(E){return x=E})},focusReset:"manual",scroll:"manual"})}function c(){x!==null&&(x(),x=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,x=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),x!==null&&(x(),x=null)}}}function fb(s){this._internalRoot=s}Jp.prototype.render=fb.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,g=Vr();dO(h,g,s,c,null,null)},Jp.prototype.unmount=fb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;dO(s.current,2,null,s,null,null),Pp(),c[wn]=null}};function Jp(s){this._internalRoot=s}Jp.prototype.unstable_scheduleHydration=function(s){if(s){var c=od();s={blockedOn:null,target:s,priority:c};for(var h=0;h<Vs.length&&c!==0&&c<Vs[h].priority;h++);Vs.splice(h,0,s),h===0&&yO(s)}};var wO=t.version;if(wO!=="19.2.4")throw Error(r(527,wO,"19.2.4"));ee.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 c9={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var em=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!em.isDisabled&&em.supportsFiber)try{cn=em.inject(c9),Ze=em}catch{}}return Yd.createRoot=function(s,c){if(!i(s))throw Error(r(299));var h=!1,g="",x=AA,N=EA,E=OA;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=cO(s,1,!1,null,null,h,g,null,x,N,E,bO),s[wn]=c.current,Vx(s),new fb(c)},Yd.hydrateRoot=function(s,c,h){if(!i(s))throw Error(r(299));var g=!1,x="",N=AA,E=EA,M=OA,K=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(E=h.onCaughtError),h.onRecoverableError!==void 0&&(M=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=cO(s,1,!0,c,h??null,g,x,K,N,E,M,bO),c.context=uO(null),h=c.current,g=Vr(),g=ad(g),x=Ts(g),x.callback=null,Ps(h,x,g),h=g,c.current.lanes=h,Ss(c,h),la(c),s[wn]=c.current,Vx(s),new Jp(c)},Yd.version="19.2.4",Yd}var zO;function x9(){if(zO)return mb.exports;zO=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(),mb.exports=v9(),mb.exports}var b9=x9(),Hl=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(){}},w9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},S9=class{#t=w9;#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)}},ul=new S9;function j9(e){setTimeout(e,0)}var Al=typeof window>"u"||"Deno"in globalThis;function cr(){}function N9(e,t){return typeof e=="function"?e(t):e}function BS(e){return typeof e=="number"&&e>=0&&e!==1/0}function dI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uo(e,t){return typeof e=="function"?e(t):e}function wi(e,t){return typeof e=="function"?e(t):e}function TO(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==Pj(o,t.options))return!1}else if(!If(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 PO(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(El(t.options.mutationKey)!==El(a))return!1}else if(!If(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Pj(e,t){return(t?.queryKeyHashFn||El)(e)}function El(e){return JSON.stringify(e,(t,n)=>US(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function If(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>If(e[n],t[n])):!1}var k9=Object.prototype.hasOwnProperty;function Rj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=RO(e)&&RO(t);if(!r&&!(US(e)&&US(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:k9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const S=Rj(y,v,n+1);d[m]=S,S===y&&f++}return a===u&&f===a?e:d}function Lf(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 RO(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function US(e){if(!DO(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!DO(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function DO(e){return Object.prototype.toString.call(e)==="[object Object]"}function C9(e){return new Promise(t=>{ul.setTimeout(t,e)})}function qS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Rj(e,t):t}function _9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function A9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Dj=Symbol();function fI(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Dj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Mj(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 O9=class extends Hl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Al&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Ij=new O9;function FS(){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 z9=j9;function T9(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=z9;const a=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var yn=T9(),P9=class extends Hl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Al&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},dg=new P9;function R9(e){return Math.min(1e3*2**e,3e4)}function hI(e){return(e??"online")==="online"?dg.isOnline():!0}var HS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function pI(e){let t=!1,n=0,r;const i=FS(),a=()=>i.status!=="pending",o=w=>{if(!a()){const j=new HS(w);y(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ij.isFocused()&&(e.networkMode==="always"||dg.isOnline())&&e.canRun(),p=()=>hI(e.networkMode)&&e.canRun(),m=w=>{a()||(r?.(),i.resolve(w))},y=w=>{a()||(r?.(),i.reject(w))},v=()=>new Promise(w=>{r=j=>{(a()||f())&&w(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(k){w=Promise.reject(k)}Promise.resolve(w).then(m).catch(k=>{if(a())return;const O=e.retry??(Al?0:3),_=e.retryDelay??R9,A=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),C9(A).then(()=>f()?void 0:v()).then(()=>{t?y(k):S()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?S():v().then(S),i)}}var mI=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),BS(this.gcTime)&&(this.#t=ul.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Al?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ul.clearTimeout(this.#t),this.#t=void 0)}},D9=class extends mI{#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=IO(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=IO(this.options);t.data!==void 0&&(this.setState(MO(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=qS(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===Dj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>uo(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:!dI(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=fI(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=pI({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof HS&&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 HS){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,...gI(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...MO(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),yn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function gI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function MO(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function IO(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 Lj=class extends Hl{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=FS(),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),LO(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return KS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return KS(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&&!Lf(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&$O(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)||uo(this.options.staleTime,this.#e)!==uo(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 I9(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=uo(this.options.staleTime,this.#e);if(Al||this.#i.isStale||!BS(e))return;const n=dI(this.#i.dataUpdatedAt,e)+1;this.#c=ul.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Al||wi(this.options.enabled,this.#e)===!1||!BS(this.#l)||this.#l===0)&&(this.#u=ul.setInterval(()=>{(this.options.refetchIntervalInBackground||Ij.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(ul.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(ul.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 R=this.hasListeners(),B=!R&&LO(e,t),F=R&&$O(e,n,t,r);(B||F)&&(p={...p,...gI(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:w}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&w==="pending"){let R;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(R=i.data,j=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(w="success",y=qS(i?.data,R,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=qS(i?.data,y,t),this.#d=y,this.#s=null}catch(R){this.#s=R}this.#s&&(v=this.#s,y=this.#d,S=Date.now(),w="error");const k=p.fetchStatus==="fetching",O=w==="pending",_=w==="error",A=O&&k,T=y!==void 0,z={status:w,fetchStatus:p.fetchStatus,isPending:O,isSuccess:w==="success",isError:_,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:S,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:$j(e,t),refetch:this.refetch,promise:this.#o,isEnabled:wi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=z.data!==void 0,B=z.status==="error"&&!R,F=V=>{B?V.reject(z.error):R&&V.resolve(z.data)},q=()=>{const V=this.#o=z.promise=FS();F(V)},$=this.#o;switch($.status){case"pending":e.queryHash===n.queryHash&&F($);break;case"fulfilled":(B||z.data!==$.value)&&q();break;case"rejected":(!B||z.error!==$.reason)&&q();break}}return z}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),Lf(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){yn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function M9(e,t){return wi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function LO(e,t){return M9(e,t)||e.state.data!==void 0&&KS(e,t,t.refetchOnMount)}function KS(e,t,n){if(wi(t.enabled,e)!==!1&&uo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$j(e,t)}return!1}function $O(e,t,n,r){return(e!==t||wi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$j(e,n)}function $j(e,t){return wi(t.enabled,e)!==!1&&e.isStaleByTime(uo(t.staleTime,e))}function I9(e,t){return!Lf(e.getCurrentResult(),t)}function BO(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=S=>{E9(S,()=>t.signal,()=>p=!0)},y=fI(t.options,t.fetchOptions),v=async(S,w,j)=>{if(p)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const O=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:w,direction:j?"backward":"forward",meta:t.options.meta};return m(C),C})(),_=await y(O),{maxPages:A}=t.options,T=j?A9:_9;return{pages:T(S.pages,_,A),pageParams:T(S.pageParams,w,A)}};if(i&&a.length){const S=i==="backward",w=S?L9:UO,j={pages:a,pageParams:o},k=w(r,j);u=await v(j,k,S)}else{const S=e??a.length;do{const w=d===0?o[0]??r.initialPageParam:UO(r,u);if(d>0&&w==null)break;u=await v(u,w),d++}while(d<S)}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 UO(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 L9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $9=class extends mI{#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||yI(),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=pI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function yI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vI=class extends Hl{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 $9({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=tm(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=tm(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=tm(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=tm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>PO(t,n))}findAll(e={}){return this.getAll().filter(t=>PO(e,t))}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yn.batch(()=>Promise.all(e.map(t=>t.continue().catch(cr))))}};function tm(e){return e.options.scope?.id}var B9=class extends Hl{#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),Lf(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&El(n.mutationKey)!==El(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??yI();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){yn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function qO(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function U9(e,t,n){const r=e.slice(0);return r[t]=n,r}var q9=class extends Hl{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,yn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=o||u,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!Lf(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(qO(n,i).forEach(p=>{p.destroy()}),qO(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=Rj(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 Lj(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=U9(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&yn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},F9=class extends Hl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??Pj(r,t);let a=this.get(i);return a||(a=new D9({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>TO(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>TO(e,n)):t}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},H9=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new F9,this.#e=e.mutationCache||new vI,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ij.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=dg.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(uo(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=N9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return yn.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(cr).catch(cr)}invalidateQueries(e,t={}){return yn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=yn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(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(uo(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=BO(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cr).catch(cr)}ensureInfiniteQueryData(e){return e.behavior=BO(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return dg.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(El(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{If(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(El(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{If(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=Pj(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===Dj&&(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()}},xI=b.createContext(void 0),ni=e=>{const t=b.useContext(xI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},K9=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(xI.Provider,{value:e,children:t})),bI=b.createContext(!1),wI=()=>b.useContext(bI);bI.Provider;function G9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V9=b.createContext(G9()),SI=()=>b.useContext(V9),jI=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Mj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},NI=e=>{b.useEffect(()=>{e.clearReset()},[e])},kI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Mj(n,[e.error,r])),CI=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))}},Q9=(e,t)=>e.isLoading&&e.isFetching&&!t,GS=(e,t)=>e?.suspense&&t.isPending,VS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Z9({queries:e,...t},n){const r=ni(),i=wI(),a=SI(),o=b.useMemo(()=>e.map(w=>{const j=r.defaultQueryOptions(w);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(w=>{CI(w);const j=r.getQueryCache().get(w.queryHash);jI(w,a,j)}),NI(a);const[u]=b.useState(()=>new q9(r,o,t)),[d,f,p]=u.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(w=>m?u.subscribe(yn.batchCalls(w)):cr,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const v=d.some((w,j)=>GS(o[j],w))?d.flatMap((w,j)=>{const k=o[j];if(k&&GS(k,w)){const O=new Lj(r,k);return VS(k,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const S=d.find((w,j)=>{const k=o[j];return k&&kI({result:w,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(S?.error)throw S.error;return f(p())}function Y9(e,t,n){const r=wI(),i=SI(),a=ni(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",CI(o),jI(o,i,u),NI(i);const d=!a.getQueryCache().get(o.queryHash),[f]=b.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(y=>{const v=m?f.subscribe(yn.batchCalls(y)):cr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(o)},[o,f]),GS(o,p))throw VS(o,f,i);if(kI({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Al&&Q9(p,r)&&(d?VS(o,f,i):u?.promise)?.catch(cr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function Yi(e,t){return Y9(e,Lj)}function fh(e,t){const n=ni(),[r]=b.useState(()=>new B9(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(yn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((o,u)=>{r.mutate(o,u).catch(cr)},[r]);if(i.error&&Mj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var nm=typeof window<"u"?b.useLayoutEffect:b.useEffect;function xb(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function W9(e,t,n={},r={}){b.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function X9(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}var J9=!1;function $f(e){return e[e.length-1]}function eH(e){return typeof e=="function"}function so(e,t){return eH(e)?e(t):e}var tH=Object.prototype.hasOwnProperty,FO=Object.prototype.propertyIsEnumerable,nH=()=>Object.create(null),Xo=(e,t)=>dl(e,t,nH);function dl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=GO(e)&&GO(i);if(!a&&!(fg(e)&&fg(i)))return i;const o=a?e:HO(e);if(!o)return i;const u=a?i:HO(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],S=e[v],w=i[v];if(S===w){p[v]=S,(a?y<d:tH.call(e,v))&&m++;continue}if(S===null||w===null||typeof S!="object"||typeof w!="object"){p[v]=w;continue}const j=dl(S,w,n,r+1);p[v]=j,j===S&&m++}return d===f&&m===d?e:p}function HO(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!FO.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(!FO.call(e,i))return!1;r.push(i)}return r}function fg(e){if(!KO(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!KO(n)||!n.hasOwnProperty("isPrototypeOf"))}function KO(e){return Object.prototype.toString.call(e)==="[object Object]"}function GO(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xl(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!xl(e[r],t[r],n))return!1;return!0}if(fg(e)&&fg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!xl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!xl(e[o],t[o],n)))return!1;return i===a}return!1}function Su(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 Bf(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function rH(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function VO(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 rH(t)}var iH=["http:","https:","mailto:","tel:"];function hg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wd(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+=VO(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+VO(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function aH(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function pg(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 sH="Invariant failed";function vo(e,t){if(!e)throw new Error(sH)}var fl=4,_I=5;function oH(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 Bj(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=oH(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 Ry(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=Bj(d,u,t);let S;const w=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)S=O;else{i.static??=new Map;const _=hl(n.fullPath??n.from);_.parent=i,_.depth=a,S=_,i.static.set(k,_)}}else{const O=k.toLowerCase(),_=i.staticInsensitive?.get(O);if(_)S=_;else{i.staticInsensitive??=new Map;const A=hl(n.fullPath??n.from);A.parent=i,A.depth=a,S=A,i.staticInsensitive.set(O,A)}}break}case 1:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),A=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,C=!m&&i.dynamic?.find(z=>!z.skipOnParamError&&z.caseSensitive===_&&z.prefix===A&&z.suffix===T);if(C)S=C;else{const z=wb(1,n.fullPath??n.from,_,A,T);S=z,z.depth=a,z.parent=i,i.dynamic??=[],i.dynamic.push(z)}break}case 3:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),A=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,C=!m&&i.optional?.find(z=>!z.skipOnParamError&&z.caseSensitive===_&&z.prefix===A&&z.suffix===T);if(C)S=C;else{const z=wb(3,n.fullPath??n.from,_,A,T);S=z,z.parent=i,z.depth=a,i.optional??=[],i.optional.push(z)}break}case 2:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),A=k?_?k:k.toLowerCase():void 0,T=O?_?O:O.toLowerCase():void 0,C=wb(2,n.fullPath??n.from,_,A,T);S=C,C.parent=i,C.depth=a,i.wildcard??=[],i.wildcard.push(C)}}i=S}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=hl(n.fullPath??n.from);v.kind=_I,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=hl(n.fullPath??n.from);v.kind=fl,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)Ry(e,t,d,u,i,a,o)}function bb(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 eo(e){if(e.pathless)for(const t of e.pathless)eo(t);if(e.static)for(const t of e.static.values())eo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())eo(t);if(e.dynamic?.length){e.dynamic.sort(bb);for(const t of e.dynamic)eo(t)}if(e.optional?.length){e.optional.sort(bb);for(const t of e.optional)eo(t)}if(e.wildcard?.length){e.wildcard.sort(bb);for(const t of e.wildcard)eo(t)}}function hl(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 wb(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 lH(e,t){const n=hl("/"),r=new Uint16Array(6);for(const i of e)Ry(!1,r,i,1,n,0);eo(n),t.masksTree=n,t.flatCache=pg(1e3)}function cH(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Uj(e,t.masksTree);return t.flatCache.set(e,r),r}function uH(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=hl("/"),Ry(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Uj(r,o,n)}function dH(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=Uj(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=pH(a.route)),t.matchCache.set(r,a),a}function fH(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function hH(e,t=!1,n){const r=hl(e.fullPath),i=new Uint16Array(6),a={},o={};let u=0;return Ry(t,i,e,1,r,0,d=>{if(n?.(d,u),vo(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=fH(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}u++}),eo(r),{processedTree:{segmentTree:r,singleCache:pg(1e3),matchCache:pg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Uj(e,t,n=!1){const r=e.split("/"),i=gH(e,r,t,n);if(!i)return null;const[a]=AI(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function AI(e,t,n){const r=mH(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===fl)break;if(p.kind===_I){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],S=p.prefix?.length??0;if(v.charCodeAt(S)===123){const w=p.suffix?.length??0,j=v.substring(S+2,v.length-w-1),k=m.substring(S,m.length-w);a[j]=decodeURIComponent(k)}else{const w=v.substring(1);a[w]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],S=p.prefix?.length??0,w=p.suffix?.length??0,j=v.substring(S+3,v.length-w-1),k=p.suffix||p.prefix?m.substring(S,m.length-w):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,S=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),w=decodeURIComponent(S);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:u,path:d,segment:f}]}function pH(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mH(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function gH(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!$f(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:S,depth:w,statics:j,dynamics:k,optionals:O}=m;let{extract:_,rawParams:A,parsedParams:T}=m;if(y.skipOnParamError){if(!Sb(e,t,m))continue;A=m.rawParams,_=m.extract,T=m.parsedParams}r&&y.route&&y.kind!==fl&&Xd(f,m)&&(f=m);const C=v===o;if(C&&(y.route&&!a&&Xd(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const z=C?void 0:t[v];let R;if(C&&y.index){const B={node:y.index,index:v,skipped:S,depth:w+1,statics:j,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T};let F=!0;if(y.index.skipOnParamError&&(Sb(e,t,B)||(F=!1)),F){if(j===o&&!k&&!O&&!S)return B;Xd(p,B)&&(p=B)}}if(y.wildcard&&Xd(d,m))for(const B of y.wildcard){const{prefix:F,suffix:q}=B;if(F&&(C||!(B.caseSensitive?z:R??=z.toLowerCase()).startsWith(F)))continue;if(q){if(C)continue;const V=t.slice(v).join("/").slice(-q.length);if((B.caseSensitive?V:V.toLowerCase())!==q)continue}const $={node:B,index:o,skipped:S,depth:w,statics:j,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T};if(!(B.skipOnParamError&&!Sb(e,t,$))){d=$;break}}if(y.optional){const B=S|1<<w,F=w+1;for(let q=y.optional.length-1;q>=0;q--){const $=y.optional[q];u.push({node:$,index:v,skipped:B,depth:F,statics:j,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T})}if(!C)for(let q=y.optional.length-1;q>=0;q--){const $=y.optional[q],{prefix:V,suffix:te}=$;if(V||te){const W=$.caseSensitive?z:R??=z.toLowerCase();if(V&&!W.startsWith(V)||te&&!W.endsWith(te))continue}u.push({node:$,index:v+1,skipped:S,depth:F,statics:j,dynamics:k,optionals:O+1,extract:_,rawParams:A,parsedParams:T})}}if(!C&&y.dynamic&&z)for(let B=y.dynamic.length-1;B>=0;B--){const F=y.dynamic[B],{prefix:q,suffix:$}=F;if(q||$){const V=F.caseSensitive?z:R??=z.toLowerCase();if(q&&!V.startsWith(q)||$&&!V.endsWith($))continue}u.push({node:F,index:v+1,skipped:S,depth:w+1,statics:j,dynamics:k+1,optionals:O,extract:_,rawParams:A,parsedParams:T})}if(!C&&y.staticInsensitive){const B=y.staticInsensitive.get(R??=z.toLowerCase());B&&u.push({node:B,index:v+1,skipped:S,depth:w+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T})}if(!C&&y.static){const B=y.static.get(z);B&&u.push({node:B,index:v+1,skipped:S,depth:w+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T})}if(y.pathless){const B=w+1;for(let F=y.pathless.length-1;F>=0;F--){const q=y.pathless[F];u.push({node:q,index:v,skipped:S,depth:B,statics:j,dynamics:k,optionals:O,extract:_,rawParams:A,parsedParams:T})}}}if(p&&d)return Xd(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 Sb(e,t,n){try{const[r,i]=AI(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 Xd(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===fl)>(e.node.kind===fl)||t.node.kind===fl==(e.node.kind===fl)&&t.depth>e.depth))):!0}function Vm(e){return qj(e.filter(t=>t!==void 0).join("/"))}function qj(e){return e.replace(/\/{2,}/g,"/")}function EI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function fo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function OI(e){return fo(EI(e))}function mg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function yH(e,t,n){return mg(e,n)===mg(t,n)}function vH({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&&$f(u)==="";)u.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const S=m[y];S===""?y?y===v-1&&u.push(S):u=[S]:S===".."?u.pop():S==="."||u.push(S)}}u.length>1&&($f(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=Bj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const S=d[5],w=y.substring(0,d[1]),j=y.substring(d[4],S),k=y.substring(d[2],d[3]);v===1?f+=w||j?`${w}{$${k}}${j}`:`$${k}`:v===2?f+=w||j?`${w}{$}${j}`:"$":f+=`${w}{-$${k}}${j}`}f=qj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function xH(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 jb(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=>ZO(i,n)).join("/"):ZO(r,n)}function QO({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=Bj(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 S=e.substring(p,d[1]),w=e.substring(d[4],m);if(!v){i=!0,(S||w)&&(f+="/"+S+w);continue}const j=jb("_splat",t,n);f+="/"+S+j+w;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const S=e.substring(p,d[1]),w=e.substring(d[4],m),j=jb(v,t,n)??"undefined";f+="/"+S+j+w;continue}if(y===3){const v=e.substring(d[2],d[3]),S=t[v];if(S==null)continue;a[v]=S;const w=e.substring(p,d[1]),j=e.substring(d[4],m),k=jb(v,t,n)??"";f+="/"+w+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function ZO(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function xr(e){return!!e?.isNotFound}function bH(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var QS="tsr-scroll-restoration-v1_3",wH=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function SH(){const e=bH();if(!e)return null;const t=e.getItem(QS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=so(r,n)||n;try{e.setItem(QS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var rm=SH(),jH=e=>e.state.__TSR_key||e.href;function NH(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 gg=!1;function kH({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];gg=!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)}}gg=!1}function CH(e,t){if(!rm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!rm))return;e.isScrollRestorationSetup=!0,gg=!1;const n=e.options.getScrollRestorationKey||jH;window.history.scrollRestoration="manual";const r=i=>{if(gg||!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=NH(i.target)}const o=n(e.state.location);rm.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",wH(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})||(kH({storageKey:QS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&rm.set(o=>(o[a]||={},o)))})}function _H(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 AH(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 Nb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function EH(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]=Nb(i):Array.isArray(a)?a.push(Nb(i)):n[r]=[a,Nb(i)]}return n}var OH=TH(JSON.parse),zH=PH(JSON.stringify,JSON.parse);function TH(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=EH(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function PH(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=AH(i,r);return a?`?${a}`:""}}var bl="__root__";function Fj(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 Tr(e){return e instanceof Response&&!!e.options}function RH(e){return{input:({url:t})=>{for(const n of e)t=ZS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=zI(e[n],t);return t}}}function DH(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=Vm(["/",t,o.pathname]),o)}}function ZS(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 zI(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 rn=(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))(rn||{});function TI({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 S=f.subsTail;if(S!==void 0&&S.version===m&&S.sub===p)return;const w=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:S,nextSub:void 0};v!==void 0&&(v.prevDep=w),y!==void 0?y.nextDep=w:p.deps=w,S!==void 0?S.nextSub=w:f.subs=w}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,S=f.nextSub,w=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,S!==void 0?S.prevSub=w:m.subsTail=w,w!==void 0?w.nextSub=S:(m.subs=S)===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 S=y.subs;if(S!==void 0){const w=(f=S).nextSub;w!==void 0&&(m={value:p,prev:m},p=w);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const S=f.dep,w=S.flags;if(p.flags&16)v=!0;else if((w&17)===17){if(e(S)){const j=S.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((w&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=S.deps,p=S,++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 Hj=0,Jo=0,Cf=0;const ns=[],{link:KCe,unlink:PI,propagate:GCe,checkDirty:MH,shallowPropagate:VCe}=TI({update(e){return e.depsTail!==void 0?BH(e):UH(e)},notify(e){let t=Cf,n=t;do if(ns[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Cf=t;n<--t;){const r=ns[n];ns[n++]=ns[t],ns[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Dy(e)):HH.call(e)}});function IH(){return Hj}function LH(){++Hj}function $H(){--Hj||FH()}function BH(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Dy(e)}}function UH(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function qH(e){const t=e.flags;if(t&16||t&32&&MH(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Dy(e)}}else e.flags=2}function FH(){try{for(;Jo<Cf;){const e=ns[Jo];ns[Jo++]=void 0,qH(e)}}finally{for(;Jo<Cf;){const e=ns[Jo];ns[Jo++]=void 0,e.flags|=10}Jo=0,Cf=0}}function HH(){this.depsTail=void 0,this.flags=0,Dy(this);const e=this.subs;e!==void 0&&PI(e)}function Dy(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=PI(n,e)}function Kj(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const YS=[];let Qm=0;const{link:YO,unlink:KH,propagate:GH,checkDirty:RI,shallowPropagate:WO}=TI({update(e){return e._update()},notify(e){YS[WS++]=e,e.flags&=~rn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=rn.Mutable|rn.Dirty,yg(e))}});let im=0,WS=0,pa;function yg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=KH(n,e)}function DI(){if(!(IH()>0)){for(;im<WS;){const e=YS[im];YS[im++]=void 0,e.notify()}im=0,WS=0}}function MI(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?rn.None:rn.Mutable,get(){return pa!==void 0&&YO(i,pa,Qm),i._snapshot},subscribe(a){const o=Kj(a),u={current:!1},d=VH(()=>{i.get(),u.current?o.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=pa,u=Object.is;if(n)pa=i,++Qm,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=rn.Mutable|rn.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{pa=o,n&&(i.flags&=~rn.RecursedCheck),yg(i)}}};return n?(i.flags=rn.Mutable|rn.Dirty,i.get=function(){const a=i.flags;if(a&rn.Dirty||a&rn.Pending&&RI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&WO(o)}}else a&rn.Pending&&(i.flags=a&~rn.Pending);return pa!==void 0&&YO(i,pa,Qm),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(GH(o),WO(o),DI())}},i}function VH(e){const t=()=>{const r=pa;pa=n,++Qm,n.depsTail=void 0,n.flags=rn.Watching|rn.RecursedCheck;try{return e()}finally{pa=r,n.flags&=~rn.RecursedCheck,yg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:rn.Watching|rn.RecursedCheck,notify(){const r=this.flags;r&rn.Dirty||r&rn.Pending&&RI(this.deps,this)?t():this.flags=rn.Watching},stop(){this.flags=rn.None,this.depsTail=void 0,yg(this)}};return t(),n}class QH{constructor(t){this.atom=MI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Kj(t))}}class ZH{constructor(t){this.atom=MI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Kj(t))}}function YH(e){return typeof e=="function"?new ZH(e):new QH(e)}function WH(e){try{LH(),e()}finally{$H(),DI()}}function _f(e){let t;return WH(()=>{t=e()}),t}var XS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},My=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),wl=(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},XO=(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},oo=(e,t,n)=>{if(!(!Tr(n)&&!xr(n)))throw Tr(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:Tr(n)?"redirected":r.status==="pending"?"success":r.status,context:wl(e,t.index),isFetching:!1,error:n})),xr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Tr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},II=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},JO=(e,t,n)=>{const r=wl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Jd=(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,oo(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(u){n=u,oo(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&&!Tr(n)&&!xr(n)&&(e.serialError??=n)},LI=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!My(e,t)&&(n.options.loader||n.options.beforeLoad||BI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{XS(e)},i);r._nonReactive.pendingTimeout=a}},XH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;LI(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&oo(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},JH=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Su(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:u}=i;o&&Jd(e,n,o,"PARSE_PARAMS"),u&&Jd(e,n,u,"VALIDATE_SEARCH"),LI(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){_f(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Su();const y={...wl(e,n,!1),...i.__routeContext},{search:v,params:S,cause:w}=i,j=My(e,t),k={search:v,abortController:d,params:S,preload:j,context:y,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=A=>{if(A===void 0){_f(()=>{p(),m()});return}(Tr(A)||xr(A))&&(p(),Jd(e,n,A,"BEFORE_LOAD")),_f(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:A})),m()})};let _;try{if(_=r.options.beforeLoad(k),Bf(_))return p(),_.catch(A=>{Jd(e,n,A,"BEFORE_LOAD")}).then(O)}catch(A){p(),Jd(e,n,A,"BEFORE_LOAD")}O(_)},e7=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),o=()=>JH(e,n,t,i),u=()=>{if(II(e,n))return;const d=XH(e,n,i);return Bf(d)?d.then(o):o()};return a()},t7=(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}))},$I=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=wl(e,r),m=My(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}},ez=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(J9??e.router.isServer)||a.ssr===!0)&&Uf(i);const o=i.options.loader,u=typeof o=="function"?o:o?.handler,d=u?.($I(e,t,n,r,i)),f=!!u&&Bf(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;oo(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:wl(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:wl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,xr(o)&&await i.options.notFoundComponent?.preload?.(),oo(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){u=f,oo(e,e.router.getMatch(n),f)}!Tr(u)&&!xr(u)&&await Uf(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:wl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),oo(e,o,a)}},n7=async(e,t,n)=>{async function r(v,S,w,j,k){const O=Date.now()-S.updatedAt,_=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,A=k.options.shouldReload,T=typeof A=="function"?A($I(e,t,i,n,k)):A,{status:C,invalid:z}=j,R=O>_&&(!!e.forceStaleReload||j.cause==="enter"||w!==void 0&&w!==j.id);o=C==="success"&&(z||(T??R)),v&&k.options.preload===!1||(o&&!e.sync&&p?(u=!0,(async()=>{try{await ez(e,t,i,n,k);const B=e.router.getMatch(i);B._nonReactive.loaderPromise?.resolve(),B._nonReactive.loadPromise?.resolve(),B._nonReactive.loaderPromise=void 0,B._nonReactive.loadPromise=void 0}catch(B){Tr(B)&&await e.router.navigate(B.options)}})()):C!=="success"||o?await ez(e,t,i,n,k):JO(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(II(e,i)){if(!e.router.getMatch(i))return e.matches[n];JO(e,i,n)}else{const v=e.router.getMatch(i),S=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,w=My(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&&oo(e,j,k),j.status==="pending"&&await r(w,v,S,j,d)}else{const j=w&&!e.router.state.matches.some(O=>O.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Su(),j!==k.preload&&e.updateMatch(i,O=>({...O,preload:j})),await r(w,v,S,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 tz(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&XS(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=e7(t,y);Bf(v)&&await v}catch(v){if(Tr(v))throw v;if(xr(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?XO(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(n7(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 S=v.reason;if(Tr(S))throw S;xr(S)?u??=S:d??=S}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=XO(t,f);vo(y!==void 0);const v=t.matches[y],S=t.router.looseRoutesById[v.routeId],w=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&w&&(S.options.notFoundComponent=w),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await Uf(S,["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 Uf(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:S}=t.matches[y],w=t.router.looseRoutesById[S];try{const j=t7(t,v,w);if(j){const k=await j;t.updateMatch(v,O=>({...O,...k}))}}catch(j){console.error(`Error executing head for route ${S}:`,j)}}const m=XS(t);if(Bf(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function nz(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Uf(e,t=Zm){!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===Zm?(()=>{if(e._componentsPromise===void 0){const r=nz(e,Zm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():nz(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function BI(e){for(const t of Zm)if(e.options[t]?.preload)return!0;return!1}var Zm=["component","errorComponent","pendingComponent","notFoundComponent"],ho="__TSR_index",rz="popstate",iz="beforeunload";function r7(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=vg(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[ho];u=az(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[ho];u=az(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[ho]!==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 az(e,t){t||(t={});const n=Gj();return{...t,key:n,__TSR_key:n,[ho]:e}}function i7(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=R=>i=R,u=(R=>R),d=(()=>vg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=Gj();t.history.replaceState({[ho]:0,key:R,__TSR_key:R},"")}let f=d(),p,m=!1,y=!1,v=!1,S=!1;const w=()=>f;let j,k;const O=()=>{j&&(z._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),z._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},_=(R,B,F)=>{const q=u(B);k||(p=f),f=vg(B,F),j={href:q,state:F,isPush:j?.isPush||R==="push"},k||(k=Promise.resolve().then(()=>O()))},A=R=>{f=d(),z.notify({type:R})},T=async()=>{if(y){y=!1;return}const R=d(),B=R.state[ho]-f.state[ho],F=B===1,q=B===-1,$=!F&&!q||m;m=!1;const V=$?"GO":q?"BACK":"FORWARD",te=$?{type:"GO",index:B}:{type:q?"BACK":"FORWARD"};if(v)v=!1;else{const W=a();if(typeof document<"u"&&W.length){for(const H of W)if(await H.blockerFn({currentLocation:f,nextLocation:R,action:V})){y=!0,t.history.go(1),z.notify(te);return}}}f=d(),z.notify(te)},C=R=>{if(S){S=!1;return}let B=!1;const F=a();if(typeof document<"u"&&F.length)for(const q of F){const $=q.enableBeforeUnload??!0;if($===!0){B=!0;break}if(typeof $=="function"&&$()===!0){B=!0;break}}if(B)return R.preventDefault(),R.returnValue=""},z=r7({getLocation:w,getLength:()=>t.history.length,pushState:(R,B)=>_("push",R,B),replaceState:(R,B)=>_("replace",R,B),back:R=>(R&&(v=!0),S=!0,t.history.back()),forward:R=>{R&&(v=!0),S=!0,t.history.forward()},go:R=>{m=!0,t.history.go(R)},createHref:R=>u(R),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(iz,C,{capture:!0}),t.removeEventListener(rz,T)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(iz,C,{capture:!0}),t.addEventListener(rz,T),t.history.pushState=function(...R){const B=n.apply(t.history,R);return z._ignoreSubscribers||A("PUSH"),B},t.history.replaceState=function(...R){const B=r.apply(t.history,R);return z._ignoreSubscribers||A("REPLACE"),B},z}function a7(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function vg(e,t){const n=a7(e),r=n.indexOf("#"),i=n.indexOf("?"),a=Gj();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||{[ho]:0,key:a,__TSR_key:a}}}function Gj(){return(Math.random()+1).toString(36).substring(7)}function Sl(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 s7(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var o7=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=xH(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=i7()),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=pg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=YH(c7(this.latestLocation)),CH(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(DH({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:RH(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=hH(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&lH(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:Wd(u).path,external:!1,searchStr:k,search:Xo(n?.search,j),hash:Wd(f.slice(1)).path,state:dl(n?.state,m)}}const y=new URL(p,this.origin),v=ZS(this.rewrite,y),S=this.options.parseSearch(v.search),w=this.options.stringifySearch(S);return v.search=w,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Wd(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:w,search:Xo(n?.search,S),hash:Wd(v.hash.slice(1)).path,state:dl(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)=>vH({base:t,to:qj(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=>u7({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,so(i.params,p)),v=this.getMatchedRoutes(m);let S=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(S=[...S,this.options.notFoundRoute]),Object.keys(y).length>0)for(const B of S){const F=B.options.params?.stringify??B.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const w=t.leaveParams?m:Wd(QO({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const B={};S.forEach(F=>{if(F.options.validateSearch)try{Object.assign(B,Ym(F.options.validateSearch,{...B,...j}))}catch{}}),j=B}j=d7({search:j,dest:i,destRoutes:S,_includeValidateSearch:t._includeValidateSearch}),j=Xo(f,j);const k=this.options.stringifySearch(j),O=i.hash===!0?a.hash:i.hash?so(i.hash,a.hash):void 0,_=O?`#${O}`:"";let A=i.state===!0?a.state:i.state?so(i.state,a.state):{};A=dl(a.state,A);const T=`${w}${k}${_}`;let C,z,R=!1;if(this.rewrite){const B=new URL(T,this.origin),F=zI(this.rewrite,B);C=B.href.replace(B.origin,""),F.origin!==this.origin?(z=F.href,R=!0):z=F.pathname+F.search+F.hash}else C=aH(T),z=C;return{publicHref:z,href:C,pathname:w,search:j,searchStr:k,state:A,hash:O??"",external:R,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=cH(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,so(m,d));a={from:t.from,...y,params:v},u=n(a)}}}return u&&(o.maskedLocation=u),o};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=xl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=fo(this.latestLocation.href)===fo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=Su(()=>{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=vg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);u.to=ZS(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(hg(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",...Sl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Sl({resolvedLocation:f,location:d})}),await tz({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=[];_f(()=>{this.__store.setState(S=>{const w=S.matches,j=S.pendingMatches||S.matches;return p=w.filter(k=>!j.some(O=>O.id===k.id)),m=w.filter(k=>!j.some(O=>O.routeId===k.routeId)),y=j.filter(k=>!w.some(O=>O.routeId===k.routeId)),v=j.filter(k=>w.some(O=>O.routeId===k.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([S,w])=>{S.forEach(j=>{this.looseRoutesById[j.routeId].options[w]?.(j)})})})})}})}catch(d){Tr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):xr(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(Sl({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:s7(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&&hg(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=Uf,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)]);_f(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,o]}))})});try{return r=await tz({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(Tr(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});xr(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=uH(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!xl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?xl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??zH,parseSearch:e.parseSearch??OH,protocolAllowlist:e.protocolAllowlist??iH}),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["**"]:fo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:u=!0);const d=u?h7(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 S,w,j;{const V=v?.search??e.search,te=v?._strictSearch??void 0;try{const W=Ym(y.options.validateSearch,{...V})??void 0;S={...V,...W},w={...te,...W},j=void 0}catch(W){let H=W;if(W instanceof xg||(H=new xg(W.message,{cause:W})),t?.throwOnError)throw H;S=V,w={},j=H}}const k=y.options.loaderDeps?.({search:S})??"",O=k?JSON.stringify(k):"",{interpolatedPath:_,usedParams:A}=QO({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=y.id+_+O,C=this.getMatch(T),z=p.get(y.id),R=C?._strictParams??A;let B;if(!C)try{sz(y,A,a,R)}catch(V){if(xr(V)||Tr(V)?B=V:B=new l7(V.message,{cause:V}),t?.throwOnError)throw B}Object.assign(i,R);const F=z?"stay":"enter";let q;if(C)q={...C,cause:F,params:z?.params??i,_strictParams:R,search:Xo(z?z.search:C.search,S),_strictSearch:w};else{const V=y.options.loader||y.options.beforeLoad||y.lazyFn||BI(y)?"pending":"success";q={id:T,ssr:y.options.ssr,index:m,routeId:y.id,params:z?.params??i,_strictParams:R,pathname:_,updatedAt:Date.now(),search:z?Xo(z.search,S):S,_strictSearch:w,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:B,__routeContext:void 0,_nonReactive:{loadPromise:Su()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:z?dl(z.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||(q.globalNotFound=d===y.id),q.searchError=j;const $=this.getParentContext(v);q.context={...$,...q.__routeContext,...q.__beforeLoadContext},f[m]=q}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],S=this.getMatch(y.id),w=p.get(y.routeId);if(y.params=w?Xo(w.params,i):i,!S){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=$f(t),a={...e.search};for(const f of t)try{Object.assign(a,Ym(f.options.validateSearch,a))}catch{}const o=$f(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{sz(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},xg=class extends Error{},l7=class extends Error{};function c7(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ym(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new xg("Async validation not supported");if(n.issues)throw new xg(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 u7({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=fo(e);let a,o;const u=dH(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 d7({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return f7(n)(e,t,r??!1)}function f7(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,...Ym(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:so(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 h7(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 bl}function sz(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 p7="Error preloading route! ☝️",UI=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=bl:this.parentRoute||vo(!1);let i=r?bl:n?.path;i&&i!=="/"&&(i=EI(i));const a=n?.id||i;let o=r?bl:Vm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=Vm(["/",o]));const u=o==="__root__"?"/":Vm([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=u,this._to=fo(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=>Fj({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.")}},m7=class extends UI{constructor(e){super(e)}};function Vj(e){const t=e.errorComponent??Qj;return l.jsx(g7,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var g7=class extends b.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function Qj({error:e}){const[t,n]=b.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 y7({children:e,fallback:t=null}){return qI()?l.jsx(Si.Fragment,{children:e}):l.jsx(Si.Fragment,{children:t})}function qI(){return Si.useSyncExternalStore(v7,()=>!0,()=>!1)}function v7(){return()=>{}}var FI=b.createContext(null);function Ti(e){const t=b.useContext(FI);return e?.warn,t}var kb={exports:{}},Cb={},_b={exports:{}},Ab={};var oz;function x7(){if(oz)return Ab;oz=1;var e=Iu();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(),S=r({inst:{value:v,getSnapshot:y}}),w=S[0].inst,j=S[1];return a(function(){w.value=v,w.getSnapshot=y,d(w)&&j({inst:w})},[m,v,y]),i(function(){return d(w)&&j({inst:w}),m(function(){d(w)&&j({inst:w})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Ab.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ab}var lz;function b7(){return lz||(lz=1,_b.exports=x7()),_b.exports}var cz;function w7(){if(cz)return Cb;cz=1;var e=Iu(),t=b7();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 Cb.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=u(function(){function k(C){if(!O){if(O=!0,_=C,C=y(C),v!==void 0&&w.hasValue){var z=w.value;if(v(z,C))return A=z}return A=C}if(z=A,r(_,C))return z;var R=y(C);return v!==void 0&&v(z,R)?(_=C,z):(_=C,A=R)}var O=!1,_,A,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,S[0],S[1]);return o(function(){w.hasValue=!0,w.value=j},[j]),d(j),j},Cb}var uz;function S7(){return uz||(uz=1,kb.exports=w7()),kb.exports}var HI=S7();function j7(e,t){return e===t}function N7(e,t,n=j7){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(o);return u},[e]),i=b.useCallback(()=>e?.get(),[e]);return HI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Dr(e){const t=Ti({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return N7(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=dl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Iy=b.createContext(void 0),k7=b.createContext(void 0);function No(e){const t=b.useContext(e.from?k7:Iy);return Dr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(vo(!((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 Zj(e){return No({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Yj(e){const{select:t,...n}=e;return No({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ly(e){return No({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 $y(e){return No({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ko(e){const t=Ti();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Wj(e){return No({...e,select:t=>e.select?e.select(t.context):t.context})}var Kl=uI();const C7=za(Kl);function _7(e,t){const n=Ti(),r=X9(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:S,children:w,target:j,disabled:k,style:O,className:_,onClick:A,onBlur:T,onFocus:C,onMouseEnter:z,onMouseLeave:R,onTouchStart:B,ignoreBlocker:F,params:q,search:$,hash:V,state:te,mask:W,reloadDocument:H,unsafeRelative:ee,from:le,_fromLocation:je,...L}=e,I=qI(),U=Dr({select:Je=>{const ue=Je.matches[Je.matches.length-1];return{search:ue?.search,hash:Je.location.hash,path:ue?.pathname}},structuralSharing:!0}),D=e.from,G=b.useMemo(()=>({...e,from:D}),[n,U,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ae=b.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=ae.maskedLocation?ae.maskedLocation.publicHref:ae.publicHref,Ce=ae.maskedLocation?ae.maskedLocation.external:ae.external,Se=b.useMemo(()=>P7(ne,Ce,n.history,k),[k,Ce,ne,n.history]),X=b.useMemo(()=>{if(Se?.external)return hg(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!R7(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),hg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Se,n.protocolAllowlist]),me=Dr({select:Je=>{if(X)return!1;if(o?.exact){if(!yH(Je.location.pathname,ae.pathname,n.basepath))return!1}else{const ue=mg(Je.location.pathname,n.basepath),Ne=mg(ae.pathname,n.basepath);if(!(ue.startsWith(Ne)&&(ue.length===Ne.length||ue[Ne.length]==="/")))return!1}return(o?.includeSearch??!0)&&!xl(Je.location.search,ae.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?I&&Je.location.hash===ae.hash:!0}}),Ee=me?so(i,{})??A7:Eb,Y=me?Eb:so(a,{})??Eb,Fe=[_,Ee.className,Y.className].filter(Boolean).join(" "),Te=(O||Ee.style||Y.style)&&{...O,...Ee.style,...Y.style},[it,Ge]=b.useState(!1),$t=b.useRef(!1),Dt=e.reloadDocument||X?!1:d??n.options.defaultPreload,tn=f??n.options.defaultPreloadDelay??0,Zt=b.useCallback(()=>{n.preloadRoute({...G,_builtLocation:ae}).catch(Je=>{console.warn(Je),console.warn(p7)})},[n,G,ae]);W9(r,b.useCallback(Je=>{Je?.isIntersecting&&Zt()},[Zt]),T7,{disabled:!!k||Dt!=="viewport"}),b.useEffect(()=>{$t.current||!k&&Dt==="render"&&(Zt(),$t.current=!0)},[k,Zt,Dt]);const we=Je=>{const ue=Je.currentTarget.getAttribute("target"),Ne=j!==void 0?j:ue;if(!k&&!D7(Je)&&!Je.defaultPrevented&&(!Ne||Ne==="_self")&&Je.button===0){Je.preventDefault(),Kl.flushSync(()=>{Ge(!0)});const De=n.subscribe("onResolved",()=>{De(),Ge(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:S,ignoreBlocker:F})}};if(X)return{...L,ref:r,href:X,...w&&{children:w},...j&&{target:j},...k&&{disabled:k},...O&&{style:O},..._&&{className:_},...A&&{onClick:A},...T&&{onBlur:T},...C&&{onFocus:C},...z&&{onMouseEnter:z},...R&&{onMouseLeave:R},...B&&{onTouchStart:B}};const Xe=Je=>{if(k||Dt!=="intent")return;if(!tn){Zt();return}const ue=Je.currentTarget;if(ef.has(ue))return;const Ne=setTimeout(()=>{ef.delete(ue),Zt()},tn);ef.set(ue,Ne)},Ot=Je=>{k||Dt!=="intent"||Zt()},ft=Je=>{if(k||!Dt||!tn)return;const ue=Je.currentTarget,Ne=ef.get(ue);Ne&&(clearTimeout(Ne),ef.delete(ue))};return{...L,...Ee,...Y,href:Se?.href,ref:r,onClick:Dc([A,we]),onBlur:Dc([T,ft]),onFocus:Dc([C,Xe]),onMouseEnter:Dc([z,Xe]),onMouseLeave:Dc([R,ft]),onTouchStart:Dc([B,Ot]),disabled:!!k,target:j,...Te&&{style:Te},...Fe&&{className:Fe},...k&&E7,...me&&O7,...I&&it&&z7}}var Eb={},A7={className:"active"},E7={role:"link","aria-disabled":!0},O7={"data-status":"active","aria-current":"page"},z7={"data-transitioning":"transitioning"},ef=new WeakMap,T7={rootMargin:"100px"},Dc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function P7(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function R7(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Kt=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=_7(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return b.createElement("a",d,o)}return b.createElement(n,a,o)});function D7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var M7=class extends UI{constructor(e){super(e),this.useMatch=t=>No({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Wj({...t,from:this.id}),this.useSearch=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Yj({...t,from:this.id}),this.useLoaderData=t=>Zj({...t,from:this.id}),this.useNavigate=()=>ko({from:this.fullPath}),this.Link=Si.forwardRef((t,n)=>l.jsx(Kt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Lr(e){return new M7(e)}function I7(){return e=>$7(e)}var L7=class extends m7{constructor(e){super(e),this.useMatch=t=>No({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Wj({...t,from:this.id}),this.useSearch=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Yj({...t,from:this.id}),this.useLoaderData=t=>Zj({...t,from:this.id}),this.useNavigate=()=>ko({from:this.fullPath}),this.Link=Si.forwardRef((t,n)=>l.jsx(Kt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function $7(e){return new L7(e)}function dz(e){return typeof e=="object"?new fz(e,{silent:!0}).createRoute(e):new fz(e,{silent:!0}).createRoute}var fz=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=Lr(n);return r.isRoot=!1,r},this.silent=t?.silent}},hz=class{constructor(e){this.useMatch=t=>No({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Wj({...t,from:this.options.id}),this.useSearch=t=>$y({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Yj({...t,from:this.options.id}),this.useLoaderData=t=>Zj({...t,from:this.options.id}),this.useNavigate=()=>ko({from:Ti().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function pz(e){return typeof e=="object"?new hz(e):t=>new hz({id:e,...t})}function B7(e){const t=Dr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return l.jsx(Vj,{getResetKey:()=>t,onCatch:(n,r)=>{if(xr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(xr(n))return e.fallback?.(n);throw n},children:e.children})}function U7(){return l.jsx("p",{children:"Not Found"})}function Xc(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(U7,{})}function q7(){return Ti().isScrollRestoring,null}var GI=b.memo(function({matchId:t}){const n=Ti(),r=Dr({select:S=>{const w=S.matches.findIndex(k=>k.id===t),j=S.matches[w];return vo(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:S.loadedAt,parentRouteId:S.matches[w-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))?b.Suspense:Xc,y=u?Vj:Xc,v=f?B7:Xc;return l.jsxs(i.isRoot?i.options.shellComponent??Xc:Xc,{children:[l.jsx(Iy.Provider,{value:t,children:l.jsx(m,{fallback:o,children:l.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||Qj,onCatch:(S,w)=>{if(xr(S))throw S;d?.(S,w)},children:l.jsx(v,{fallback:S=>{if(!f||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!i.isRoot)throw S;return b.createElement(f,S)},children:p||r._displayPending?l.jsx(y7,{fallback:o,children:l.jsx(mz,{matchId:t})}):l.jsx(mz,{matchId:t})})})})}),r.parentRouteId===bl&&n.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(F7,{}),l.jsx(q7,{})]}):null]})});function F7(){const e=Ti(),t=b.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",...Sl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var mz=b.memo(function({matchId:t}){const n=Ti(),{match:r,key:i,routeId:a}=Dr({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],u=b.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?l.jsx(d,{},i):l.jsx(Xj,{})},[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=Su();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 vo(xr(r.error)),KI(n,o,r.error);if(r.status==="redirected")throw vo(Tr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),Xj=b.memo(function(){const t=Ti(),n=b.useContext(Iy),r=Dr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Dr({select:f=>{const p=f.matches.find(m=>m.id===n);return vo(p),p.globalNotFound}}),o=Dr({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(GI,{matchId:o});return r===bl?l.jsx(b.Suspense,{fallback:u,children:d}):d});function H7(){const e=Ti(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:a}=Dr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=xb(a),u=a||n||i,d=xb(u),f=a||i,p=xb(f);return e.startTransition=m=>{r(!0),b.startTransition(()=>{m(),r(!1)})},b.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return fo(e.latestLocation.publicHref)!==fo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),nm(()=>{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]),nm(()=>{o&&!a&&e.emit({type:"onLoad",...Sl(e.state)})},[o,e,a]),nm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Sl(e.state)})},[f,p,e]),nm(()=>{if(d&&!u){const m=Sl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&_H(e)}},[u,d,e]),null}function K7(){const e=Ti(),t=e.routesById[bl].options.pendingComponent??e.options.defaultPendingComponent,n=t?l.jsx(t,{}):null,r=l.jsxs(typeof document<"u"&&e.ssr?Xc:b.Suspense,{fallback:n,children:[l.jsx(H7,{}),l.jsx(G7,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:r}):r}function G7(){const e=Ti(),t=Dr({select:i=>i.matches[0]?.id}),n=Dr({select:i=>i.loadedAt}),r=t?l.jsx(GI,{matchId:t}):null;return l.jsx(Iy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:l.jsx(Vj,{getResetKey:()=>n,errorComponent:Qj,onCatch:void 0,children:r})})}var V7=e=>new Q7(e),Q7=class extends o7{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=dz,globalThis.createLazyFileRoute=pz):typeof window<"u"&&(window.createFileRoute=dz,window.createLazyFileRoute=pz);function Z7({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(FI.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:r}):r}function Y7({router:e,...t}){return l.jsx(Z7,{router:e,...t,children:l.jsx(K7,{})})}function VI(e){return Dr({select:t=>t.location})}class Ir extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function W7(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const QI=W7();function X7(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function J7(e){return`${X7()}${e}`}function eK(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 tK(){return""}function gz(){return!!tK()}async function Oe(e,t){const n=t?.body!=null,r=await fetch(`${QI}${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 Ir(a,r.status,o)}if(r.status!==204)return r.json()}function Jj(){return Oe("/projects")}function ZI(e){return Oe(`/projects/${encodeURIComponent(e)}`)}function YI(){return Oe("/runs")}function nK(e){return Oe(`/projects/${encodeURIComponent(e)}/runs`)}function Ol(e){return Oe(`/runs/${encodeURIComponent(e)}`)}function rK(e){return Oe(`/projects/${encodeURIComponent(e)}/queries`)}function WI(e){return Oe(`/projects/${encodeURIComponent(e)}/competitors`)}function XI(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Oe(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function iK(e,t){const r=new URLSearchParams().toString();return Oe(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function By(e,t){return Oe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function aK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function sK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function JI(e,t){return Oe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function yz(e,t){const n=await ZI(e);return By(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 oK(e,t){const n=await ZI(e);return By(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 lK(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Oe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function cK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function uK(e,t){await Oe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function dK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function fK(e){await Oe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function hK(e){return Oe(`/projects/${encodeURIComponent(e)}/export`)}function eN(){return Oe("/settings")}function pK(){return Oe("/session")}function mK(e){return Oe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function gK(e){return Oe("/session",{method:"POST",body:JSON.stringify({password:e})})}function yK(e,t){return Oe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function vK(e){return Oe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function xK(e){try{return await Oe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Ir&&t.statusCode===404)return null;throw t}}function vz(e,t){return Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function bK(e){await Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function wK(e){return Oe(`/projects/${encodeURIComponent(e)}/notifications`)}function SK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function jK(e,t){await Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function NK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function kK(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function CK(e){return Oe("/apply",{method:"POST",body:JSON.stringify(e)})}function _K(e){return Oe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function eL(e){return Oe(`/projects/${encodeURIComponent(e)}/google/connections`)}function AK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function EK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function OK(e){return Oe(`/projects/${encodeURIComponent(e)}/google/properties`)}function zK(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function TK(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function tL(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function PK(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function RK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function DK(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function MK(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function tN(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function IK(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function LK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function $K(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function BK(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function xz(){return Oe("/cdp/status")}function UK(e,t){return Oe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function bz(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function nL(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/status`)}function qK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function FK(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function HK(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function KK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function nN(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function rL(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function iL(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function wz(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function GK(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function VK(e){return Oe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function QK(e){return Oe(`/projects/${encodeURIComponent(e)}/report`)}function ZK(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function YK(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${QI}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Ir(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),o=ZK(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,u=document.createElement("a");u.href=a,u.download=o,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(a)}function WK(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/status`)}function XK(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function aL(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function JK(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function eG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function tG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function nG(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function rG(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function iG(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Oe(`/projects/${encodeURIComponent(e)}/insights${n}`)}function aG(e){return Oe(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function sG(e,t){const n=J7(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:eK(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 Oe("/backlinks/status")}function lG(){return Oe("/backlinks/install",{method:"POST"})}function sL(){return Oe("/backlinks/syncs/latest")}function cG(){return Oe("/backlinks/syncs")}function uG(e){return Oe("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function dG(){return Oe("/backlinks/releases")}function fG(){return Oe("/backlinks/latest-release")}function hG(e){return Oe(`/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 Oe(`/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 Oe(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function gG(e){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function yG(e,t){return Oe(`/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 JS=new Set,e1=new Map,t1=new Map;function bg(){const e=[...ur];for(const t of JS)t(e)}function rN(e){const t=e1.get(e);t&&(clearTimeout(t),e1.delete(e));const n=t1.get(e);n&&(clearTimeout(n),t1.delete(e))}function oL(e){rN(e);const t=ur.length;ur=ur.filter(n=>n.id!==e),ur.length!==t&&bg()}function Sz(e){rN(e.id),e1.set(e.id,setTimeout(()=>{n1(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),bg(),Sz(o),a.id}}return ur.length>=xG&&oL(ur[0].id),ur=[...ur,i],bg(),Sz(i),i.id}function n1(e){const t=ur.find(n=>n.id===e);!t||t.state==="closing"||(rN(e),ur=ur.map(n=>n.id===e?{...n,state:"closing"}:n),bg(),t1.set(e,setTimeout(()=>{oL(e)},bG)))}function jG(e){return JS.add(e),()=>{JS.delete(e)}}function jz(){return ur}const NG=5*6e4,lL=30*6e4,tf=3e4,dr=6e4,r1=3e4;function kG(){return new H9({defaultOptions:{queries:{staleTime:NG,retry:1,refetchOnWindowFocus:!1}},mutationCache:new vI({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()),Nz=e=>{const t=_G(e);return t.charAt(0).toUpperCase()+t.slice(1)},cL=(...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 EG={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 OG=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...u},d)=>b.createElement("svg",{ref:d,...EG,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cL("lucide",i),...!a&&!AG(u)&&{"aria-hidden":"true"},...u},[...o.map(([f,p])=>b.createElement(f,p)),...Array.isArray(a)?a:[a]]));const jt=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(OG,{ref:a,iconNode:t,className:cL(`lucide-${CG(Nz(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Nz(e),n};const zG=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],TG=jt("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=jt("book-open",PG);const DG=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],uL=jt("check",DG);const MG=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IG=jt("chevron-down",MG);const LG=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hh=jt("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=jt("circle-alert",$G);const UG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],dL=jt("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"}]],fL=jt("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"}]],HG=jt("copy",FG);const KG=[["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"}]],Uy=jt("download",KG);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=jt("external-link",GG);const QG=[["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"}]],ZG=jt("file-text",QG);const YG=[["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"}]],WG=jt("github",YG);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=jt("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=jt("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"}]],hL=jt("link-2",nV);const rV=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pL=jt("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=jt("maximize-2",iV);const sV=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],oV=jt("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=jt("minimize-2",lV);const uV=[["path",{d:"M5 12h14",key:"1ays0h"}]],dV=jt("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"}]],wg=jt("play",fV);const hV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kz=jt("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"}]],Cz=jt("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=jt("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"}]],mL=jt("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=jt("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"}]],_z=jt("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"}]],gL=jt("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"}]],Sg=jt("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=jt("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=jt("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=jt("wrench",_V);const EV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ph=jt("x",EV);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 du extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class yL extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vL={};function xo(e){return vL}function xL(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 i1(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 iN(e){return e==null}function aN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function OV(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return o%u/10**a}const Az=Symbol("evaluating");function zt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Az)return r===void 0&&(r=Az,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Gl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Co(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ez(e){return JSON.stringify(e)}function zV(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const bL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qf(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 ju(e){if(qf(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(qf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wL(e){return ju(e)?{...e}:Array.isArray(e)?[...e]:e}const PV=new Set(["string","number","symbol"]);function Nu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _o(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=Co(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 Gl(this,"shape",o),o},checks:[]});return _o(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=Co(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 Gl(this,"shape",o),o},checks:[]});return _o(e,a)}function LV(e,t){if(!ju(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=Co(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Gl(this,"shape",a),a}});return _o(e,i)}function $V(e,t){if(!ju(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Co(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Gl(this,"shape",r),r}});return _o(e,n)}function BV(e,t){const n=Co(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Gl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return _o(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=Co(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 Gl(this,"shape",d),d},checks:[]});return _o(t,o)}function qV(e,t,n){const r=Co(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 Gl(this,"shape",a),a}});return _o(t,r)}function eu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function am(e){return typeof e=="string"?e:e?.message}function bo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=am(e.inst?._zod.def?.error?.(e))??am(t?.error?.(e))??am(n.customError?.(e))??am(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function sN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ff(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const SL=(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,i1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jL=ye("$ZodError",SL),NL=ye("$ZodError",SL,{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 HV(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 oN=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 du;if(o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>bo(d,a,xo())));throw bL(u,i?.callee),u}return o.value},lN=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=>bo(d,a,xo())));throw bL(u,i?.callee),u}return o.value},Fy=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 du;return a.issues.length?{success:!1,error:new(e??jL)(a.issues.map(o=>bo(o,i,xo())))}:{success:!0,data:a.value}},KV=Fy(NL),Hy=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>bo(o,i,xo())))}:{success:!0,data:a.value}},GV=Hy(NL),VV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return oN(e)(t,n,i)},QV=e=>(t,n,r)=>oN(e)(t,n,r),ZV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lN(e)(t,n,i)},YV=e=>async(t,n,r)=>lN(e)(t,n,r),WV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fy(e)(t,n,i)},XV=e=>(t,n,r)=>Fy(e)(t,n,r),JV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hy(e)(t,n,i)},eQ=e=>async(t,n,r)=>Hy(e)(t,n,r),tQ=/^[cC][^\s-]{8,}$/,nQ=/^[0-9a-z]+$/,rQ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iQ=/^[0-9a-vA-V]{20}$/,aQ=/^[A-Za-z0-9]{27}$/,sQ=/^[a-zA-Z0-9_-]{21}$/,oQ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lQ=/^([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})$/,Oz=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)$/,cQ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dQ(){return new RegExp(uQ,"u")}const fQ=/^(?:(?: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])$/,hQ=/^(([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}|:))$/,pQ=/^((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])$/,mQ=/^(([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])$/,gQ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kL=/^[A-Za-z0-9_-]*$/,yQ=/^\+[1-9]\d{6,14}$/,CL="(?:(?:\\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])))",vQ=new RegExp(`^${CL}$`);function _L(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 xQ(e){return new RegExp(`^${_L(e)}$`)}function bQ(e){const t=_L({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(`^${CL}T(?:${r})$`)}const wQ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},SQ=/^-?\d+$/,AL=/^-?\d+(?:\.\d+)?$/,jQ=/^(?:true|false)$/i,NQ=/^[^A-Z]*$/,kQ=/^[^a-z]*$/,$r=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),EL={number:"number",bigint:"bigint",object:"date"},OL=ye("$ZodCheckLessThan",(e,t)=>{$r.init(e,t);const n=EL[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})}}),zL=ye("$ZodCheckGreaterThan",(e,t)=>{$r.init(e,t);const n=EL[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})}}),CQ=ye("$ZodCheckMultipleOf",(e,t)=>{$r.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):OV(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_Q=ye("$ZodCheckNumberFormat",(e,t)=>{$r.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=SQ)}),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})}}),AQ=ye("$ZodCheckMaxLength",(e,t)=>{var n;$r.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!iN(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=sN(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),EQ=ye("$ZodCheckMinLength",(e,t)=>{var n;$r.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!iN(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=sN(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),OQ=ye("$ZodCheckLengthEquals",(e,t)=>{var n;$r.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!iN(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=sN(i),u=a>t.length;r.issues.push({origin:o,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ky=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;$r.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=()=>{})}),zQ=ye("$ZodCheckRegex",(e,t)=>{Ky.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),TQ=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NQ),Ky.init(e,t)}),PQ=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kQ),Ky.init(e,t)}),RQ=ye("$ZodCheckIncludes",(e,t)=>{$r.init(e,t);const n=Nu(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})}}),DQ=ye("$ZodCheckStartsWith",(e,t)=>{$r.init(e,t);const n=new RegExp(`^${Nu(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})}}),MQ=ye("$ZodCheckEndsWith",(e,t)=>{$r.init(e,t);const n=new RegExp(`.*${Nu(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})}}),IQ=ye("$ZodCheckOverwrite",(e,t)=>{$r.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class LQ{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 $Q={major:4,minor:3,patch:6},dn=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$Q;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,u,d)=>{let f=eu(o),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new du;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=eu(o,y)))});else{if(o.issues.length===y)continue;f||(f=eu(o,y))}}return p?p.then(()=>o):o},a=(o,u,d)=>{if(eu(o))return o.aborted=!0,o;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new du;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 du;return d.then(f=>i(f,r,u))}return i(d,r,u)}}zt(e,"~standard",()=>({validate:i=>{try{const a=KV(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}))}),cN=ye("$ZodString",(e,t)=>{dn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wQ(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}}),sn=ye("$ZodStringFormat",(e,t)=>{Ky.init(e,t),cN.init(e,t)}),BQ=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lQ),sn.init(e,t)}),UQ=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=Oz(r))}else t.pattern??(t.pattern=Oz());sn.init(e,t)}),qQ=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cQ),sn.init(e,t)}),FQ=ye("$ZodURL",(e,t)=>{sn.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})}}}),HQ=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dQ()),sn.init(e,t)}),KQ=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=sQ),sn.init(e,t)}),GQ=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tQ),sn.init(e,t)}),VQ=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nQ),sn.init(e,t)}),QQ=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rQ),sn.init(e,t)}),ZQ=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=iQ),sn.init(e,t)}),YQ=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=aQ),sn.init(e,t)}),WQ=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bQ(t)),sn.init(e,t)}),XQ=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vQ),sn.init(e,t)}),JQ=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xQ(t)),sn.init(e,t)}),eZ=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=oQ),sn.init(e,t)}),tZ=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fQ),sn.init(e,t),e._zod.bag.format="ipv4"}),nZ=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hQ),sn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),rZ=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pQ),sn.init(e,t)}),iZ=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mQ),sn.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 TL(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const aZ=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gQ),sn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{TL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sZ(e){if(!kL.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return TL(n)}const oZ=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=kL),sn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{sZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),lZ=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=yQ),sn.init(e,t)});function cZ(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const uZ=ye("$ZodJWT",(e,t)=>{sn.init(e,t),e._zod.check=n=>{cZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),PL=ye("$ZodNumber",(e,t)=>{dn.init(e,t),e._zod.pattern=e._zod.bag.pattern??AL,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}}),dZ=ye("$ZodNumberFormat",(e,t)=>{_Q.init(e,t),PL.init(e,t)}),fZ=ye("$ZodBoolean",(e,t)=>{dn.init(e,t),e._zod.pattern=jQ,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),hZ=ye("$ZodUnknown",(e,t)=>{dn.init(e,t),e._zod.parse=n=>n}),pZ=ye("$ZodNever",(e,t)=>{dn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function zz(e,t,n){e.issues.length&&t.issues.push(...tu(n,e.issues)),t.value[n]=e.value}const mZ=ye("$ZodArray",(e,t)=>{dn.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=>zz(f,n,o))):zz(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function jg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...tu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function RL(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 DL(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=>jg(v,n,m,t,p))):jg(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 gZ=ye("$ZodObject",(e,t)=>{if(dn.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(()=>RL(t));zt(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=qf,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],S=v._zod.optout==="optional",w=v._zod.run({value:f[y],issues:[]},d);w instanceof Promise?p.push(w.then(j=>jg(j,u,y,f,S))):jg(w,u,y,f,S)}return a?DL(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),yZ=ye("$ZodObjectJIT",(e,t)=>{gZ.init(e,t);const n=e._zod.parse,r=qy(()=>RL(t)),i=y=>{const v=new LQ(["shape","payload","ctx"]),S=r.value,w=_=>{const A=Ez(_);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const _ of S.keys)j[_]=`key_${k++}`;v.write("const newResult = {};");for(const _ of S.keys){const A=j[_],T=Ez(_),z=y[_]?._zod?.optout==="optional";v.write(`const ${A} = ${w(_)};`),z?v.write(`
12
+ if (${A}.issues.length) {
13
+ if (${T} in input) {
14
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${A}.value === undefined) {
22
+ if (${T} in input) {
23
+ newResult[${T}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${T}] = ${A}.value;
27
+ }
28
+
29
+ `):v.write(`
30
+ if (${A}.issues.length) {
31
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
34
+ })));
35
+ }
36
+
37
+ if (${A}.value === undefined) {
38
+ if (${T} in input) {
39
+ newResult[${T}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${T}] = ${A}.value;
43
+ }
44
+
45
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(_,A)=>O(y,_,A)};let a;const o=qf,u=!vL.jitless,f=u&&TV.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const S=y.value;return o(S)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?DL([],S,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),y)}});function Tz(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!eu(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(o=>bo(o,r,xo())))}),t)}const ML=ye("$ZodUnion",(e,t)=>{dn.init(e,t),zt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),zt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),zt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),zt(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=>aN(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=>Tz(d,i,e,a)):Tz(u,i,e,a)}}),vZ=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ML.init(e,t);const n=e._zod.parse;zt(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(!qf(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)}}),xZ=ye("$ZodIntersection",(e,t)=>{dn.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])=>Pz(n,d,f)):Pz(n,a,o)}});function a1(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(ju(e)&&ju(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=a1(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=a1(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 Pz(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),eu(e))return e;const o=a1(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 bZ=ye("$ZodRecord",(e,t)=>{dn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!ju(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...tu(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...tu(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&AL.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=>bo(m,r,xo())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...tu(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...tu(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),wZ=ye("$ZodEnum",(e,t)=>{dn.init(e,t);const n=xL(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"?Nu(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}}),SZ=ye("$ZodLiteral",(e,t)=>{if(dn.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"?Nu(r):r?Nu(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}}),jZ=ye("$ZodTransform",(e,t)=>{dn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yL(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 du;return n.value=i,n}});function Rz(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const IL=ye("$ZodOptional",(e,t)=>{dn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",zt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${aN(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=>Rz(a,n.value)):Rz(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),NZ=ye("$ZodExactOptional",(e,t)=>{IL.init(e,t),zt(e._zod,"values",()=>t.innerType._zod.values),zt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),kZ=ye("$ZodNullable",(e,t)=>{dn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${aN(n.source)}|null)$`):void 0}),zt(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)}),CZ=ye("$ZodDefault",(e,t)=>{dn.init(e,t),e._zod.optin="optional",zt(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=>Dz(a,t)):Dz(i,t)}});function Dz(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _Z=ye("$ZodPrefault",(e,t)=>{dn.init(e,t),e._zod.optin="optional",zt(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))}),AZ=ye("$ZodNonOptional",(e,t)=>{dn.init(e,t),zt(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=>Mz(a,e)):Mz(i,e)}});function Mz(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 EZ=ye("$ZodCatch",(e,t)=>{dn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(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=>bo(o,r,xo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>bo(a,r,xo()))},input:n.value}),n.issues=[]),n)}}),OZ=ye("$ZodPipe",(e,t)=>{dn.init(e,t),zt(e._zod,"values",()=>t.in._zod.values),zt(e._zod,"optin",()=>t.in._zod.optin),zt(e._zod,"optout",()=>t.out._zod.optout),zt(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=>sm(o,t.in,r)):sm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>sm(a,t.out,r)):sm(i,t.out,r)}});function sm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zZ=ye("$ZodReadonly",(e,t)=>{dn.init(e,t),zt(e._zod,"propValues",()=>t.innerType._zod.propValues),zt(e._zod,"values",()=>t.innerType._zod.values),zt(e._zod,"optin",()=>t.innerType?._zod?.optin),zt(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(Iz):Iz(i)}});function Iz(e){return e.value=Object.freeze(e.value),e}const TZ=ye("$ZodCustom",(e,t)=>{$r.init(e,t),dn.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=>Lz(a,n,r,e));Lz(i,n,r,e)}});function Lz(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(Ff(i))}}var $z;class PZ{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 RZ(){return new PZ}($z=globalThis).__zod_globalRegistry??($z.__zod_globalRegistry=RZ());const wf=globalThis.__zod_globalRegistry;function DZ(e,t){return new e({type:"string",...qe(t)})}function MZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function Bz(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function IZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function LZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function $Z(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function BZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function UZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function qZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function FZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function HZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function KZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function GZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function VZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function QZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function ZZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function YZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function WZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function XZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function JZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function eY(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function tY(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function nY(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function rY(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function iY(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function aY(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function sY(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function oY(e,t){return new e({type:"number",checks:[],...qe(t)})}function lY(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function cY(e,t){return new e({type:"boolean",...qe(t)})}function uY(e){return new e({type:"unknown"})}function dY(e,t){return new e({type:"never",...qe(t)})}function Uz(e,t){return new OL({check:"less_than",...qe(t),value:e,inclusive:!1})}function Ob(e,t){return new OL({check:"less_than",...qe(t),value:e,inclusive:!0})}function qz(e,t){return new zL({check:"greater_than",...qe(t),value:e,inclusive:!1})}function zb(e,t){return new zL({check:"greater_than",...qe(t),value:e,inclusive:!0})}function Fz(e,t){return new CQ({check:"multiple_of",...qe(t),value:e})}function LL(e,t){return new AQ({check:"max_length",...qe(t),maximum:e})}function Ng(e,t){return new EQ({check:"min_length",...qe(t),minimum:e})}function $L(e,t){return new OQ({check:"length_equals",...qe(t),length:e})}function fY(e,t){return new zQ({check:"string_format",format:"regex",...qe(t),pattern:e})}function hY(e){return new TQ({check:"string_format",format:"lowercase",...qe(e)})}function pY(e){return new PQ({check:"string_format",format:"uppercase",...qe(e)})}function mY(e,t){return new RQ({check:"string_format",format:"includes",...qe(t),includes:e})}function gY(e,t){return new DQ({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function yY(e,t){return new MQ({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function Lu(e){return new IQ({check:"overwrite",tx:e})}function vY(e){return Lu(t=>t.normalize(e))}function xY(){return Lu(e=>e.trim())}function bY(){return Lu(e=>e.toLowerCase())}function wY(){return Lu(e=>e.toUpperCase())}function SY(){return Lu(e=>zV(e))}function jY(e,t,n){return new e({type:"array",element:t,...qe(n)})}function NY(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function kY(e){const t=CY(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Ff(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(Ff(i))}},e(n.value,n)));return t}function CY(e,t){const n=new $r({check:"custom",...qe(t)});return n._zod.check=e,n}function BL(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??wf,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 Tn(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),Tn(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"&&gr(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 UL(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??(S=>S);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 qL(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 w in d)w==="$ref"||w==="allOf"||w in f||delete d[w];if(v.$ref&&y.def)for(const w in d)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(d[w])===JSON.stringify(y.def[w])&&delete d[w]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:kg(t,"input",e.processors),output:kg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function gr(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 gr(r.element,n);if(r.type==="set")return gr(r.valueType,n);if(r.type==="lazy")return gr(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 gr(r.innerType,n);if(r.type==="intersection")return gr(r.left,n)||gr(r.right,n);if(r.type==="record"||r.type==="map")return gr(r.keyType,n)||gr(r.valueType,n);if(r.type==="pipe")return gr(r.in,n)||gr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(gr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(gr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(gr(i,n))return!0;return!!(r.rest&&gr(r.rest,n))}return!1}const _Y=(e,t={})=>n=>{const r=BL({...n,processors:t});return Tn(e,r),UL(r,e),qL(r,e)},kg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=BL({...i??{},target:a,io:t,processors:n});return Tn(e,o),UL(o,e),qL(o,e)},AY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EY=(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=AY[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}))])}},OY=(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)},zY=(e,t,n,r)=>{n.type="boolean"},TY=(e,t,n,r)=>{n.not={}},PY=(e,t,n,r)=>{},RY=(e,t,n,r)=>{const i=e._zod.def,a=xL(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},DY=(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},MY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},IY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},LY=(e,t,n,r)=>{const i=n,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=Tn(a.element,t,{...r,path:[...r.path,"items"]})},$Y=(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]=Tn(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=Tn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},BY=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((u,d)=>Tn(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},UY=(e,t,n,r)=>{const i=e._zod.def,a=Tn(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Tn(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},qY=(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=Tn(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=Tn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Tn(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)}},FY=(e,t,n,r)=>{const i=e._zod.def,a=Tn(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"}]},HY=(e,t,n,r)=>{const i=e._zod.def;Tn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},KY=(e,t,n,r)=>{const i=e._zod.def;Tn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},GY=(e,t,n,r)=>{const i=e._zod.def;Tn(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)))},VY=(e,t,n,r)=>{const i=e._zod.def;Tn(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},QY=(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;Tn(a,t,r);const o=t.seen.get(e);o.ref=a},ZY=(e,t,n,r)=>{const i=e._zod.def;Tn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},FL=(e,t,n,r)=>{const i=e._zod.def;Tn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},YY=ye("ZodISODateTime",(e,t)=>{WQ.init(e,t),hn.init(e,t)});function WY(e){return rY(YY,e)}const XY=ye("ZodISODate",(e,t)=>{XQ.init(e,t),hn.init(e,t)});function JY(e){return iY(XY,e)}const eW=ye("ZodISOTime",(e,t)=>{JQ.init(e,t),hn.init(e,t)});function tW(e){return aY(eW,e)}const nW=ye("ZodISODuration",(e,t)=>{eZ.init(e,t),hn.init(e,t)});function rW(e){return sY(nW,e)}const iW=(e,t)=>{jL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>HV(e,n)},flatten:{value:n=>FV(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,i1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,i1,2)}},isEmpty:{get(){return e.issues.length===0}}})},Pi=ye("ZodError",iW,{Parent:Error}),aW=oN(Pi),sW=lN(Pi),oW=Fy(Pi),lW=Hy(Pi),cW=VV(Pi),uW=QV(Pi),dW=ZV(Pi),fW=YV(Pi),hW=WV(Pi),pW=XV(Pi),mW=JV(Pi),gW=eQ(Pi),fn=ye("ZodType",(e,t)=>(dn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kg(e,"input"),output:kg(e,"output")}}),e.toJSONSchema=_Y(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Co(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)=>_o(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>aW(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>oW(e,n,r),e.parseAsync=async(n,r)=>sW(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>lW(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>cW(e,n,r),e.decode=(n,r)=>uW(e,n,r),e.encodeAsync=async(n,r)=>dW(e,n,r),e.decodeAsync=async(n,r)=>fW(e,n,r),e.safeEncode=(n,r)=>hW(e,n,r),e.safeDecode=(n,r)=>pW(e,n,r),e.safeEncodeAsync=async(n,r)=>mW(e,n,r),e.safeDecodeAsync=async(n,r)=>gW(e,n,r),e.refine=(n,r)=>e.check(dX(n,r)),e.superRefine=n=>e.check(fX(n)),e.overwrite=n=>e.check(Lu(n)),e.optional=()=>Gz(e),e.exactOptional=()=>XW(e),e.nullable=()=>Vz(e),e.nullish=()=>Gz(Vz(e)),e.nonoptional=n=>iX(e,n),e.array=()=>_e(e),e.or=n=>qW([e,n]),e.and=n=>GW(e,n),e.transform=n=>Qz(e,YW(n)),e.default=n=>tX(e,n),e.prefault=n=>rX(e,n),e.catch=n=>sX(e,n),e.pipe=n=>Qz(e,n),e.readonly=()=>cX(e),e.describe=n=>{const r=e.clone();return wf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wf.get(e);const r=e.clone();return wf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),HL=ye("_ZodString",(e,t)=>{cN.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>EY(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(fY(...r)),e.includes=(...r)=>e.check(mY(...r)),e.startsWith=(...r)=>e.check(gY(...r)),e.endsWith=(...r)=>e.check(yY(...r)),e.min=(...r)=>e.check(Ng(...r)),e.max=(...r)=>e.check(LL(...r)),e.length=(...r)=>e.check($L(...r)),e.nonempty=(...r)=>e.check(Ng(1,...r)),e.lowercase=r=>e.check(hY(r)),e.uppercase=r=>e.check(pY(r)),e.trim=()=>e.check(xY()),e.normalize=(...r)=>e.check(vY(...r)),e.toLowerCase=()=>e.check(bY()),e.toUpperCase=()=>e.check(wY()),e.slugify=()=>e.check(SY())}),yW=ye("ZodString",(e,t)=>{cN.init(e,t),HL.init(e,t),e.email=n=>e.check(MZ(vW,n)),e.url=n=>e.check(UZ(xW,n)),e.jwt=n=>e.check(nY(RW,n)),e.emoji=n=>e.check(qZ(bW,n)),e.guid=n=>e.check(Bz(Hz,n)),e.uuid=n=>e.check(IZ(om,n)),e.uuidv4=n=>e.check(LZ(om,n)),e.uuidv6=n=>e.check($Z(om,n)),e.uuidv7=n=>e.check(BZ(om,n)),e.nanoid=n=>e.check(FZ(wW,n)),e.guid=n=>e.check(Bz(Hz,n)),e.cuid=n=>e.check(HZ(SW,n)),e.cuid2=n=>e.check(KZ(jW,n)),e.ulid=n=>e.check(GZ(NW,n)),e.base64=n=>e.check(JZ(zW,n)),e.base64url=n=>e.check(eY(TW,n)),e.xid=n=>e.check(VZ(kW,n)),e.ksuid=n=>e.check(QZ(CW,n)),e.ipv4=n=>e.check(ZZ(_W,n)),e.ipv6=n=>e.check(YZ(AW,n)),e.cidrv4=n=>e.check(WZ(EW,n)),e.cidrv6=n=>e.check(XZ(OW,n)),e.e164=n=>e.check(tY(PW,n)),e.datetime=n=>e.check(WY(n)),e.date=n=>e.check(JY(n)),e.time=n=>e.check(tW(n)),e.duration=n=>e.check(rW(n))});function P(e){return DZ(yW,e)}const hn=ye("ZodStringFormat",(e,t)=>{sn.init(e,t),HL.init(e,t)}),vW=ye("ZodEmail",(e,t)=>{qQ.init(e,t),hn.init(e,t)}),Hz=ye("ZodGUID",(e,t)=>{BQ.init(e,t),hn.init(e,t)}),om=ye("ZodUUID",(e,t)=>{UQ.init(e,t),hn.init(e,t)}),xW=ye("ZodURL",(e,t)=>{FQ.init(e,t),hn.init(e,t)}),bW=ye("ZodEmoji",(e,t)=>{HQ.init(e,t),hn.init(e,t)}),wW=ye("ZodNanoID",(e,t)=>{KQ.init(e,t),hn.init(e,t)}),SW=ye("ZodCUID",(e,t)=>{GQ.init(e,t),hn.init(e,t)}),jW=ye("ZodCUID2",(e,t)=>{VQ.init(e,t),hn.init(e,t)}),NW=ye("ZodULID",(e,t)=>{QQ.init(e,t),hn.init(e,t)}),kW=ye("ZodXID",(e,t)=>{ZQ.init(e,t),hn.init(e,t)}),CW=ye("ZodKSUID",(e,t)=>{YQ.init(e,t),hn.init(e,t)}),_W=ye("ZodIPv4",(e,t)=>{tZ.init(e,t),hn.init(e,t)}),AW=ye("ZodIPv6",(e,t)=>{nZ.init(e,t),hn.init(e,t)}),EW=ye("ZodCIDRv4",(e,t)=>{rZ.init(e,t),hn.init(e,t)}),OW=ye("ZodCIDRv6",(e,t)=>{iZ.init(e,t),hn.init(e,t)}),zW=ye("ZodBase64",(e,t)=>{aZ.init(e,t),hn.init(e,t)}),TW=ye("ZodBase64URL",(e,t)=>{oZ.init(e,t),hn.init(e,t)}),PW=ye("ZodE164",(e,t)=>{lZ.init(e,t),hn.init(e,t)}),RW=ye("ZodJWT",(e,t)=>{uZ.init(e,t),hn.init(e,t)}),KL=ye("ZodNumber",(e,t)=>{PL.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>OY(e,r,i),e.gt=(r,i)=>e.check(qz(r,i)),e.gte=(r,i)=>e.check(zb(r,i)),e.min=(r,i)=>e.check(zb(r,i)),e.lt=(r,i)=>e.check(Uz(r,i)),e.lte=(r,i)=>e.check(Ob(r,i)),e.max=(r,i)=>e.check(Ob(r,i)),e.int=r=>e.check(Kz(r)),e.safe=r=>e.check(Kz(r)),e.positive=r=>e.check(qz(0,r)),e.nonnegative=r=>e.check(zb(0,r)),e.negative=r=>e.check(Uz(0,r)),e.nonpositive=r=>e.check(Ob(0,r)),e.multipleOf=(r,i)=>e.check(Fz(r,i)),e.step=(r,i)=>e.check(Fz(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 ce(e){return oY(KL,e)}const DW=ye("ZodNumberFormat",(e,t)=>{dZ.init(e,t),KL.init(e,t)});function Kz(e){return lY(DW,e)}const MW=ye("ZodBoolean",(e,t)=>{fZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zY(e,n,r)});function lt(e){return cY(MW,e)}const IW=ye("ZodUnknown",(e,t)=>{hZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PY()});function zl(){return uY(IW)}const LW=ye("ZodNever",(e,t)=>{pZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TY(e,n,r)});function $W(e){return dY(LW,e)}const BW=ye("ZodArray",(e,t)=>{mZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LY(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Ng(n,r)),e.nonempty=n=>e.check(Ng(1,n)),e.max=(n,r)=>e.check(LL(n,r)),e.length=(n,r)=>e.check($L(n,r)),e.unwrap=()=>e.element});function _e(e,t){return jY(BW,e,t)}const UW=ye("ZodObject",(e,t)=>{yZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$Y(e,n,r,i),zt(e,"shape",()=>t.shape),e.keyof=()=>We(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:zl()}),e.loose=()=>e.clone({...e._zod.def,catchall:zl()}),e.strict=()=>e.clone({...e._zod.def,catchall:$W()}),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(VL,e,n[0]),e.required=(...n)=>qV(QL,e,n[0])});function pe(e,t){const n={type:"object",shape:e??{},...qe(t)};return new UW(n)}const GL=ye("ZodUnion",(e,t)=>{ML.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BY(e,n,r,i),e.options=t.options});function qW(e,t){return new GL({type:"union",options:e,...qe(t)})}const FW=ye("ZodDiscriminatedUnion",(e,t)=>{GL.init(e,t),vZ.init(e,t)});function HW(e,t,n){return new FW({type:"union",options:t,discriminator:e,...qe(n)})}const KW=ye("ZodIntersection",(e,t)=>{xZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UY(e,n,r,i)});function GW(e,t){return new KW({type:"intersection",left:e,right:t})}const VW=ye("ZodRecord",(e,t)=>{bZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qY(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ta(e,t,n){return new VW({type:"record",keyType:e,valueType:t,...qe(n)})}const s1=ye("ZodEnum",(e,t)=>{wZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>RY(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 s1({...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 s1({...t,checks:[],...qe(i),entries:a})}});function We(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new s1({type:"enum",entries:n,...qe(t)})}const QW=ye("ZodLiteral",(e,t)=>{SZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DY(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 Ei(e,t){return new QW({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const ZW=ye("ZodTransform",(e,t)=>{jZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IY(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yL(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Ff(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(Ff(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function YW(e){return new ZW({type:"transform",transform:e})}const VL=ye("ZodOptional",(e,t)=>{IL.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Gz(e){return new VL({type:"optional",innerType:e})}const WW=ye("ZodExactOptional",(e,t)=>{NZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function XW(e){return new WW({type:"optional",innerType:e})}const JW=ye("ZodNullable",(e,t)=>{kZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Vz(e){return new JW({type:"nullable",innerType:e})}const eX=ye("ZodDefault",(e,t)=>{CZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KY(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():wL(t)}})}const nX=ye("ZodPrefault",(e,t)=>{_Z.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GY(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():wL(t)}})}const QL=ye("ZodNonOptional",(e,t)=>{AZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function iX(e,t){return new QL({type:"nonoptional",innerType:e,...qe(t)})}const aX=ye("ZodCatch",(e,t)=>{EZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sX(e,t){return new aX({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const oX=ye("ZodPipe",(e,t)=>{OZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QY(e,n,r,i),e.in=t.in,e.out=t.out});function Qz(e,t){return new oX({type:"pipe",in:e,out:t})}const lX=ye("ZodReadonly",(e,t)=>{zZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZY(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)=>{TZ.init(e,t),fn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MY(e,n)});function dX(e,t={}){return NY(uX,e,t)}function fX(e){return kY(e)}pe({maxConcurrency:ce().int().positive(),maxRequestsPerMinute:ce().int().positive(),maxRequestsPerDay:ce().int().positive()});const hs=P().min(1);P().min(1);const uN=pe({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),dN=We(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);pe({id:P(),projectId:P(),channel:Ei("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:_e(dN),enabled:lt().default(!0),source:P().optional(),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});pe({channel:Ei("webhook"),url:P().url(),events:_e(dN).min(1),source:P().optional()});const ZL=We(["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}pe({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:_e(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:_e(P()).optional(),labels:Ta(P(),P()).optional(),providers:_e(hs).optional(),locations:_e(uN).optional(),defaultLocation:P().nullable().optional(),autoExtractBacklinks:lt().optional(),configSource:ZL.optional()});pe({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:_e(P()).default([]),country:P().length(2),language:P().min(2),tags:_e(P()).default([]),labels:Ta(P(),P()).default({}),locations:_e(uN).default([]),defaultLocation:P().nullable().optional(),autoExtractBacklinks:lt().default(!1),configSource:ZL.default("cli"),configRevision:ce().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});pe({id:P(),query:P(),createdAt:P()});pe({id:P(),keyword:P(),createdAt:P()});pe({queries:_e(P().trim().min(1)).min(1)});pe({keywords:_e(P().trim().min(1)).min(1)});pe({provider:hs,count:ce().int().min(1).max(20).optional()});pe({id:P(),domain:P(),createdAt:P()});pe({competitors:_e(P().trim().min(1)).min(1)});function Cg(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const mX=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function gX(e){const t=Cg(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return mX.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function yX(e){const t=gX(e);return t?t.split(".")[0]??"":""}function vX(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=Cg(a);n.has(o)||(n.add(o),r.push(a))}return r}const xX=pe({name:P().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:Ta(P(),P()).optional().default({})}),bX=pe({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:_e(hs).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),wX=pe({channel:Ei("webhook"),url:P().url(),events:_e(dN).min(1)}),SX=pe({gsc:pe({propertyUrl:P()}).optional(),syncSchedule:pe({preset:P().optional(),cron:P().optional()}).optional()}).optional(),Zz=_e(P().min(1)),jX=pe({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:_e(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),queries:Zz.optional(),keywords:Zz.optional(),competitors:_e(P().min(1)).optional().default([]),providers:_e(hs).optional().default([]),locations:_e(uN).optional().default([]),defaultLocation:P().optional(),schedule:bX,notifications:_e(wX).optional().default([]),google:SX,autoExtractBacklinks:lt().optional().default(!1)}).superRefine((e,t)=>{e.queries!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const n=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"]})});pe({apiVersion:Ei("canonry/v1"),kind:Ei("Project"),metadata:xX,spec:jX});const NX=We(["gsc","ga4"]);pe({id:P(),domain:P(),connectionType:NX,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:_e(P()).default([]),createdAt:P(),updatedAt:P()});pe({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:ce(),impressions:ce(),ctr:ce(),position:ce()});const o1=pe({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:lt().nullable().optional(),richResults:_e(P()).default([]),inspectedAt:P()});We(["stable","reindexed","deindexed","still-missing","new"]);const kX=pe({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),CX=pe({reason:P(),count:ce(),urls:_e(o1).default([])});pe({summary:pe({total:ce(),indexed:ce(),notIndexed:ce(),deindexed:ce(),percentage:ce()}),lastInspectedAt:P().nullable(),lastSyncedAt:P().nullable(),indexed:_e(o1).default([]),notIndexed:_e(o1).default([]),deindexed:_e(kX).default([]),reasonGroups:_e(CX).default([])});pe({url:P(),type:We(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});pe({url:P(),type:We(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:We(["success","error"]),error:P().optional()});pe({date:P(),indexed:ce(),notIndexed:ce(),reasonBreakdown:Ta(P(),ce()).default({})});pe({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const Tb=pe({id:P(),url:P(),httpCode:ce().nullable().optional(),inIndex:lt().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:ce().nullable().optional(),anchorCount:ce().nullable().optional(),discoveryDate:P().nullable().optional()});pe({summary:pe({total:ce(),indexed:ce(),notIndexed:ce(),unknown:ce().optional(),percentage:ce()}),lastInspectedAt:P().nullable(),indexed:_e(Tb).default([]),notIndexed:_e(Tb).default([]),unknown:_e(Tb).default([]).optional()});pe({query:P(),impressions:ce(),clicks:ce(),ctr:ce(),averagePosition:ce()});pe({date:P(),indexed:ce(),notIndexed:ce(),unknown:ce()});pe({url:P(),status:We(["success","error"]),submittedAt:P(),error:P().optional()});const $u=We(["live","staging"]);pe({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:$u,createdAt:P(),updatedAt:P()});const Yz=pe({url:P(),reachable:lt(),pageCount:ce().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:_e(P()).optional(),authenticatedUser:pe({id:ce(),slug:P()}).nullable().optional()});pe({connected:lt(),projectName:P(),defaultEnv:$u,live:Yz.nullable(),staging:Yz.nullable(),adminUrl:P().nullable().optional()});const _X=pe({id:ce(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),YL=pe({title:P().nullable(),description:P().nullable(),noindex:lt().nullable(),writable:lt().default(!1),writeTargets:_e(P()).default([])}),AX=pe({type:P(),json:Ta(P(),zl())}),EX=_X.extend({env:$u,content:P(),seo:YL,schemaBlocks:_e(AX).default([])}),Wz=EX.extend({contentHash:P(),contentSnippet:P()}),WL=pe({manualRequired:Ei(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:_e(P()).default([])}),OX=pe({slug:P(),severity:We(["high","medium","low"]),code:We(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});pe({slug:P(),title:P(),status:P(),wordCount:ce(),seo:YL,schemaPresent:lt(),issues:_e(OX).default([])});const zX=pe({slug:P(),status:We(["applied","skipped","manual"]),error:P().optional(),manualAssist:WL.optional()});pe({env:$u,strategy:We(["plugin","manual"]),results:_e(zX)});const TX=pe({slug:P(),status:We(["deployed","stripped","skipped","failed"]),schemasInjected:_e(P()).optional(),manualAssist:WL.optional(),error:P().optional()});pe({env:$u,results:_e(TX)});const PX=pe({slug:P(),title:P(),canonrySchemas:_e(P()),thirdPartySchemas:_e(P()),hasCanonrySchema:lt()});pe({env:$u,pages:_e(PX)});const RX=pe({name:P(),status:We(["completed","skipped","failed"]),summary:P().optional(),error:P().optional()});pe({projectName:P(),steps:_e(RX)});pe({slug:P(),live:Wz,staging:Wz,hasDifferences:lt(),differences:pe({title:lt(),slug:lt(),content:lt(),seoTitle:lt(),seoDescription:lt(),noindex:lt(),schema:lt()})});const XL=We(["queued","running","completed","partial","failed","cancelled"]),tr=XL.enum,JL=We(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync"]),St=JL.enum,e5=We(["manual","scheduled","config-apply"]),Af=e5.enum,ku=We(["cited","not-cited"]),Hf=ku.enum,_g=We(["visible","not-visible"]);_g.enum;const t5=We(["new","cited","lost","emerging","not-cited"]);t5.enum;pe({kind:Ei(St["answer-visibility"]).optional(),trigger:Ei(Af.manual).optional(),providers:_e(hs).optional(),location:P().min(1).optional(),allLocations:lt().optional(),noLocation:lt().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const DX=pe({message:P(),raw:zl().optional()}),MX=pe({message:P().optional(),providers:Ta(P(),DX).optional()}),IX=pe({id:P(),projectId:P(),kind:JL,status:XL,trigger:e5.default("manual"),location:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:MX.nullable().optional(),createdAt:P()});function fN(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 n5=pe({uri:P(),title:P()}),r5=pe({id:P(),runId:P(),queryId:P(),query:P().optional(),provider:hs,citationState:ku,answerMentioned:lt().optional(),visibilityState:_g.optional(),transition:t5.optional(),answerText:P().nullable().optional(),citedDomains:_e(P()).default([]),competitorOverlap:_e(P()).default([]),recommendedCompetitors:_e(P()).default([]),matchedTerms:_e(P()).default([]),groundingSources:_e(n5).default([]),searchQueries:_e(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});pe({snapshots:_e(r5),total:ce().int().nonnegative()});const LX=pe({queryId:P().nullable(),query:P().nullable(),run1State:ku.nullable(),run2State:ku.nullable(),run1AnswerMentioned:lt().nullable(),run2AnswerMentioned:lt().nullable(),run1VisibilityState:_g.nullable(),run2VisibilityState:_g.nullable(),changed:lt(),visibilityChanged:lt()});pe({run1:P(),run2:P(),diff:_e(LX)});const $X=IX.extend({snapshots:_e(r5).optional()});pe({totalRuns:ce().int().nonnegative(),run:$X.nullable()});pe({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:zl().optional(),createdAt:P()});const BX=We(["yes","no","unknown","not-mentioned"]),Xz=_e(P().min(1));pe({companyName:P().min(1),domain:P().min(1),queries:Xz.optional(),phrases:Xz.optional(),competitors:_e(P().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const UX=pe({name:P(),count:ce().int().nonnegative()}),qX=pe({id:P(),name:P(),weight:ce(),score:ce(),grade:P(),status:We(["pass","partial","fail"]),findings:_e(pe({type:P(),message:P()})).default([]),recommendations:_e(P()).default([])}),FX=pe({url:P(),finalUrl:P(),auditedAt:P(),overallScore:ce(),overallGrade:P(),summary:P(),factors:_e(qX).default([])}),HX=pe({industry:P(),summary:P(),services:_e(P()).default([]),categoryTerms:_e(P()).default([])}),KX=pe({provider:P(),displayName:P(),model:P().nullable().optional(),mentioned:lt(),cited:lt(),describedAccurately:BX,accuracyNotes:P().nullable().optional(),incorrectClaims:_e(P()).default([]),recommendedCompetitors:_e(P()).default([]),citedDomains:_e(P()).default([]),groundingSources:_e(n5).default([]),searchQueries:_e(P()).default([]),answerText:P(),error:P().nullable().optional()}),GX=pe({query:P(),providerResults:_e(KX).default([])}),VX=pe({totalQueries:ce().int().nonnegative(),totalProviders:ce().int().nonnegative(),totalComparisons:ce().int().nonnegative(),mentionCount:ce().int().nonnegative(),citationCount:ce().int().nonnegative(),topCompetitors:_e(UX).default([]),visibilityGap:P(),whatThisMeans:_e(P()).default([]),recommendedActions:_e(P()).default([])});pe({companyName:P(),domain:P(),homepageUrl:P(),generatedAt:P(),queries:_e(P()).default([]),competitors:_e(P()).default([]),profile:HX,audit:FX,queryResults:_e(GX).default([]),summary:VX});pe({id:P(),projectId:P(),cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:lt().default(!0),providers:_e(hs).default([]),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});pe({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:lt().optional().default(!0),providers:_e(hs).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const QX=We(["mentioned","cited"]);QX.enum;pe({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:lt(),createdAt:P(),updatedAt:P()});pe({date:P(),landingPage:P(),sessions:ce(),organicSessions:ce(),users:ce()});const hN=We(["session","first_user","manual_utm"]),ZX=pe({source:P(),medium:P(),sessions:ce(),users:ce(),sourceDimension:hN}),YX=pe({source:P(),medium:P(),sourceDimension:hN,landingPage:P(),sessions:ce(),users:ce()}),WX=pe({source:P(),medium:P(),sessions:ce(),users:ce(),channelGroup:P()});pe({totalSessions:ce(),totalOrganicSessions:ce(),totalDirectSessions:ce(),totalUsers:ce(),topPages:_e(pe({landingPage:P(),sessions:ce(),organicSessions:ce(),directSessions:ce(),users:ce()})),aiReferrals:_e(ZX),aiReferralLandingPages:_e(YX),aiSessionsDeduped:ce(),aiUsersDeduped:ce(),aiSessionsBySession:ce(),aiUsersBySession:ce(),socialReferrals:_e(WX),socialSessions:ce(),socialUsers:ce(),organicSharePct:ce(),aiSharePct:ce(),aiSharePctBySession:ce(),directSharePct:ce(),socialSharePct:ce(),organicSharePctDisplay:P(),aiSharePctDisplay:P(),aiSharePctBySessionDisplay:P(),directSharePctDisplay:P(),socialSharePctDisplay:P(),lastSyncedAt:P().nullable()});pe({date:P(),source:P(),medium:P(),landingPage:P(),sessions:ce(),users:ce(),sourceDimension:hN});pe({date:P(),source:P(),medium:P(),sessions:ce(),users:ce(),channelGroup:P()});pe({date:P(),sessions:ce(),organicSessions:ce(),users:ce()});function Ag(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const XX=We(["aero","user","compaction"]);XX.enum;const i5=128;pe({key:P().min(1).max(i5),value:P().min(1)});pe({key:P().min(1).max(i5)});const pN=We(["queued","downloading","querying","ready","failed"]);pN.enum;pe({id:P(),release:P(),status:pN,phaseDetail:P().nullable().optional(),vertexPath:P().nullable().optional(),edgesPath:P().nullable().optional(),vertexSha256:P().nullable().optional(),edgesSha256:P().nullable().optional(),vertexBytes:ce().int().nullable().optional(),edgesBytes:ce().int().nullable().optional(),projectsProcessed:ce().int().nullable().optional(),domainsDiscovered:ce().int().nullable().optional(),downloadStartedAt:P().nullable().optional(),downloadFinishedAt:P().nullable().optional(),queryStartedAt:P().nullable().optional(),queryFinishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P(),updatedAt:P()});const JX=pe({linkingDomain:P(),numHosts:ce().int()}),eJ=pe({projectId:P(),release:P(),targetDomain:P(),totalLinkingDomains:ce().int(),totalHosts:ce().int(),top10HostsShare:P(),queriedAt:P(),excludedLinkingDomains:ce().int().optional(),excludedHosts:ce().int().optional()});pe({summary:eJ.nullable(),total:ce().int(),rows:_e(JX)});pe({release:P(),totalLinkingDomains:ce().int(),totalHosts:ce().int(),top10HostsShare:P(),queriedAt:P()});pe({duckdbInstalled:lt(),duckdbVersion:P().nullable().optional(),duckdbSpec:P(),pluginDir:P()});pe({installed:lt(),version:P(),path:P(),alreadyPresent:lt()});pe({release:P(),vertexUrl:P(),edgesUrl:P(),vertexBytes:ce().int().nullable(),edgesBytes:ce().int().nullable(),lastModified:P().nullable()});pe({release:P(),syncStatus:pN.nullable(),bytes:ce().int(),lastUsedAt:P().nullable()});We(["snapshot","insight"]);const tJ=pe({kind:Ei("snapshot"),id:P(),runId:P(),query:P(),provider:P(),model:P().nullable(),citationState:ku,matchedField:We(["answerText","citedDomains","searchQueries","query"]),snippet:P(),createdAt:P()}),nJ=pe({kind:Ei("insight"),id:P(),runId:P().nullable(),type:We(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:We(["critical","high","medium","low"]),title:P(),query:P(),provider:P(),matchedField:We(["title","query","recommendation","cause"]),snippet:P(),dismissed:lt(),createdAt:P()}),rJ=HW("kind",[tJ,nJ]);pe({query:P(),totalHits:ce().int().nonnegative(),truncated:lt(),hits:_e(rJ)});const a5=We(["create","expand","refresh","add-schema"]);a5.enum;function iJ(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const s5=We(["gsc","competitor-evidence","both"]);s5.enum;const o5=We(["high","medium","low"]);o5.enum;const aJ=We(["blog-post","comparison","listicle","how-to","guide","glossary"]);aJ.enum;const l5=We(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);l5.enum;const sJ=pe({url:P(),gscImpressions:ce().nonnegative(),gscClicks:ce().nonnegative(),gscAvgPosition:ce().nonnegative().nullable(),organicSessions:ce().nonnegative()}),oJ=pe({domain:P(),url:P(),title:P(),citationCount:ce().int().nonnegative()}),lJ=pe({demand:ce(),competitor:ce(),absence:ce(),gapSeverity:ce()}),cJ=pe({actionId:P(),state:l5,lastUpdated:P()}),uJ=pe({targetRef:P(),query:P(),action:a5,ourBestPage:sJ.nullable(),winningCompetitor:oJ.nullable(),score:ce(),scoreBreakdown:lJ,drivers:_e(P()),demandSource:s5,actionConfidence:o5,existingAction:cJ.nullable()});pe({targets:_e(uJ),contextMetrics:pe({totalAiReferralSessions:ce().int().nonnegative(),latestRunId:P(),runTimestamp:P()})});const dJ=pe({uri:P(),title:P(),domain:P(),isOurDomain:lt(),isCompetitor:lt(),citationCount:ce().int().nonnegative(),providers:_e(hs)}),fJ=pe({query:P(),groundingSources:_e(dJ)});pe({sources:_e(fJ),latestRunId:P()});const hJ=pe({query:P(),competitorDomains:_e(P()),competitorCount:ce().int().nonnegative(),missRate:ce().min(0).max(1),lastSeenInRunId:P()});pe({gaps:_e(hJ),latestRunId:P()});const c5=We(["ok","warn","fail","skipped"]);c5.enum;const mN=We(["global","project"]);mN.enum;const u5=We(["auth","config","providers","integrations","database","schedules"]);u5.enum;const pJ=pe({id:P(),category:u5,scope:mN,title:P(),status:c5,code:P().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:P(),remediation:P().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Ta(P(),zl()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:ce().int().nonnegative().describe("How long the check took to execute.")});pe({scope:mN,project:P().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:P().describe("ISO-8601 timestamp when this doctor run started."),durationMs:ce().int().nonnegative(),summary:pe({total:ce().int().nonnegative(),ok:ce().int().nonnegative(),warn:ce().int().nonnegative(),fail:ce().int().nonnegative(),skipped:ce().int().nonnegative()}),checks:_e(pJ)});const mJ=pe({provider:P(),citationState:ku,cited:lt(),mentioned:lt(),runId:P(),runCreatedAt:P()}),gJ=pe({queryId:P(),query:P(),providers:_e(mJ),citedCount:ce().int().nonnegative(),mentionedCount:ce().int().nonnegative(),totalProviders:ce().int().nonnegative()}),yJ=pe({queryId:P(),query:P(),provider:P(),citingCompetitors:_e(P()),runId:P(),runCreatedAt:P()}),vJ=pe({providersConfigured:ce().int().nonnegative(),providersCiting:ce().int().nonnegative(),providersMentioning:ce().int().nonnegative(),totalQueries:ce().int().nonnegative(),queriesCitedAndMentioned:ce().int().nonnegative(),queriesCitedOnly:ce().int().nonnegative(),queriesMentionedOnly:ce().int().nonnegative(),queriesInvisible:ce().int().nonnegative(),latestRunId:P().nullable(),latestRunAt:P().nullable()});pe({summary:vJ,byQuery:_e(gJ),competitorGaps:_e(yJ),status:We(["ready","no-data"]),reason:We(["no-runs-yet","no-queries"]).optional()});function xJ(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function bJ(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function wJ(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function SJ(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function jJ(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const NJ=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function d5(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function f5(e){return e.length>4&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function h5(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(d5).map(f5).filter(Boolean)):new Set}function p5(e,t){const n=d5(e).map(f5).filter(Boolean).filter(r=>!NJ.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function kJ(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function CJ(e,t){const n=h5(e);if(t.length<=1||n.size===0)return[...t];const r=new Set,i=[];for(const a of t){if(a.category!=="content"){i.push(a);continue}const o=p5(kJ(a),n);!o||r.has(o)||(r.add(o),i.push(a))}return i}function _J(e){const t=h5(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=p5(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const AJ=We(["claude","codex"]);AJ.enum;const EJ=We(["claude","codex","all"]);EJ.enum;const gN=We(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);gN.enum;const OJ=We(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);OJ.enum;const zJ=We(["raw-request","aggregate-bucket"]),TJ=zJ.enum,PJ=We(["observed","provider-aggregated","inferred"]),RJ=PJ.enum,DJ=pe({type:P().nullable(),labels:Ta(P(),P())}),MJ=pe({sourceType:gN,evidenceKind:Ei(TJ["raw-request"]),confidence:Ei(RJ.observed),eventId:P().min(1),observedAt:P().min(1),method:P().nullable(),requestUrl:P().nullable(),host:P().nullable(),path:P().min(1),queryString:P().nullable(),status:ce().int().nullable(),userAgent:P().nullable(),remoteIp:P().nullable(),referer:P().nullable(),latencyMs:ce().nullable(),requestSizeBytes:ce().int().nullable(),responseSizeBytes:ce().int().nullable(),providerResource:DJ,providerLabels:Ta(P(),P())});pe({events:_e(MJ),rawEntryCount:ce().int().nonnegative(),skippedEntryCount:ce().int().nonnegative(),nextPageToken:P().optional(),filter:P()});const m5=We(["connected","paused","error","archived"]);m5.enum;const g5=We(["oauth","service-account"]);g5.enum;pe({gcpProjectId:P().min(1),serviceName:P().nullable().optional(),location:P().nullable().optional(),authMode:g5});pe({id:P(),projectId:P(),sourceType:gN,displayName:P(),status:m5,lastSyncedAt:P().nullable(),lastCursor:P().nullable(),lastError:P().nullable(),archivedAt:P().nullable(),config:Ta(P(),zl()),createdAt:P(),updatedAt:P()});pe({gcpProjectId:P().min(1),serviceName:P().min(1).optional(),location:P().min(1).optional(),displayName:P().min(1).optional(),keyJson:P().optional()});pe({sourceId:P(),runId:P(),syncedAt:P(),pulledEvents:ce().int().nonnegative(),crawlerHits:ce().int().nonnegative(),aiReferralHits:ce().int().nonnegative(),unknownHits:ce().int().nonnegative(),crawlerBucketRows:ce().int().nonnegative(),aiReferralBucketRows:ce().int().nonnegative(),sampleRows:ce().int().nonnegative(),windowStart:P(),windowEnd:P()});var lo=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(lo||{});const IJ={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},lm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},LJ=fN;function $J(e){const t=[];if(e.message&&t.push(e.message),e.providers)for(const[n,r]of Object.entries(e.providers)){const i=`[${n}] ${r.message}`;r.raw!==void 0?t.push(`${i}
48
+
49
+ ${JSON.stringify(r.raw,null,2)}`):t.push(i)}return t.length>0?t.join(`
50
+
51
+ `):"Run failed."}function Gy(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ki(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Jz(e){return e===null?"Unknown":e?"Pass":"Fail"}function l1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function BJ(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function UJ(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 Pb(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 ${l1(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 ${l1(u)} · ${r}`}return`${e} · ${r}`}function Eg(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function y5(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 qJ(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 FJ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function HJ(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function wo(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
52
+ `):void 0}function KJ(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:Eg(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:Eg(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=>HJ(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function GJ(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 VJ(e,t,n){const r=GJ(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 v5="canonry.run-tracker",c1=new Set;let e2=!1,QJ=0,Vy={runs:{},batches:{}};function ZJ(){const e=Tl();for(const t of c1)t(e)}function YJ(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function WJ(){typeof window>"u"||window.sessionStorage.setItem(v5,JSON.stringify(Vy))}function x5(){e2||(e2=!0,!(typeof window>"u")&&(Vy=YJ(window.sessionStorage.getItem(v5))))}function Qy(e){Vy=e,WJ(),ZJ()}function Tl(){return x5(),Vy}function XJ(e){return x5(),c1.add(e),()=>{c1.delete(e)}}function b5(e){const t=Tl();Qy({...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 t2(e){const t=Tl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Qy({...t,runs:r})}function JJ(e){const t=Tl(),n=`batch_${Date.now()}_${++QJ}`;return Qy({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function eee(e){const t=Tl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Qy({...t,batches:r})}function yN(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function tee(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 n2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vN(...e){return t=>{let n=!1;const r=e.map(i=>{const a=n2(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():n2(e[i],null)}}}}function Vl(...e){return b.useCallback(vN(...e),e)}var nee=Symbol.for("react.lazy"),Og=Py[" use ".trim().toString()];function ree(e){return typeof e=="object"&&e!==null&&"then"in e}function w5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nee&&"_payload"in e&&ree(e._payload)}function iee(e){const t=see(e),n=b.forwardRef((r,i)=>{let{children:a,...o}=r;w5(a)&&typeof Og=="function"&&(a=Og(a._payload));const u=b.Children.toArray(a),d=u.find(lee);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var aee=iee("Slot");function see(e){const t=b.forwardRef((n,r)=>{let{children:i,...a}=n;if(w5(i)&&typeof Og=="function"&&(i=Og(i._payload)),b.isValidElement(i)){const o=uee(i),u=cee(a,i.props);return i.type!==b.Fragment&&(u.ref=r?vN(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oee=Symbol("radix.slottable");function lee(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oee}function cee(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 uee(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 S5(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=S5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=S5(e))&&(r&&(r+=" "),r+=t);return r}const r2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,i2=Rt,j5=(e,t)=>n=>{var r;if(t?.variants==null)return i2(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=r2(p)||r2(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(S=>{let[w,j]=S;return Array.isArray(j)?j.includes({...a,...u}[w]):{...a,...u}[w]===j})?[...f,m,y]:f},[]);return i2(e,o,d,n?.class,n?.className)},dee=(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},fee=(e,t)=>({classGroupId:e,validator:t}),N5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),zg="-",a2=[],hee="arbitrary..",pee=e=>{const t=gee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return mee(o);const u=o.split(zg),d=u[0]===""&&u.length>1?1:0;return k5(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=r[o],f=n[o];return d?f?dee(f,d):d:f||a2}return n[o]||a2}}},k5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=k5(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const u=t===0?e.join(zg):e.slice(t).join(zg),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},mee=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?hee+r:void 0})(),gee=e=>{const{theme:t,classGroups:n}=e;return yee(n,t)},yee=(e,t)=>{const n=N5();for(const r in e){const i=e[r];xN(i,n,r,t)}return n},xN=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];vee(o,t,n,r)}},vee=(e,t,n,r)=>{if(typeof e=="string"){xee(e,t,n);return}if(typeof e=="function"){bee(e,t,n,r);return}wee(e,t,n,r)},xee=(e,t,n)=>{const r=e===""?t:C5(t,e);r.classGroupId=n},bee=(e,t,n,r)=>{if(See(e)){xN(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(fee(n,e))},wee=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[u,d]=i[o];xN(d,C5(t,u),n,r)}},C5=(e,t)=>{let n=e;const r=t.split(zg),i=r.length;for(let a=0;a<i;a++){const o=r[a];let u=n.nextPart.get(o);u||(u=N5(),n.nextPart.set(o,u)),n=u}return n},See=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,jee=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)}}},u1="!",s2=":",Nee=[],o2=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),kee=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 w=0;w<p;w++){const j=i[w];if(o===0&&u===0){if(j===s2){a.push(i.slice(d,w)),d=w+1;continue}if(j==="/"){f=w;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(u1)?(y=m.slice(0,-1),v=!0):m.startsWith(u1)&&(y=m.slice(1),v=!0);const S=f&&f>d?f-d:void 0;return o2(a,v,y,S)};if(t){const i=t+s2,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):o2(Nee,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Cee=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}},_ee=e=>({cache:jee(e.cacheSize),parseClassName:kee(e),sortModifiers:Cee(e),...pee(e)}),Aee=/\s+/,Eee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],u=e.trim().split(Aee);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!w,k=r(j?S.substring(0,w):S);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(S),!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+u1:O,A=_+k;if(o.indexOf(A)>-1)continue;o.push(A);const T=i(k,j);for(let C=0;C<T.length;++C){const z=T[C];o.push(_+z)}d=p+(d.length>0?" "+d:d)}return d},Oee=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=_5(n))&&(i&&(i+=" "),i+=r);return i},_5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_5(e[r]))&&(n&&(n+=" "),n+=t);return n},zee=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=_ee(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=Eee(d,n);return i(d,p),p};return a=o,(...d)=>a(Oee(...d))},Tee=[],Mn=e=>{const t=n=>n[e]||Tee;return t.isThemeGetter=!0,t},A5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,E5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ree=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dee=/\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$/,Mee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zs=e=>Pee.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),Ys=e=>!!e&&Number.isInteger(Number(e)),Rb=e=>e.endsWith("%")&&ut(e.slice(0,-1)),es=e=>Ree.test(e),O5=()=>!0,$ee=e=>Dee.test(e)&&!Mee.test(e),bN=()=>!1,Bee=e=>Iee.test(e),Uee=e=>Lee.test(e),qee=e=>!Me(e)&&!Ie(e),Fee=e=>Ao(e,P5,bN),Me=e=>A5.test(e),el=e=>Ao(e,R5,$ee),l2=e=>Ao(e,Wee,ut),Hee=e=>Ao(e,M5,O5),Kee=e=>Ao(e,D5,bN),c2=e=>Ao(e,z5,bN),Gee=e=>Ao(e,T5,Uee),cm=e=>Ao(e,I5,Bee),Ie=e=>E5.test(e),nf=e=>Ql(e,R5),Vee=e=>Ql(e,D5),u2=e=>Ql(e,z5),Qee=e=>Ql(e,P5),Zee=e=>Ql(e,T5),um=e=>Ql(e,I5,!0),Yee=e=>Ql(e,M5,!0),Ao=(e,t,n)=>{const r=A5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ql=(e,t,n=!1)=>{const r=E5.exec(e);return r?r[1]?t(r[1]):n:!1},z5=e=>e==="position"||e==="percentage",T5=e=>e==="image"||e==="url",P5=e=>e==="length"||e==="size"||e==="bg-size",R5=e=>e==="length",Wee=e=>e==="number",D5=e=>e==="family-name",M5=e=>e==="number"||e==="weight",I5=e=>e==="shadow",Xee=()=>{const e=Mn("color"),t=Mn("font"),n=Mn("text"),r=Mn("font-weight"),i=Mn("tracking"),a=Mn("leading"),o=Mn("breakpoint"),u=Mn("container"),d=Mn("spacing"),f=Mn("radius"),p=Mn("shadow"),m=Mn("inset-shadow"),y=Mn("text-shadow"),v=Mn("drop-shadow"),S=Mn("blur"),w=Mn("perspective"),j=Mn("aspect"),k=Mn("ease"),O=Mn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),Ie,Me],C=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],R=()=>[Ie,Me,d],B=()=>[Zs,"full","auto",...R()],F=()=>[Ys,"none","subgrid",Ie,Me],q=()=>["auto",{span:["full",Ys,Ie,Me]},Ys,Ie,Me],$=()=>[Ys,"auto",Ie,Me],V=()=>["auto","min","max","fr",Ie,Me],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],ee=()=>[Zs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],le=()=>[Zs,"screen","full","dvw","lvw","svw","min","max","fit",...R()],je=()=>[Zs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],L=()=>[e,Ie,Me],I=()=>[...A(),u2,c2,{position:[Ie,Me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Qee,Fee,{size:[Ie,Me]}],G=()=>[Rb,nf,el],ae=()=>["","none","full",f,Ie,Me],ne=()=>["",ut,nf,el],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"],X=()=>[ut,Rb,u2,c2],me=()=>["","none",S,Ie,Me],Ee=()=>["none",ut,Ie,Me],Y=()=>["none",ut,Ie,Me],Fe=()=>[ut,Ie,Me],Te=()=>[Zs,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[es],breakpoint:[es],color:[O5],container:[es],"drop-shadow":[es],ease:["in","out","in-out"],font:[qee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[es],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[es],shadow:[es],spacing:["px",ut],text:[es],"text-shadow":[es],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zs,Me,Ie,j]}],container:["container"],columns:[{columns:[ut,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:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Ys,"auto",Ie,Me]}],basis:[{basis:[Zs,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,Zs,"auto","initial","none",Me]}],grow:[{grow:["",ut,Ie,Me]}],shrink:[{shrink:["",ut,Ie,Me]}],order:[{order:[Ys,"first","last","none",Ie,Me]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"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",...ee()]}],"min-w":[{"min-w":[u,"screen","none",...ee()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,nf,el]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Yee,Hee]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rb,Me]}],"font-family":[{font:[Vee,Kee,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":[ut,"none",Ie,l2]}],leading:[{leading:[a,...R()]}],"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:[ut,"from-font","auto",Ie,el]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[ut,"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:R()}],"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:U()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ys,Ie,Me],radial:["",Ie,Me],conic:[Ys,Ie,Me]},Zee,Gee]}],"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:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"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":[ut,Ie,Me]}],"outline-w":[{outline:["",ut,nf,el]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,um,cm]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,um,cm]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[ut,el]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,um,cm]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[ut,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":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"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":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"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":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"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":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"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":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"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":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"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":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"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":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"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:U()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Me]}],filter:[{filter:["","none",Ie,Me]}],blur:[{blur:me()}],brightness:[{brightness:[ut,Ie,Me]}],contrast:[{contrast:[ut,Ie,Me]}],"drop-shadow":[{"drop-shadow":["","none",v,um,cm]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",ut,Ie,Me]}],"hue-rotate":[{"hue-rotate":[ut,Ie,Me]}],invert:[{invert:["",ut,Ie,Me]}],saturate:[{saturate:[ut,Ie,Me]}],sepia:[{sepia:["",ut,Ie,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Me]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[ut,Ie,Me]}],"backdrop-contrast":[{"backdrop-contrast":[ut,Ie,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,Ie,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,Ie,Me]}],"backdrop-invert":[{"backdrop-invert":["",ut,Ie,Me]}],"backdrop-opacity":[{"backdrop-opacity":[ut,Ie,Me]}],"backdrop-saturate":[{"backdrop-saturate":[ut,Ie,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,Ie,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"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:[ut,"initial",Ie,Me]}],ease:[{ease:["linear","initial",k,Ie,Me]}],delay:[{delay:[ut,Ie,Me]}],animate:[{animate:["none",O,Ie,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ie,Me]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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:[ut,nf,el,l2]}],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"]}},Jee=zee(Xee);function Ri(...e){return Jee(Rt(e))}const ete=j5("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=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?aee:"button";return l.jsx(o,{ref:a,className:Ri(ete({variant:t,size:n,className:e})),...i})});xe.displayName="Button";const tte=j5("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 L5({className:e,variant:t,...n}){return l.jsx("div",{className:Ri(tte({variant:t}),e),...n})}function d2({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 Pl({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 mt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(L5,{variant:r,...n,children:t})}function Zy({status:e}){return l.jsx(mt,{tone:y5(e),children:Gy(e)})}function po(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function nte(e,t){const n=b.createContext(t),r=a=>{const{children:o,...u}=a,d=b.useMemo(()=>u,Object.values(u));return l.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=b.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function rte(e,t=[]){let n=[];function r(a,o){const u=b.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...S}=m,w=y?.[e]?.[d]||u,j=b.useMemo(()=>S,Object.values(S));return l.jsx(w.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||u,S=b.useContext(v);if(S)return S;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>b.createContext(o));return function(u){const d=u?.[e]||a;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,ite(i,...t)]}function ite(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Kf=globalThis?.document?b.useLayoutEffect:()=>{},ate=Py[" useId ".trim().toString()]||(()=>{}),ste=0;function Db(e){const[t,n]=b.useState(ate());return Kf(()=>{n(r=>r??String(ste++))},[e]),e||(t?`radix-${t}`:"")}var ote=Py[" useInsertionEffect ".trim().toString()]||Kf;function lte({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=cte({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=b.useRef(e!==void 0);b.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const f=b.useCallback(p=>{if(u){const m=ute(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[u,e,a,o]);return[d,f]}function cte({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return ote(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ute(e){return typeof e=="function"}function $5(e){const t=dte(e),n=b.forwardRef((r,i)=>{const{children:a,...o}=r,u=b.Children.toArray(a),d=u.find(hte);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function dte(e){const t=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const o=mte(i),u=pte(a,i.props);return i.type!==b.Fragment&&(u.ref=r?vN(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fte=Symbol("radix.slottable");function hte(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fte}function pte(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 mte(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 gte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ps=gte.reduce((e,t)=>{const n=$5(`Primitive.${t}`),r=b.forwardRef((i,a)=>{const{asChild:o,...u}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function yte(e,t){e&&Kl.flushSync(()=>e.dispatchEvent(t))}function Gf(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function vte(e,t=globalThis?.document){const n=Gf(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var xte="DismissableLayer",d1="dismissableLayer.update",bte="dismissableLayer.pointerDownOutside",wte="dismissableLayer.focusOutside",f2,B5=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),U5=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:u,...d}=e,f=b.useContext(B5),[p,m]=b.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=b.useState({}),S=Vl(t,z=>m(z)),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(j),O=p?w.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=k,T=Nte(z=>{const R=z.target,B=[...f.branches].some(F=>F.contains(R));!A||B||(i?.(z),o?.(z),z.defaultPrevented||u?.())},y),C=kte(z=>{const R=z.target;[...f.branches].some(F=>F.contains(R))||(a?.(z),o?.(z),z.defaultPrevented||u?.())},y);return vte(z=>{O===f.layers.size-1&&(r?.(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))},y),b.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(f2=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),h2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=f2)}},[p,y,n,f]),b.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),h2())},[p,f]),b.useEffect(()=>{const z=()=>v({});return document.addEventListener(d1,z),()=>document.removeEventListener(d1,z)},[]),l.jsx(ps.div,{...d,ref:S,style:{pointerEvents:_?A?"auto":"none":void 0,...e.style},onFocusCapture:po(e.onFocusCapture,C.onFocusCapture),onBlurCapture:po(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:po(e.onPointerDownCapture,T.onPointerDownCapture)})});U5.displayName=xte;var Ste="DismissableLayerBranch",jte=b.forwardRef((e,t)=>{const n=b.useContext(B5),r=b.useRef(null),i=Vl(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(ps.div,{...e,ref:i})});jte.displayName=Ste;function Nte(e,t=globalThis?.document){const n=Gf(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){q5(bte,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 kte(e,t=globalThis?.document){const n=Gf(e),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&q5(wte,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 h2(){const e=new CustomEvent(d1);document.dispatchEvent(e)}function q5(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?yte(i,a):i.dispatchEvent(a)}var Mb="focusScope.autoFocusOnMount",Ib="focusScope.autoFocusOnUnmount",p2={bubbles:!1,cancelable:!0},Cte="FocusScope",F5=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[u,d]=b.useState(null),f=Gf(i),p=Gf(a),m=b.useRef(null),y=Vl(t,w=>d(w)),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let w=function(_){if(v.paused||!u)return;const A=_.target;u.contains(A)?m.current=A:Js(m.current,{select:!0})},j=function(_){if(v.paused||!u)return;const A=_.relatedTarget;A!==null&&(u.contains(A)||Js(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const T of _)T.removedNodes.length>0&&Js(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",j);const O=new MutationObserver(k);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",j),O.disconnect()}}},[r,u,v.paused]),b.useEffect(()=>{if(u){g2.add(v);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(Mb,p2);u.addEventListener(Mb,f),u.dispatchEvent(k),k.defaultPrevented||(_te(Tte(H5(u)),{select:!0}),document.activeElement===w&&Js(u))}return()=>{u.removeEventListener(Mb,f),setTimeout(()=>{const k=new CustomEvent(Ib,p2);u.addEventListener(Ib,p),u.dispatchEvent(k),k.defaultPrevented||Js(w??document.body,{select:!0}),u.removeEventListener(Ib,p),g2.remove(v)},0)}}},[u,f,p,v]);const S=b.useCallback(w=>{if(!n&&!r||v.paused)return;const j=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(j&&k){const O=w.currentTarget,[_,A]=Ate(O);_&&A?!w.shiftKey&&k===A?(w.preventDefault(),n&&Js(_,{select:!0})):w.shiftKey&&k===_&&(w.preventDefault(),n&&Js(A,{select:!0})):k===O&&w.preventDefault()}},[n,r,v.paused]);return l.jsx(ps.div,{tabIndex:-1,...o,ref:y,onKeyDown:S})});F5.displayName=Cte;function _te(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Js(r,{select:t}),document.activeElement!==n)return}function Ate(e){const t=H5(e),n=m2(t,e),r=m2(t.reverse(),e);return[n,r]}function H5(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 m2(e,t){for(const n of e)if(!Ete(n,{upTo:t}))return n}function Ete(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 Ote(e){return e instanceof HTMLInputElement&&"select"in e}function Js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ote(e)&&t&&e.select()}}var g2=zte();function zte(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=y2(e,t),e.unshift(t)},remove(t){e=y2(e,t),e[0]?.resume()}}}function y2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tte(e){return e.filter(t=>t.tagName!=="A")}var Pte="Portal",K5=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=b.useState(!1);Kf(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?C7.createPortal(l.jsx(ps.div,{...r,ref:t}),o):null});K5.displayName=Pte;function Rte(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Yy=e=>{const{present:t,children:n}=e,r=Dte(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=Vl(r.ref,Mte(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};Yy.displayName="Presence";function Dte(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef("none"),o=e?"mounted":"unmounted",[u,d]=Rte(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=dm(r.current);a.current=u==="mounted"?f:"none"},[u]),Kf(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=dm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Kf(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const w=dm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=dm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function dm(e){return e?.animationName||"none"}function Mte(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 Lb=0;function Ite(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??v2()),document.body.insertAdjacentElement("beforeend",e[1]??v2()),Lb++,()=>{Lb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lb--}},[])}function v2(){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 ga=function(){return ga=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},ga.apply(this,arguments)};function G5(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 Lte(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 Wm="right-scroll-bar-position",Xm="width-before-scroll-bar",$te="with-scroll-bars-hidden",Bte="--removed-body-scroll-bar-size";function $b(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ute(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var qte=typeof window<"u"?b.useLayoutEffect:b.useEffect,x2=new WeakMap;function Fte(e,t){var n=Ute(null,function(r){return e.forEach(function(i){return $b(i,r)})});return qte(function(){var r=x2.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(u){a.has(u)||$b(u,null)}),a.forEach(function(u){i.has(u)||$b(u,o)})}x2.set(n,e)},[e]),n}function Hte(e){return e}function Kte(e,t){t===void 0&&(t=Hte);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 Gte(e){e===void 0&&(e={});var t=Kte(null);return t.options=ga({async:!0,ssr:!1},e),t}var V5=function(e){var t=e.sideCar,n=G5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,ga({},n))};V5.isSideCarExport=!0;function Vte(e,t){return e.useMedium(t),V5}var Q5=Gte(),Bb=function(){},Wy=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Bb,onWheelCapture:Bb,onTouchMoveCapture:Bb}),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,S=e.noIsolation,w=e.inert,j=e.allowPinchZoom,k=e.as,O=k===void 0?"div":k,_=e.gapMode,A=G5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=y,C=Fte([n,t]),z=ga(ga({},A),i);return b.createElement(b.Fragment,null,p&&b.createElement(T,{sideCar:Q5,removeScrollBar:f,shards:m,noRelative:v,noIsolation:S,inert:w,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?b.cloneElement(b.Children.only(u),ga(ga({},z),{ref:C})):b.createElement(O,ga({},z,{className:d,ref:C}),u))});Wy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wy.classNames={fullWidth:Xm,zeroRight:Wm};var Qte=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qte();return t&&e.setAttribute("nonce",t),e}function Yte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zte())&&(Yte(t,n),Wte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jte=function(){var e=Xte();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Z5=function(){var e=Jte(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ene={left:0,top:0,right:0,gap:0},Ub=function(e){return parseInt(e||"",10)||0},tne=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[Ub(n),Ub(r),Ub(i)]},nne=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ene;var t=tne(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])}},rne=Z5(),fu="data-scroll-locked",ine=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($te,` {
54
+ overflow: hidden `).concat(r,`;
55
+ padding-right: `).concat(u,"px ").concat(r,`;
56
+ }
57
+ body[`).concat(fu,`] {
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(Wm,` {
71
+ right: `).concat(u,"px ").concat(r,`;
72
+ }
73
+
74
+ .`).concat(Xm,` {
75
+ margin-right: `).concat(u,"px ").concat(r,`;
76
+ }
77
+
78
+ .`).concat(Wm," .").concat(Wm,` {
79
+ right: 0 `).concat(r,`;
80
+ }
81
+
82
+ .`).concat(Xm," .").concat(Xm,` {
83
+ margin-right: 0 `).concat(r,`;
84
+ }
85
+
86
+ body[`).concat(fu,`] {
87
+ `).concat(Bte,": ").concat(u,`px;
88
+ }
89
+ `)},b2=function(){var e=parseInt(document.body.getAttribute(fu)||"0",10);return isFinite(e)?e:0},ane=function(){b.useEffect(function(){return document.body.setAttribute(fu,(b2()+1).toString()),function(){var e=b2()-1;e<=0?document.body.removeAttribute(fu):document.body.setAttribute(fu,e.toString())}},[])},sne=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;ane();var a=b.useMemo(function(){return nne(i)},[i]);return b.createElement(rne,{styles:ine(a,!t,i,n?"":"!important")})},f1=!1;if(typeof window<"u")try{var fm=Object.defineProperty({},"passive",{get:function(){return f1=!0,!0}});window.addEventListener("test",fm,fm),window.removeEventListener("test",fm,fm)}catch{f1=!1}var Mc=f1?{passive:!1}:!1,one=function(e){return e.tagName==="TEXTAREA"},Y5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!one(e)&&n[t]==="visible")},lne=function(e){return Y5(e,"overflowY")},cne=function(e){return Y5(e,"overflowX")},w2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=W5(e,r);if(i){var a=X5(e,r),o=a[1],u=a[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},une=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},W5=function(e,t){return e==="v"?lne(t):cne(t)},X5=function(e,t){return e==="v"?une(t):dne(t)},fne=function(e,t){return e==="h"&&t==="rtl"?-1:1},hne=function(e,t,n,r,i){var a=fne(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=X5(e,u),S=v[0],w=v[1],j=v[2],k=w-j-a*S;(S||k)&&W5(e,u)&&(m+=k,y+=S);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},hm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S2=function(e){return[e.deltaX,e.deltaY]},j2=function(e){return e&&"current"in e?e.current:e},pne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mne=function(e){return`
90
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
91
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
+ `)},gne=0,Ic=[];function yne(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(gne++)[0],a=b.useState(Z5)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=Lte([e.lockRef.current],(e.shards||[]).map(j2),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var k=hm(w),O=n.current,_="deltaX"in w?w.deltaX:O[0]-k[0],A="deltaY"in w?w.deltaY:O[1]-k[1],T,C=w.target,z=Math.abs(_)>Math.abs(A)?"h":"v";if("touches"in w&&z==="h"&&C.type==="range")return!1;var R=window.getSelection(),B=R&&R.anchorNode,F=B?B===C||B.contains(C):!1;if(F)return!1;var q=w2(z,C);if(!q)return!0;if(q?T=z:(T=z==="v"?"h":"v",q=w2(z,C)),!q)return!1;if(!r.current&&"changedTouches"in w&&(_||A)&&(r.current=T),!T)return!0;var $=r.current||T;return hne($,j,w,$==="h"?_:A)},[]),d=b.useCallback(function(w){var j=w;if(!(!Ic.length||Ic[Ic.length-1]!==a)){var k="deltaY"in j?S2(j):hm(j),O=t.current.filter(function(T){return T.name===j.type&&(T.target===j.target||j.target===T.shadowParent)&&pne(T.delta,k)})[0];if(O&&O.should){j.cancelable&&j.preventDefault();return}if(!O){var _=(o.current.shards||[]).map(j2).filter(Boolean).filter(function(T){return T.contains(j.target)}),A=_.length>0?u(j,_[0]):!o.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),f=b.useCallback(function(w,j,k,O){var _={name:w,delta:j,target:k,should:O,shadowParent:vne(k)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(A){return A!==_})},1)},[]),p=b.useCallback(function(w){n.current=hm(w),r.current=void 0},[]),m=b.useCallback(function(w){f(w.type,S2(w),w.target,u(w,e.lockRef.current))},[]),y=b.useCallback(function(w){f(w.type,hm(w),w.target,u(w,e.lockRef.current))},[]);b.useEffect(function(){return Ic.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Mc),document.addEventListener("touchmove",d,Mc),document.addEventListener("touchstart",p,Mc),function(){Ic=Ic.filter(function(w){return w!==a}),document.removeEventListener("wheel",d,Mc),document.removeEventListener("touchmove",d,Mc),document.removeEventListener("touchstart",p,Mc)}},[]);var v=e.removeScrollBar,S=e.inert;return b.createElement(b.Fragment,null,S?b.createElement(a,{styles:mne(i)}):null,v?b.createElement(sne,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vne(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xne=Vte(Q5,yne);var J5=b.forwardRef(function(e,t){return b.createElement(Wy,ga({},e,{ref:t,sideCar:xne}))});J5.classNames=Wy.classNames;var bne=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lc=new WeakMap,pm=new WeakMap,mm={},qb=0,e4=function(e){return e&&(e.host||e4(e.parentNode))},wne=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=e4(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})},Sne=function(e,t,n,r){var i=wne(t,Array.isArray(e)?e:[e]);mm[n]||(mm[n]=new WeakMap);var a=mm[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),S=v!==null&&v!=="false",w=(Lc.get(y)||0)+1,j=(a.get(y)||0)+1;Lc.set(y,w),a.set(y,j),o.push(y),w===1&&S&&pm.set(y,!0),j===1&&y.setAttribute(n,"true"),S||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),u.clear(),qb++,function(){o.forEach(function(m){var y=Lc.get(m)-1,v=a.get(m)-1;Lc.set(m,y),a.set(m,v),y||(pm.has(m)||m.removeAttribute(r),pm.delete(m)),v||m.removeAttribute(n)}),qb--,qb||(Lc=new WeakMap,Lc=new WeakMap,pm=new WeakMap,mm={})}},jne=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=bne(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Sne(r,i,n,"aria-hidden")):function(){return null}},Xy="Dialog",[t4]=rte(Xy),[Nne,Xi]=t4(Xy),n4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,u=b.useRef(null),d=b.useRef(null),[f,p]=lte({prop:r,defaultProp:i??!1,onChange:a,caller:Xy});return l.jsx(Nne,{scope:t,triggerRef:u,contentRef:d,contentId:Db(),titleId:Db(),descriptionId:Db(),open:f,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};n4.displayName=Xy;var r4="DialogTrigger",kne=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xi(r4,n),a=Vl(t,i.triggerRef);return l.jsx(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jN(i.open),...r,ref:a,onClick:po(e.onClick,i.onOpenToggle)})});kne.displayName=r4;var wN="DialogPortal",[Cne,i4]=t4(wN,{forceMount:void 0}),a4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Xi(wN,t);return l.jsx(Cne,{scope:t,forceMount:n,children:b.Children.map(r,o=>l.jsx(Yy,{present:n||a.open,children:l.jsx(K5,{asChild:!0,container:i,children:o})}))})};a4.displayName=wN;var Tg="DialogOverlay",s4=b.forwardRef((e,t)=>{const n=i4(Tg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Xi(Tg,e.__scopeDialog);return a.modal?l.jsx(Yy,{present:r||a.open,children:l.jsx(Ane,{...i,ref:t})}):null});s4.displayName=Tg;var _ne=$5("DialogOverlay.RemoveScroll"),Ane=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xi(Tg,n);return l.jsx(J5,{as:_ne,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(ps.div,{"data-state":jN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Rl="DialogContent",o4=b.forwardRef((e,t)=>{const n=i4(Rl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Xi(Rl,e.__scopeDialog);return l.jsx(Yy,{present:r||a.open,children:a.modal?l.jsx(Ene,{...i,ref:t}):l.jsx(One,{...i,ref:t})})});o4.displayName=Rl;var Ene=b.forwardRef((e,t)=>{const n=Xi(Rl,e.__scopeDialog),r=b.useRef(null),i=Vl(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return jne(a)},[]),l.jsx(l4,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:po(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:po(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&a.preventDefault()}),onFocusOutside:po(e.onFocusOutside,a=>a.preventDefault())})}),One=b.forwardRef((e,t)=>{const n=Xi(Rl,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return l.jsx(l4,{...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()}})}),l4=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,u=Xi(Rl,n),d=b.useRef(null),f=Vl(t,d);return Ite(),l.jsxs(l.Fragment,{children:[l.jsx(F5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(U5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":jN(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(zne,{titleId:u.titleId}),l.jsx(Pne,{contentRef:d,descriptionId:u.descriptionId})]})]})}),SN="DialogTitle",c4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xi(SN,n);return l.jsx(ps.h2,{id:i.titleId,...r,ref:t})});c4.displayName=SN;var u4="DialogDescription",d4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xi(u4,n);return l.jsx(ps.p,{id:i.descriptionId,...r,ref:t})});d4.displayName=u4;var f4="DialogClose",h4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xi(f4,n);return l.jsx(ps.button,{type:"button",...r,ref:t,onClick:po(e.onClick,()=>i.onOpenChange(!1))})});h4.displayName=f4;function jN(e){return e?"open":"closed"}var p4="DialogTitleWarning",[QCe,m4]=nte(p4,{contentName:Rl,titleName:SN,docsSlug:"dialog"}),zne=({titleId:e})=>{const t=m4(p4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
93
+
94
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
95
+
96
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Tne="DialogDescriptionWarning",Pne=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${m4(Tne).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},g4=n4,y4=a4,NN=s4,kN=o4,CN=c4,v4=d4,x4=h4;const Rne=g4,Dne=y4,b4=b.forwardRef(({className:e,...t},n)=>l.jsx(NN,{ref:n,className:Ri("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));b4.displayName=NN.displayName;const Mne=400,Ine=1200,Lne=720,w4=b.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=b.useState(Lne),o=b.useRef(!1),u=b.useRef(0),d=b.useRef(0),f=b.useCallback(y=>{o.current=!0,u.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=b.useCallback(y=>{if(!o.current)return;const v=u.current-y.clientX,S=Math.min(Ine,Math.max(Mne,d.current+v));a(S)},[]),m=b.useCallback(()=>{o.current=!1},[]);return l.jsxs(Dne,{children:[l.jsx(b4,{}),l.jsxs(kN,{ref:r,className:Ri("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(x4,{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(ph,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});w4.displayName=kN.displayName;const $ne=({className:e,...t})=>l.jsx("div",{className:Ri("flex flex-col gap-1.5 pr-10",e),...t}),S4=b.forwardRef(({className:e,...t},n)=>l.jsx(CN,{ref:n,className:Ri("text-lg font-medium text-zinc-50",e),...t}));S4.displayName=CN.displayName;const j4=b.forwardRef(({className:e,...t},n)=>l.jsx(v4,{ref:n,className:Ri("text-sm text-zinc-500",e),...t}));j4.displayName=v4.displayName;function Bne({title:e,subtitle:t,children:n,open:r,onClose:i}){return l.jsx(Rne,{open:r,onOpenChange:a=>a?void 0:i(),children:l.jsxs(w4,{children:[l.jsxs($ne,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(S4,{id:"drawer-title",children:e}),l.jsx(j4,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:n})]})})}function nr({text:e}){const[t,n]=b.useState(null),r=b.useRef(null),i=b.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=b.useCallback(()=>n(null),[]);return 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&&Kl.createPortal(l.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const Une=/[\s\-_]+/;function qne(e){const t=e.split(Une).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function N2(e,t){const n=Fne(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"?Si.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(qne).filter(f=>!!f);if(o.length===0)return r.map((f,p)=>f.type==="bold"?Si.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const u=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=Ag(p);m&&!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 w=d.get(Ag(y))??"answer-highlight";return f.type==="bold"?Si.createElement("mark",{key:`hl-${p}-${v}`,className:w},Si.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Si.createElement("mark",{key:`hl-${p}-${v}`,className:w},y)}return f.type==="bold"?Si.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Fne(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Fb(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 Hne({evidence:e,project:t,onClose:n}){const[r,i]=b.useState(!1),[a,o]=b.useState("mentions"),[u,d]=b.useState(-1),[f,p]=b.useState(null),[m,y]=b.useState(!1),[v,S]=b.useState({}),w=vX(t.project),j=new Set(w.map(Cg)),k=e.runHistory,O=k.length>1,[_,A]=b.useState(null),T=b.useRef(!1);b.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(T.current=!0,Ol(G.runId).then(ae=>{const ne=ae.snapshots.find(Ce=>Ce.query===e.query&&Ce.provider===e.provider);ne&&A({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 C=u>=0&&f!==null,z=C?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},R=z.visibilityState==="pending"||z.citationState==="pending",B=R?!1:z.visibilityState!=null?z.visibilityState==="visible":z.answerMentioned!=null?z.answerMentioned:z.citationState===Hf.cited||z.citationState==="emerging",F=z.answerMentioned!=null||z.visibilityState!=null||z.recommendedCompetitors.length>0,q=z.citedDomains.length>0||z.groundingSources.length>0||z.evidenceUrls.length>0,$=t.project.displayName||t.project.name,V=[...w.map(Cg),$,$.split(" ").slice(0,2).join(" "),...z.matchedTerms].filter(G=>G.trim().length>2),te=[...z.competitorDomains.flatMap(G=>{const ae=yX(G);return ae.length>=4?[ae]:[]}),...z.recommendedCompetitors].filter(G=>G.trim().length>2),W=[{terms:V,className:"answer-highlight-brand"},...te.length>0?[{terms:te,className:"answer-highlight-competitor"}]:[]],H=R?"pending":z.visibilityTransition==="lost"?"lost":B?"cited":"not-cited",ee=b.useRef(0),le=b.useCallback(async G=>{const ae=++ee.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.query}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}y(!0);try{const Se=await Ol(ne.runId);if(ae!==ee.current)return;const X=Se.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??Se.snapshots.find(Ee=>Ee.query===e.query),me=X?{citationState:X.citationState,answerMentioned:X.answerMentioned,visibilityState:X.visibilityState,visibilityTransition:ne.visibilityTransition,provider:X.provider,model:X.model??null,answerSnippet:X.answerText??"",citedDomains:X.citedDomains,competitorDomains:X.competitorOverlap,recommendedCompetitors:X.recommendedCompetitors??[],matchedTerms:X.matchedTerms??[],groundingSources:X.groundingSources,evidenceUrls:[],changeLabel:Fb(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:Fb(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};S(Ee=>({...Ee,[Ce]:me})),p(me)}catch{if(ae!==ee.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:Fb(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{ae===ee.current&&y(!1)}},[k,e.query,e.provider,v]),L=(C||e.historyScope!=="provider")&&z.model?`${z.provider} (${z.model}) · ${z.changeLabel.toLowerCase()}`:`${z.provider} · ${z.changeLabel.toLowerCase()}`,I=!C&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",U=B?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:L}:z.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:L}:R?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:L},D=()=>{if(!z.answerSnippet)return null;const G=z.answerSnippet.split(`
97
+ `),ae=[];let ne=[],Ce=0;const Se=()=>{if(ne.length===0)return;const X=ne.join(" ").trim();X&&ae.push(l.jsx("p",{className:ae.length>0?"mt-2.5":"",children:N2(X,W)},Ce++)),ne=[]};for(const X of G){const me=X.trim();if(/^[-\u2013\u2014]{3,}$/.test(me)){Se(),ae.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Ee=me.match(/^(#{1,3})\s+(.+)$/);if(Ee){Se();const Y=Ee[1].length,Fe=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],Te=Y===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Y===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ae.push(l.jsx("p",{className:Te,children:N2(Fe,W)},Ce++));continue}if(me===""){Se();continue}ne.push(me)}return Se(),ae};return l.jsx(g4,{open:!0,onOpenChange:G=>{G||n()},children:l.jsxs(y4,{children:[l.jsx(NN,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(kN,{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," ","·"," ",z.provider||"All providers"]}),l.jsx(CN,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),l.jsxs(x4,{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(ph,{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,ae)=>{const ne=u===-1&&ae===k.length-1||u===ae,Ce=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),Se=G.visibilityTransition??Ce,X=Ce==="visible"?"bg-emerald-400":Se==="emerging"?"bg-amber-400":Se==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Y=!!(G.model&&ae>0&&k[ae-1]?.model&&k[ae-1].model!==G.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>le(ae===k.length-1?-1:ae),"aria-label":[`Run ${Ee}: ${Ce}`,G.model?`model ${G.model}`:null,Y?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[l.jsx("span",{className:`size-2 rounded-full ${X} ${Y?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},ae)})}),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"]})]}),!C&&(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--${H}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:U.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:U.title}),l.jsx("p",{className:"evidence-position-meta",children:U.meta}),I&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:I})]}),z.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),z.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"})]}),!z.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"}),!C&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:B?"Why you're visible":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,ae)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${B?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:B?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})]},ae))})]}),z.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:z.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||q)&&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(nr,{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--${B?"visible":"not-visible"}`,children:[l.jsx("span",{className:"mention-status-icon",children:R?"…":B?"✓":"—"}),l.jsx("span",{className:"mention-status-label",children:R?"Pending":B?"Visible":"Not visible"})]}),z.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:z.matchedTerms.map(G=>l.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!R&&!B&&z.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."})]})]}),(z.recommendedCompetitors.length>0||z.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(nr,{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=z.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),ae=new Set(G.map(Ce=>Ag(Ce.replace(/\.[^.]+$/,""))));return[...z.recommendedCompetitors.filter(Ce=>!ae.has(Ag(Ce))),...G].map(Ce=>l.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&l.jsxs(l.Fragment,{children:[z.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(nr,{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:z.citedDomains.map((G,ae)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ce=j.has(ne),Se=!Ce&&z.competitorDomains.some(me=>me.toLowerCase().replace(/^www\./,"")===ne),X=Ce?"you":Se?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${X}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ae+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)})})]}),z.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 (",z.groundingSources.length,")"]}),l.jsx(nr,{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:z.groundingSources.map((G,ae)=>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})},ae))})]}),z.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:z.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))})]}),z.citedDomains.length===0&&z.groundingSources.length===0&&z.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",C?"for this run":"yet"]})]}),!F&&!q&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",C?"for this run":"yet"]})]})]})]})]})]})})}function Fi(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 Hb=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Jy(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const Kne=Jy({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),Gne=Jy({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),Vne=Jy({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),Qne=Jy({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),Zne=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:Fi(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:Fi(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",query:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:Fi(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",query:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",query:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Hb[0],Hb[1],Fi(["cited","cited","cited","cited","cited"]),Hb[2],2/7,Fi(["not-cited","not-cited","not-cited","cited"]);function Yne(e,t){return e.projects.find(n=>n.project.id===t)}function Wne(e,t){return e.runs.find(n=>n.id===t)}function Xne(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 Jne={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},ere={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},tre={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function nre(e){return{id:e.id,tone:Jne[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??tre[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:ere[e.type]}]}}function rre(e){return e.filter(t=>!t.dismissed).map(nre)}function N4(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 k2(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function ire(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 k4(e){switch(e){case St["answer-visibility"]:return"Answer visibility sweep";case St["gsc-sync"]:return"GSC sync";case St["inspect-sitemap"]:return"Sitemap inspection";case St["ga-sync"]:return"GA sync";case St["traffic-sync"]:return"Traffic sync";case St["bing-inspect"]:return"Bing URL inspection";case St["bing-inspect-sitemap"]:return"Bing sitemap inspection";case St["site-audit"]:return"Site audit";case St["backlink-extract"]:return"Backlink extract"}}function are(e){return e===Af.manual?"Manual":e===Af.scheduled?"Scheduled":e===Af["config-apply"]?"Config apply":e}function _N(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:k4(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?k2(e.startedAt):k2(e.createdAt),duration:ire(e.startedAt,e.finishedAt),statusDetail:e.error?C4(e.error):sre(e),summary:ore(e),triggerLabel:are(e.trigger)}}function C4(e){const t=fN(e);return t.length>200?t.slice(0,200)+"…":t}function sre(e){switch(e.status){case tr.queued:return"Waiting for execution slot.";case tr.running:return"Provider queries in progress.";case tr.completed:return"All queries checked.";case tr.partial:return"Run completed with some queries skipped.";case tr.failed:return e.error?C4(e.error):"Run failed.";case tr.cancelled:return"Run was cancelled.";default:return""}}function ore(e){const t=k4(e.kind);switch(e.status){case tr.queued:return`${t} queued`;case tr.running:return`${t} in progress`;case tr.completed:return`${t} completed`;case tr.partial:return`${t} partially completed`;case tr.failed:return`${t} failed`;case tr.cancelled:return`${t} cancelled`;default:return e.status}}function lre(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.query){const v=`${y.query}::${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.query);const v=y.runs.at(-1),S=v?.transition??"not-cited";for(const w of m){const j=u.get(`${y.query}::${w}`),k=(y.providerRuns?.[w]?.length??0)>0;if(!j&&!k)continue;const O=j?.model??null,_=O?`${w}:${O}`:null,A=_?y.modelRuns?.[_]:void 0,T=y.providerRuns?.[w],C=(T?.length?T:null)??(A?.length?A:null),z=T?.length?"provider":A?.length?"model":"query",R=C?C.at(-1).transition:S,B=C?C.at(-1).visibilityTransition??(C.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=C?.at(-1)?.citationState,q=C?.at(-1)?.visibilityState,$=j?R==="lost"?"lost":R==="emerging"?"emerging":j.citationState===Hf.cited?"cited":"not-cited":F===Hf.cited?"cited":"not-cited",V=j?.visibilityState??(q==="visible"?"visible":q==="pending"?"pending":"not-visible"),te=C2(C||y.runs),W=_2(C||y.runs),H=cre(y,w),ee=(C??y.runs).map(I=>({runId:I.runId,citationState:I.citationState,createdAt:I.createdAt,model:H.get(I.runId)??null,answerMentioned:I.answerMentioned,visibilityState:I.visibilityState,visibilityTransition:I.visibilityTransition})),le=ure(ee),je=z==="provider"&&le.length<=1?"model":z,L=dre(ee);i.push({id:`evidence_${e}_${a++}`,query:y.query,provider:j?.provider??w,model:j?.model??null,location:j?.location??null,citationState:$,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:A2(B,W,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:A2(R,te),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:fre(V,B,y.query),runHistory:ee,historyScope:je,modelsSeen:le,modelTransitions:L})}}}for(const u of r)o.has(u.query)||i.push({id:`evidence_${e}_${a++}`,query:u.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${u.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function cre(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 ure(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function dre(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 C2(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 _2(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 A2(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?`${rf(r.positive)} in latest run`:`${rf(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return rf(r.first);case"not-cited":case"not-visible":return t<=1?`${rf(r.negative)} in latest run`:`${rf(r.negative)} across ${t} runs`;default:return e}}function rf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fre(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 hre(e){const t=N4(e.project),n=lre(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,o)=>o.createdAt.localeCompare(a.createdAt)).map(a=>_N(a,e.project.displayName||e.project.name));return e.overview?pre(t,e.overview,n,i):mre(t,n,i)}function pre(e,t,n,r){const i=rre(t.topInsights);for(const a of t.attentionItems)a.id.startsWith("insight_")||i.push({id:a.id,tone:a.tone,title:a.title,detail:a.detail,actionLabel:a.actionLabel,affectedPhrases:[]});return{project:e,dateRangeLabel:t.dateRangeLabel,contextLabel:t.contextLabel,visibilitySummary:t.scores.visibility,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,indexCoverage:t.scores.indexCoverage,providerScores:t.providerScores,competitorPressure:t.scores.competitorPressure,runStatus:t.scores.runStatus,movementSummary:t.movementSummary,insights:i,visibilityEvidence:n,competitors:t.competitors.map(a=>({id:a.id,domain:a.domain,citationCount:a.citationCount,totalQueries:a.totalQueries,pressureLabel:a.pressureLabel,citedQueries:a.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5)}}function mre(e,t,n){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,visibilitySummary:{...r,label:"Answer Visibility"},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Gap Queries"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:t,competitors:[],recentRuns:n.slice(0,5)}}function gre(e){const t=N4(e.project),n=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),r=n.find(y=>y.kind===St["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?_N(r,i):yre(e.project.id,i),o=e.overview;if(!o)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const u=o.scores.visibility,d=u.progress??0,f=o.queryCounts.citedQueries,p=o.queryCounts.totalQueries,m=o.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:u.tone,providerCoverage:u.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:o.scores.competitorPressure.value}}function yre(e,t){return{id:"none",projectId:e,projectName:t,kind:St["answer-visibility"],kindLabel:"No runs yet",status:tr.queued,trigger:Af.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function vre(e,t){const n=[],r=[],i=[];for(const o of e){r.push(hre(o)),i.push(gre(o));const u=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(_N(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?xre(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function xre(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===tr.running||a.status===tr.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 Be={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],queries:e=>["projects",e,"queries"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],gsc:{project:e=>["gsc",e],connections:e=>["gsc",e,"connections"],properties:e=>["gsc",e,"properties"],performance:(e,t)=>["gsc",e,"performance",t],inspections:(e,t)=>["gsc",e,"inspections",t],deindexed:e=>["gsc",e,"deindexed"],coverage:e=>["gsc",e,"coverage"],coverageHistory:e=>["gsc",e,"coverage-history"],sitemaps:e=>["gsc",e,"sitemaps"]},bing:{project:e=>["bing",e],status:e=>["bing",e,"status"],coverage:e=>["bing",e,"coverage"],inspections:e=>["bing",e,"inspections"],performance:e=>["bing",e,"performance"],sites:e=>["bing",e,"sites"]},schedule:e=>["schedule",e],notifications:e=>["notifications",e],agent:{providers:e=>["agent",e,"providers"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]}},_4=b.createContext(null);_4.Provider;function mh(){return b.useContext(_4)}function Zl(e){const n=mh()?.dashboard??null,r=Yi({queryKey:Be.projects.all,queryFn:Jj,enabled:!n}),i=Yi({queryKey:Be.runs.all,queryFn:YI,enabled:!n,staleTime:r1,refetchInterval:S=>S.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:r1}),a=Yi({queryKey:Be.settings,queryFn:()=>eN().catch(()=>null),enabled:!n}),o=r.data??[],u=i.data??[],d=Z9({queries:o.map(S=>{const w=u.filter(k=>k.projectId===S.id),j=w.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,O)=>O.createdAt.localeCompare(k.createdAt));return{queryKey:Be.projects.detail(S.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[O,_,A,T,C,z,R,B,F]=await Promise.all([rK(S.name).catch(()=>[]),WI(S.name).catch(()=>[]),XI(S.name).catch(()=>[]),k?Ol(k).catch(()=>null):Promise.resolve(null),j[1]?Ol(j[1].id).catch(()=>null):Promise.resolve(null),tN(S.name).catch(()=>null),nN(S.name).catch(()=>null),k?iG(S.name,k).catch(()=>null):Promise.resolve(null),iK(S.name).catch(()=>null)]);return{project:S,runs:w,queries:O,competitors:_,timeline:A,latestRunDetail:T,previousRunDetail:C,gscCoverage:z,bingCoverage:R,dbInsights:B,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:lL}})}),f=d.every(S=>S.isSuccess),p=b.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const S=d.map(w=>w.data?{...w.data,runs:u.filter(j=>j.projectId===w.data.project.id)}:null).filter(w=>w!=null);return vre(S,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length,u]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=b.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function bre(){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 ev(e,t){return Yi({queryKey:Be.health,queryFn:bre,enabled:e,refetchInterval:15e3,initialData:t})}function wre(e){return Yi({queryKey:Be.runs.detail(e??""),queryFn:()=>Ol(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Bu(){const e=ko(),t=$y({strict:!1}),n=Dr({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 Sre={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function jre(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Nre(){const e=b.useSyncExternalStore(jG,jz,jz),t=ko(),{openRun:n}=Bu(),r=b.useCallback(a=>{n1(a)},[]),i=b.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),n1(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 ${Sre[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":jre(a),children:a.cta.label}):null]}),l.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:l.jsx(ph,{className:"size-3.5"})})]},a.id))})}function kre(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,_re=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Are={};function E2(e,t){return(Are.jsx?_re:Cre).test(e)}const Ere=/[ \t\n\f\r]/g;function Ore(e){return typeof e=="object"?e.type==="text"?O2(e.value):!1:O2(e)}function O2(e){return e.replace(Ere,"")===""}let gh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};gh.prototype.normal={};gh.prototype.property={};gh.prototype.space=void 0;function A4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new gh(n,r,t)}function h1(e){return e.toLowerCase()}class Br{constructor(t,n){this.attribute=n,this.property=t}}Br.prototype.attribute="";Br.prototype.booleanish=!1;Br.prototype.boolean=!1;Br.prototype.commaOrSpaceSeparated=!1;Br.prototype.commaSeparated=!1;Br.prototype.defined=!1;Br.prototype.mustUseProperty=!1;Br.prototype.number=!1;Br.prototype.overloadedBoolean=!1;Br.prototype.property="";Br.prototype.spaceSeparated=!1;Br.prototype.space=void 0;let zre=0;const ot=Yl(),zn=Yl(),p1=Yl(),Ae=Yl(),Ht=Yl(),hu=Yl(),Qr=Yl();function Yl(){return 2**++zre}const m1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:zn,commaOrSpaceSeparated:Qr,commaSeparated:hu,number:Ae,overloadedBoolean:p1,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),Kb=Object.keys(m1);class AN extends Br{constructor(t,n,r,i){let a=-1;if(super(t,n),z2(this,"space",i),typeof r=="number")for(;++a<Kb.length;){const o=Kb[a];z2(this,Kb[a],(r&m1[o])===m1[o])}}}AN.prototype.defined=!0;function z2(e,t,n){n&&(e[t]=n)}function Uu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new AN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[h1(r)]=r,n[h1(a.attribute)]=r}return new gh(t,n,e.space)}const E4=Uu({properties:{ariaActiveDescendant:null,ariaAtomic:zn,ariaAutoComplete:null,ariaBusy:zn,ariaChecked:zn,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:Ht,ariaCurrent:null,ariaDescribedBy:Ht,ariaDetails:null,ariaDisabled:zn,ariaDropEffect:Ht,ariaErrorMessage:null,ariaExpanded:zn,ariaFlowTo:Ht,ariaGrabbed:zn,ariaHasPopup:null,ariaHidden:zn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ht,ariaLevel:Ae,ariaLive:null,ariaModal:zn,ariaMultiLine:zn,ariaMultiSelectable:zn,ariaOrientation:null,ariaOwns:Ht,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:zn,ariaReadOnly:zn,ariaRelevant:null,ariaRequired:zn,ariaRoleDescription:Ht,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:zn,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function O4(e,t){return t in e?e[t]:t}function z4(e,t){return O4(e,t.toLowerCase())}const Tre=Uu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hu,acceptCharset:Ht,accessKey:Ht,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Ht,autoFocus:ot,autoPlay:ot,blocking:Ht,capture:null,charSet:null,checked:ot,cite:null,className:Ht,cols:Ae,colSpan:null,content:null,contentEditable:zn,controls:ot,controlsList:Ht,coords:Ae|hu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:p1,draggable:zn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Ht,height:Ae,hidden:p1,high:Ae,href:null,hrefLang:null,htmlFor:Ht,httpEquiv:Ht,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Ht,itemRef:Ht,itemScope:ot,itemType:Ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ae,pattern:null,ping:Ht,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Ht,required:ot,reversed:ot,rows:Ae,rowSpan:Ae,sandbox:Ht,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:zn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:zn,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ht,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:zn,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:z4}),Pre=Uu({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:Qr,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:Ht,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:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,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:hu,g2:hu,glyphName:hu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:Qr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,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:Ae,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:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qr,rev:Qr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qr,requiredFeatures:Qr,requiredFonts:Qr,requiredFormats:Qr,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:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:Qr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qr,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:O4}),T4=Uu({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()}}),P4=Uu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:z4}),R4=Uu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Rre={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"},Dre=/[A-Z]/g,T2=/-[a-z]/g,Mre=/^data[-\w.:]+$/i;function Ire(e,t){const n=h1(t);let r=t,i=Br;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Mre.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(T2,$re);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!T2.test(a)){let o=a.replace(Dre,Lre);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=AN}return new i(r,t)}function Lre(e){return"-"+e.toLowerCase()}function $re(e){return e.charAt(1).toUpperCase()}const Bre=A4([E4,Tre,T4,P4,R4],"html"),EN=A4([E4,Pre,T4,P4,R4],"svg");function Ure(e){return e.join(" ").trim()}var $c={},Gb,P2;function qre(){if(P2)return Gb;P2=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 S(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 A(te){var W=te.match(t);W&&(O+=W.length);var H=te.lastIndexOf(d);_=~H?te.length-H:_+te.length}function T(){var te={line:O,column:_};return function(W){return W.position=new C(te),B(),W}}function C(te){this.start=te,this.end={line:O,column:_},this.source=k.source}C.prototype.content=j;function z(te){var W=new Error(k.source+":"+O+":"+_+": "+te);if(W.reason=te,W.filename=k.source,W.line=O,W.column=_,W.source=j,!k.silent)throw W}function R(te){var W=te.exec(j);if(W){var H=W[0];return A(H),j=j.slice(H.length),W}}function B(){R(n)}function F(te){var W;for(te=te||[];W=q();)W!==!1&&te.push(W);return te}function q(){var te=T();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var W=2;m!=j.charAt(W)&&(p!=j.charAt(W)||f!=j.charAt(W+1));)++W;if(W+=2,m===j.charAt(W-1))return z("End of comment missing");var H=j.slice(2,W-2);return _+=2,A(H),j=j.slice(W),_+=2,te({type:y,comment:H})}}function $(){var te=T(),W=R(r);if(W){if(q(),!R(i))return z("property missing ':'");var H=R(a),ee=te({type:v,property:w(W[0].replace(e,m)),value:H?w(H[0].replace(e,m)):m});return R(o),ee}}function V(){var te=[];F(te);for(var W;W=$();)W!==!1&&(te.push(W),F(te));return te}return B(),V()}function w(j){return j?j.replace(u,m):m}return Gb=S,Gb}var R2;function Fre(){if(R2)return $c;R2=1;var e=$c&&$c.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($c,"__esModule",{value:!0}),$c.default=n;const t=e(qre());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),u=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return $c}var af={},D2;function Hre(){if(D2)return af;D2=1,Object.defineProperty(af,"__esModule",{value:!0}),af.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 af.camelCase=d,af}var sf,M2;function Kre(){if(M2)return sf;M2=1;var e=sf&&sf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fre()),n=Hre();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,sf=r,sf}var Gre=Kre();const Vre=za(Gre),D4=M4("end"),ON=M4("start");function M4(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 Qre(e){const t=ON(e),n=D4(e);if(t&&n)return{start:t,end:n}}function Ef(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?I2(e.position):"start"in e||"end"in e?I2(e):"line"in e||"column"in e?g1(e):""}function g1(e){return L2(e&&e.line)+":"+L2(e&&e.column)}function I2(e){return g1(e&&e.start)+"-"+g1(e&&e.end)}function L2(e){return e&&typeof e=="number"?e:1}class fr 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=Ef(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}}fr.prototype.file="";fr.prototype.name="";fr.prototype.reason="";fr.prototype.message="";fr.prototype.stack="";fr.prototype.column=void 0;fr.prototype.line=void 0;fr.prototype.ancestors=void 0;fr.prototype.cause=void 0;fr.prototype.fatal=void 0;fr.prototype.place=void 0;fr.prototype.ruleId=void 0;fr.prototype.source=void 0;const zN={}.hasOwnProperty,Zre=new Map,Yre=/[A-Z]/g,Wre=new Set(["table","tbody","thead","tfoot","tr"]),Xre=new Set(["td","th"]),I4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jre(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=oie(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=sie(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"?EN:Bre,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=L4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function L4(e,t,n){if(t.type==="element")return eie(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tie(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rie(e,t,n);if(t.type==="mdxjsEsm")return nie(e,t);if(t.type==="root")return iie(e,t,n);if(t.type==="text")return aie(e,t)}function eie(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=EN,e.schema=i),e.ancestors.push(t);const a=B4(e,t.tagName,!1),o=lie(e,t);let u=PN(e,t);return Wre.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Ore(d):!0})),$4(e,o,a,t),TN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function tie(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)}Vf(e,t.position)}function nie(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vf(e,t.position)}function rie(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=EN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:B4(e,t.name,!0),o=cie(e,t),u=PN(e,t);return $4(e,o,a,t),TN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function iie(e,t,n){const r={};return TN(r,PN(e,t)),e.create(t,e.Fragment,r,n)}function aie(e,t){return t.value}function $4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function TN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function sie(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 oie(e,t){return n;function n(r,i,a,o){const u=Array.isArray(a.children),d=ON(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 lie(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&zN.call(t.properties,i)){const a=uie(e,i,t.properties[i]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&Xre.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 cie(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 Vf(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 Vf(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function PN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Zre;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=L4(e,a,o);u!==void 0&&n.push(u)}return n}function uie(e,t,n){const r=Ire(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kre(n):Ure(n)),r.property==="style"){let i=typeof n=="object"?n:die(e,String(n));return e.stylePropertyNameCase==="css"&&(i=fie(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Rre[r.property]||r.property:r.attribute,n]}}function die(e,t){try{return Vre(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new fr("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=I4+"#cannot-parse-style-attribute",i}}function B4(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=E2(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=E2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return zN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vf(e)}function Vf(e,t){const n=new fr("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=I4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fie(e){const t={};let n;for(n in e)zN.call(e,n)&&(t[hie(n)]=e[n]);return t}function hie(e){let t=e.replace(Yre,pie);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pie(e){return"-"+e.toLowerCase()}const Vb={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"]},mie={};function gie(e,t){const n=mie,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return U4(e,r,i)}function U4(e,t,n){if(yie(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 $2(e.children,t,n)}return Array.isArray(e)?$2(e,t,n):""}function $2(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=U4(e[i],t,n);return r.join("")}function yie(e){return!!(e&&typeof e=="object")}const B2=document.createElement("i");function RN(e){const t="&"+e+";";B2.innerHTML=t;const n=B2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ja(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 ji(e,t){return e.length>0?(ja(e,e.length,0,t),e):t}const U2={}.hasOwnProperty;function vie(e){const t={};let n=-1;for(;++n<e.length;)xie(t,e[n]);return t}function xie(e,t){let n;for(n in t){const i=(U2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){U2.call(i,o)||(i[o]=[]);const u=a[o];bie(i[o],Array.isArray(u)?u:u?[u]:[])}}}function bie(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ja(e,0,0,r)}function q4(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 pu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ya=Eo(/[A-Za-z]/),Yr=Eo(/[\dA-Za-z]/),wie=Eo(/[#-'*+\--9=?A-Z^-~]/);function y1(e){return e!==null&&(e<32||e===127)}const v1=Eo(/\d/),Sie=Eo(/[\dA-Fa-f]/),jie=Eo(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Mr(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const Nie=Eo(new RegExp("\\p{P}|\\p{S}","u")),kie=Eo(/\s/);function Eo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Yr(e.charCodeAt(n+1))&&Yr(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 Et(d)?(e.enter(n),u(d)):t(d)}function u(d){return Et(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const Cie={tokenize:_ie};function _ie(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 et(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),o)}}const Aie={tokenize:Eie},q2={tokenize:Oie};function Eie(e){const t=this,n=[];let r=0,i,a,o;return u;function u(_){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const A=t.events.length;let T=A,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){C=t.events[T][1].end;break}k(r);let z=A;for(;z<t.events.length;)t.events[z][1].end={...C},z++;return ja(t.events,T+1,0,t.events.slice(A)),t.events.length=z,f(_)}return u(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return S(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(q2,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,S(_)}function y(_){return t.containerState={},e.attempt(q2,v,S)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function S(_){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}),w(_)}function w(_){if(_===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return et(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(_),w)}function j(_,A){const T=t.sliceStream(_);if(A&&T.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(T),t.parser.lazy[_.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<o&&(!i.events[C][1].end||i.events[C][1].end.offset>o))return;const z=t.events.length;let R=z,B,F;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){F=t.events[R][1].end;break}B=!0}for(k(r),C=z;C<t.events.length;)t.events[C][1].end={...F},C++;ja(t.events,R+1,0,t.events.slice(z)),t.events.length=C}}function k(_){let A=n.length;for(;A-- >_;){const T=n[A];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 Oie(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 F2(e){if(e===null||Mr(e)||kie(e))return 1;if(Nie(e))return 2}function DN(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 x1={name:"attention",resolveAll:zie,tokenize:Tie};function zie(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};H2(m,-d),H2(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=ji(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=ji(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=ji(f,DN(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=ji(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=ji(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ja(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 Tie(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=F2(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=F2(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 H2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Pie={name:"autolink",tokenize:Rie};function Rie(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 ya(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Yr(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||Yr(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||y1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):wie(v)?(e.consume(v),f):n(v)}function p(v){return Yr(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||Yr(v))&&r++<63){const S=v===45?y:m;return e.consume(v),S}return n(v)}}const tv={partial:!0,tokenize:Die};function Die(e,t,n){return r;function r(a){return Et(a)?Vt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||et(a)?t(a):n(a)}}const F4={continuation:{tokenize:Iie},exit:Lie,name:"blockQuote",tokenize:Mie};function Mie(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 Et(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Iie(e,t,n){const r=this;return i;function i(o){return Et(o)?Vt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(F4,t,n)(o)}}function Lie(e){e.exit("blockQuote")}const H4={name:"characterEscape",tokenize:$ie};function $ie(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 jie(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const K4={name:"characterReference",tokenize:Bie};function Bie(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=Yr,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=Sie,p):(e.enter("characterReferenceValue"),a=7,o=v1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Yr&&!RN(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 K2={partial:!0,tokenize:qie},G2={concrete:!0,name:"codeFenced",tokenize:Uie};function Uie(e,t,n){const r=this,i={partial:!0,tokenize:T};let a=0,o=0,u;return d;function d(C){return f(C)}function f(C){const z=r.events[r.events.length-1];return a=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(C)}function p(C){return C===u?(o++,e.consume(C),p):o<3?n(C):(e.exit("codeFencedFenceSequence"),Et(C)?Vt(e,m,"whitespace")(C):m(C))}function m(C){return C===null||et(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(K2,w,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||et(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(C)):Et(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Vt(e,v,"whitespace")(C)):C===96&&C===u?n(C):(e.consume(C),y)}function v(C){return C===null||et(C)?m(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===null||et(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(C)):C===96&&C===u?n(C):(e.consume(C),S)}function w(C){return e.attempt(i,A,j)(C)}function j(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),k}function k(C){return a>0&&Et(C)?Vt(e,O,"linePrefix",a+1)(C):O(C)}function O(C){return C===null||et(C)?e.check(K2,w,A)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||et(C)?(e.exit("codeFlowValue"),O(C)):(e.consume(C),_)}function A(C){return e.exit("codeFenced"),t(C)}function T(C,z,R){let B=0;return F;function F(W){return C.enter("lineEnding"),C.consume(W),C.exit("lineEnding"),q}function q(W){return C.enter("codeFencedFence"),Et(W)?Vt(C,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):$(W)}function $(W){return W===u?(C.enter("codeFencedFenceSequence"),V(W)):R(W)}function V(W){return W===u?(B++,C.consume(W),V):B>=o?(C.exit("codeFencedFenceSequence"),Et(W)?Vt(C,te,"whitespace")(W):te(W)):R(W)}function te(W){return W===null||et(W)?(C.exit("codeFencedFence"),z(W)):R(W)}}}function qie(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 Qb={name:"codeIndented",tokenize:Hie},Fie={partial:!0,tokenize:Kie};function Hie(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):et(f)?e.attempt(Fie,o,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||et(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Kie(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):et(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):et(o)?i(o):n(o)}}const Gie={name:"codeText",previous:Qie,resolve:Vie,tokenize:Zie};function Vie(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 Qie(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Zie(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)):et(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||et(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 Yie{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&&of(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),of(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),of(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);of(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);of(this.left,n.reverse())}}}function of(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 G4(e){const t={};let n=-1,r,i,a,o,u,d,f;const p=new Yie(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,Wie(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 ja(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Wie(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,S=0,w=0;const j=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<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&&(w=y+1,j.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=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[S+d[y][0]]=S+d[y][1],S+=d[y][1]-d[y][0]-1;return f}const Xie={resolve:eae,tokenize:tae},Jie={partial:!0,tokenize:nae};function eae(e){return G4(e),e}function tae(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):et(u)?e.check(Jie,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 nae(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||et(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 V4(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||y1(k)?n(k):(e.enter(r),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(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||et(k)?n(k):(e.consume(k),k===92?S:v)}function S(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function w(k){return!p&&(k===null||k===41||Mr(k))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||y1(k)?n(k):(e.consume(k),k===92?j:w)}function j(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function Q4(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):et(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||et(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Et(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function Z4(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):et(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||et(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 Of(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Et(i)?Vt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const rae={name:"definition",tokenize:aae},iae={partial:!0,tokenize:sae};function aae(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return Q4.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=pu(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 Mr(v)?Of(e,f)(v):f(v)}function f(v){return V4(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(iae,m,m)(v)}function m(v){return Et(v)?Vt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||et(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function sae(e,t,n){return r;function r(u){return Mr(u)?Of(e,i)(u):n(u)}function i(u){return Z4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Et(u)?Vt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||et(u)?t(u):n(u)}}const oae={name:"hardBreakEscape",tokenize:lae};function lae(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return et(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const cae={name:"headingAtx",resolve:uae,tokenize:dae};function uae(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"},ja(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function dae(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||Mr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||et(p)?(e.exit("atxHeading"),t(p)):Et(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||Mr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const fae=["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"],V2=["pre","script","style","textarea"],hae={concrete:!0,name:"htmlFlow",resolveTo:gae,tokenize:yae},pae={partial:!0,tokenize:xae},mae={partial:!0,tokenize:vae};function gae(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 yae(e,t,n){const r=this;let i,a,o,u,d;return f;function f(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),y):D===47?(e.consume(D),a=!0,w):D===63?(e.consume(D),i=3,r.interrupt?t:L):ya(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function y(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,S):ya(D)?(e.consume(D),i=4,r.interrupt?t:L):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:L):n(D)}function S(D){const G="CDATA[";return D===G.charCodeAt(u++)?(e.consume(D),u===G.length?r.interrupt?t:$:S):n(D)}function w(D){return ya(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||Mr(D)){const G=D===47,ae=o.toLowerCase();return!G&&!a&&V2.includes(ae)?(i=1,r.interrupt?t(D):$(D)):fae.includes(o.toLowerCase())?(i=6,G?(e.consume(D),k):r.interrupt?t(D):$(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?O(D):_(D))}return D===45||Yr(D)?(e.consume(D),o+=String.fromCharCode(D),j):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:$):n(D)}function O(D){return Et(D)?(e.consume(D),O):F(D)}function _(D){return D===47?(e.consume(D),F):D===58||D===95||ya(D)?(e.consume(D),A):Et(D)?(e.consume(D),_):F(D)}function A(D){return D===45||D===46||D===58||D===95||Yr(D)?(e.consume(D),A):T(D)}function T(D){return D===61?(e.consume(D),C):Et(D)?(e.consume(D),T):_(D)}function C(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,z):Et(D)?(e.consume(D),C):R(D)}function z(D){return D===d?(e.consume(D),d=null,B):D===null||et(D)?n(D):(e.consume(D),z)}function R(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Mr(D)?T(D):(e.consume(D),R)}function B(D){return D===47||D===62||Et(D)?_(D):n(D)}function F(D){return D===62?(e.consume(D),q):n(D)}function q(D){return D===null||et(D)?$(D):Et(D)?(e.consume(D),q):n(D)}function $(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),ee):D===62&&i===4?(e.consume(D),I):D===63&&i===3?(e.consume(D),L):D===93&&i===5?(e.consume(D),je):et(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(pae,U,V)(D)):D===null||et(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),$)}function V(D){return e.check(mae,te,U)(D)}function te(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return D===null||et(D)?V(D):(e.enter("htmlFlowData"),$(D))}function H(D){return D===45?(e.consume(D),L):$(D)}function ee(D){return D===47?(e.consume(D),o="",le):$(D)}function le(D){if(D===62){const G=o.toLowerCase();return V2.includes(G)?(e.consume(D),I):$(D)}return ya(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),le):$(D)}function je(D){return D===93?(e.consume(D),L):$(D)}function L(D){return D===62?(e.consume(D),I):D===45&&i===2?(e.consume(D),L):$(D)}function I(D){return D===null||et(D)?(e.exit("htmlFlowData"),U(D)):(e.consume(D),I)}function U(D){return e.exit("htmlFlow"),t(D)}}function vae(e,t,n){const r=this;return i;function i(o){return et(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 xae(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(tv,t,n)}}const bae={name:"htmlText",tokenize:wae};function wae(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),_):ya(L)?(e.consume(L),R):n(L)}function f(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),a=0,S):ya(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):et(L)?(o=m,ee(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),v):m(L)}function v(L){return L===62?H(L):L===45?y(L):m(L)}function S(L){const I="CDATA[";return L===I.charCodeAt(a++)?(e.consume(L),a===I.length?w:S):n(L)}function w(L){return L===null?n(L):L===93?(e.consume(L),j):et(L)?(o=w,ee(L)):(e.consume(L),w)}function j(L){return L===93?(e.consume(L),k):w(L)}function k(L){return L===62?H(L):L===93?(e.consume(L),k):w(L)}function O(L){return L===null||L===62?H(L):et(L)?(o=O,ee(L)):(e.consume(L),O)}function _(L){return L===null?n(L):L===63?(e.consume(L),A):et(L)?(o=_,ee(L)):(e.consume(L),_)}function A(L){return L===62?H(L):_(L)}function T(L){return ya(L)?(e.consume(L),C):n(L)}function C(L){return L===45||Yr(L)?(e.consume(L),C):z(L)}function z(L){return et(L)?(o=z,ee(L)):Et(L)?(e.consume(L),z):H(L)}function R(L){return L===45||Yr(L)?(e.consume(L),R):L===47||L===62||Mr(L)?B(L):n(L)}function B(L){return L===47?(e.consume(L),H):L===58||L===95||ya(L)?(e.consume(L),F):et(L)?(o=B,ee(L)):Et(L)?(e.consume(L),B):H(L)}function F(L){return L===45||L===46||L===58||L===95||Yr(L)?(e.consume(L),F):q(L)}function q(L){return L===61?(e.consume(L),$):et(L)?(o=q,ee(L)):Et(L)?(e.consume(L),q):B(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,V):et(L)?(o=$,ee(L)):Et(L)?(e.consume(L),$):(e.consume(L),te)}function V(L){return L===i?(e.consume(L),i=void 0,W):L===null?n(L):et(L)?(o=V,ee(L)):(e.consume(L),V)}function te(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Mr(L)?B(L):(e.consume(L),te)}function W(L){return L===47||L===62||Mr(L)?B(L):n(L)}function H(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function ee(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),le}function le(L){return Et(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 MN={name:"labelEnd",resolveAll:kae,resolveTo:Cae,tokenize:_ae},Sae={tokenize:Aae},jae={tokenize:Eae},Nae={tokenize:Oae};function kae(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&&ja(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=ji(u,e.slice(a+1,a+r+3)),u=ji(u,[["enter",p,t]]),u=ji(u,DN(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),u=ji(u,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),u=ji(u,e.slice(o+1)),u=ji(u,[["exit",d,t]]),ja(e,a,e.length,u),e}function _ae(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(pu(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(Sae,p,o?p:m)(y):y===91?e.attempt(jae,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(Nae,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Aae(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 Mr(m)?Of(e,a)(m):a(m)}function a(m){return m===41?p(m):V4(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Mr(m)?Of(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?Z4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Mr(m)?Of(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 Eae(e,t,n){const r=this;return i;function i(u){return Q4.call(r,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(pu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function Oae(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 zae={name:"labelStartImage",resolveAll:MN.resolveAll,tokenize:Tae};function Tae(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 Pae={name:"labelStartLink",resolveAll:MN.resolveAll,tokenize:Rae};function Rae(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 Zb={name:"lineEnding",tokenize:Dae};function Dae(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Vt(e,t,"linePrefix")}}const Jm={name:"thematicBreak",tokenize:Mae};function Mae(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||et(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Et(f)?Vt(e,u,"whitespace")(f):u(f))}}const zr={continuation:{tokenize:Bae},exit:qae,name:"list",tokenize:$ae},Iae={partial:!0,tokenize:Fae},Lae={partial:!0,tokenize:Uae};function $ae(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 S=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:v1(v)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Jm,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return v1(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(tv,r.interrupt?n:p,e.attempt(Iae,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Et(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 Bae(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(tv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Et(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(Lae,t,o)(u))}function o(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vt(e,e.attempt(zr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Uae(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 qae(e){e.exit(this.containerState.type)}function Fae(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!Et(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Q2={name:"setextUnderline",resolveTo:Hae,tokenize:Kae};function Hae(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 Kae(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"),Et(f)?Vt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||et(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Gae={tokenize:Vae};function Vae(e){const t=this,n=e.attempt(tv,r,e.attempt(this.parser.constructs.flowInitial,i,Vt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xie,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 Qae={resolveAll:W4()},Zae=Y4("string"),Yae=Y4("text");function Y4(e){return{resolveAll:W4(e==="text"?Wae: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 W4(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 Wae(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 Xae={42:zr,43:zr,45:zr,48:zr,49:zr,50:zr,51:zr,52:zr,53:zr,54:zr,55:zr,56:zr,57:zr,62:F4},Jae={91:rae},ese={[-2]:Qb,[-1]:Qb,32:Qb},tse={35:cae,42:Jm,45:[Q2,Jm],60:hae,61:Q2,95:Jm,96:G2,126:G2},nse={38:K4,92:H4},rse={[-5]:Zb,[-4]:Zb,[-3]:Zb,33:zae,38:K4,42:x1,60:[Pie,bae],91:Pae,92:[oae,H4],93:MN,95:x1,96:Gie},ise={null:[x1,Qae]},ase={null:[42,95]},sse={null:[]},ose=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ase,contentInitial:Jae,disable:sse,document:Xae,flow:tse,flowInitial:ese,insideSpan:ise,string:nse,text:rse},Symbol.toStringTag,{value:"Module"}));function lse(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:z(T),check:z(C),consume:O,enter:_,exit:A,interrupt:z(C,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:S,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(q){return o=ji(o,q),j(),o[o.length-1]!==null?[]:(R(t,0),f.events=DN(a,f.events,f),f.events)}function y(q,$){return use(v(q),$)}function v(q){return cse(o,q)}function S(){const{_bufferIndex:q,_index:$,line:V,column:te,offset:W}=r;return{_bufferIndex:q,_index:$,line:V,column:te,offset:W}}function w(q){i[q.line]=q.column,F()}function j(){let q;for(;r._index<o.length;){const $=o[r._index];if(typeof $=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<$.length;)k($.charCodeAt(r._bufferIndex));else k($)}}function k(q){p=p(q)}function O(q){et(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,F()):q!==-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=q}function _(q,$){const V=$||{};return V.type=q,V.start=S(),f.events.push(["enter",V,f]),u.push(V),V}function A(q){const $=u.pop();return $.end=S(),f.events.push(["exit",$,f]),$}function T(q,$){R(q,$.from)}function C(q,$){$.restore()}function z(q,$){return V;function V(te,W,H){let ee,le,je,L;return Array.isArray(te)?U(te):"tokenize"in te?U([te]):I(te);function I(ne){return Ce;function Ce(Se){const X=Se!==null&&ne[Se],me=Se!==null&&ne.null,Ee=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(me)?me:me?[me]:[]];return U(Ee)(Se)}}function U(ne){return ee=ne,le=0,ne.length===0?H:D(ne[le])}function D(ne){return Ce;function Ce(Se){return L=B(),je=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?ae():ne.tokenize.call($?Object.assign(Object.create(f),$):f,d,G,ae)(Se)}}function G(ne){return q(je,L),W}function ae(ne){return L.restore(),++le<ee.length?D(ee[le]):H}}}function R(q,$){q.resolveAll&&!a.includes(q)&&a.push(q),q.resolve&&ja(f.events,$,f.events.length-$,q.resolve(f.events.slice($),f)),q.resolveTo&&(f.events=q.resolveTo(f.events,f))}function B(){const q=S(),$=f.previous,V=f.currentConstruct,te=f.events.length,W=Array.from(u);return{from:te,restore:H};function H(){r=q,f.previous=$,f.currentConstruct=V,f.events.length=te,u=W,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function cse(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 use(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 dse(e){const r={constructs:vie([ose,...(e||{}).extensions||[]]),content:i(Cie),defined:[],document:i(Aie),flow:i(Gae),lazy:{},string:i(Zae),text:i(Yae)};return r;function i(a){return o;function o(u){return lse(r,a,u)}}}function fse(e){for(;!G4(e););return e}const Z2=/[\0\t\n\r]/g;function hse(){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(Z2.lastIndex=m,f=Z2.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 pse=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mse(e){return e.replace(pse,gse)}function gse(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return q4(n.slice(a?2:1),a?16:10)}return RN(n)||e}const X4={}.hasOwnProperty;function yse(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),vse(n)(fse(dse(n).document().write(hse()(e,t,!0))))}function vse(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(tn),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(it),blockQuote:a(me),characterEscape:B,characterReference:B,codeFenced:a(Ee),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Ee,o),codeText:a(Y,o),codeTextData:B,data:B,codeFlowValue:B,definition:a(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Te),hardBreakEscape:a(Ge),hardBreakTrailing:a(Ge),htmlFlow:a($t,o),htmlFlowData:B,htmlText:a($t,o),htmlTextData:B,image:a(Dt),label:o,link:a(tn),listItem:a(we),listItemValue:y,listOrdered:a(Zt,m),listUnordered:a(Zt),paragraph:a(Xe),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(it),strong:a(Ot),thematicBreak:a(Je)},exit:{atxHeading:d(),atxHeadingSequence:T,autolink:d(),autolinkEmail:X,autolinkProtocol:Se,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:ne,characterReference:Ce,codeFenced:d(j),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:F,codeIndented:d(k),codeText:d(W),codeTextData:F,data:F,definition:d(),definitionDestinationString:A,definitionLabelString:O,definitionTitleString:_,emphasis:d(),hardBreakEscape:d($),hardBreakTrailing:d($),htmlFlow:d(V),htmlFlowData:F,htmlText:d(te),htmlTextData:F,image:d(ee),label:je,labelText:le,lineEnding:q,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:L,resourceTitleString:I,resource:U,setextHeading:d(R),setextHeadingLineSequence:z,setextHeadingText:C,strong:d(),thematicBreak:d()}};J4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ne={type:"root",children:[]};const De={stack:[Ne],tokenStack:[],config:t,enter:u,exit:f,buffer:o,resume:p,data:n},Ke=[];let dt=-1;for(;++dt<ue.length;)if(ue[dt][1].type==="listOrdered"||ue[dt][1].type==="listUnordered")if(ue[dt][0]==="enter")Ke.push(dt);else{const ln=Ke.pop();dt=i(ue,ln,dt)}for(dt=-1;++dt<ue.length;){const ln=t[ue[dt][0]];X4.call(ln,ue[dt][1].type)&&ln[ue[dt][1].type].call(Object.assign({sliceSerialize:ue[dt][2].sliceSerialize},De),ue[dt][1])}if(De.tokenStack.length>0){const ln=De.tokenStack[De.tokenStack.length-1];(ln[1]||Y2).call(De,void 0,ln[0])}for(Ne.position={start:Ws(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ws(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},dt=-1;++dt<t.transforms.length;)Ne=t.transforms[dt](Ne)||Ne;return Ne}function i(ue,Ne,De){let Ke=Ne-1,dt=-1,ln=!1,xn,cn,Ze,Bt;for(;++Ke<=De;){const fe=ue[Ke];switch(fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{fe[0]==="enter"?dt++:dt--,Bt=void 0;break}case"lineEndingBlank":{fe[0]==="enter"&&(xn&&!Bt&&!dt&&!Ze&&(Ze=Ke),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!dt&&fe[0]==="enter"&&fe[1].type==="listItemPrefix"||dt===-1&&fe[0]==="exit"&&(fe[1].type==="listUnordered"||fe[1].type==="listOrdered")){if(xn){let ze=Ke;for(cn=void 0;ze--;){const he=ue[ze];if(he[1].type==="lineEnding"||he[1].type==="lineEndingBlank"){if(he[0]==="exit")continue;cn&&(ue[cn][1].type="lineEndingBlank",ln=!0),he[1].type="lineEnding",cn=ze}else if(!(he[1].type==="linePrefix"||he[1].type==="blockQuotePrefix"||he[1].type==="blockQuotePrefixWhitespace"||he[1].type==="blockQuoteMarker"||he[1].type==="listItemIndent"))break}Ze&&(!cn||Ze<cn)&&(xn._spread=!0),xn.end=Object.assign({},cn?ue[cn][1].start:fe[1].end),ue.splice(cn||Ke,0,["exit",xn,fe[2]]),Ke++,De++}if(fe[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},fe[1].start),end:void 0};xn=ze,ue.splice(Ke,0,["enter",ze,fe[2]]),Ke++,De++,Ze=void 0,Bt=!0}}}return ue[Ne][1]._spread=ln,De}function a(ue,Ne){return De;function De(Ke){u.call(this,ue(Ke),Ke),Ne&&Ne.call(this,Ke)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ue,Ne,De){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Ne,De||void 0]),ue.position={start:Ws(Ne.start),end:void 0}}function d(ue){return Ne;function Ne(De){ue&&ue.call(this,De),f.call(this,De)}}function f(ue,Ne){const De=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==ue.type&&(Ne?Ne.call(this,ue,Ke[0]):(Ke[1]||Y2).call(this,ue,Ke[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Ef({start:ue.start,end:ue.end})+"): it’s not open");De.position.end=Ws(ue.end)}function p(){return gie(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ue}function S(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue.replace(/(\r?\n|\r)$/g,"")}function O(ue){const Ne=this.resume(),De=this.stack[this.stack.length-1];De.label=Ne,De.identifier=pu(this.sliceSerialize(ue)).toLowerCase()}function _(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ue}function A(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ue}function T(ue){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const De=this.sliceSerialize(ue).length;Ne.depth=De}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function z(ue){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ue){const De=this.stack[this.stack.length-1].children;let Ke=De[De.length-1];(!Ke||Ke.type!=="text")&&(Ke=ft(),Ke.position={start:Ws(ue.start),end:void 0},De.push(Ke)),this.stack.push(Ke)}function F(ue){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ue),Ne.position.end=Ws(ue.end)}function q(ue){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=Ne.children[Ne.children.length-1];De.position.end=Ws(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&(B.call(this,ue),F.call(this,ue))}function $(){this.data.atHardBreak=!0}function V(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function te(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function W(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function H(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ee(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function le(ue){const Ne=this.sliceSerialize(ue),De=this.stack[this.stack.length-2];De.label=mse(Ne),De.identifier=pu(Ne).toLowerCase()}function je(){const ue=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 Ke=ue.children;De.children=Ke}else De.alt=Ne}function L(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ue}function I(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ue}function U(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ue){const Ne=this.resume(),De=this.stack[this.stack.length-1];De.label=Ne,De.identifier=pu(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ae(ue){this.data.characterReferenceType=ue.type}function ne(ue){const Ne=this.sliceSerialize(ue),De=this.data.characterReferenceType;let Ke;De?(Ke=q4(Ne,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=RN(Ne);const dt=this.stack[this.stack.length-1];dt.value+=Ke}function Ce(ue){const Ne=this.stack.pop();Ne.position.end=Ws(ue.end)}function Se(ue){F.call(this,ue);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ue)}function X(ue){F.call(this,ue);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ue)}function me(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Y(){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 Ge(){return{type:"break"}}function $t(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function tn(){return{type:"link",title:null,url:"",children:[]}}function Zt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function we(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Xe(){return{type:"paragraph",children:[]}}function Ot(){return{type:"strong",children:[]}}function ft(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function Ws(e){return{line:e.line,column:e.column,offset:e.offset}}function J4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?J4(e,r):xse(e,r)}}function xse(e,t){let n;for(n in t)if(X4.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 Y2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ef({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ef({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ef({start:t.start,end:t.end})+") is still open")}function bse(e){const t=this;t.parser=n;function n(r){return yse(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function wse(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 Sse(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
101
+ `}]}function jse(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 Nse(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kse(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=qu(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 _se(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 Ase(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function e3(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 Ese(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return e3(e,t);const i={src:qu(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 Ose(e,t){const n={src:qu(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 zse(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 Tse(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return e3(e,t);const i={href:qu(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 Pse(e,t){const n={href:qu(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 Rse(e,t,n){const r=e.all(t),i=n?Dse(n):t3(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 Dse(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=t3(n[r])}return t}function t3(e){const t=e.spread;return t??e.children.length>1}function Mse(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 Ise(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lse(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function $se(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bse(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=ON(t.children[1]),d=D4(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 Use(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 S={type:"element",tagName:a,properties:y,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),f.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function qse(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const W2=9,X2=32;function Fse(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(J2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(J2(t.slice(i),i>0,!1)),a.join("")}function J2(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===W2||a===X2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===W2||a===X2;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Hse(e,t){const n={type:"text",value:Fse(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Kse(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gse={blockquote:wse,break:Sse,code:jse,delete:Nse,emphasis:kse,footnoteReference:Cse,heading:_se,html:Ase,imageReference:Ese,image:Ose,inlineCode:zse,linkReference:Tse,link:Pse,listItem:Rse,list:Mse,paragraph:Ise,root:Lse,strong:$se,table:Bse,tableCell:qse,tableRow:Use,text:Hse,thematicBreak:Kse,toml:gm,yaml:gm,definition:gm,footnoteDefinition:gm};function gm(){}const n3=-1,nv=0,zf=1,Pg=2,IN=3,LN=4,$N=5,BN=6,r3=7,i3=8,eT=typeof self=="object"?self:globalThis,Vse=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case nv:case n3:return n(o,i);case zf:{const u=n([],i);for(const d of o)u.push(r(d));return u}case Pg:{const u=n({},i);for(const[d,f]of o)u[r(d)]=r(f);return u}case IN:return n(new Date(o),i);case LN:{const{source:u,flags:d}=o;return n(new RegExp(u,d),i)}case $N:{const u=n(new Map,i);for(const[d,f]of o)u.set(r(d),r(f));return u}case BN:{const u=n(new Set,i);for(const d of o)u.add(r(d));return u}case r3:{const{name:u,message:d}=o;return n(new eT[u](d),i)}case i3: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 eT[a](o),i)};return r},tT=e=>Vse(new Map,e)(0),Bc="",{toString:Qse}={},{keys:Zse}=Object,lf=e=>{const t=typeof e;if(t!=="object"||!e)return[nv,t];const n=Qse.call(e).slice(8,-1);switch(n){case"Array":return[zf,Bc];case"Object":return[Pg,Bc];case"Date":return[IN,Bc];case"RegExp":return[LN,Bc];case"Map":return[$N,Bc];case"Set":return[BN,Bc];case"DataView":return[zf,n]}return n.includes("Array")?[zf,n]:n.includes("Error")?[r3,n]:[Pg,n]},ym=([e,t])=>e===nv&&(t==="function"||t==="symbol"),Yse=(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]=lf(o);switch(u){case nv:{let p=o;switch(d){case"bigint":u=i3,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([n3],o)}return i([u,p],o)}case zf:{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 Pg:{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 Zse(o))(e||!ym(lf(o[y])))&&p.push([a(y),a(o[y])]);return m}case IN:return i([u,o.toISOString()],o);case LN:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case $N:{const p=[],m=i([u,p],o);for(const[y,v]of o)(e||!(ym(lf(y))||ym(lf(v))))&&p.push([a(y),a(v)]);return m}case BN:{const p=[],m=i([u,p],o);for(const y of o)(e||!ym(lf(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([u,{name:d,message:f}],o)};return a},nT=(e,{json:t,lossy:n}={})=>{const r=[];return Yse(!(t||n),!!t,new Map,r)(e),r},Rg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tT(nT(e,t)):structuredClone(e):(e,t)=>tT(nT(e,t));function Wse(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 Xse(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Jse(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Wse,r=e.options.footnoteBackLabel||Xse,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=qu(m.toLowerCase());let v=0;const S=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++v<=w;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,v);typeof O=="string"&&(O={type:"text",value:O}),S.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(...S)}else p.push(...S);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:{...Rg(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 a3=(function(e){if(e==null)return roe;if(typeof e=="function")return rv(e);if(typeof e=="object")return Array.isArray(e)?eoe(e):toe(e);if(typeof e=="string")return noe(e);throw new Error("Expected function, string, or object as test")});function eoe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=a3(e[n]);return rv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function toe(e){const t=e;return rv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function noe(e){return rv(t);function t(n){return n&&n.type===e}}function rv(e){return t;function t(n,r,i){return!!(ioe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function roe(){return!0}function ioe(e){return e!==null&&typeof e=="object"&&"type"in e}const s3=[],aoe=!0,rT=!1,soe="skip";function ooe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=a3(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=s3,S,w,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=loe(n(d,p)),v[0]===rT))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==soe)for(w=(r?k.children.length:-1)+o,j=p.concat(k);w>-1&&w<k.children.length;){const O=k.children[w];if(S=u(O,w,j)(),S[0]===rT)return S;w=typeof S[1]=="number"?S[1]:w+o}}return v}}}function loe(e){return Array.isArray(e)?e:typeof e=="number"?[aoe,e]:e==null?s3:[e]}function o3(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),ooe(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 b1={}.hasOwnProperty,coe={};function uoe(e,t){const n=t||coe,r=new Map,i=new Map,a=new Map,o={...Gse,...n.handlers},u={all:f,applyData:foe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:doe,wrap:poe};return o3(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(b1.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:w,...j}=p,k=Rg(j);return k.children=u.all(p),k}return Rg(p)}return(u.options.unknownHandler||hoe)(u,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const S=u.one(y[v],p);if(S){if(v&&y[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=iT(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=iT(w.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function doe(e,t){e.position&&(t.position=Qre(e))}function foe(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,Rg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function hoe(e,t){const n=t.data||{},r="value"in t&&!(b1.call(n,"hProperties")||b1.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 poe(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 iT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function aT(e,t){const n=uoe(e,t),r=n.one(e,void 0),i=Jse(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 moe(e,t){return e&&"run"in e?async function(n,r){const i=aT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return aT(n,{file:r,...e||t})}}function sT(e){if(e)throw e}var Yb,oT;function goe(){if(oT)return Yb;oT=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 Yb=function d(){var f,p,m,y,v,S,w=arguments[0],j=1,k=arguments.length,O=!1;for(typeof w=="boolean"&&(O=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=u(w,p),y=u(f,p),w!==y&&(O&&y&&(a(y)||(v=i(y)))?(v?(v=!1,S=m&&i(m)?m:[]):S=m&&a(m)?m:{},o(w,{name:p,newValue:d(O,S,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},Yb}var yoe=goe();const Wb=za(yoe);function w1(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 voe(){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?xoe(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 xoe(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 ha={basename:boe,dirname:woe,extname:Soe,join:joe,sep:"/"};function boe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yh(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 woe(e){if(yh(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 Soe(e){yh(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 joe(...e){let t=-1,n;for(;++t<e.length;)yh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Noe(n)}function Noe(e){yh(e);const t=e.codePointAt(0)===47;let n=koe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function koe(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 yh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Coe={cwd:_oe};function _oe(){return"/"}function S1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Aoe(e){if(typeof e=="string")e=new URL(e);else if(!S1(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 Eoe(e)}function Eoe(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 Xb=["history","path","basename","stem","extname","dirname"];class l3{constructor(t){let n;t?S1(t)?n={path:t}:typeof t=="string"||Ooe(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<Xb.length;){const a=Xb[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)Xb.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ha.basename(this.path):void 0}set basename(t){ew(t,"basename"),Jb(t,"basename"),this.path=ha.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ha.dirname(this.path):void 0}set dirname(t){lT(this.basename,"dirname"),this.path=ha.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ha.extname(this.path):void 0}set extname(t){if(Jb(t,"extname"),lT(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=ha.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){S1(t)&&(t=Aoe(t)),ew(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ha.basename(this.path,this.extname):void 0}set stem(t){ew(t,"stem"),Jb(t,"stem"),this.path=ha.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 fr(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 Jb(e,t){if(e&&e.includes(ha.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ha.sep+"`")}function ew(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Ooe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zoe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Toe={}.hasOwnProperty;class UN extends zoe{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=voe()}copy(){const t=new UN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Wb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(rw("data",this.frozen),this.namespace[t]=n,this):Toe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(rw("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=vm(t),r=this.parser||this.Parser;return tw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tw("process",this.parser||this.Parser),nw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const u=vm(t),d=r.parse(u);r.run(d,u,function(p,m,y){if(p||!m||!y)return f(p);const v=m,S=r.stringify(v,y);Doe(S)?y.value=S:y.result=S,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(),tw("processSync",this.parser||this.Parser),nw("processSync",this.compiler||this.Compiler),this.process(t,i),uT("processSync","process",n),r;function i(a,o){n=!0,sT(a),r=o}}run(t,n,r){cT(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=vm(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),uT("runSync","run",r),i;function a(o,u){sT(o),i=u,r=!0}}stringify(t,n){this.freeze();const r=vm(n),i=this.compiler||this.Compiler;return nw("stringify",i),cT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(rw("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=Wb(!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,...S]=p;const w=r[y][1];w1(w)&&w1(v)&&(v=Wb(!0,w,v)),r[y]=[f,v,...S]}}}}const Poe=new UN().freeze();function tw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function nw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rw(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 cT(e){if(!w1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vm(e){return Roe(e)?e:new l3(e)}function Roe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Doe(e){return typeof e=="string"||Moe(e)}function Moe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ioe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dT=[],fT={allowDangerousHtml:!0},Loe=/^(https?|ircs?|mailto|xmpp)$/i,$oe=[{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 Boe(e){const t=Uoe(e),n=qoe(e);return Foe(t.runSync(t.parse(n),n),e)}function Uoe(e){const t=e.rehypePlugins||dT,n=e.remarkPlugins||dT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fT}:fT;return Poe().use(bse).use(n).use(moe,r).use(t)}function qoe(e){const t=e.children||"",n=new l3;return typeof t=="string"&&(n.value=t),n}function Foe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Hoe;for(const p of $oe)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ioe+p.id,void 0);return o3(e,f),Jre(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 Vb)if(Object.hasOwn(Vb,v)&&Object.hasOwn(p.properties,v)){const S=p.properties[v],w=Vb[v];(w===null||w.includes(p.tagName))&&(p.properties[v]=d(String(S||""),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 Hoe(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||Loe.test(e.slice(0,t))?e:""}function Koe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const iv=Koe();async function hT(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ir(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Goe(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ir(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Voe(e){const t=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ir(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Qoe({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${iv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new Ir(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:S}=await f.read();if(S)break;m+=p.decode(v,{stream:!0});let w=m.indexOf(`
111
+
112
+ `);for(;w!==-1;){const j=m.slice(0,w);m=m.slice(w+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{}}w=m.indexOf(`
114
+
115
+ `)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function c3(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Zoe=[{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?"}],Yoe=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],xm=e=>`canonry:aero:provider:${e}`,pT=e=>`canonry:aero:scope:${e}`;function Woe({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState(""),[f,p]=b.useState(!1),[m,y]=b.useState([]),[v,S]=b.useState(""),[w,j]=b.useState(null),[k,O]=b.useState(()=>typeof window>"u"?null:window.localStorage.getItem(xm(e))??null),[_,A]=b.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(pT(e))==="all"?"all":"read-only"),T=b.useRef(null),C=b.useRef(null),z=b.useRef(null),[R,B]=b.useState(0),F=b.useMemo(()=>{const U=u.trimStart();if(!U.startsWith("/"))return[];if(/\s/.test(U))return[];const D=U.toLowerCase();return Yoe.filter(G=>G.command.startsWith(D)||G.label.toLowerCase().includes(D.slice(1)))},[u]);b.useEffect(()=>{B(U=>F.length===0?0:Math.min(U,F.length-1))},[F.length]);const q=Yi({queryKey:Be.agent.providers(e),queryFn:()=>Goe(e),enabled:t,staleTime:6e4}),$=b.useMemo(()=>{const U=q.data?.providers??[];if(k){const G=U.find(ae=>ae.id===k&&ae.configured);if(G)return G}const D=q.data?.defaultProvider;return D?U.find(G=>G.id===D)??null:null},[k,q.data]);b.useEffect(()=>{if(!q.data||!k)return;q.data.providers.find(D=>D.id===k&&D.configured)||(O(null),window.localStorage.removeItem(xm(e)))},[q.data,k,e]);const V=b.useCallback(U=>{O(U),!(typeof window>"u")&&(U?window.localStorage.setItem(xm(e),U):window.localStorage.removeItem(xm(e)))},[e]),te=b.useCallback(()=>{A(U=>{const D=U==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(pT(e),D),D})},[e]);b.useEffect(()=>{if(!t)return;const U=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,r]),b.useEffect(()=>{if(!t)return;let U=!1;j(null);const D=()=>{U||f||hT(e).then(ne=>{U||o(ne.messages)}).catch(ne=>{U||j(ne instanceof Error?ne.message:"Failed to load transcript")})};D();const ae=window.setInterval(D,15e3);return()=>{U=!0,window.clearInterval(ae)}},[t,e,f]),b.useEffect(()=>()=>{T.current?.abort()},[e]),b.useEffect(()=>{const U=C.current;U&&(U.scrollTop=U.scrollHeight)},[a,v,m]);async function W(U){const D=U.trim();if(!D||f)return;j(null),d(""),p(!0),S(""),y([]);const G={role:"user",content:D,timestamp:Date.now()};o(ne=>[...ne,G]);const ae=new AbortController;T.current=ae;try{await Qoe({project:e,prompt:D,provider:k??void 0,scope:_,signal:ae.signal,onEvent:H});const ne=await hT(e);o(ne.messages)}catch(ne){ne.name!=="AbortError"&&j(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),S(""),T.current=null}}function H(U){switch(U.type){case"message_update":S(c3(U.message));break;case"message_end":U.message.role==="assistant"&&S("");break;case"tool_execution_start":y(D=>[...D,{id:U.toolCallId,name:U.toolName,args:U.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(D=>D.map(G=>G.id===U.toolCallId?{...G,endedAt:Date.now(),isError:U.isError,result:U.result}:G));break;case"error":j(U.message);break}}async function ee(){T.current?.abort();try{await Voe(e),o([]),j(null)}catch(U){j(U instanceof Error?U.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:U=>{r&&U.target===U.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(_z,{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(Xoe,{providers:q.data?.providers??[],active:$,override:k,onPick:V,disabled:f}),l.jsx("button",{type:"button",onClick:ee,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(mL,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.jsx("button",{type:"button",onClick:()=>i(U=>!U),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?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(ph,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),l.jsxs("div",{ref:C,className:I,children:[w&&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:w}),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:Zoe.map(U=>l.jsx("button",{type:"button",onClick:()=>W(U.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:U.label},U.label))})]}),rle(a,e,k,_),m.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(U=>l.jsx(u3,{trail:U},U.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(d3,{content:v})]}),f&&!v&&m.every(U=>U.endedAt!==void 0)&&l.jsx(ole,{})]}),l.jsx(Joe,{projectName:e,activeProvider:$,scope:_,onToggleScope:te,disabled:f}),l.jsxs("div",{className:"relative",children:[F.length>0&&l.jsx(ele,{matches:F,selectedIndex:R,onHover:B,onPick:U=>{d(""),z.current?.focus(),U.action==="clear"?ee():W(U.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:U=>{if(U.preventDefault(),F.length>0){const D=F[R];d(""),D.action==="clear"?ee():W(D.prompt);return}W(u)},children:[l.jsx("textarea",{ref:z,value:u,onChange:U=>d(U.target.value),onKeyDown:U=>{if(F.length>0){if(U.key==="ArrowDown"){U.preventDefault(),B(D=>(D+1)%F.length);return}if(U.key==="ArrowUp"){U.preventDefault(),B(D=>(D-1+F.length)%F.length);return}if(U.key==="Tab"){U.preventDefault();const D=F[R];d(`${D.command} `);return}if(U.key==="Escape"){U.preventDefault(),d("");return}}if(U.key==="Enter"&&!U.shiftKey)if(U.preventDefault(),F.length>0){const D=F[R];d(""),D.action==="clear"?ee():W(D.prompt)}else W(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(_z,{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 Xoe({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=b.useState(!1),u=b.useRef(null);if(b.useEffect(()=>{if(!a)return;const p=y=>{u.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return 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(uL,{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:tle(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 Joe({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 ele({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 tle(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 nle(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function rle(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],u=nle(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(ile,{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=sle(o,d,o.timestamp??0),m=c3(o);i.push(l.jsxs(b.Fragment,{children:[p.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>l.jsx(u3,{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(d3,{content:m})]})]},u)),a=f-1;continue}}return i}function ile({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=b.useState(!1),o=b.useMemo(()=>ale(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(uL,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):l.jsxs(l.Fragment,{children:[l.jsx(HG,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),l.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function ale(e,t,n,r){const i=["canonry","agent","ask",mT(e),mT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function mT(e){return`'${e.replace(/'/g,"'\\''")}'`}function sle(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 u3({trail:e}){const[t,n]=b.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,u=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return 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(pL,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?l.jsx(Sg,{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(hh,{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:gT(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:gT(e.result)})]})]})]})}function gT(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 d3({content:e}){return l.jsx("div",{className:"aero-markdown text-zinc-100",children:l.jsx(Boe,{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 ole(){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 lle(){const e=VI(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=Yi({queryKey:Be.projects.all,queryFn:Jj,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(Woe,{projectName:a.name},a.name):null}function av(e,t,n){switch(e.invalidateQueries({queryKey:Be.runs.all}),e.invalidateQueries({queryKey:Be.projects.all}),t){case St["answer-visibility"]:case St["site-audit"]:case St["backlink-extract"]:return;case St["gsc-sync"]:case St["inspect-sitemap"]:e.invalidateQueries({queryKey:Be.gsc.project(n)});return;case St["ga-sync"]:case St["traffic-sync"]:e.invalidateQueries({queryKey:Be.traffic.project(n)});return;case St["bing-inspect"]:case St["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:Be.bing.project(n)});return;default:return t}}const yT=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:WG},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:RG},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:ZG}],vT=e=>({label:e,state:"checking",detail:"Checking service health"}),cle={apiStatus:vT("API"),workerStatus:vT("Worker")};function ule(e){switch(e){case St["answer-visibility"]:return"Visibility sweep";case St["gsc-sync"]:return"GSC sync";case St["inspect-sitemap"]:return"Sitemap inspection";case St["ga-sync"]:return"GA sync";case St["traffic-sync"]:return"Traffic sync";case St["bing-inspect"]:return"Bing URL inspection";case St["bing-inspect-sitemap"]:return"Bing sitemap inspection";case St["site-audit"]:return"Site audit";case St["backlink-extract"]:return"Backlink extract"}}function dle(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function fle(e){const t=ule(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function hle(e,t){return e.error?`${t}: ${fN(e.error)}`:e.location?`${t} · ${e.location}`:t}function ple(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function mle(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 gle(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function yle(){const e=ni(),t=b.useSyncExternalStore(XJ,Tl,Tl),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=Yi({queryKey:Be.runs.all,queryFn:YI,enabled:n,staleTime:r1,refetchInterval:3e3}),i=Yi({queryKey:Be.projects.all,queryFn:Jj,enabled:n}),a=b.useRef({}),o=b.useCallback(()=>{r.refetch()},[r.refetch]);return b.useEffect(()=>{n&&o()},[n,o]),b.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&o()};return window.addEventListener("focus",o),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",o),document.removeEventListener("visibilitychange",u)}},[n,o]),b.useEffect(()=>{const u=r.data??[],d=i.data??[],f=Object.fromEntries(u.map(m=>[m.id,m])),p=Object.fromEntries(u.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const y=f[m.runId];if(!y||!yN(y.status)||(a.current[y.id]??m.lastAnnouncedStatus)===y.status)continue;const S=d.find(j=>j.id===y.projectId);if(S&&av(e,y.kind,S.name),m.sourceAction==="run-all"){t2(y.id);continue}const w=ple(y.projectId,m.projectLabel,d);gt({title:fle(y),detail:hle(y,w),tone:dle(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),t2(y.id)}for(const m of Object.values(t.batches)){const y=tee(m.runIds,f);y.finished&&(gt({title:"Run-all batch finished",detail:mle(y,m.skippedCount),tone:gle(y),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),eee(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function vle(){const e=mh(),{dashboard:t,isLoading:n,refetch:r}=Zl(),o=ev(!e,e?.health).data??e?.health??cle,u=VI(),{runId:d,evidenceId:f,closeDrawer:p}=Bu(),[m,y]=b.useState(!1),v=wre(d),S=v.data??null,w=v.isLoading;b.useEffect(()=>{S&&S.status!=="running"&&S.status!=="queued"&&r()},[S?.status,r]),b.useEffect(()=>{y(!1)},[u.pathname]),b.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const A=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?Wne(j,d):void 0,O=f&&j?Xne(j,f):void 0,_=(()=>{const A=u.pathname;if(A==="/")return"Portfolio";if(A==="/projects")return"Projects";if(A==="/runs")return"Runs";if(A==="/settings")return"Settings";if(A==="/setup")return"Setup";if(A==="/backlinks")return"Backlinks";if(A.startsWith("/projects/")){const C=A.split("/").filter(Boolean)[1];if(C&&j){const z=j.projects.find(R=>R.project.id===C);if(z)return z.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(d2,{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(wg,{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(hL,{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(A=>l.jsxs("div",{className:"sidebar-skeleton-item",children:[l.jsx("span",{className:"skeleton-circle size-2"}),l.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+A*15}%`}})]},A))]}):j&&j.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(A=>{const T=A.visibilitySummary.tone;return l.jsxs(Kt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),l.jsx("span",{children:A.project.name})]},A.project.id)})]}):n?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(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:yT.map(({label:A,href:T,Icon:C})=>l.jsx("a",{className:"sidebar-footer-icon",href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:l.jsx(C,{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(d2,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(Kt,{to:"/",children:"Home"}),l.jsx(hh,{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:wo(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:wo(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(A=>!A),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(ph,{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(A=>l.jsx(Kt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"mobile-nav-link",children:A.project.name},A.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:n&&!e?l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-40"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(A=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text w-full"}),l.jsx("div",{className:"skeleton-text-sm w-3/4"})]},A))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(A=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-20"}),l.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>l.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},A))})]}):l.jsx(Xj,{})}),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:yT.map(({label:A,href:T,Icon:C})=>l.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:l.jsx(C,{className:"size-3.5"})},T))})]})]}),k?l.jsxs(Bne,{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(Zy,{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"}),w?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):S&&S.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[S.snapshots.map(A=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:A.query??"Unknown query"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Pl,{provider:A.provider}),l.jsx(L5,{variant:A.citationState===Hf.cited?"success":"neutral",children:A.citationState})]})]}),A.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:A.model}),A.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",A.citedDomains.join(", ")]}),A.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",A.competitorOverlap.join(", ")]}),A.groundingSources&&A.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[A.groundingSources.length," grounding source",A.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:A.groundingSources.map((T,C)=>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})},C))})]}),A.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:A.answerText})]})]},A.id)),S.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):S&&S.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):S&&S.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..."]}):S&&S.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:$J(S.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?l.jsx(Hne,{evidence:O.evidence,project:O.project,onClose:p}):null,l.jsx(yle,{}),l.jsx(Nre,{}),l.jsx(lle,{})]})}class xle extends b.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?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(Sg,{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(mL,{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 Le=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ri("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}));Le.displayName="Card";const j1=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ri("flex flex-col gap-1.5 p-5",e),...t}));j1.displayName="CardHeader";const N1=b.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Ri("font-medium tracking-tight text-zinc-50",e),...t}));N1.displayName="CardTitle";const k1=b.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Ri("text-sm text-zinc-500",e),...t}));k1.displayName="CardDescription";const eg=b.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Ri("p-5 pt-0",e),...t}));eg.displayName="CardContent";function ble({points:e,tone:t}){const n=b.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const S=a+v/Math.max(e.length-1,1)*f,w=a+(1-(y-o)/d)*p;return`${S},${w}`}).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 wle({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," · ",Gy(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(ble,{points:e.trend,tone:y5(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(hh,{className:"h-4 w-4 text-zinc-500"})})]})}function Sle(){const e=mh(),{dashboard:t,isLoading:n}=Zl(),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=ev(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=KJ(i.systemHealth,u,r.settings),{openRun:f}=Bu();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(wle,{project:p},p.project.id))}):l.jsxs(Le,{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(Zy,{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(Le,{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(mt,{tone:p.tone,title:p.id==="api"?wo(u.apiStatus):p.id==="worker"?wo(u.workerStatus):void 0,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const qN=Symbol.for("yaml.alias"),C1=Symbol.for("yaml.document"),mo=Symbol.for("yaml.map"),f3=Symbol.for("yaml.pair"),Na=Symbol.for("yaml.scalar"),Fu=Symbol.for("yaml.seq"),Oi=Symbol.for("yaml.node.type"),Wl=e=>!!e&&typeof e=="object"&&e[Oi]===qN,sv=e=>!!e&&typeof e=="object"&&e[Oi]===C1,vh=e=>!!e&&typeof e=="object"&&e[Oi]===mo,Cn=e=>!!e&&typeof e=="object"&&e[Oi]===f3,Qt=e=>!!e&&typeof e=="object"&&e[Oi]===Na,xh=e=>!!e&&typeof e=="object"&&e[Oi]===Fu;function Nn(e){if(e&&typeof e=="object")switch(e[Oi]){case mo:case Fu:return!0}return!1}function kn(e){if(e&&typeof e=="object")switch(e[Oi]){case qN:case mo:case Na:case Fu:return!0}return!1}const h3=e=>(Qt(e)||Nn(e))&&!!e.anchor,sl=Symbol("break visit"),jle=Symbol("skip children"),Tf=Symbol("remove node");function Hu(e,t){const n=Nle(t);sv(e)?nu(null,e.contents,n,Object.freeze([e]))===Tf&&(e.contents=null):nu(null,e,n,Object.freeze([]))}Hu.BREAK=sl;Hu.SKIP=jle;Hu.REMOVE=Tf;function nu(e,t,n,r){const i=kle(e,t,n,r);if(kn(i)||Cn(i))return Cle(e,r,i),nu(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=nu(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===sl)return sl;o===Tf&&(t.items.splice(a,1),a-=1)}}}else if(Cn(t)){r=Object.freeze(r.concat(t));const a=nu("key",t.key,n,r);if(a===sl)return sl;a===Tf&&(t.key=null);const o=nu("value",t.value,n,r);if(o===sl)return sl;o===Tf&&(t.value=null)}}return i}function Nle(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 kle(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(vh(t))return n.Map?.(e,t,r);if(xh(t))return n.Seq?.(e,t,r);if(Cn(t))return n.Pair?.(e,t,r);if(Qt(t))return n.Scalar?.(e,t,r);if(Wl(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(sv(r))r.contents=n;else{const i=Wl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const _le={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ale=e=>e.replace(/[!,[\]{}]/g,t=>_le[t]);class yr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},yr.defaultYaml,t),this.tags=Object.assign({},yr.defaultTags,n)}clone(){const t=new yr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new yr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:yr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},yr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:yr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},yr.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+Ale(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={};Hu(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
+ `)}}yr.defaultYaml={explicit:!1,version:"1.2"};yr.defaultTags={"!!":"tag:yaml.org,2002:"};function p3(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 m3(e){const t=new Set;return Hu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function g3(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Ele(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=m3(e));const o=g3(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Qt(o.node)||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 ru(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],u=ru(e,r,String(i),o);u===void 0?delete r[i]:u!==o&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=ru(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=ru(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=ru(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function _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||!h3(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 FN{constructor(t){Object.defineProperty(this,Oi,{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(!sv(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"?ru(a,{"":u},"",u):u}}class HN extends FN{constructor(t){super(qN),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=[],Hu(t,{Node:(a,o)=>{(Wl(o)||h3(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=tg(i,o,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(p3(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function tg(e,t,n){if(Wl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Nn(t)){let r=0;for(const i of t.items){const a=tg(e,i,n);a>r&&(r=a)}return r}else if(Cn(t)){const r=tg(e,t.key,n),i=tg(e,t.value,n);return Math.max(r,i)}return 1}const y3=e=>!e||typeof e!="function"&&typeof e!="object";class rt extends FN{constructor(t){super(Na),this.value=t}toJSON(t,n){return n?.keep?this.value:_i(this.value,t,n)}toString(){return String(this.value)}}rt.BLOCK_FOLDED="BLOCK_FOLDED";rt.BLOCK_LITERAL="BLOCK_LITERAL";rt.PLAIN="PLAIN";rt.QUOTE_DOUBLE="QUOTE_DOUBLE";rt.QUOTE_SINGLE="QUOTE_SINGLE";const Ole="tag:yaml.org,2002:";function zle(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 Qf(e,t,n){if(sv(e)&&(e=e.contents),kn(e))return e;if(Cn(e)){const m=n.schema[mo].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 HN(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=Ole+t.slice(2));let f=zle(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new rt(e);return d&&(d.node=m),m}f=e instanceof Map?o[mo]:Symbol.iterator in Object(e)?o[Fu]:o[mo]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new rt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Dg(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 Qf(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 Sf=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class v3 extends FN{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(Sf(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,Dg(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&&Qt(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&&Qt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return 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,Dg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Tle=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function is(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const pl=(e,t,n)=>e.endsWith(`
118
+ `)?is(n,t):n.includes(`
119
+ `)?`
120
+ `+is(n,t):(e.endsWith(" ")?"":" ")+n,x3="flow",_1="block",ng="quoted";function ov(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,S=!1,w=-1,j=-1,k=-1;n===_1&&(w=xT(e,w,t.length),w!==-1&&(m=w+d));for(let _;_=e[w+=1];){if(n===ng&&_==="\\"){switch(j=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(_===`
121
+ `)n===_1&&(w=xT(e,w,t.length)),m=w+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
122
+ `&&v!==" "){const A=e[w+1];A&&A!==" "&&A!==`
123
+ `&&A!==" "&&(y=w)}if(w>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===ng){for(;v===" "||v===" ";)v=_,_=e[w+=1],S=!0;const A=w>k+1?w-2:j-1;if(p[A])return e;f.push(A),p[A]=!0,m=A+d,y=void 0}else S=!0}v=_}if(S&&u&&u(),f.length===0)return e;o&&o();let O=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const A=f[_],T=f[_+1]||e.length;A===0?O=`
124
+ ${t}${e.slice(0,T)}`:(n===ng&&p[A]&&(O+=`${e[A]}\\`),O+=`
125
+ ${t}${e.slice(A+1,T)}`)}return O}function xT(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 lv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),cv=e=>/^(%|---|\.\.\.)/m.test(e);function Ple(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 Pf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(cv(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:ov(o,a,ng,lv(t,!1))}function A1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
131
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Pf(e,t);const n=t.indent||(cv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
132
+ ${n}`)+"'";return t.implicitKey?r:ov(r,n,x3,lv(t,!1))}function iu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Pf;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=A1:a&&!i?r=Pf:r=n?A1:Pf}return r(e,t)}let E1;try{E1=new RegExp(`(^|(?<!
133
+ ))
134
+ +(?!
135
+ |$)`,"g")}catch{E1=/\n+(?!\n|$)/g}function rg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:u,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return iu(n,r);const f=r.indent||(r.forceBlockIndent||cv(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===rt.BLOCK_FOLDED?!1:t===rt.BLOCK_LITERAL?!0:!Ple(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 S=v.indexOf(`
139
+ `);S===-1?m="-":n===v||S!==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(E1,`$&${f}`));let w=!1,j,k=-1;for(j=0;j<n.length;++j){const T=n[j];if(T===" ")w=!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 A=(w?f?"2":"1":"")+m;if(e&&(A+=" "+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 C=!1;const z=lv(r,!0);o!=="folded"&&t!==rt.BLOCK_FOLDED&&(z.onOverflow=()=>{C=!0});const R=ov(`${O}${T}${v}`,f,_1,z);if(!C)return`>${A}
143
+ ${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
144
+ ${f}${O}${n}${v}`}function Rle(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
145
+ `)||p&&/[[\]{},]/.test(a))return iu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
146
+ `)?iu(a,t):rg(e,t,n,r);if(!u&&!p&&i!==rt.PLAIN&&a.includes(`
147
+ `))return rg(e,t,n,r);if(cv(a)){if(d==="")return t.forceBlockIndent=!0,rg(e,t,n,r);if(u&&d===f)return iu(a,t)}const m=a.replace(/\n+/g,`$&
148
+ ${d}`);if(o){const y=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(m),{compat:v,tags:S}=t.doc.schema;if(S.some(y)||v?.some(y))return iu(a,t)}return u?m:ov(m,d,x3,lv(t,!1))}function KN(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!==rt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(u=rt.QUOTE_DOUBLE);const d=p=>{switch(p){case rt.BLOCK_FOLDED:case rt.BLOCK_LITERAL:return i||a?iu(o.value,t):rg(o,t,n,r);case rt.QUOTE_DOUBLE:return Pf(o.value,t);case rt.QUOTE_SINGLE:return A1(o.value,t);case rt.PLAIN:return Rle(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 b3(e,t){const n=Object.assign({blockQuote:!0,commentString:Tle,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 Dle(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Qt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Mle(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Qt(e)||Nn(e))&&e.anchor;a&&p3(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 Cu(e,t,n,r){if(Cn(e))return e.toString(t,n,r);if(Wl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const a=kn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Dle(t.doc.schema.tags,a));const o=Mle(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):Qt(a)?KN(a,t,n,r):a.toString(t,n,r);return o?Qt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
149
+ ${t.indent}${u}`:u}function Ile({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 z="With simple keys, collection cannot be used as a key value";throw new Error(z)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||Nn(e)||(Qt(e)?e.type===rt.BLOCK_FOLDED||e.type===rt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let S=!1,w=!1,j=Cu(e,n,()=>S=!0,()=>w=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return S&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!S?j+=pl(j,n.indent,f(y)):w&&i&&i(),j;S&&(y=null),v?(y&&(j+=pl(j,n.indent,f(y))),j=`? ${j}
150
+ ${u}:`):(j=`${j}:`,y&&(j+=pl(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&&Qt(t)&&(n.indentAtStart=j.length+1),w=!1,!p&&d.length>=2&&!n.inFlow&&!v&&xh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let A=!1;const T=Cu(t,n,()=>A=!0,()=>w=!0);let C=" ";if(y||k||O){if(C=k?`
151
+ `:"",O){const z=f(O);C+=`
152
+ ${is(z,n.indent)}`}T===""&&!n.inFlow?C===`
153
+ `&&_&&(C=`
154
+
155
+ `):C+=`
156
+ ${n.indent}`}else if(!v&&Nn(t)){const z=T[0],R=T.indexOf(`
157
+ `),B=R!==-1,F=n.inFlow??t.flow??t.items.length===0;if(B||!F){let q=!1;if(B&&(z==="&"||z==="!")){let $=T.indexOf(" ");z==="&"&&$!==-1&&$<R&&T[$+1]==="!"&&($=T.indexOf(" ",$+1)),($===-1||R<$)&&(q=!0)}q||(C=`
158
+ ${n.indent}`)}}else(T===""||T[0]===`
159
+ `)&&(C="");return j+=C+T,n.inFlow?A&&r&&r():_&&!A?j+=pl(j,n.indent,f(_)):w&&i&&i(),j}function Lle(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const bm="<<",os={identify:e=>e===bm||typeof e=="symbol"&&e.description===bm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new rt(Symbol(bm)),{addToJSMap:w3}),stringify:()=>bm},$le=(e,t)=>(os.identify(t)||Qt(t)&&(!t.type||t.type===rt.PLAIN)&&os.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===os.tag&&n.default);function w3(e,t,n){if(n=e&&Wl(n)?n.resolve(e.doc):n,xh(n))for(const r of n.items)iw(e,t,r);else if(Array.isArray(n))for(const r of n)iw(e,t,r);else iw(e,t,n)}function iw(e,t,n){const r=e&&Wl(n)?n.resolve(e.doc):n;if(!vh(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 S3(e,t,{key:n,value:r}){if(kn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if($le(e,n))w3(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=Ble(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 Ble(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kn(e)&&n?.doc){const r=b3(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)+'..."'),Lle(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 GN(e,t,n){const r=Qf(e,void 0,n),i=Qf(t,void 0,n);return new br(r,i)}class br{constructor(t,n=null){Object.defineProperty(this,Oi,{value:f3}),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 br(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return S3(n,r,this)}toString(t,n,r){return t?.doc?Ile(this,t,n,r):JSON.stringify(this)}}function j3(e,t,n){return(t.inFlow??e.flow?qle:Ule)(e,t,n)}function Ule({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 S=0;S<t.length;++S){const w=t[S];let j=null;if(kn(w))!m&&w.spaceBefore&&y.push(""),Mg(n,y,w.commentBefore,m),w.comment&&(j=w.comment);else if(Cn(w)){const O=kn(w.key)?w.key:null;O&&(!m&&O.spaceBefore&&y.push(""),Mg(n,y,O.commentBefore,m))}m=!1;let k=Cu(w,p,()=>j=null,()=>m=!0);j&&(k+=pl(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 S=1;S<y.length;++S){const w=y[S];v+=w?`
160
+ ${d}${w}`:`
161
+ `}}return e?(v+=`
162
+ `+is(f(e),d),u&&u()):m&&o&&o(),v}function qle({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 S=0;S<e.length;++S){const w=e[S];let j=null;if(kn(w))w.spaceBefore&&m.push(""),Mg(t,m,w.commentBefore,!1),w.comment&&(j=w.comment);else if(Cn(w)){const O=kn(w.key)?w.key:null;O&&(O.spaceBefore&&m.push(""),Mg(t,m,O.commentBefore,!1),O.comment&&(f=!0));const _=kn(w.value)?w.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):w.value==null&&O?.comment&&(j=O.comment)}j&&(f=!0);let k=Cu(w,d,()=>j=null);S<e.length-1&&(k+=","),j&&(k+=pl(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 S=m.reduce((w,j)=>w+j.length+2,2);f=t.options.lineWidth>0&&S>t.options.lineWidth}if(f){let S=y;for(const w of m)S+=w?`
164
+ ${a}${i}${w}`:`
165
+ `;return`${S}
166
+ ${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function Mg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=is(t(r),e);n.push(a.trimStart())}}function ml(e,t){const n=Qt(t)?t.value:t;for(const r of e)if(Cn(r)&&(r.key===t||r.key===n||Qt(r.key)&&r.key.value===n))return r}class Ni extends v3{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(mo,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(GN(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 br(t,t?.value):r=new br(t.key,t.value);const i=ml(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Qt(i.value)&&y3(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=ml(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=ml(this.items,t)?.value;return(!n&&Qt(i)?i.value:i)??void 0}has(t){return!!ml(this.items,t)}set(t,n){this.add(new br(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)S3(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})),j3(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Ku={collection:"map",default:!0,nodeClass:Ni,tag:"tag:yaml.org,2002:map",resolve(e,t){return vh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ni.from(e,t,n)};class Dl extends v3{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Fu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=wm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=wm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Qt(i)?i.value:i}has(t){const n=wm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=wm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Qt(i)&&y3(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?j3(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(Qf(u,void 0,r))}}return a}}function wm(e){let t=Qt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Gu={collection:"seq",default:!0,nodeClass:Dl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Dl.from(e,t,n)},uv={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),KN(e,t,n,r)}},dv={identify:e=>e==null,createNode:()=>new rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rt(null),stringify:({source:e},t)=>typeof e=="string"&&dv.test.test(e)?e:t.options.nullStr},VN={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new rt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&VN.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 Ji({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 N3={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:Ji},k3={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():Ji(e)}},C3={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new rt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ji},fv=e=>typeof e=="bigint"||Number.isInteger(e),QN=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function _3(e,t,n){const{value:r}=e;return fv(r)&&r>=0?n+r.toString(t):Ji(e)}const A3={identify:e=>fv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>QN(e,2,8,n),stringify:e=>_3(e,8,"0o")},E3={identify:fv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>QN(e,0,10,n),stringify:Ji},O3={identify:e=>fv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>QN(e,2,16,n),stringify:e=>_3(e,16,"0x")},Fle=[Ku,Gu,uv,dv,VN,A3,E3,O3,N3,k3,C3];function bT(e){return typeof e=="bigint"||Number.isInteger(e)}const Sm=({value:e})=>JSON.stringify(e),Hle=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Sm},{identify:e=>e==null,createNode:()=>new rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Sm},{identify:bT,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})=>bT(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:Sm}],Kle={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Gle=[Ku,Gu].concat(Hle,Kle),ZN={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=rt.BLOCK_LITERAL),t!==rt.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===rt.BLOCK_LITERAL?`
167
+ `:" ")}return KN({comment:e,type:t,value:u},r,i,a)}};function z3(e,t){if(xh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Cn(r)){if(vh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new br(new rt(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
168
+ ${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
169
+ ${a.comment}`:r.comment}r=i}e.items[n]=Cn(r)?r:new br(r)}}else t("Expected a sequence for this tag");return e}function T3(e,t,n){const{replacer:r}=n,i=new Dl(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(GN(u,d,n))}return i}const YN={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:z3,createNode:T3};class mu extends Dl{constructor(){super(),this.add=Ni.prototype.add.bind(this),this.delete=Ni.prototype.delete.bind(this),this.get=Ni.prototype.get.bind(this),this.has=Ni.prototype.has.bind(this),this.set=Ni.prototype.set.bind(this),this.tag=mu.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=T3(t,n,r),a=new this;return a.items=i.items,a}}mu.tag="tag:yaml.org,2002:omap";const WN={collection:"seq",identify:e=>e instanceof Map,nodeClass:mu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=z3(e,t),r=[];for(const{key:i}of n.items)Qt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new mu,n)},createNode:(e,t,n)=>mu.from(e,t,n)};function P3({value:e,source:t},n){return t&&(e?R3:D3).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const R3={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new rt(!0),stringify:P3},D3={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new rt(!1),stringify:P3},Vle={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:Ji},Qle={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():Ji(e)}},Zle={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new rt(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Ji},bh=e=>typeof e=="bigint"||Number.isInteger(e);function hv(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 XN(e,t,n){const{value:r}=e;if(bh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Ji(e)}const Yle={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>hv(e,2,2,n),stringify:e=>XN(e,2,"0b")},Wle={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>hv(e,1,8,n),stringify:e=>XN(e,8,"0")},Xle={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>hv(e,0,10,n),stringify:Ji},Jle={identify:bh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>hv(e,2,16,n),stringify:e=>XN(e,16,"0x")};class gu extends Ni{constructor(t){super(t),this.tag=gu.tag}add(t){let n;Cn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new br(t.key,null):n=new br(t,null),ml(this.items,n.key)||this.items.push(n)}get(t,n){const r=ml(this.items,t);return!n&&Cn(r)?Qt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=ml(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new br(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(GN(o,null,r));return a}}gu.tag="tag:yaml.org,2002:set";const JN={collection:"map",identify:e=>e instanceof Set,nodeClass:gu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>gu.from(e,t,n),resolve(e,t){if(vh(e)){if(e.hasAllNullValues(!0))return Object.assign(new gu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ek(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 M3(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Ji(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 I3={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})=>ek(e,n),stringify:M3},L3={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=>ek(e,!1),stringify:M3},pv={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(pv.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=ek(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$/,"")??""},wT=[Ku,Gu,uv,dv,R3,D3,Yle,Wle,Xle,Jle,Vle,Qle,Zle,ZN,os,WN,YN,JN,I3,L3,pv],ST=new Map([["core",Fle],["failsafe",[Ku,Gu,uv]],["json",Gle],["yaml11",wT],["yaml-1.1",wT]]),jT={binary:ZN,bool:VN,float:C3,floatExp:k3,floatNaN:N3,floatTime:L3,int:E3,intHex:O3,intOct:A3,intTime:I3,map:Ku,merge:os,null:dv,omap:WN,pairs:YN,seq:Gu,set:JN,timestamp:pv},ece={"tag:yaml.org,2002:binary":ZN,"tag:yaml.org,2002:merge":os,"tag:yaml.org,2002:omap":WN,"tag:yaml.org,2002:pairs":YN,"tag:yaml.org,2002:set":JN,"tag:yaml.org,2002:timestamp":pv};function aw(e,t,n){const r=ST.get(t);if(r&&!e)return n&&!r.includes(os)?r.concat(os):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(ST.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(os)),i.reduce((a,o)=>{const u=typeof o=="string"?jT[o]:o;if(!u){const d=JSON.stringify(o),f=Object.keys(jT).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 tce=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class tk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?aw(t,"compat"):t?aw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?ece:{},this.tags=aw(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,mo,{value:Ku}),Object.defineProperty(this,Na,{value:uv}),Object.defineProperty(this,Fu,{value:Gu}),this.sortMapEntries=typeof o=="function"?o:o===!0?tce:null}clone(){const t=Object.create(tk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function nce(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=b3(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(is(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(is(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>o=!0;let f=Cu(e.contents,i,()=>u=null,d);u&&(f+=pl(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Cu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
170
+ `)?(n.push("..."),n.push(is(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(is(a(d),"")))}return n.join(`
171
+ `)+`
172
+ `}class mv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Oi,{value:C1});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 yr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(mv.prototype,{[Oi]:{value:C1}});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){Uc(this.contents)&&this.contents.add(t)}addIn(t,n){Uc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=m3(this);t.anchor=!n||r.has(n)?g3(n||"a",r):n}return new HN(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}=Ele(this,o||"a"),S={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},w=Qf(t,p,S);return u&&Nn(w)&&(w.flow=!0),y(),w}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new br(i,a)}delete(t){return Uc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Sf(t)?this.contents==null?!1:(this.contents=null,!0):Uc(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 Sf(t)?!n&&Qt(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 Sf(t)?this.contents!==void 0:Nn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Dg(this.schema,[t],n):Uc(this.contents)&&this.contents.set(t,n)}setIn(t,n){Sf(t)?this.contents=n:this.contents==null?this.contents=Dg(this.schema,Array.from(t),n):Uc(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new yr({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 yr({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 tk(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"?ru(o,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return nce(this,t)}}function Uc(e){if(Nn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class $3 extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class jm extends $3{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class rce extends $3{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const NT=(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 _u(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,S=!1,w=null,j=null,k=null,O=null,_=null,A=null,T=null;for(const R of e)switch(S&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&a(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),w&&(f&&R.type!=="comment"&&R.type!=="newline"&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),R.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(w=R),p=!0;break;case"comment":{p||a(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const B=R.source.substring(1)||" ";m?m+=y+B:m=B,y="",f=!1;break}case"newline":f?m?m+=R.source:(!A||n!=="seq-item-ind")&&(d=!0):y+=R.source,f=!0,v=!0,(j||k)&&(O=R),p=!0;break;case"anchor":j&&a(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&a(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=R,T??(T=R.offset),f=!1,p=!1,S=!0;break;case"tag":{k&&a(R,"MULTIPLE_TAGS","A node can have at most one tag"),k=R,T??(T=R.offset),f=!1,p=!1,S=!0;break}case n:(j||k)&&a(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),A&&a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),A=R,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=R,f=!1,p=!1;break}default:a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),f=!1,p=!1}const C=e[e.length-1],z=C?C.offset+C.source.length:i;return S&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(f&&w.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:A,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:O,end:z,start:T??z}}function Zf(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(Zf(t.key)||Zf(t.value))return!0}return!1;default:return!0}}function O1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Zf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function B3(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Qt(a)&&Qt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const kT="All mapping items must start at the same column";function ice({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Ni,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:S}=p,w=_u(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!w.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",kT)),!w.anchor&&!w.tag&&!v){f=w.end,w.comment&&(u.comment?u.comment+=`
179
+ `+w.comment:u.comment=w.comment);continue}(w.newlineAfterProp||Zf(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&i(d,"BAD_INDENT",kT);n.atKey=!0;const k=w.end,O=y?e(n,y,w,i):t(n,k,m,null,w,i);n.schema.compat&&O1(r.indent,y,i),n.atKey=!1,B3(n,u.items,O)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const _=_u(v??[],{indicator:"map-value-ind",next:S,offset:O.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(S?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&i(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=S?e(n,S,_,i):t(n,d,v,null,_,i);n.schema.compat&&O1(r.indent,S,i),d=A.range[2];const T=new br(O,A);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 A=new br(O);n.options.keepSourceTokens&&(A.srcToken=p),u.items.push(A)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function ace({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Dl,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=_u(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&&O1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function wh(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 sw="Block collections are not allowed within flow collections",ow=e=>e&&(e.type==="block-map"||e.type==="block-seq");function sce({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",u=o?"flow map":"flow sequence",d=a?.nodeClass??(o?Ni:Dl),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:A,value:T}=k,C=_u(O,{flow:u,indicator:"explicit-key-ind",next:_??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!A&&!T){j===0&&C.comma?i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),C.comment&&(f.comment?f.comment+=`
181
+ `+C.comment:f.comment=C.comment),m=C.end;continue}!o&&n.options.strict&&Zf(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)C.comma&&i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(C.comma||i(C.start,"MISSING_CHAR",`Missing , between ${u} items`),C.comment){let z="";e:for(const R of O)switch(R.type){case"comma":case"space":break;case"comment":z=R.source.substring(1);break e;default:break e}if(z){let R=f.items[f.items.length-1];Cn(R)&&(R=R.value??R.key),R.comment?R.comment+=`
182
+ `+z:R.comment=z,C.comment=C.comment.substring(z.length+1)}}if(!o&&!A&&!C.found){const z=T?e(n,T,C,i):t(n,C.end,A,null,C,i);f.items.push(z),m=z.range[2],ow(T)&&i(z.range,"BLOCK_IN_FLOW",sw)}else{n.atKey=!0;const z=C.end,R=_?e(n,_,C,i):t(n,z,O,null,C,i);ow(_)&&i(R.range,"BLOCK_IN_FLOW",sw),n.atKey=!1;const B=_u(A??[],{flow:u,indicator:"map-value-ind",next:T,offset:R.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(B.found){if(!o&&!C.found&&n.options.strict){if(A)for(const $ of A){if($===B.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<B.found.offset-1024&&i(B.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(B.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=T?e(n,T,B,i):B.found?t(n,B.end,A,null,B,i):null;F?ow(T)&&i(F.range,"BLOCK_IN_FLOW",sw):B.comment&&(R.comment?R.comment+=`
183
+ `+B.comment:R.comment=B.comment);const q=new br(R,F);if(n.options.keepSourceTokens&&(q.srcToken=k),o){const $=f;B3(n,$.items,R)&&i(z,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(q)}else{const $=new Ni(n.schema);$.flow=!0,$.items.push(q);const V=(F??R).range;$.range=[R.range[0],V[1],V[2]],f.items.push($)}m=F?F.range[2]:B.end}}const y=o?"}":"]",[v,...S]=r.end;let w=m;if(v?.source===y)w=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&&S.unshift(v)}if(S.length>0){const j=wh(S,w,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
184
+ `+j.comment:f.comment=j.comment),f.range=[r.offset,w,j.offset]}else f.range=[r.offset,w,w];return f}function lw(e,t,n,r,i,a){const o=n.type==="block-map"?ice(e,t,n,r,a):n.type==="block-seq"?ace(e,t,n,r,a):sce(e,t,n,r,a),u=o.constructor;return i==="!"||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}function oce(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,S=y&&a?y.offset>a.offset?y:a:y??a;S&&(!v||v.offset<S.offset)&&i(S,"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===Ni.tagName&&u==="map"||o===Dl.tagName&&u==="seq")return lw(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),lw(e,t,n,i,o)}const f=lw(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 rt(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function lce(e,t,n){const r=t.offset,i=cce(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?rt.BLOCK_FOLDED:rt.BLOCK_LITERAL,o=t.source?uce(t.source):[];let u=o.length;for(let w=o.length-1;w>=0;--w){const j=o[w][1];if(j===""||j==="\r")u=w;else break}if(u===0){const w=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:w,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let w=0;w<u;++w){const[j,k]=o[w];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=w,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let w=o.length-1;w>=u;--w)o[w][0].length>d&&(u=w+1);let m="",y="",v=!1;for(let w=0;w<p;++w)m+=o[w][0].slice(d)+`
186
+ `;for(let w=p;w<u;++w){let[j,k]=o[w];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 A=`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",A),j=""}a===rt.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 w=u;w<o.length;++w)m+=`
196
+ `+o[w][0].slice(d);m[m.length-1]!==`
197
+ `&&(m+=`
198
+ `);break;default:m+=`
199
+ `}const S=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,S,S]}}function cce({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 S=Number(v);!o&&S?o=S: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 S=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",S);const w=v.source;w&&typeof w=="string"&&(m+=w.length)}}}return{mode:a,indent:o,chomp:u,comment:p,length:m}}function uce(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 dce(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let u,d;const f=(y,v,S)=>n(r+y,v,S);switch(i){case"scalar":u=rt.PLAIN,d=fce(a,f);break;case"single-quoted-scalar":u=rt.QUOTE_SINGLE,d=hce(a,f);break;case"double-quoted-scalar":u=rt.QUOTE_DOUBLE,d=pce(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=wh(o,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function fce(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}`),U3(e)}function hce(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),U3(e.slice(1,-1)).replace(/''/g,"'")}function U3(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 pce(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}=mce(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=gce[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+=yce(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 mce(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 gce={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
214
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yce(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 q3(e,t,n,r){const{value:i,type:a,comment:o,range:u}=t.type==="block-scalar"?lce(e,t,r):dce(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[Na]:d?f=vce(e.schema,i,d,n,r):t.type==="scalar"?f=xce(e,i,t,r):f=e.schema[Na];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Qt(m)?m:new rt(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new rt(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 vce(e,t,n,r,i){if(n==="!")return e[Na];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[Na])}function xce({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[Na];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[Na];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 bce(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 wce={composeNode:F3,composeEmptyNode:nk};function F3(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=Sce(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=q3(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=oce(wce,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=nk(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&&(!Qt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function nk(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:u,end:d},f){const p={type:"scalar",offset:bce(t,n,r),indent:-1,source:""},m=q3(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 Sce({options:e},{offset:t,source:n,end:r},i){const a=new HN(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=wh(r,o,e.strict,i);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function jce(e,t,{offset:n,start:r,value:i,end:a},o){const u=Object.assign({_directives:t},e),d=new mv(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=_u(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?F3(f,i,p,o):nk(f,p.end,r,null,p,o);const m=d.contents.range[2],y=wh(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function cf(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 CT(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 Nce{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=cf(n);a?this.warnings.push(new rce(o,r,i)):this.errors.push(new jm(o,r,i))},this.directives=new yr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=CT(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:CT(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=cf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=jce(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 jm(cf(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 jm(cf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=wh(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 jm(cf(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 mv(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 H3="\uFEFF",K3="",G3="",z1="";function kce(e){switch(e){case H3:return"byte-order-mark";case K3:return"doc-mode";case G3:return"flow-error-end";case z1: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 qi(e){switch(e){case void 0:case" ":case`
224
+ `:case"\r":case" ":return!0;default:return!1}}const _T=new Set("0123456789ABCDEFabcdef"),Cce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Nm=new Set(",[]{}"),_ce=new Set(` ,[]{}
225
+ \r `),cw=e=>!e||_ce.has(e);class Ace{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==="...")&&qi(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]===H3&&(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 K3,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==="...")&&qi(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&&!qi(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===":")&&qi(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(cw),"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("..."))&&qi(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield G3,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(cw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||qi(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=>qi(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 z1,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(qi(a)||t&&Nm.has(a))break;n=r}else if(qi(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
238
+ `?(r+=1,i=`
239
+ `,a=this.buffer[r+1]):n=r),a==="#"||t&&Nm.has(a))break;if(i===`
240
+ `){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Nm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield z1,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(cw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(qi(n)||t&&Nm.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!qi(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==="%"&&_T.has(this.buffer[t+1])&&_T.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 Ece{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 to(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function AT(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 V3(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 km(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 qc(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&&!to(t.start,"explicit-key-ind")&&!to(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,V3(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 Oce{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 Ace,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=kce(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&&AT(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":{AT(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=km(this.peek(2)),r=qc(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(to(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(V3(n.key)&&!to(n.sep,"newline")){const o=qc(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(to(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=qc(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]}):to(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&&!to(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||to(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=km(r),a=qc(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=km(t),r=qc(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=km(t),r=qc(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 zce(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ece||null,prettyErrors:t}}function Tce(e,t={}){const{lineCounter:n,prettyErrors:r}=zce(t),i=new Oce(n?.addNewLine),a=new Nce(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of o)u.errors.forEach(NT(e,n)),u.warnings.forEach(NT(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Pce({onApplied:e}){const[t,n]=b.useState(""),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=Tce(t),m=[],y=[];for(let v=0;v<p.length;v++){const S=p[v];if(S.errors.length>0){m.push(`Document ${v+1}: ${S.errors[0]?.message}`);continue}const w=S.toJSON();if(!(!w||typeof w!="object"))try{const j=await CK(w);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(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
+ queries: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),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 Rce(){const{dashboard:e,isLoading:t,refetch:n}=Zl();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(z=>l.jsx("div",{className:"skeleton-text-sm w-16"},z))}),[1,2,3].map(z=>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"})]},z))]})]});const r=e.projects,i=ko(),[a,o]=b.useState(!1),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,S]=b.useState("US"),[w,j]=b.useState("en"),[k,O]=b.useState(!1),[_,A]=b.useState(null),T=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),C=async()=>{if(!(!T||!m)){O(!0),A(null);try{const z=await By(T,{displayName:f||u,canonicalDomain:m,country:v,language:w});gt({title:"Project created",detail:`${z.displayName||z.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${z.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),S("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:z.id}})}catch(z){A(z instanceof Error?z.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(z=>!z),children:[l.jsx(kz,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?l.jsxs(Le,{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:z=>d(z.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:z=>p(z.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:z=>y(z.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:z=>S(z.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:w,onChange:z=>j(z.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:C,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(z=>{const R=z.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:z.project.id}}),children:[l.jsxs("td",{children:[l.jsx(Kt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:B=>B.stopPropagation(),children:z.project.displayName||z.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:z.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:z.project.canonicalDomain}),l.jsx("td",{children:l.jsx(mt,{tone:z.visibilitySummary.tone,children:z.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:R?l.jsx(Zy,{status:R.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:z.project.country})]},z.project.id)})})]})}):a?null:l.jsxs(Le,{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(kz,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(Pce,{onApplied:()=>{n()}})]})}function T1({state:e,label:t}){return l.jsx(mt,{tone:qJ(e),children:t??Gy(e)})}function Q3({run:e}){const{openRun:t}=Bu();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(Zy,{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 Dce({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),100)/100:o&&!Number.isNaN(y)?Math.min(y/100,1):.5,S=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:S,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(nr,{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 OT({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 Mce(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 zT(e,t){return t==="citations"?e.citationState:e.visibilityState==="pending"||e.answerMentioned==null&&e.visibilityState==null?"pending":e.visibilityState==="visible"||e.answerMentioned===!0?"cited":"not-cited"}function TT(e,t){if(t==="mentions")switch(e){case"cited":return"Mentioned";case"not-cited":return"Not Mentioned";case"pending":return"Pending";case"emerging":return"Newly Mentioned";case"lost":return"No Longer Mentioned"}switch(e){case"cited":return"Cited";case"not-cited":return"Not Cited";case"lost":return"Lost";case"emerging":return"Emerging";case"pending":return"Pending"}}function PT(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let o=0;for(let u=e.length-1;u>=0&&e[u].citationState===i;u--)o++;return i==="cited"?o<=1?`${r} in latest run`:`${r} for ${o} runs`:o<=1?`Not ${n} in latest run`:`Not ${n} across ${o} runs`}function Ice(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:zT(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:zT(r,t)}))}))}function Lce({evidence:e}){const{openEvidence:t}=Bu(),[n,r]=b.useState(new Set),[i,a]=b.useState("citations"),o=b.useMemo(()=>{const m=Ice(e,i),y=new Map;for(const v of m){const S=y.get(v.query)??[];y.set(v.query,[...S,v])}return[...y.entries()].map(([v,S])=>({phrase:v,items:S}))},[e,i]),u=m=>{r(y=>{const v=new Set(y);return v.has(m)?v.delete(m):v.add(m),v})},d=i==="mentions"?"mentioned":"cited",f=i==="mentions"?"Mention History":"Citation History",p=i==="mentions"?"mentioned":"cited";return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),l.jsxs("div",{className:"inline-flex gap-0.5 p-0.5 rounded-md bg-zinc-900/60 border border-zinc-800/40",role:"tablist","aria-label":"Citation tracking view",children:[l.jsx("button",{type:"button",role:"tab","aria-selected":i==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("citations"),children:"Citations"}),l.jsx("button",{type:"button",role:"tab","aria-selected":i==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("mentions"),children:"Mentions"})]}),l.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:f}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:o.map(({phrase:m,items:y})=>{const v=n.has(m),S=y.map(_=>_.citationState),w=S.includes("cited")?"cited":S.includes("emerging")?"emerging":S.includes("lost")?"lost":S.every(_=>_==="pending")?"pending":"not-cited",j=Mce(y),k=y.filter(_=>_.citationState===Hf.cited||_.citationState==="emerging").length,O=PT(j,i);return l.jsxs(b.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>u(m),"aria-expanded":v,children:[l.jsx("td",{children:l.jsx(hh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-query-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:m}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:y.map(_=>l.jsx(Pl,{provider:_.provider},_.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(T1,{state:w,label:TT(w,i)}),l.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${y.length} engines ${p}`,children:[k,"/",y.length]})]})}),l.jsx("td",{children:l.jsx(OT,{history:j})}),l.jsx("td",{className:"evidence-change-cell",children:O}),l.jsx("td",{})]}),v&&y.map(_=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-query-cell pl-5",children:l.jsx(Pl,{provider:_.provider})}),l.jsx("td",{children:l.jsx(T1,{state:_.citationState,label:TT(_.citationState,i)})}),l.jsx("td",{children:l.jsx(OT,{history:_.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:PT(_.runHistory,i)}),l.jsx("td",{children:l.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:A=>{A.stopPropagation(),t(_.id)},children:"View"})})]},_.id))]},m)})})]})}),l.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function $ce({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Queries"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(mt,{tone:FJ(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function RT({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(mt,{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 ${Ki(d)}`:"No recent sync yet"})]})]})}function Cm({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 Bce=["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 rk(e){if(typeof e!="string")return!1;var t=Bce;return t.includes(e)}var Uce=["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"],qce=new Set(Uce);function Z3(e){return typeof e!="string"?!1:qce.has(e)}function Y3(e){return typeof e=="string"&&e.startsWith("data-")}function ka(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Z3(n)||Y3(n))&&(t[n]=e[n]);return t}function gv(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ka(t)}return typeof e=="object"&&!Array.isArray(e)?ka(e):null}function Jr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Z3(n)||Y3(n)||rk(n))&&(t[n]=e[n]);return t}function Fce(e){return e==null?null:b.isValidElement(e)?Jr(e.props):typeof e=="object"&&!Array.isArray(e)?Jr(e):null}var Hce=["children","width","height","viewBox","className","style","title","desc"];function P1(){return P1=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},P1.apply(null,arguments)}function Kce(e,t){if(e==null)return{};var n,r,i=Gce(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 Gce(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 ik=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:u,title:d,desc:f}=e,p=Kce(e,Hce),m=a||{width:r,height:i,x:0,y:0},y=Rt("recharts-surface",o);return b.createElement("svg",P1({},Jr(p),{className:y,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),b.createElement("title",null,d),b.createElement("desc",null,f),n)}),Vce=["children","className"];function R1(){return R1=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},R1.apply(null,arguments)}function Qce(e,t){if(e==null)return{};var n,r,i=Zce(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ca=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Qce(e,Vce),a=Rt("recharts-layer",r);return b.createElement("g",R1({className:a},Jr(i),{ref:t}),n)}),W3=b.createContext(null),Yce=()=>b.useContext(W3);function Gt(e){return function(){return e}}const X3=Math.cos,Ig=Math.sin,ea=Math.sqrt,Lg=Math.PI,yv=2*Lg,D1=Math.PI,M1=2*D1,ol=1e-6,Wce=M1-ol;function J3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Xce(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return J3;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 Jce{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?J3:Xce(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>ol)if(!(Math.abs(m*d-f*p)>ol)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,S=i-u,w=d*d+f*f,j=v*v+S*S,k=Math.sqrt(w),O=Math.sqrt(y),_=a*Math.tan((D1-Math.acos((w+y-j)/(2*k*O)))/2),A=_/O,T=_/k;Math.abs(A-1)>ol&&this._append`L${t+A*p},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>p*S)},${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)>ol||Math.abs(this._y1-p)>ol)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%M1+M1),y>Wce?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>ol&&this._append`A${r},${r},0,${+(y>=D1)},${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 ak(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 Jce(t)}function sk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function e$(e){this._context=e}e$.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 vv(e){return new e$(e)}function t$(e){return e[0]}function n$(e){return e[1]}function r$(e,t){var n=Gt(!0),r=null,i=vv,a=null,o=ak(u);e=typeof e=="function"?e:e===void 0?t$:Gt(e),t=typeof t=="function"?t:t===void 0?n$:Gt(t);function u(d){var f,p=(d=sk(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:Gt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Gt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Gt(!!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 _m(e,t,n){var r=null,i=Gt(!0),a=null,o=vv,u=null,d=ak(f);e=typeof e=="function"?e:e===void 0?t$:Gt(+e),t=typeof t=="function"?t:Gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?n$:Gt(+n);function f(m){var y,v,S,w=(m=sk(m)).length,j,k=!1,O,_=new Array(w),A=new Array(w);for(a==null&&(u=o(O=d())),y=0;y<=w;++y){if(!(y<w&&i(j=m[y],y,m))===k)if(k=!k)v=y,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),S=y-1;S>=v;--S)u.point(_[S],A[S]);u.lineEnd(),u.areaEnd()}k&&(_[y]=+e(j,y,m),A[y]=+t(j,y,m),u.point(r?+r(j,y,m):_[y],n?+n(j,y,m):A[y]))}if(O)return u=null,O+""||null}function p(){return r$().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Gt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Gt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Gt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Gt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Gt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Gt(+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:Gt(!!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 i${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 eue(e){return new i$(e,!0)}function tue(e){return new i$(e,!1)}const ok={draw(e,t){const n=ea(t/Lg);e.moveTo(n,0),e.arc(0,0,n,0,yv)}},nue={draw(e,t){const n=ea(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()}},a$=ea(1/3),rue=a$*2,iue={draw(e,t){const n=ea(t/rue),r=n*a$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},aue={draw(e,t){const n=ea(t),r=-n/2;e.rect(r,r,n,n)}},sue=.8908130915292852,s$=Ig(Lg/10)/Ig(7*Lg/10),oue=Ig(yv/10)*s$,lue=-X3(yv/10)*s$,cue={draw(e,t){const n=ea(t*sue),r=oue*n,i=lue*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=yv*a/5,u=X3(o),d=Ig(o);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},uw=ea(3),uue={draw(e,t){const n=-ea(t/(uw*3));e.moveTo(0,n*2),e.lineTo(-uw*n,-n),e.lineTo(uw*n,-n),e.closePath()}},yi=-.5,vi=ea(3)/2,I1=1/ea(12),due=(I1/2+1)*3,fue={draw(e,t){const n=ea(t/due),r=n/2,i=n*I1,a=r,o=n*I1+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 hue(e,t){let n=null,r=ak(i);e=typeof e=="function"?e:Gt(e||ok),t=typeof t=="function"?t:Gt(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:Gt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Gt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function $g(){}function Bg(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 o$(e){this._context=e}o$.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:Bg(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:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pue(e){return new o$(e)}function l$(e){this._context=e}l$.prototype={areaStart:$g,areaEnd:$g,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:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mue(e){return new l$(e)}function c$(e){this._context=e}c$.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:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gue(e){return new c$(e)}function u$(e){this._context=e}u$.prototype={areaStart:$g,areaEnd:$g,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 yue(e){return new u$(e)}function DT(e){return e<0?-1:1}function MT(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(DT(a)+DT(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function IT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dw(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 Ug(e){this._context=e}Ug.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:dw(this,this._t0,IT(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,dw(this,IT(this,n=MT(this,e,t)),n);break;default:dw(this,this._t0,n=MT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function d$(e){this._context=new f$(e)}(d$.prototype=Object.create(Ug.prototype)).point=function(e,t){Ug.prototype.point.call(this,t,e)};function f$(e){this._context=e}f$.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 vue(e){return new Ug(e)}function xue(e){return new d$(e)}function h$(e){this._context=e}h$.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=LT(e),i=LT(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 LT(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 bue(e){return new h$(e)}function xv(e,t){this._context=e,this._t=t}xv.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 wue(e){return new xv(e,.5)}function Sue(e){return new xv(e,0)}function jue(e){return new xv(e,1)}function Ml(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 L1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Nue(e,t){return e[t]}function kue(e){const t=[];return t.key=e,t}function Cue(){var e=Gt([]),t=L1,n=Ml,r=Nue;function i(a){var o=Array.from(e.apply(this,arguments),kue),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=sk(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:Gt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Gt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?L1:typeof a=="function"?a:Gt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Ml,i):n},i}function _ue(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}Ml(e,t)}}function Aue(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}Ml(e,t)}}function Eue(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,S=0;S<u;++S){var w=e[t[S]],j=w[r][1]||0,k=w[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,Ml(e,t)}}var fw={},hw={},$T;function Oue(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(hw)),hw}var pw={},BT;function p$(){return BT||(BT=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})(pw)),pw}var mw={},UT;function lk(){return UT||(UT=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})(mw)),mw}var gw={},yw={},qT;function zue(){return qT||(qT=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})(yw)),yw}var FT;function ck(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zue(),n=lk();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})(gw)),gw}var HT;function uk(){return HT||(HT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Oue(),n=p$(),r=lk(),i=ck();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})(fw)),fw}var vw,KT;function Tue(){return KT||(KT=1,vw=uk().get),vw}var Pue=Tue();const bv=za(Pue);var Rue=4;function co(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rue,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Jn(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+co(u)+a:i+a},"")}var Zi=e=>e===0?0:e>0?1:-1,_a=e=>typeof e=="number"&&e!=+e,Il=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ue=e=>(typeof e=="number"||e instanceof Number)&&!_a(e),Aa=e=>Ue(e)||typeof e=="string",Due=0,Yf=e=>{var t=++Due;return"".concat(e||"").concat(t)},So=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ue(t)&&typeof t!="string")return r;var a;if(Il(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return _a(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},m$=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 ma(e,t,n){return Ue(e)&&Ue(t)?co(e+n*(t-e)):t}function g$(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):bv(r,t))===n)}var ir=e=>e===null||typeof e>"u",Sh=e=>ir(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function va(e){return e!=null}function Vu(){}var Mue=["type","size","sizeType"];function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$1.apply(null,arguments)}function 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 VT(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){Iue(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 Iue(e,t,n){return(t=Lue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lue(e){var t=$ue(e,"string");return typeof t=="symbol"?t:t+""}function $ue(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 Bue(e,t){if(e==null)return{};var n,r,i=Uue(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 Uue(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 y$={symbolCircle:ok,symbolCross:nue,symbolDiamond:iue,symbolSquare:aue,symbolStar:cue,symbolTriangle:uue,symbolWye:fue},que=Math.PI/180,Fue=e=>{var t="symbol".concat(Sh(e));return y$[t]||ok},Hue=(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*que;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}},Kue=(e,t)=>{y$["symbol".concat(Sh(e))]=t},v$=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Bue(e,Mue),a=VT(VT({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var u=()=>{var y=Fue(o),v=hue().type(y).size(Hue(n,r,o)),S=v();if(S!==null)return S},{className:d,cx:f,cy:p}=a,m=Jr(a);return Ue(f)&&Ue(p)&&Ue(n)?b.createElement("path",$1({},m,{className:Rt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};v$.registerSymbol=Kue;var x$=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,dk=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{rk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Gue=(e,t,n)=>r=>(e(t,n,r),null),b$=(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];rk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Gue(a,t,n))}),r};function QT(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 Vue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){Que(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Que(e,t,n){return(t=Zue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zue(e){var t=Yue(e,"string");return typeof t=="symbol"?t:t+""}function Yue(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 ri(e,t){var n=Vue({},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 qg(){return qg=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},qg.apply(null,arguments)}function ZT(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 w$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZT(Object(n),!0).forEach(function(r){Wue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wue(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=Jue(e,"string");return typeof t=="symbol"?t:t+""}function Jue(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,ede={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function tde(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function nde(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 b.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:tde(t.payload),x1:0,y1:i,x2:bi,y2:i,className:"recharts-legend-icon"});if(d==="line")return b.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(o,`
255
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
256
+ H`).concat(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 b.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(b.isValidElement(t.legendIcon)){var f=w$({},t);return delete f.legendIcon,b.cloneElement(t.legendIcon,f)}return b.createElement(v$,{fill:u,cx:i,cy:i,size:bi,sizeType:"diameter",type:d})}function rde(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,S=Rt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var w=typeof u=="object"?w$({},u):{};w.color=m.inactive?a:w.color||m.color;var j=v?v(m.value,m,y):m.value;return b.createElement("li",qg({className:S,style:f,key:"legend-item-".concat(y)},b$(e,m,y)),b.createElement(ik,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},b.createElement(nde,{data:m,iconType:o,inactiveColor:a})),b.createElement("span",{className:"recharts-legend-item-text",style:w},j))})}var ide=e=>{var t=ri(e,ede),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return b.createElement("ul",{className:"recharts-default-legend",style:a},b.createElement(rde,qg({},t,{payload:n})))},xw={},bw={},YT;function ade(){return YT||(YT=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})(bw)),bw}var ww={},WT;function sde(){return WT||(WT=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})(ww)),ww}var Sw={},XT;function S$(){return XT||(XT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Sw)),Sw}var jw={},Nw={},kw={},JT;function ode(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(kw)),kw}var eP;function j$(){return eP||(eP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ode();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Nw)),Nw}var Cw={},tP;function lde(){return tP||(tP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Cw)),Cw}var nP;function cde(){return nP||(nP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j$(),n=lde();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(jw)),jw}var _w={},Aw={},rP;function ude(){return rP||(rP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uk();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Aw)),Aw}var Ew={},Ow={},zw={},Tw={},iP;function N$(){return iP||(iP=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})(Tw)),Tw}var Pw={},aP;function k$(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Pw)),Pw}var Rw={},sP;function C$(){return sP||(sP=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})(Rw)),Rw}var oP;function dde(){return oP||(oP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N$(),n=k$(),r=C$();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(S,w,j,k,O,_){const A=y(S,w,j,k,O,_);return A!==void 0?!!A:a(S,w,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return u(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const S=Object.keys(m);if(p==null||n.isPrimitive(p))return S.length===0;if(S.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let w=0;w<S.length;w++){const j=S[w];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[S,w]of m.entries()){const j=p.get(S);if(y(j,w,S,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 S=new Set;for(let w=0;w<m.length;w++){const j=m[w];let k=!1;for(let O=0;O<p.length;O++){if(S.has(O))continue;const _=p[O];let A=!1;if(y(_,j,w,p,m,v)&&(A=!0),A){S.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})(zw)),zw}var lP;function _$(){return lP||(lP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dde();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Ow)),Ow}var Dw={},Mw={},Iw={},cP;function fde(){return cP||(cP=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})(Iw)),Iw}var Lw={},uP;function fk(){return uP||(uP=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})(Lw)),Lw}var $w={},dP;function A$(){return dP||(dP=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]",S="[object Error]",w="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",O="[object Uint16Array]",_="[object Uint32Array]",A="[object BigUint64Array]",T="[object Int8Array]",C="[object Int16Array]",z="[object Int32Array]",R="[object BigInt64Array]",B="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=w,e.dateTag=u,e.errorTag=S,e.float32ArrayTag=B,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=C,e.int32ArrayTag=z,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})($w)),$w}var Bw={},fP;function hde(){return fP||(fP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Bw)),Bw}var hP;function E$(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fde(),n=fk(),r=A$(),i=k$(),a=hde();function o(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,y,v=new Map,S=void 0){const w=S?.(p,m,y,v);if(w!==void 0)return w;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,y,v,S);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,S));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,S));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,S);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,S),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,S),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,S),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,S),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,S),j}return p}function d(p,m,y=p,v,S){const w=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<w.length;j++){const k=w[j],O=Object.getOwnPropertyDescriptor(p,k);(O==null||O.writable)&&(p[k]=u(m[k],k,y,v,S))}}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})(Mw)),Mw}var pP;function pde(){return pP||(pP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E$();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Dw)),Dw}var mP;function mde(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_$(),n=pde();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Ew)),Ew}var Uw={},qw={},Fw={},gP;function gde(){return gP||(gP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E$(),n=fk(),r=A$();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})(Fw)),Fw}var yP;function yde(){return yP||(yP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gde();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(qw)),qw}var Hw={},Kw={},vP;function O$(){return vP||(vP=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})(Kw)),Kw}var Gw={},xP;function vde(){return xP||(xP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fk();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Gw)),Gw}var bP;function xde(){return bP||(bP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p$(),n=O$(),r=vde(),i=ck();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})(Hw)),Hw}var wP;function bde(){return wP||(wP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_$(),n=lk(),r=yde(),i=uk(),a=xde();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})(Uw)),Uw}var SP;function wde(){return SP||(SP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S$(),n=ude(),r=mde(),i=bde();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})(_w)),_w}var jP;function Sde(){return jP||(jP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ade(),n=sde(),r=S$(),i=cde(),a=wde();function o(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(xw)),xw}var Vw,NP;function jde(){return NP||(NP=1,Vw=Sde().uniqBy),Vw}var Nde=jde();const kP=za(Nde);function z$(e,t,n){return t===!0?kP(e,n):typeof t=="function"?kP(e,t):e}var hk=b.createContext(null),kde=e=>e,vn=()=>{var e=b.useContext(hk);return e?e.store.dispatch:kde},ig=()=>{},Cde=()=>ig,_de=(e,t)=>e===t;function Qe(e){var t=b.useContext(hk),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:ig,[t,e]);return HI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Cde,t?t.store.getState:ig,t?t.store.getState:ig,n,_de)}function Ade(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ede(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ode(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 CP=e=>Array.isArray(e)?e:[e];function zde(e){const t=Array.isArray(e[0])?e[0]:e;return Ode(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Tde(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}},Rde=typeof WeakRef<"u"?WeakRef:Pde,Dde=0,_P=1;function Am(){return{s:Dde,v:void 0,o:null,p:null}}function T$(e,t={}){let n=Am();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 S=u.o;S===null&&(u.o=S=new WeakMap);const w=S.get(v);w===void 0?(u=Am(),S.set(v,u)):u=w}else{let S=u.p;S===null&&(u.p=S=new Map);const w=S.get(v);w===void 0?(u=Am(),S.set(v,u)):u=w}}const f=u;let p;if(u.s===_P)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 Rde(p):p}return f.s=_P,f.v=p,p}return o.clearCache=()=>{n=Am(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Mde(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()),Ade(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=T$,argsMemoizeOptions:S=[]}=p,w=CP(y),j=CP(S),k=zde(i),O=m(function(){return a++,f.apply(null,arguments)},...w),_=v(function(){o++;const T=Tde(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=Mde(T$),Ide=Object.assign((e,t=oe)=>{Ede(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:()=>Ide}),Qw={},Zw={},Yw={},AP;function Lde(){return AP||(AP=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})(Yw)),Yw}var Ww={},Xw={},EP;function P$(){return EP||(EP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Xw)),Xw}var OP;function $de(){return OP||(OP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P$(),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})(Ww)),Ww}var zP;function Bde(){return zP||(zP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lde(),n=$de(),r=ck();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,S)=>{let w=v;for(let j=0;j<S.length&&w!=null;++j)w=w[S[j]];return w},p=(v,S)=>S==null||v==null?S:typeof v=="object"&&"key"in v?Object.hasOwn(S,v.key)?S[v.key]:f(S,v.path):typeof v=="function"?v(S):Array.isArray(v)?f(S,v):typeof S=="object"?S[v]:S,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(S=>p(S,v))})).slice().sort((v,S)=>{for(let w=0;w<m.length;w++){const j=t.compareValues(v.criteria[w],S.criteria[w],u[w]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(Zw)),Zw}var Jw={},TP;function Ude(){return TP||(TP=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})(Jw)),Jw}var eS={},PP;function R$(){return PP||(PP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O$(),n=j$(),r=N$(),i=C$();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})(eS)),eS}var RP;function qde(){return RP||(RP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bde(),n=Ude(),r=R$();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})(Qw)),Qw}var tS,DP;function Fde(){return DP||(DP=1,tS=qde().sortBy),tS}var Hde=Fde();const wv=za(Hde);var D$=e=>e.legend.settings,Kde=e=>e.legend.size,Gde=e=>e.legend.payload,Vde=oe([Gde,D$],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?wv(r,n):r});function Qde(){return Qe(Vde)}var Em=1;function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=b.useState({height:0,left:0,top:0,width:0}),r=b.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>Em||Math.abs(o.left-t.left)>Em||Math.abs(o.top-t.top)>Em||Math.abs(o.width-t.width)>Em)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Xn(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 Zde=typeof Symbol=="function"&&Symbol.observable||"@@observable",MP=Zde,nS=()=>Math.random().toString(36).substring(7).split("").join("."),Yde={INIT:`@@redux/INIT${nS()}`,REPLACE:`@@redux/REPLACE${nS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${nS()}`},Fg=Yde;function pk(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 I$(e,t,n){if(typeof e!="function")throw new Error(Xn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Xn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Xn(1));return n(I$)(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(Xn(3));return i}function m(j){if(typeof j!="function")throw new Error(Xn(4));if(d)throw new Error(Xn(5));let k=!0;f();const O=u++;return o.set(O,j),function(){if(k){if(d)throw new Error(Xn(6));k=!1,f(),o.delete(O),a=null}}}function y(j){if(!pk(j))throw new Error(Xn(7));if(typeof j.type>"u")throw new Error(Xn(8));if(typeof j.type!="string")throw new Error(Xn(17));if(d)throw new Error(Xn(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(Xn(10));r=j,y({type:Fg.REPLACE})}function S(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Xn(11));function O(){const A=k;A.next&&A.next(p())}return O(),{unsubscribe:j(O)}},[MP](){return this}}}return y({type:Fg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[MP]:S}}function Wde(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Fg.INIT})>"u")throw new Error(Xn(12));if(typeof n(void 0,{type:Fg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xn(13))})}function L$(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{Wde(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],S=y(v,u);if(typeof S>"u")throw u&&u.type,new Error(Xn(14));f[m]=S,d=d||S!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function Hg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Xde(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Xn(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(o));return a=Hg(...u)(i.dispatch),{...i,dispatch:a}}}function $$(e){return pk(e)&&"type"in e&&typeof e.type=="string"}var B$=Symbol.for("immer-nothing"),IP=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state");function Gi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wr=Object,Au=Wr.getPrototypeOf,Kg="constructor",Sv="prototype",B1="configurable",Gg="enumerable",ag="writable",Wf="value",cs=e=>!!e&&!!e[wr];function Wi(e){return e?U$(e)||Nv(e)||!!e[IP]||!!e[Kg]?.[IP]||kv(e)||Cv(e):!1}var Jde=Wr[Sv][Kg].toString(),LP=new WeakMap;function U$(e){if(!e||!mk(e))return!1;const t=Au(e);if(t===null||t===Wr[Sv])return!0;const n=Wr.hasOwnProperty.call(t,Kg)&&t[Kg];if(n===Object)return!0;if(!Jc(n))return!1;let r=LP.get(n);return r===void 0&&(r=Function.toString.call(n),LP.set(n,r)),r===Jde}function jv(e,t,n=!0){jh(e)===0?(n?Reflect.ownKeys(e):Wr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function jh(e){const t=e[wr];return t?t.type_:Nv(e)?1:kv(e)?2:Cv(e)?3:0}var $P=(e,t,n=jh(e))=>n===2?e.has(t):Wr[Sv].hasOwnProperty.call(e,t),U1=(e,t,n=jh(e))=>n===2?e.get(t):e[t],Vg=(e,t,n,r=jh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function efe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Nv=Array.isArray,kv=e=>e instanceof Map,Cv=e=>e instanceof Set,mk=e=>typeof e=="object",Jc=e=>typeof e=="function",rS=e=>typeof e=="boolean";function tfe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ts=e=>e.copy_||e.base_,gk=e=>e.modified_?e.copy_:e.base_;function q1(e,t){if(kv(e))return new Map(e);if(Cv(e))return new Set(e);if(Nv(e))return Array[Sv].slice.call(e);const n=U$(e);if(t===!0||t==="class_only"&&!n){const r=Wr.getOwnPropertyDescriptors(e);delete r[wr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u[ag]===!1&&(u[ag]=!0,u[B1]=!0),(u.get||u.set)&&(r[o]={[B1]:!0,[ag]:!0,[Gg]:u[Gg],[Wf]:e[o]})}return Wr.create(Au(e),r)}else{const r=Au(e);if(r!==null&&n)return{...e};const i=Wr.create(r);return Wr.assign(i,e)}}function yk(e,t=!1){return _v(e)||cs(e)||!Wi(e)||(jh(e)>1&&Wr.defineProperties(e,{set:Om,add:Om,clear:Om,delete:Om}),Wr.freeze(e),t&&jv(e,(n,r)=>{yk(r,!0)},!1)),e}function nfe(){Gi(2)}var Om={[Wf]:nfe};function _v(e){return e===null||!mk(e)?!0:Wr.isFrozen(e)}var Qg="MapSet",F1="Patches",BP="ArrayMethods",q$={};function Ll(e){const t=q$[e];return t||Gi(0,e),t}var UP=e=>!!q$[e],Xf,F$=()=>Xf,rfe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:UP(Qg)?Ll(Qg):void 0,arrayMethodsPlugin_:UP(BP)?Ll(BP):void 0});function qP(e,t){t&&(e.patchPlugin_=Ll(F1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function H1(e){K1(e),e.drafts_.forEach(ife),e.drafts_=null}function K1(e){e===Xf&&(Xf=e.parent_)}var FP=e=>Xf=rfe(Xf,e);function ife(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function HP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[wr].modified_&&(H1(t),Gi(4)),Wi(e)&&(e=KP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[wr].base_,e,t)}else e=KP(t,n);return afe(t,e,!0),H1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==B$?e:void 0}function KP(e,t){if(_v(t))return t;const n=t[wr];if(!n)return Zg(t,e.handledSet_,e);if(!Av(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);G$(n,e)}return n.copy_}function afe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yk(t,n)}function H$(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Av=(e,t)=>e.scope_===t,sfe=[];function K$(e,t,n,r){const i=ts(e),a=e.type_;if(r!==void 0&&U1(i,r,a)===t){Vg(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;jv(i,(d,f)=>{if(cs(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const o=e.draftLocations_.get(t)??sfe;for(const u of o)Vg(i,u,n,a)}function ofe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!Av(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=gk(a);K$(e,a.draft_??a,o,n),G$(a,i)})}function G$(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)}H$(e)}}function lfe(e,t,n){const{scope_:r}=e;if(cs(n)){const i=n[wr];Av(i,r)&&i.callbacks_.push(function(){sg(e);const o=gk(i);K$(e,n,o,t)})}else Wi(n)&&e.callbacks_.push(function(){const a=ts(e);e.type_===3?a.has(n)&&Zg(n,r.handledSet_,r):U1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Zg(U1(e.copy_,t,e.type_),r.handledSet_,r)})}function Zg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||cs(e)||t.has(e)||!Wi(e)||_v(e)||(t.add(e),jv(e,(r,i)=>{if(cs(i)){const a=i[wr];if(Av(a,n)){const o=gk(a);Vg(e,r,o,e.type_),H$(a)}}else Wi(i)&&Zg(i,t,n)})),e}function cfe(e,t){const n=Nv(e),r={type_:n?1:0,scope_:t?t.scope_:F$(),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=Yg;n&&(i=[r],a=Jf);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,[u,r]}var Yg={get(e,t){if(t===wr)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=ts(e);if(!$P(i,t,e.type_))return ufe(e,i,t);const a=i[t];if(e.finalized_||!Wi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&tfe(t))return a;if(a===iS(e.base_,t)){sg(e);const o=e.type_===1?+t:t,u=V1(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in ts(e)},ownKeys(e){return Reflect.ownKeys(ts(e))},set(e,t,n){const r=V$(ts(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=iS(ts(e),t),a=i?.[wr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(efe(n,i)&&(n!==void 0||$P(e.base_,t,e.type_)))return!0;sg(e),G1(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),lfe(e,t,n)),!0},deleteProperty(e,t){return sg(e),iS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),G1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ts(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ag]:!0,[B1]:e.type_!==1||t!=="length",[Gg]:r[Gg],[Wf]:n[t]}},defineProperty(){Gi(11)},getPrototypeOf(e){return Au(e.base_)},setPrototypeOf(){Gi(12)}},Jf={};for(let e in Yg){let t=Yg[e];Jf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Jf.deleteProperty=function(e,t){return Jf.set.call(this,e,t,void 0)};Jf.set=function(e,t,n){return Yg.set.call(this,e[0],t,n,e[0])};function iS(e,t){const n=e[wr];return(n?ts(n):e)[t]}function ufe(e,t,n){const r=V$(t,n);return r?Wf in r?r[Wf]:r.get?.call(e.draft_):void 0}function V$(e,t){if(!(t in e))return;let n=Au(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Au(n)}}function G1(e){e.modified_||(e.modified_=!0,e.parent_&&G1(e.parent_))}function sg(e){e.copy_||(e.assigned_=new Map,e.copy_=q1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dfe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Jc(n)&&!Jc(r)){const o=r;r=n;const u=this;return function(f=o,...p){return u.produce(f,m=>r.call(this,m,...p))}}Jc(r)||Gi(6),i!==void 0&&!Jc(i)&&Gi(7);let a;if(Wi(n)){const o=FP(this),u=V1(o,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?H1(o):K1(o)}return qP(o,i),HP(a,o)}else if(!n||!mk(n)){if(a=r(n),a===void 0&&(a=n),a===B$&&(a=void 0),this.autoFreeze_&&yk(a,!0),i){const o=[],u=[];Ll(F1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else Gi(1,n)},this.produceWithPatches=(n,r)=>{if(Jc(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},rS(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),rS(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),rS(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Wi(t)||Gi(8),cs(t)&&(t=ki(t));const n=FP(this),r=V1(n,t,void 0);return r[wr].isManual_=!0,K1(n),r}finishDraft(t,n){const r=t&&t[wr];(!r||!r.isManual_)&&Gi(9);const{scope_:i}=r;return qP(i,n),HP(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=Ll(F1).applyPatches_;return cs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function V1(e,t,n,r){const[i,a]=kv(t)?Ll(Qg).proxyMap_(t,n):Cv(t)?Ll(Qg).proxySet_(t,n):cfe(t,n);return(n?.scope_??F$()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?ofe(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 cs(e)||Gi(10,e),Q$(e)}function Q$(e){if(!Wi(e)||_v(e))return e;const t=e[wr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=q1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=q1(e,!0);return jv(n,(i,a)=>{Vg(n,i,Q$(a))},r),t&&(t.finalized_=!1),n}var ffe=new dfe,Z$=ffe.produce;function Y$(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var hfe=Y$(),pfe=Y$,mfe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Hg:Hg.apply(null,arguments)};function ei(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Xr(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=>$$(r)&&r.type===e,n}var W$=class jf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,jf.prototype)}static get[Symbol.species](){return jf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new jf(...t[0].concat(this)):new jf(...t.concat(this))}};function GP(e){return Wi(e)?Z$(e,()=>{}):e}function zm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function gfe(e){return typeof e=="boolean"}var yfe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new W$;return n&&(gfe(n)?o.push(hfe):o.push(pfe(n.extraArgument))),o},X$="RTK_autoBatch",Jt=()=>e=>({payload:e,meta:{[X$]:!0}}),VP=e=>t=>{setTimeout(t,e)},J$=(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:VP(10):e.type==="callback"?e.queueNotification:VP(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?.[X$],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},vfe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new W$(e);return r&&i.push(J$(typeof r=="object"?r:void 0)),i};function xfe(e){const t=yfe(),{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(pk(n))u=L$(n);else throw new Error(Xr(1));let d;typeof r=="function"?d=r(t):d=t();let f=Hg;i&&(f=mfe({trace:!1,...typeof i=="object"&&i}));const p=Xde(...d),m=vfe(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return I$(u,a,v)}function e6(e){const t={},n=[];let r;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Xr(28));if(u in t)throw new Error(Xr(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 bfe(e){return typeof e=="function"}function wfe(e,t){let[n,r,i]=e6(t),a;if(bfe(e))a=()=>GP(e());else{const u=GP(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(cs(p)){const v=m(p,d);return v===void 0?p:v}else{if(Wi(p))return Z$(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 Sfe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",jfe=(e=21)=>{let t="",n=e;for(;n--;)t+=Sfe[Math.random()*64|0];return t},Nfe=Symbol.for("rtk-slice-createasyncthunk");function kfe(e,t){return`${e}/${t}`}function Cfe({creators:e}={}){const t=e?.asyncThunk?.[Nfe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Xr(11));const o=(typeof r.reducers=="function"?r.reducers(Afe()):r.reducers)||{},u=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,A){const T=typeof _=="string"?_:_.type;if(!T)throw new Error(Xr(12));if(T in d.sliceCaseReducersByType)throw new Error(Xr(13));return d.sliceCaseReducersByType[T]=A,f},addMatcher(_,A){return d.sliceMatchers.push({matcher:_,reducer:A}),f},exposeAction(_,A){return d.actionCreators[_]=A,f},exposeCaseReducer(_,A){return d.sliceCaseReducersByName[_]=A,f}};u.forEach(_=>{const A=o[_],T={reducerName:_,type:kfe(i,_),createNotation:typeof r.reducers=="function"};Ofe(A)?Tfe(T,A,f,t):Efe(T,A,f)});function p(){const[_={},A=[],T=void 0]=typeof r.extraReducers=="function"?e6(r.extraReducers):[r.extraReducers],C={..._,...d.sliceCaseReducersByType};return wfe(r.initialState,z=>{for(let R in C)z.addCase(R,C[R]);for(let R of d.sliceMatchers)z.addMatcher(R.matcher,R.reducer);for(let R of A)z.addMatcher(R.matcher,R.reducer);T&&z.addDefaultCase(T)})}const m=_=>_,y=new Map,v=new WeakMap;let S;function w(_,A){return S||(S=p()),S(_,A)}function j(){return S||(S=p()),S.getInitialState()}function k(_,A=!1){function T(z){let R=z[_];return typeof R>"u"&&A&&(R=zm(v,T,j)),R}function C(z=m){const R=zm(y,A,()=>new WeakMap);return zm(R,z,()=>{const B={};for(const[F,q]of Object.entries(r.selectors??{}))B[F]=_fe(q,z,()=>zm(v,z,j),A);return B})}return{reducerPath:_,getSelectors:C,get selectors(){return C(T)},selectSlice:T}}const O={name:i,reducer:w,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(_,{reducerPath:A,...T}={}){const C=A??a;return _.inject({reducerPath:C,reducer:w},T),{...O,...k(C,!0)}}};return O}}function _fe(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 hr=Cfe();function Afe(){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 Efe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!zfe(r))throw new Error(Xr(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?ei(e,o):ei(e))}function Ofe(e){return e._reducerDefinitionType==="asyncThunk"}function zfe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Tfe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Xr(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||Tm,pending:u||Tm,rejected:d||Tm,settled:f||Tm})}function Tm(){}var Pfe="task",t6="listener",n6="completed",vk="cancelled",Rfe=`task-${vk}`,Dfe=`task-${n6}`,Q1=`${t6}-${vk}`,Mfe=`${t6}-${n6}`,Ev=class{constructor(e){this.code=e,this.message=`${Pfe} ${vk} (reason: ${e})`}name="TaskAbortError";message},xk=(e,t)=>{if(typeof e!="function")throw new TypeError(Xr(32))},Wg=()=>{},r6=(e,t=Wg)=>(e.catch(t),e),i6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),jl=e=>{if(e.aborted)throw new Ev(e.reason)};function a6(e,t){let n=Wg;return new Promise((r,i)=>{const a=()=>i(new Ev(e.reason));if(e.aborted){a();return}n=i6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Wg})}var Ife=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Ev?"cancelled":"rejected",error:n}}finally{t?.()}},Xg=e=>t=>r6(a6(e,t).then(n=>(jl(e),n))),s6=e=>{const t=Xg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:yu}=Object,QP={},Ov="listenerMiddleware",Lfe=(e,t)=>{const n=r=>i6(e,()=>r.abort(e.reason));return(r,i)=>{xk(r);const a=new AbortController;n(a);const o=Ife(async()=>{jl(e),jl(a.signal);const u=await r({pause:Xg(a.signal),delay:s6(a.signal),signal:a.signal});return jl(a.signal),u},()=>a.abort(Dfe));return i?.autoJoin&&t.push(o.catch(Wg)),{result:Xg(e)(o),cancel(){a.abort(Rfe)}}}},$fe=(e,t)=>{const n=async(r,i)=>{jl(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 a6(t,Promise.race(u));return jl(t),d}finally{a()}};return(r,i)=>r6(n(r,i))},o6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=ei(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Xr(21));return xk(a),{predicate:i,type:t,effect:a}},l6=yu(e=>{const{type:t,predicate:n,effect:r}=o6(e);return{id:jfe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Xr(22))}}},{withTypes:()=>l6}),ZP=(e,t)=>{const{type:n,effect:r,predicate:i}=o6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Z1=e=>{e.pending.forEach(t=>{t.abort(Q1)})},Bfe=(e,t)=>()=>{for(const n of t.keys())Z1(n);e.clear()},YP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},c6=yu(ei(`${Ov}/add`),{withTypes:()=>c6}),Ufe=ei(`${Ov}/removeAll`),u6=yu(ei(`${Ov}/remove`),{withTypes:()=>u6}),qfe=(...e)=>{console.error(`${Ov}/error`,...e)},Nh=(e={})=>{const t=new Map,n=new Map,r=v=>{const S=n.get(v)??0;n.set(v,S+1)},i=v=>{const S=n.get(v)??1;S===1?n.delete(v):n.set(v,S-1)},{extra:a,onError:o=qfe}=e;xk(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),S=>{v.unsubscribe(),S?.cancelActive&&Z1(v)}),d=v=>{const S=ZP(t,v)??l6(v);return u(S)};yu(d,{withTypes:()=>d});const f=v=>{const S=ZP(t,v);return S&&(S.unsubscribe(),v.cancelActive&&Z1(S)),!!S};yu(f,{withTypes:()=>f});const p=async(v,S,w,j)=>{const k=new AbortController,O=$fe(d,k.signal),_=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(S,yu({},w,{getOriginalState:j,condition:(A,T)=>O(A,T).then(Boolean),take:O,delay:s6(k.signal),pause:Xg(k.signal),extra:a,signal:k.signal,fork:Lfe(k.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,T,C)=>{A!==k&&(A.abort(Q1),C.delete(A))})},cancel:()=>{k.abort(Q1),v.pending.delete(k)},throwIfCancelled:()=>{jl(k.signal)}})))}catch(A){A instanceof Ev||YP(o,A,{raisedBy:"effect"})}finally{await Promise.all(_),k.abort(Mfe),i(v),v.pending.delete(k)}},m=Bfe(t,n);return{middleware:v=>S=>w=>{if(!$$(w))return S(w);if(c6.match(w))return d(w.payload);if(Ufe.match(w)){m();return}if(u6.match(w))return f(w.payload);let j=v.getState();const k=()=>{if(j===QP)throw new Error(Xr(23));return j};let O;try{if(O=S(w),t.size>0){const _=v.getState(),A=Array.from(t.values());for(const T of A){let C=!1;try{C=T.predicate(w,_,j)}catch(z){C=!1,YP(o,z,{raisedBy:"predicate"})}C&&p(T,w,v,k)}}}finally{j=QP}return O},startListening:d,stopListening:f,clearListeners:m}};function Xr(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 Ffe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},d6=hr({name:"chartLayout",initialState:Ffe,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:Hfe,setLayout:Kfe,setChartSize:Gfe,setScale:Vfe}=d6.actions,Qfe=d6.reducer;function f6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ct(e){return Number.isFinite(e)}function jo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){Zfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zfe(e,t,n){return(t=Yfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yfe(e){var t=Wfe(e,"string");return typeof t=="symbol"?t:t+""}function Wfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hn(e,t,n){return ir(e)||ir(t)?n:Aa(t)?bv(e,t,n):typeof t=="function"?t(e):n}var Xfe=(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"&&Ue(e[a]))return au(au({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&Ue(e[o]))return au(au({},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",Jfe=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=_a(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},ehe=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=_a(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},the={sign:Jfe,expand:_ue,none:Ml,silhouette:Aue,wiggle:Eue,positive:ehe},nhe=(e,t,n)=>{var r,i=(r=the[n])!==null&&r!==void 0?r:Ml,a=Cue().keys(t).value((u,d)=>Number(Hn(u,d,0))).order(L1).offset(i),o=a(e);return o.forEach((u,d)=>{u.forEach((f,p)=>{var m=Hn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Ue(m[0])&&Ue(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function rhe(e){return e==null?void 0:String(e)}function XP(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=g$(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=Hn(i,ir(o)?t.dataKey:o),f=t.scale.map(d);return Ue(f)?f:null}var ihe=e=>{var t=e.flat(2).filter(Ue);return[Math.min(...t),Math.max(...t)]},ahe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],she=(e,t,n)=>{if(e!=null)return ahe(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=f6(f,t,n),m=ihe(p);return!Ct(m[0])||!Ct(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]))},JP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Jg=(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=wv(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 tR(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return au(au({},t),{},{dataKey:n,payload:r,value:i,name:a})}function h6(e,t){if(e)return String(e);if(typeof t=="string")return t}var ohe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},lhe=(e,t)=>t==="centric"?e.angle:e.radius,ms=e=>e.layout.width,gs=e=>e.layout.height,che=e=>e.layout.scale,p6=e=>e.layout.margin,zv=oe(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Tv=oe(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),uhe="data-recharts-item-index",dhe="data-recharts-item-id",kh=60;function nR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nR(Object(n),!0).forEach(function(r){fhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fhe(e,t,n){return(t=hhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hhe(e){var t=phe(e,"string");return typeof t=="symbol"?t:t+""}function phe(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 mhe=e=>e.brush.height;function ghe(e){var t=Tv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:kh;return n+i}return n},0)}function yhe(e){var t=Tv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:kh;return n+i}return n},0)}function vhe(e){var t=zv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function xhe(e){var t=zv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var ar=oe([ms,gs,p6,mhe,ghe,yhe,vhe,xhe,D$,Kde],(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=Pm(Pm({},m),p),v=y.bottom;y.bottom+=r,y=Xfe(y,d,f);var S=e-y.left-y.right,w=t-y.top-y.bottom;return Pm(Pm({brushBottom:v},y),{},{width:Math.max(S,0),height:Math.max(w,0)})}),bhe=oe(ar,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),m6=oe(ms,gs,(e,t)=>({x:0,y:0,width:e,height:t})),whe=b.createContext(null),ii=()=>b.useContext(whe)!=null,Pv=e=>e.brush,Rv=oe([Pv,ar,p6],(e,t,n)=>({height:e.height,x:Ue(e.x)?e.x:t.left,y:Ue(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Ue(e.width)?e.width:t.width})),aS={},sS={},oS={},rR;function She(){return rR||(rR=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(),w()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},S=()=>{y!==null&&(clearTimeout(y),y=null)},w=()=>{S(),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=w,k.flush=j,i?.addEventListener("abort",w,{once:!0}),k}e.debounce=t})(oS)),oS}var iR;function jhe(){return iR||(iR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=She();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(...w){p=r.apply(this,w),m=null},i,{edges:f}),v=function(...w){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,w),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,w),p)},S=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=S,v}e.debounce=n})(sS)),sS}var aR;function Nhe(){return aR||(aR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jhe();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})(aS)),aS}var lS,sR;function khe(){return sR||(sR=1,lS=Nhe().throttle),lS}var Che=khe();const _he=za(Che);var oR=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++]))}},xa={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},g6=(e,t,n)=>{var{width:r=xa.width,height:i=xa.height,aspect:a,maxHeight:o}=n,u=Il(r)?e:Number(r),d=Il(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}},Ahe={width:0,height:0,overflow:"visible"},Ehe={width:0,overflowX:"visible"},Ohe={height:0,overflowY:"visible"},zhe={},The=e=>{var{width:t,height:n}=e,r=Il(t),i=Il(n);return r&&i?Ahe:r?Ehe:i?Ohe:zhe};function Phe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=xa.width,a=xa.height):i===void 0?i=r&&r>0?void 0:xa.width:a===void 0&&(a=r&&r>0?void 0:xa.height),{width:i,height:a}}function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(null,arguments)}function lR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lR(Object(n),!0).forEach(function(r){Rhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rhe(e,t,n){return(t=Dhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dhe(e){var t=Mhe(e,"string");return typeof t=="symbol"?t:t+""}function Mhe(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 y6=b.createContext(xa.initialDimension);function Ihe(e){return jo(e.width)&&jo(e.height)}function v6(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return Ihe(i)?b.createElement(y6.Provider,{value:i},t):null}var bk=()=>b.useContext(y6),Lhe=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=xa.initialDimension,width:i,height:a,minWidth:o=xa.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=xa.debounce,id:m,className:y,onResize:v,style:S={}}=e,w=b.useRef(null),j=b.useRef();j.current=v,b.useImperativeHandle(t,()=>w.current);var[k,O]=b.useState({containerWidth:r.width,containerHeight:r.height}),_=b.useCallback((R,B)=>{O(F=>{var q=Math.round(R),$=Math.round(B);return F.containerWidth===q&&F.containerHeight===$?F:{containerWidth:q,containerHeight:$}})},[]);b.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Vu;var R=$=>{var V,te=$[0];if(te!=null){var{width:W,height:H}=te.contentRect;_(W,H),(V=j.current)===null||V===void 0||V.call(j,W,H)}};p>0&&(R=_he(R,p,{trailing:!0,leading:!1}));var B=new ResizeObserver(R),{width:F,height:q}=w.current.getBoundingClientRect();return _(F,q),B.observe(w.current),()=>{B.disconnect()}},[_,p]);var{containerWidth:A,containerHeight:T}=k;oR(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:C,calculatedHeight:z}=g6(A,T,{width:i,height:a,aspect:n,maxHeight:d});return oR(C!=null&&C>0||z!=null&&z>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.`,C,z,i,a,o,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:Rt("recharts-responsive-container",y),style:cR(cR({},S),{},{width:i,height:a,minWidth:o,minHeight:u,maxHeight:d}),ref:w},b.createElement("div",{style:The({width:i,height:a})},b.createElement(v6,{width:C,height:z},f)))}),W1=b.forwardRef((e,t)=>{var n=bk();if(jo(n.width)&&jo(n.height))return e.children;var{width:r,height:i}=Phe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=g6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ue(a)&&Ue(o)?b.createElement(v6,{width:a,height:o},e.children):b.createElement(Lhe,Y1({},e,{width:r,height:i,ref:t}))});function wk(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 Dv=()=>{var e,t=ii(),n=Qe(bhe),r=Qe(Rv),i=(e=Qe(Pv))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},$he={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Bhe=()=>{var e;return(e=Qe(ar))!==null&&e!==void 0?e:$he},x6=()=>Qe(ms),b6=()=>Qe(gs),Uhe=()=>Qe(e=>e.layout.margin),on=e=>e.layout.layoutType,Qu=()=>Qe(on),Sk=()=>{var e=Qu();if(e==="horizontal"||e==="vertical")return e},w6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},qhe=()=>{var e=Qu();return e!==void 0},Ch=e=>{var t=vn(),n=ii(),{width:r,height:i}=e,a=bk(),o=r,u=i;return a&&(o=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&jo(o)&&jo(u)&&t(Gfe({width:o,height:u}))},[t,n,o,u]),null},S6=Symbol.for("immer-nothing"),uR=Symbol.for("immer-draftable"),ti=Symbol.for("immer-state");function Vi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var eh=Object.getPrototypeOf;function Eu(e){return!!e&&!!e[ti]}function $l(e){return e?j6(e)||Array.isArray(e)||!!e[uR]||!!e.constructor?.[uR]||_h(e)||Iv(e):!1}var Fhe=Object.prototype.constructor.toString(),dR=new WeakMap;function j6(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=dR.get(n);return r===void 0&&(r=Function.toString.call(n),dR.set(n,r)),r===Fhe}function ey(e,t,n=!0){Mv(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 Mv(e){const t=e[ti];return t?t.type_:Array.isArray(e)?1:_h(e)?2:Iv(e)?3:0}function X1(e,t){return Mv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function N6(e,t,n){const r=Mv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Hhe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function _h(e){return e instanceof Map}function Iv(e){return e instanceof Set}function ll(e){return e.copy_||e.base_}function J1(e,t){if(_h(e))return new Map(e);if(Iv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=j6(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[ti];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(eh(e),r)}else{const r=eh(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function jk(e,t=!1){return Lv(e)||Eu(e)||!$l(e)||(Mv(e)>1&&Object.defineProperties(e,{set:Rm,add:Rm,clear:Rm,delete:Rm}),Object.freeze(e),t&&Object.values(e).forEach(n=>jk(n,!0))),e}function Khe(){Vi(2)}var Rm={value:Khe};function Lv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ghe={};function Bl(e){const t=Ghe[e];return t||Vi(0,e),t}var th;function k6(){return th}function Vhe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fR(e,t){t&&(Bl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ej(e){tj(e),e.drafts_.forEach(Qhe),e.drafts_=null}function tj(e){e===th&&(th=e.parent_)}function hR(e){return th=Vhe(th,e)}function Qhe(e){const t=e[ti];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ti].modified_&&(ej(t),Vi(4)),$l(e)&&(e=ty(t,e),t.parent_||ny(t,e)),t.patches_&&Bl("Patches").generateReplacementPatches_(n[ti].base_,e,t.patches_,t.inversePatches_)):e=ty(t,n,[]),ej(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==S6?e:void 0}function ty(e,t,n){if(Lv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[ti];if(!i)return ey(t,(a,o)=>mR(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return ny(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),ey(o,(d,f)=>mR(e,i,a,d,f,n,u),r),ny(e,a,!1),n&&e.patches_&&Bl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function mR(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=Lv(i);if(!(u&&!o)){if(Eu(i)){const d=a&&t&&t.type_!==3&&!X1(t.assigned_,r)?a.concat(r):void 0,f=ty(e,i,d);if(N6(n,r,f),Eu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if($l(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;ty(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(_h(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&ny(e,i)}}}function ny(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jk(t,n)}function Zhe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:k6(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Nk;n&&(i=[r],a=nh);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,u}var Nk={get(e,t){if(t===ti)return e;const n=ll(e);if(!X1(n,t))return Yhe(e,n,t);const r=n[t];return e.finalized_||!$l(r)?r:r===cS(e.base_,t)?(uS(e),e.copy_[t]=rj(r,e)):r},has(e,t){return t in ll(e)},ownKeys(e){return Reflect.ownKeys(ll(e))},set(e,t,n){const r=C6(ll(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cS(ll(e),t),a=i?.[ti];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Hhe(n,i)&&(n!==void 0||X1(e.base_,t)))return!0;uS(e),nj(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 cS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,uS(e),nj(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ll(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Vi(11)},getPrototypeOf(e){return eh(e.base_)},setPrototypeOf(){Vi(12)}},nh={};ey(Nk,(e,t)=>{nh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nh.deleteProperty=function(e,t){return nh.set.call(this,e,t,void 0)};nh.set=function(e,t,n){return Nk.set.call(this,e[0],t,n,e[0])};function cS(e,t){const n=e[ti];return(n?ll(n):e)[t]}function Yhe(e,t,n){const r=C6(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function C6(e,t){if(!(t in e))return;let n=eh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=eh(n)}}function nj(e){e.modified_||(e.modified_=!0,e.parent_&&nj(e.parent_))}function uS(e){e.copy_||(e.copy_=J1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Whe=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"&&Vi(6),r!==void 0&&typeof r!="function"&&Vi(7);let i;if($l(t)){const a=hR(this),o=rj(t,void 0);let u=!0;try{i=n(o),u=!1}finally{u?ej(a):tj(a)}return fR(a,r),pR(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===S6&&(i=void 0),this.autoFreeze_&&jk(i,!0),r){const a=[],o=[];Bl("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Vi(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){$l(e)||Vi(8),Eu(e)&&(e=Xhe(e));const t=hR(this),n=rj(e,void 0);return n[ti].isManual_=!0,tj(t),n}finishDraft(e,t){const n=e&&e[ti];(!n||!n.isManual_)&&Vi(9);const{scope_:r}=n;return fR(r,t),pR(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=Bl("Patches").applyPatches_;return Eu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function rj(e,t){const n=_h(e)?Bl("MapSet").proxyMap_(e,t):Iv(e)?Bl("MapSet").proxySet_(e,t):Zhe(e,t);return(t?t.scope_:k6()).drafts_.push(n),n}function Xhe(e){return Eu(e)||Vi(10,e),_6(e)}function _6(e){if(!$l(e)||Lv(e))return e;const t=e[ti];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=J1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=J1(e,!0);return ey(n,(i,a)=>{N6(n,i,_6(a))},r),t&&(t.finalized_=!1),n}var Jhe=new Whe;Jhe.produce;var epe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},A6=hr({name:"legend",initialState:epe,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:Jt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Jt()},removeLegendPayload:{reducer(e,t){var n=ki(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Jt()}}}),{setLegendSize:gR,setLegendSettings:tpe,addLegendPayload:npe,replaceLegendPayload:rpe,removeLegendPayload:ipe}=A6.actions,ape=A6.reducer,dS={exports:{}},fS={};var yR;function spe(){if(yR)return fS;yR=1;var e=Iu();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 fS.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var S={hasValue:!1,value:null};v.current=S}else S=v.current;v=o(function(){function j(T){if(!k){if(k=!0,O=T,T=m(T),y!==void 0&&S.hasValue){var C=S.value;if(y(C,T))return _=C}return _=T}if(C=_,n(O,T))return C;var z=m(T);return y!==void 0&&y(C,z)?(O=T,C):(O=T,_=z)}var k=!1,O,_,A=p===void 0?null:p;return[function(){return j(f())},A===null?void 0:function(){return j(A())}]},[f,p,m,y]);var w=r(d,v[0],v[1]);return a(function(){S.hasValue=!0,S.value=w},[w]),u(w),w},fS}var vR;function ope(){return vR||(vR=1,dS.exports=spe()),dS.exports}ope();function lpe(e){e()}function cpe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){lpe(()=>{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 xR={notify(){},get:()=>[]};function upe(e,t){let n,r=xR,i=0,a=!1;function o(w){p();const j=r.subscribe(w);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){S.onStateChange&&S.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=cpe())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=xR)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const S={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return S}var dpe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fpe=dpe(),hpe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ppe=hpe(),mpe=()=>fpe||ppe?b.useLayoutEffect:b.useEffect,gpe=mpe();function bR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ype(e,t){if(bR(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])||!bR(e[n[i]],t[n[i]]))return!1;return!0}var vpe=Symbol.for("react-redux-context"),xpe=typeof globalThis<"u"?globalThis:{};function bpe(){if(!b.createContext)return{};const e=xpe[vpe]??=new Map;let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var wpe=bpe();function Spe(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=upe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=b.useMemo(()=>i.getState(),[i]);gpe(()=>{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||wpe;return b.createElement(u.Provider,{value:a},t)}var jpe=Spe,Npe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function kpe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ah(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Npe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!ype(e[r],t[r]))return!1}else if(!kpe(e[r],t[r]))return!1;return!0}var Cpe=["contextPayload"];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 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 Ou(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){_pe(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 _pe(e,t,n){return(t=Ape(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ape(e){var t=Epe(e,"string");return typeof t=="symbol"?t:t+""}function Epe(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 Ope(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}function Tpe(e){return e.value}function Ppe(e){var{contextPayload:t}=e,n=Ope(e,Cpe),r=z$(t,e.payloadUniqBy,Tpe),i=Ou(Ou({},n),{},{payload:r});return b.isValidElement(e.content)?b.cloneElement(e.content,i):typeof e.content=="function"?b.createElement(e.content,i):b.createElement(ide,i)}function Rpe(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}),Ou(Ou({},f),p)}function Dpe(e){var t=vn();return b.useEffect(()=>{t(tpe(e))},[t,e]),null}function Mpe(e){var t=vn();return b.useEffect(()=>(t(gR(e)),()=>{t(gR({width:0,height:0}))}),[t,e]),null}function Ipe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Lpe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function $pe(e){var t=ri(e,Lpe),n=Qde(),r=Yce(),i=Uhe(),{width:a,height:o,wrapperStyle:u,portal:d}=t,[f,p]=M$([n]),m=x6(),y=b6();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),S=Ipe(t.layout,o,a,v),w=d?u:Ou(Ou({position:"absolute",width:S?.width||a||"auto",height:S?.height||o||"auto"},Rpe(u,t,i,m,y,f)),u),j=d??r;if(j==null||n==null)return null;var k=b.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},b.createElement(Dpe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&b.createElement(Mpe,{width:f.width,height:f.height}),b.createElement(Ppe,ij({},t,S,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return Kl.createPortal(k,j)}var E6=b.memo($pe,Ah);E6.displayName="Legend";function aj(){return aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aj.apply(null,arguments)}function 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 uf(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){Bpe(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 Bpe(e,t,n){return(t=Upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Upe(e){var t=qpe(e,"string");return typeof t=="symbol"?t:t+""}function qpe(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 Fpe(e){return Array.isArray(e)&&Aa(e[0])&&Aa(e[1])?e.join(" ~ "):e}var Fc={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 Hpe(e,t){return t==null?e:wv(e,t)}var Kpe=e=>{var{separator:t=Fc.separator,contentStyle:n,itemStyle:r,labelStyle:i=Fc.labelStyle,payload:a,formatter:o,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Fc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var T={padding:0,margin:0},C=Hpe(a,u),z=C.map((R,B)=>{if(!R||R.type==="none")return null;var F=R.formatter||o||Fpe,{value:q,name:$}=R,V=q,te=$;if(F){var W=F(q,$,R,B,a);if(Array.isArray(W))[V,te]=W;else if(W!=null)V=W;else return null}var H=uf(uf({},Fc.itemStyle),{},{color:R.color||Fc.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:H},Aa(te)?b.createElement("span",{className:"recharts-tooltip-item-name"},te):null,Aa(te)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},V),b.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:T},z)}return null},S=uf(uf({},Fc.contentStyle),n),w=uf({margin:0},i),j=!ir(p),k=j?p:"",O=Rt("recharts-default-tooltip",d),_=Rt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var A=y?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",aj({className:O,style:S},A),b.createElement("p",{className:_,style:w},b.isValidElement(k)?k:"".concat(k)),v())},df="recharts-tooltip-wrapper",Gpe={visibility:"hidden"};function Vpe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Rt(df,{["".concat(df,"-right")]:Ue(n)&&t&&Ue(t.x)&&n>=t.x,["".concat(df,"-left")]:Ue(n)&&t&&Ue(t.x)&&n<t.x,["".concat(df,"-bottom")]:Ue(r)&&t&&Ue(t.y)&&r>=t.y,["".concat(df,"-top")]:Ue(r)&&t&&Ue(t.y)&&r<t.y})}function jR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Ue(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,S=y;return v<S?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var w=m+u,j=y+f;return w>j?Math.max(p,y):Math.max(m,y)}function Qpe(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 Zpe(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=jR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),y=jR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Qpe({translateX:m,translateY:y,useTranslate3d:d})):p=Gpe,{cssProperties:p,cssClasses:Vpe({translateX:m,translateY:y,coordinate:n})}}var Ype=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Eh={isSsr:Ype()};function O6(){var[e,t]=b.useState(()=>Eh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return b.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function NR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){Wpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wpe(e,t,n){return(t=Xpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xpe(e){var t=Jpe(e,"string");return typeof t=="symbol"?t:t+""}function Jpe(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 eme(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function tme(e){var t,n,r,i,a,o,u=O6(),[d,f]=b.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));b.useEffect(()=>{var S=w=>{if(w.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",S),()=>{document.removeEventListener("keydown",S)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Hc(Hc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Zpe({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:Hc(Hc({transition:eme({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Hc(Hc({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var nme=b.memo(tme),z6=()=>{var e;return(e=Qe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function sj(){return sj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sj.apply(null,arguments)}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){rme(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 rme(e,t,n){return(t=ime(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ime(e){var t=ame(e,"string");return typeof t=="symbol"?t:t+""}function ame(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 _R={curveBasisClosed:mue,curveBasisOpen:gue,curveBasis:pue,curveBumpX:eue,curveBumpY:tue,curveLinearClosed:yue,curveLinear:vv,curveMonotoneX:vue,curveMonotoneY:xue,curveNatural:bue,curveStep:wue,curveStepAfter:jue,curveStepBefore:Sue},ry=e=>Ct(e.x)&&Ct(e.y),AR=e=>e.base!=null&&ry(e.base)&&ry(e),ff=e=>e.x,hf=e=>e.y,sme=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Sh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=_R["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return _R[n]||vv},ER={connectNulls:!1,type:"linear"},ome=e=>{var{type:t=ER.type,points:n=[],baseLine:r,layout:i,connectNulls:a=ER.connectNulls}=e,o=sme(t,i),u=a?n.filter(ry):n;if(Array.isArray(r)){var d,f=n.map((S,w)=>CR(CR({},S),{},{base:r[w]}));i==="vertical"?d=_m().y(hf).x1(ff).x0(S=>S.base.x):d=_m().x(ff).y1(hf).y0(S=>S.base.y);var p=d.defined(AR).curve(o),m=a?f.filter(AR):f;return p(m)}var y;i==="vertical"&&Ue(r)?y=_m().y(hf).x1(ff).x0(r):Ue(r)?y=_m().x(ff).y1(hf).y0(r):y=r$().x(ff).y(hf);var v=y.defined(ry).curve(o);return v(u)},og=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Qu();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?ome(o):r;return b.createElement("path",sj({},ka(e),dk(e),{className:Rt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},lme=["x","y","top","left","width","height","className"];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 OR(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 cme(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){ume(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ume(e,t,n){return(t=dme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dme(e){var t=fme(e,"string");return typeof t=="symbol"?t:t+""}function fme(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 hme(e,t){if(e==null)return{};var n,r,i=pme(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 pme(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 mme=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),gme=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:u}=e,d=hme(e,lme),f=cme({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Ue(t)||!Ue(n)||!Ue(a)||!Ue(o)||!Ue(r)||!Ue(i)?null:b.createElement("path",oj({},Jr(f),{className:Rt("recharts-cross",u),d:mme(t,n,a,o,r,i)}))};function yme(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 zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zR(Object(n),!0).forEach(function(r){vme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vme(e,t,n){return(t=xme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xme(e){var t=bme(e,"string");return typeof t=="symbol"?t:t+""}function bme(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 wme=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Sme=(e,t,n)=>e.map(r=>"".concat(wme(r)," ").concat(t,"ms ").concat(n)).join(","),jme=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),rh=(e,t)=>Object.keys(t).reduce((n,r)=>TR(TR({},n),{},{[r]:e(r,t[r])}),{});function PR(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 $n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PR(Object(n),!0).forEach(function(r){Nme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PR(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)}var iy=(e,t,n)=>e+(t-e)*n,lj=e=>{var{from:t,to:n}=e;return t!==n},T6=(e,t,n)=>{var r=rh((i,a)=>{if(lj(a)){var[o,u]=e(a.from,a.to,a.velocity);return $n($n({},a),{},{from:o,velocity:u})}return a},t);return n<1?rh((i,a)=>lj(a)&&r[i]!=null?$n($n({},a),{},{velocity:iy(a.velocity,r[i].velocity,n),from:iy(a.from,r[i].from,n)}):a,t):T6(e,r,n-1)};function _me(e,t,n,r,i,a){var o,u=r.reduce((y,v)=>$n($n({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>rh((y,v)=>v.from,u),f=()=>!Object.values(u).filter(lj).length,p=null,m=y=>{o||(o=y);var v=y-o,S=v/n.dt;u=T6(n,u,S),i($n($n($n({},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 Ame(e,t,n,r,i,a,o){var u=null,d=i.reduce((m,y)=>{var v=e[y],S=t[y];return v==null||S==null?m:$n($n({},m),{},{[y]:[v,S]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=rh((w,j)=>iy(...j,n(y)),d);if(a($n($n($n({},e),t),v)),y<1)u=o.setTimeout(p);else{var S=rh((w,j)=>iy(...j,n(1)),d);a($n($n($n({},e),t),S))}};return()=>(u=o.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const Eme=(e,t,n,r,i,a)=>{var o=jme(e,t);return n==null?()=>(i($n($n({},e),t)),()=>{}):n.isStepper===!0?_me(e,t,n,o,i,a):Ame(e,t,n,r,o,i,a)};var ay=1e-4,P6=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],R6=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),RR=(e,t)=>n=>{var r=P6(e,t);return R6(r,n)},Ome=(e,t)=>n=>{var r=P6(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return R6(i,n)},zme=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]]},Tme=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=zme(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Pme=(e,t,n,r)=>{var i=RR(e,n),a=RR(t,r),o=Ome(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,S=o(m);if(Math.abs(v-p)<ay||S<ay)return a(m);m=u(m-v/S)}return a(m)};return d.isStepper=!1,d},DR=function(){return Pme(...Tme(...arguments))},Rme=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)<ay&&Math.abs(m)<ay?[u,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Dme=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return DR(e);case"spring":return Rme();default:if(e.split("(")[0]==="cubic-bezier")return DR(e)}return typeof e=="function"?e:null};function Mme(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 Ime{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 Lme(){return Mme(new Ime)}var $me=b.createContext(Lme);function Bme(e,t){var n=b.useContext($me);return b.useMemo(()=>t??n(e),[e,t,n])}var Ume={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},MR={t:0},hS={t:1};function D6(e){var t=ri(e,Ume),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=O6(),m=n==="auto"?!Eh.isSsr&&!p:n,y=Bme(t.animationId,t.animationManager),[v,S]=b.useState(m?MR:hS),w=b.useRef(null);return b.useEffect(()=>{m||S(hS)},[m]),b.useEffect(()=>{if(!m||!r)return Vu;var j=Eme(MR,hS,Dme(a),i,S,y.getTimeoutController()),k=()=>{w.current=j()};return y.start([d,o,k,i,u]),()=>{y.stop(),w.current&&w.current(),u()}},[m,r,i,a,o,d,u,y]),f(v.t)}function M6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(Yf(t)),r=b.useRef(e);return r.current!==e&&(n.current=Yf(t),r.current=e),n.current}var qme=["radius"],Fme=["radius"],IR,LR,$R,BR,UR,qR,FR,HR,KR,GR;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 QR(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){Hme(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 Hme(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=Gme(e,"string");return typeof t=="symbol"?t:t+""}function Gme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sy(){return sy=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},sy.apply(null,arguments)}function ZR(e,t){if(e==null)return{};var n,r,i=Vme(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 Vme(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 ca(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var YR=(e,t,n,r,i)=>{var a=co(n),o=co(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,S=4;v<S;v++){var w,j=(w=i[v])!==null&&w!==void 0?w:0;y[v]=j>u?u:j}m=Jn(IR||(IR=ca(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Jn(LR||(LR=ca(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Jn($R||($R=ca(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Jn(BR||(BR=ca(["A ",",",",0,0,",`,
261
+ `,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Jn(UR||(UR=ca(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Jn(qR||(qR=ca(["A ",",",",0,0,",`,
262
+ `,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Jn(FR||(FR=ca(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Jn(HR||(HR=ca(["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=Jn(KR||(KR=ca(["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=Jn(GR||(GR=ca(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},WR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qme=e=>{var t=ri(e,WR),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ee=n.current.getTotalLength();ee&&i(ee)}catch{}},[]);var{x:a,y:o,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:S,isUpdateAnimationActive:w}=t,j=b.useRef(u),k=b.useRef(d),O=b.useRef(a),_=b.useRef(o),A=b.useMemo(()=>({x:a,y:o,width:u,height:d,radius:f}),[a,o,u,d,f]),T=M6(A,"rectangle-");if(a!==+a||o!==+o||u!==+u||d!==+d||u===0||d===0)return null;var C=Rt("recharts-rectangle",p);if(!w){var z=Jr(t),{radius:R}=z,B=ZR(z,qme);return b.createElement("path",sy({},B,{x:co(a),y:co(o),width:co(u),height:co(d),radius:typeof f=="number"?f:void 0,className:C,d:YR(a,o,u,d,f)}))}var F=j.current,q=k.current,$=O.current,V=_.current,te="0px ".concat(r===-1?1:r,"px"),W="".concat(r,"px ").concat(r,"px"),H=Sme(["strokeDasharray"],y,typeof m=="string"?m:WR.animationEasing);return b.createElement(D6,{animationId:T,key:T,canBegin:r>0,duration:y,easing:m,isActive:w,begin:v},ee=>{var le=ma(F,u,ee),je=ma(q,d,ee),L=ma($,a,ee),I=ma(V,o,ee);n.current&&(j.current=le,k.current=je,O.current=L,_.current=I);var U;S?ee>0?U={transition:H,strokeDasharray:W}:U={strokeDasharray:te}:U={strokeDasharray:W};var D=Jr(t),{radius:G}=D,ae=ZR(D,Fme);return b.createElement("path",sy({},ae,{radius:typeof f=="number"?f:void 0,className:C,d:YR(L,I,le,je,f),ref:n,style:QR(QR({},U),t.style)}))})};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 JR(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){Zme(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 Zme(e,t,n){return(t=Yme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yme(e){var t=Wme(e,"string");return typeof t=="symbol"?t:t+""}function Wme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oy=Math.PI/180,Xme=e=>e*180/Math.PI,rr=(e,t,n,r)=>({x:e+Math.cos(-oy*r)*n,y:t+Math.sin(-oy*r)*n}),Jme=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},ege=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},tge=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=ege({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:Xme(d),angleInRadian:d}},nge=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}},rge=(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},ige=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=tge({x:n,y:r},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:d,endAngle:f}=nge(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?JR(JR({},t),{},{radius:i,angle:rge(p,t)}):null};function I6(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 eD,tD,nD,rD,iD,aD,sD;function cj(){return cj=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},cj.apply(null,arguments)}function gl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var age=(e,t)=>{var n=Zi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Dm=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)/oy,m=d?i:i+a*p,y=rr(t,n,f,m),v=rr(t,n,r,m),S=d?i-a*p:i,w=rr(t,n,f*Math.cos(p*oy),S);return{center:y,circleTangency:v,lineTangency:w,theta:p}},L6=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,u=age(a,o),d=a+u,f=rr(t,n,i,a),p=rr(t,n,i,d),m=Jn(eD||(eD=gl(["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+=Jn(tD||(tD=gl(["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+=Jn(nD||(nD=gl(["L ",","," Z"])),t,n);return m},sge=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Zi(f-d),{circleTangency:m,lineTangency:y,theta:v}=Dm({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:S,lineTangency:w,theta:j}=Dm({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?Jn(rD||(rD=gl(["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):L6({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=Jn(iD||(iD=gl(["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),S.x,S.y,a,a,+(p<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:A,theta:T}=Dm({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:C,lineTangency:z,theta:R}=Dm({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),B=u?Math.abs(d-f):Math.abs(d-f)-T-R;if(B<0&&a===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=Jn(aD||(aD=gl(["L",",",`
285
+ A`,",",",0,0,",",",",",`
286
+ A`,",",",0,",",",",",",",`
287
+ A`,",",",0,0,",",",",","Z"])),z.x,z.y,a,a,+(p<0),C.x,C.y,r,r,+(B>180),+(p>0),_.x,_.y,a,a,+(p<0),A.x,A.y)}else O+=Jn(sD||(sD=gl(["L",",","Z"])),t,n);return O},oge={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lge=e=>{var t=ri(e,oge),{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=Rt("recharts-sector",m),v=a-i,S=So(o,v,0,!0),w;return S>0&&Math.abs(f-p)<360?w=sge({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(S,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):w=L6({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),b.createElement("path",cj({},Jr(t),{className:y,d:w}))};function cge(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(x$(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 I6(t)}}var pS={},mS={},gS={},oD;function uge(){return oD||(oD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P$();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(gS)),gS}var lD;function dge(){return lD||(lD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uge();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})(mS)),mS}var cD;function fge(){return cD||(cD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R$(),n=dge();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})(pS)),pS}var yS,uD;function hge(){return uD||(uD=1,yS=fge().range),yS}var pge=hge();const $6=za(pge);var ta=e=>e.chartData,kk=oe([ta],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),$v=(e,t,n,r)=>r?kk(e):ta(e),mge=(e,t,n)=>n?kk(e):ta(e),gge=oe([$v],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});oe([kk],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var yge=oe([ta],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function wa(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ct(t)&&Ct(n))return!0}return!1}function dD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function B6(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Ct(n))i=n;else if(typeof n=="function")return;if(Ct(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(wa(o))return o}}function vge(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(wa(r))return dD(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(Ue(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&JP.test(i)){var d=JP.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(Ue(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&eR.test(a)){var p=eR.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(wa(y))return t==null?y:dD(y,t,n)}}}var Zu=1e9,xge={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_k,an=!0,zi="[DecimalError] ",Nl=zi+"Invalid argument: ",Ck=zi+"Exponent out of range: ",Yu=Math.floor,cl=Math.pow,bge=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Zr,Fn=1e7,en=7,U6=9007199254740991,ly=Yu(U6/en),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)*en;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 ls(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return Ft(ls(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Pn(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(Zr))throw Error(zi+"NaN");if(n.s<1)throw Error(zi+(n.s?"NaN":"-Infinity"));return n.eq(Zr)?new r(0):(an=!1,t=ls(ih(n,a),ih(e,a),a),an=!0,Ft(t,i))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?H6(t,e):q6(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(zi+"NaN");return n.s?(an=!1,t=ls(n,e,0,1).times(e),an=!0,n.minus(t)):Ft(new r(n),i)};Pe.naturalExponential=Pe.exp=function(){return F6(this)};Pe.naturalLogarithm=Pe.ln=function(){return ih(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?q6(t,e):H6(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Nl+e);if(t=Pn(i)+1,r=i.d.length-1,n=r*en+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(zi+"NaN")}for(e=Pn(u),an=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=ba(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Yu((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(ls(u,a,o+2)).times(.5),ba(a.d).slice(0,o)===(t=ba(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ft(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;o+=4}return an=!0,Ft(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%Fn|0,t=u/Fn|0;a[i]=(a[i]+t)%Fn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,an?Ft(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,Zu),t===void 0?t=r.rounding:Ea(t,0,8),Ft(n,e+Pn(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ul(r,!0):(Ea(e,0,Zu),t===void 0?t=i.rounding:Ea(t,0,8),r=Ft(new i(r),e+1,t),n=Ul(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Ul(i):(Ea(e,0,Zu),t===void 0?t=a.rounding:Ea(t,0,8),r=Ft(new a(i),e+Pn(i)+1,t),n=Ul(r.abs(),!1,e+Pn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return Ft(new t(e),Pn(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(Zr);if(u=new d(u),!u.s){if(e.s<1)throw Error(zi+"Infinity");return u}if(u.eq(Zr))return u;if(r=d.precision,e.eq(Zr))return Ft(u,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=u.s,o){if((n=p<0?-p:p)<=U6){for(i=new d(Zr),t=Math.ceil(r/en+4),an=!1;n%2&&(i=i.times(u),hD(i.d,t)),n=Yu(n/2),n!==0;)u=u.times(u),hD(u.d,t);return an=!0,e.s<0?new d(Zr).div(i):Ft(i,r)}}else if(a<0)throw Error(zi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,an=!1,i=e.times(ih(u,r+f)),an=!0,i=F6(i),i.s=a,i};Pe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Pn(i),r=Ul(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ea(e,1,Zu),t===void 0?t=a.rounding:Ea(t,0,8),i=Ft(new a(i),e,t),n=Pn(i),r=Ul(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,Zu),t===void 0?t=r.rounding:Ea(t,0,8)),Ft(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=Pn(e),n=e.constructor;return Ul(e,t<=n.toExpNeg||t>=n.toExpPos)};function q6(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)),an?Ft(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/en),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)/Fn|0,d[a]%=Fn;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,an?Ft(t,m):t}function Ea(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Nl+e)}function ba(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=en-r.length,n&&(a+=no(n)),a+=r;o=e[t],r=o+"",n=en-r.length,n&&(a+=no(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ls=(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%Fn|0,o=a/Fn|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*Fn+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,S,w,j,k,O,_,A,T,C,z,R,B=r.constructor,F=r.s==i.s?1:-1,q=r.d,$=i.d;if(!r.s)return new B(r);if(!i.s)throw Error(zi+"Division by zero");for(d=r.e-i.e,z=$.length,T=q.length,v=new B(F),S=v.d=[],f=0;$[f]==(q[f]||0);)++f;if($[f]>(q[f]||0)&&--d,a==null?O=a=B.precision:o?O=a+(Pn(r)-Pn(i))+1:O=a,O<0)return new B(0);if(O=O/en+2|0,f=0,z==1)for(p=0,$=$[0],O++;(f<T||p)&&O--;f++)_=p*Fn+(q[f]||0),S[f]=_/$|0,p=_%$|0;else{for(p=Fn/($[0]+1)|0,p>1&&($=e($,p),q=e(q,p),z=$.length,T=q.length),A=z,w=q.slice(0,z),j=w.length;j<z;)w[j++]=0;R=$.slice(),R.unshift(0),C=$[0],$[1]>=Fn/2&&++C;do p=0,u=t($,w,z,j),u<0?(k=w[0],z!=j&&(k=k*Fn+(w[1]||0)),p=k/C|0,p>1?(p>=Fn&&(p=Fn-1),m=e($,p),y=m.length,j=w.length,u=t(m,w,y,j),u==1&&(p--,n(m,z<y?R:$,y))):(p==0&&(u=p=1),m=$.slice()),y=m.length,y<j&&m.unshift(0),n(w,m,j),u==-1&&(j=w.length,u=t($,w,z,j),u<1&&(p++,n(w,z<j?R:$,j))),j=w.length):u===0&&(p++,w=[0]),S[f++]=p,u&&w[0]?w[j++]=q[A]||0:(w=[q[A]],j=1);while((A++<T||w[0]!==void 0)&&O--)}return S[0]||S.shift(),v.e=d,Ft(v,o?a+Pn(v)+1:a)}})();function F6(e,t){var n,r,i,a,o,u,d=0,f=0,p=e.constructor,m=p.precision;if(Pn(e)>16)throw Error(Ck+Pn(e));if(!e.s)return new p(Zr);for(an=!1,u=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(cl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(Zr),p.precision=u;;){if(i=Ft(i.times(e),u),n=n.times(++d),o=a.plus(ls(i,n,u)),ba(o.d).slice(0,u)===ba(a.d).slice(0,u)){for(;f--;)a=Ft(a.times(a),u);return p.precision=m,t==null?(an=!0,Ft(a,m)):a}a=o}}function Pn(e){for(var t=e.e*en,n=e.d[0];n>=10;n/=10)t++;return t}function vS(e,t,n){if(t>e.LN10.sd())throw an=!0,n&&(e.precision=n),Error(zi+"LN10 precision limit exceeded");return Ft(new e(e.LN10),t)}function no(e){for(var t="";e--;)t+="0";return t}function ih(e,t){var n,r,i,a,o,u,d,f,p,m=1,y=10,v=e,S=v.d,w=v.constructor,j=w.precision;if(v.s<1)throw Error(zi+(v.s?"NaN":"-Infinity"));if(v.eq(Zr))return new w(0);if(t==null?(an=!1,f=j):f=t,v.eq(10))return t==null&&(an=!0),vS(w,f);if(f+=y,w.precision=f,n=ba(S),r=n.charAt(0),a=Pn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=ba(v.d),r=n.charAt(0),m++;a=Pn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return d=vS(w,f+2,j).times(a+""),v=ih(new w(r+"."+n.slice(1)),f-y).plus(d),w.precision=j,t==null?(an=!0,Ft(v,j)):v;for(u=o=v=ls(v.minus(Zr),v.plus(Zr),f),p=Ft(v.times(v),f),i=3;;){if(o=Ft(o.times(p),f),d=u.plus(ls(o,new w(i),f)),ba(d.d).slice(0,f)===ba(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(vS(w,f+2,j).times(a+""))),u=ls(u,new w(m),f),w.precision=j,t==null?(an=!0,Ft(u,j)):u;u=d,i+=2}}function fD(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=Yu(n/en),e.d=[],r=(n+1)%en,n<0&&(r+=en),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=en;r<i;)e.d.push(+t.slice(r,r+=en));t=t.slice(r),r=en-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),an&&(e.e>ly||e.e<-ly))throw Error(Ck+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ft(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+=en,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/en),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=en,i=r-en+o}if(n!==void 0&&(a=cl(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/cl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Pn(e),m.length=1,t=t-a-1,m[0]=cl(10,(en-t%en)%en),e.e=Yu(-t/en)||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=cl(10,en-r),m[p]=i>0?(f/cl(10,o-i)%cl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Fn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Fn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(an&&(e.e>ly||e.e<-ly))throw Error(Ck+Pn(e));return e}function H6(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),an?Ft(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/en),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]=Fn-1;--d[a],d[i]+=Fn}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,an?Ft(t,v):t):new y(0)}function Ul(e,t,n){var r,i=Pn(e),a=ba(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+no(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+no(-i-1)+a,n&&(r=n-o)>0&&(a+=no(r))):i>=o?(a+=no(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+no(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=no(r))),e.s<0?"-"+a:a}function hD(e,t){if(e.length>t)return e.length=t,!0}function K6(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Nl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return fD(o,a.toString())}else if(typeof a!="string")throw Error(Nl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,bge.test(a))fD(o,a);else throw Error(Nl+a)}if(i.prototype=Pe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=K6,i.config=i.set=wge,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 wge(e){if(!e||typeof e!="object")throw Error(zi+"Object expected");var t,n,r,i=["precision",1,Zu,"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(Yu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Nl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Nl+n+": "+r);return this}var _k=K6(xge);Zr=new _k(1);const bt=_k;function G6(e){var t;return e===0?t=1:t=Math.floor(new bt(e).abs().log(10).toNumber())+1,t}function V6(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 Q6=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},Ak=(e,t,n)=>{if(e.lte(0))return new bt(0);var r=G6(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()))},Z6=(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()))},Sge=(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(G6(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},Y6=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Ak;if(!Number.isFinite((n-t)/(r-1)))return{step:new 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?Y6(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))})},pD=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]=Q6([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 Sge(d,i,a);var m=o==="snap125"?Z6:Ak,{step:y,tickMin:v,tickMax:S}=Y6(d,f,u,a,0,m),w=V6(v,S.add(new bt(.1).mul(y)),y);return n>r?w.reverse():w},mD=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]=Q6([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=o==="snap125"?Z6:Ak,p=Math.max(n,2),m=f(new bt(d).sub(u).div(p-1),a,0),y=[...V6(new bt(u),new bt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},jge=e=>e.rootProps.barCategoryGap,Bv=e=>e.rootProps.stackOffset,W6=e=>e.rootProps.reverseStackOrder,Ek=e=>e.options.chartName,Ok=e=>e.rootProps.syncId,X6=e=>e.rootProps.syncMethod,zk=e=>e.options.eventEmitter,Nge=e=>e.rootProps.baseValue,Pr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},tl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ua={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Uv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function qv(e,t,n){if(n!=="auto")return n;if(e!=null)return Pa(e,t)?"category":"number"}function gD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gD(Object(n),!0).forEach(function(r){kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kge(e,t,n){return(t=Cge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cge(e){var t=_ge(e,"string");return typeof t=="symbol"?t:t+""}function _ge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yD={allowDataOverflow:tl.allowDataOverflow,allowDecimals:tl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:tl.angleAxisId,includeHidden:!1,name:void 0,reversed:tl.reversed,scale:tl.scale,tick:tl.tick,tickCount:void 0,ticks:void 0,type:tl.type,unit:void 0,niceTicks:"auto"},vD={allowDataOverflow:ua.allowDataOverflow,allowDecimals:ua.allowDecimals,allowDuplicatedCategory:ua.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ua.radiusAxisId,includeHidden:ua.includeHidden,name:void 0,reversed:ua.reversed,scale:ua.scale,tick:ua.tick,tickCount:ua.tickCount,ticks:void 0,type:ua.type,unit:void 0,niceTicks:"auto"},Age=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Tk=oe([Age,w6],(e,t)=>{var n;if(e!=null)return e;var r=(n=qv(t,"angleAxis",yD.type))!==null&&n!==void 0?n:"category";return cy(cy({},yD),{},{type:r})}),Ege=(e,t)=>e.polarAxis.radiusAxis[t],Pk=oe([Ege,w6],(e,t)=>{var n;if(e!=null)return e;var r=(n=qv(t,"radiusAxis",vD.type))!==null&&n!==void 0?n:"category";return cy(cy({},vD),{},{type:r})}),Fv=e=>e.polarOptions,Rk=oe([ms,gs,ar],Jme),J6=oe([Fv,Rk],(e,t)=>{if(e!=null)return So(e.innerRadius,t,0)}),eB=oe([Fv,Rk],(e,t)=>{if(e!=null)return So(e.outerRadius,t,t*.8)}),Oge=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},tB=oe([Fv],Oge);oe([Tk,tB],Uv);var nB=oe([Rk,J6,eB],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});oe([Pk,nB],Uv);var rB=oe([on,Fv,J6,eB,ms,gs],(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:So(o,i,i/2),cy:So(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Kn=(e,t)=>t,Hv=(e,t,n)=>n;function Dk(e){return e?.id}function iB(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=Dk(u);f.forEach((m,y)=>{var v=a==null||i?y:String(Hn(m,a,null)),S=Hn(m,u.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[p]:S}),o.set(v,w)})}}),Array.from(o.values())}function Mk(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Kv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Gv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function zge(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 Gn=e=>{var t=on(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Wu=e=>e.tooltip.settings.axisId;function Ik(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 Tge=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!wa(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ct(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 go(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Pge(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Lk(e){let t,n,r;e.length!==2?(t=go,n=(u,d)=>go(e(u),d),r=(u,d)=>e(u)-d):(t=e===go||e===Pge?e:Rge,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 Rge(){return 0}function aB(e){return e===null?NaN:+e}function*Dge(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Mge=Lk(go),Oh=Mge.right;Lk(aB).center;class xD extends Map{constructor(t,n=$ge){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(bD(this,t))}has(t){return super.has(bD(this,t))}set(t,n){return super.set(Ige(this,t),n)}delete(t){return super.delete(Lge(this,t))}}function bD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ige({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Lge({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function $ge(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Bge(e=go){if(e===go)return sB;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 sB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Uge=Math.sqrt(50),qge=Math.sqrt(10),Fge=Math.sqrt(2);function uy(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>=Uge?10:a>=qge?5:a>=Fge?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?uy(e,t,n*2):[u,d,f]}function uj(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?uy(t,e,n):uy(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 dj(e,t,n){return t=+t,e=+e,n=+n,uy(e,t,n)[2]}function fj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?dj(t,e,n):dj(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function wD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function SD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function oB(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?sB: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)),S=Math.min(r,Math.floor(t+(d-f)*m/d+y));oB(e,t,v,S,i)}const a=e[t];let o=n,u=r;for(pf(e,n,t),i(e[r],a)>0&&pf(e,n,r);o<u;){for(pf(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?pf(e,n,u):(++u,pf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function pf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Hge(e,t,n){if(e=Float64Array.from(Dge(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return SD(e);if(t>=1)return wD(e);var r,i=(r-1)*t,a=Math.floor(i),o=wD(oB(e,a).subarray(0,a+1)),u=SD(e.subarray(a+1));return o+(u-o)*(i-a)}}function Kge(e,t,n=aB){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 Gge(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 Di(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ys(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 hj=Symbol("implicit");function $k(){var e=new xD,t=[],n=[],r=hj;function i(a){let o=e.get(a);if(o===void 0){if(r!==hj)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 xD;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 $k(t,n).unknown(r)},Di.apply(i,arguments),i}function Bk(){var e=$k().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,S=v?i:r,w=v?r:i;a=(w-S)/Math.max(1,y-d+f*2),u&&(a=Math.floor(a)),S+=(w-S-a*(y-d))*p,o=a*(1-d),u&&(S=Math.round(S),o=Math.round(o));var j=Gge(y).map(function(k){return S+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 Bk(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Di.apply(m(),arguments)}function lB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return lB(t())},e}function Vge(){return lB(Bk.apply(null,arguments).paddingInner(1))}function Uk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function cB(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zh(){}var ah=.7,dy=1/ah,vu="\\s*([+-]?\\d+)\\s*",sh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qge=/^#([0-9a-f]{3,8})$/,Zge=new RegExp(`^rgb\\(${vu},${vu},${vu}\\)$`),Yge=new RegExp(`^rgb\\(${Sa},${Sa},${Sa}\\)$`),Wge=new RegExp(`^rgba\\(${vu},${vu},${vu},${sh}\\)$`),Xge=new RegExp(`^rgba\\(${Sa},${Sa},${Sa},${sh}\\)$`),Jge=new RegExp(`^hsl\\(${sh},${Sa},${Sa}\\)$`),eye=new RegExp(`^hsla\\(${sh},${Sa},${Sa},${sh}\\)$`),jD={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};Uk(zh,oh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ND,formatHex:ND,formatHex8:tye,formatHsl:nye,formatRgb:kD,toString:kD});function ND(){return this.rgb().formatHex()}function tye(){return this.rgb().formatHex8()}function nye(){return uB(this).formatHsl()}function kD(){return this.rgb().formatRgb()}function oh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qge.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?CD(t):n===3?new Rr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Mm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Mm(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=Zge.exec(e))?new Rr(t[1],t[2],t[3],1):(t=Yge.exec(e))?new Rr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Wge.exec(e))?Mm(t[1],t[2],t[3],t[4]):(t=Xge.exec(e))?Mm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jge.exec(e))?ED(t[1],t[2]/100,t[3]/100,1):(t=eye.exec(e))?ED(t[1],t[2]/100,t[3]/100,t[4]):jD.hasOwnProperty(e)?CD(jD[e]):e==="transparent"?new Rr(NaN,NaN,NaN,0):null}function CD(e){return new Rr(e>>16&255,e>>8&255,e&255,1)}function Mm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Rr(e,t,n,r)}function rye(e){return e instanceof zh||(e=oh(e)),e?(e=e.rgb(),new Rr(e.r,e.g,e.b,e.opacity)):new Rr}function pj(e,t,n,r){return arguments.length===1?rye(e):new Rr(e,t,n,r??1)}function Rr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Uk(Rr,pj,cB(zh,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new Rr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ah:Math.pow(ah,e),new Rr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Rr(kl(this.r),kl(this.g),kl(this.b),fy(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:_D,formatHex:_D,formatHex8:iye,formatRgb:AD,toString:AD}));function _D(){return`#${yl(this.r)}${yl(this.g)}${yl(this.b)}`}function iye(){return`#${yl(this.r)}${yl(this.g)}${yl(this.b)}${yl((isNaN(this.opacity)?1:this.opacity)*255)}`}function AD(){const e=fy(this.opacity);return`${e===1?"rgb(":"rgba("}${kl(this.r)}, ${kl(this.g)}, ${kl(this.b)}${e===1?")":`, ${e})`}`}function fy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yl(e){return e=kl(e),(e<16?"0":"")+e.toString(16)}function ED(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qi(e,t,n,r)}function uB(e){if(e instanceof Qi)return new Qi(e.h,e.s,e.l,e.opacity);if(e instanceof zh||(e=oh(e)),!e)return new Qi;if(e instanceof Qi)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 Qi(o,u,d,e.opacity)}function aye(e,t,n,r){return arguments.length===1?uB(e):new Qi(e,t,n,r??1)}function Qi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Uk(Qi,aye,cB(zh,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new Qi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ah:Math.pow(ah,e),new Qi(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 Rr(xS(e>=240?e-240:e+120,i,r),xS(e,i,r),xS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qi(OD(this.h),Im(this.s),Im(this.l),fy(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=fy(this.opacity);return`${e===1?"hsl(":"hsla("}${OD(this.h)}, ${Im(this.s)*100}%, ${Im(this.l)*100}%${e===1?")":`, ${e})`}`}}));function OD(e){return e=(e||0)%360,e<0?e+360:e}function Im(e){return Math.max(0,Math.min(1,e||0))}function xS(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 qk=e=>()=>e;function sye(e,t){return function(n){return e+n*t}}function oye(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 lye(e){return(e=+e)==1?dB:function(t,n){return n-t?oye(t,n,e):qk(isNaN(t)?n:t)}}function dB(e,t){var n=t-e;return n?sye(e,n):qk(isNaN(e)?t:e)}const zD=(function e(t){var n=lye(t);function r(i,a){var o=n((i=pj(i)).r,(a=pj(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=dB(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 cye(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 uye(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dye(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]=Xu(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 fye(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function hy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hye(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]=Xu(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var mj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bS=new RegExp(mj.source,"g");function pye(e){return function(){return e}}function mye(e){return function(t){return e(t)+""}}function gye(e,t){var n=mj.lastIndex=bS.lastIndex=0,r,i,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(r=mj.exec(e))&&(i=bS.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:hy(r,i)})),n=bS.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?mye(d[0].x):pye(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 Xu(e,t){var n=typeof t,r;return t==null||n==="boolean"?qk(t):(n==="number"?hy:n==="string"?(r=oh(t))?(t=r,zD):gye:t instanceof oh?zD:t instanceof Date?fye:uye(t)?cye:Array.isArray(t)?dye:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hye:hy)(e,t)}function Fk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function yye(e,t){t===void 0&&(t=e,e=Xu);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 vye(e){return function(){return e}}function py(e){return+e}var TD=[0,1];function vr(e){return e}function gj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:vye(isNaN(t)?NaN:.5)}function xye(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function bye(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=gj(i,r),a=n(o,a)):(r=gj(r,i),a=n(a,o)),function(u){return a(r(u))}}function wye(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]=gj(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(u){var d=Oh(e,u,1,r)-1;return a[d](i[d](u))}}function Th(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Vv(){var e=TD,t=TD,n=Xu,r,i,a,o=vr,u,d,f;function p(){var y=Math.min(e.length,t.length);return o!==vr&&(o=xye(e[0],e[y-1])),u=y>2?wye:bye,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),hy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,py),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=Fk,p()},m.clamp=function(y){return arguments.length?(o=y?!0:vr,p()):o!==vr},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 Hk(){return Vv()(vr,vr)}function Sye(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function my(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 zu(e){return e=my(Math.abs(e)),e?e[1]:NaN}function jye(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 Nye(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var kye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lh(e){if(!(t=kye.exec(e)))throw new Error("invalid format: "+e);var t;return new Kk({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]})}lh.prototype=Kk.prototype;function Kk(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+""}Kk.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 Cye(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 gy;function _ye(e,t){var n=my(e,t);if(!n)return gy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(gy=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")+my(e,Math.max(0,t+a-1))[0]}function PD(e,t){var n=my(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 RD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Sye,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)=>PD(e*100,t),r:PD,s:_ye,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function DD(e){return e}var MD=Array.prototype.map,ID=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Aye(e){var t=e.grouping===void 0||e.thousands===void 0?DD:jye(MD.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?DD:Nye(MD.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=lh(m);var v=m.fill,S=m.align,w=m.sign,j=m.symbol,k=m.zero,O=m.width,_=m.comma,A=m.precision,T=m.trim,C=m.type;C==="n"?(_=!0,C="g"):RD[C]||(A===void 0&&(A=12),T=!0,C="g"),(k||v==="0"&&S==="=")&&(k=!0,v="0",S="=");var z=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),R=(j==="$"?r:/[%p]/.test(C)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),B=RD[C],F=/[defgprs%]/.test(C);A=A===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function q($){var V=z,te=R,W,H,ee;if(C==="c")te=B($)+te,$="";else{$=+$;var le=$<0||1/$<0;if($=isNaN($)?d:B(Math.abs($),A),T&&($=Cye($)),le&&+$==0&&w!=="+"&&(le=!1),V=(le?w==="("?w:u:w==="-"||w==="("?"":w)+V,te=(C==="s"&&!isNaN($)&&gy!==void 0?ID[8+gy/3]:"")+te+(le&&w==="("?")":""),F){for(W=-1,H=$.length;++W<H;)if(ee=$.charCodeAt(W),48>ee||ee>57){te=(ee===46?i+$.slice(W+1):$.slice(W))+te,$=$.slice(0,W);break}}}_&&!k&&($=t($,1/0));var je=V.length+$.length+te.length,L=je<O?new Array(O-je+1).join(v):"";switch(_&&k&&($=t(L+$,L.length?O-te.length:1/0),L=""),S){case"<":$=V+$+te+L;break;case"=":$=V+L+$+te;break;case"^":$=L.slice(0,je=L.length>>1)+V+$+te+L.slice(je);break;default:$=L+V+$+te;break}return a($)}return q.toString=function(){return m+""},q}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(zu(y)/3)))*3,S=Math.pow(10,-v),w=f((m=lh(m),m.type="f",m),{suffix:ID[8+v/3]});return function(j){return w(S*j)}}return{format:f,formatPrefix:p}}var Lm,Gk,fB;Eye({thousands:",",grouping:[3],currency:["$",""]});function Eye(e){return Lm=Aye(e),Gk=Lm.format,fB=Lm.formatPrefix,Lm}function Oye(e){return Math.max(0,-zu(Math.abs(e)))}function zye(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zu(t)/3)))*3-zu(Math.abs(e)))}function Tye(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zu(t)-zu(e))+1}function hB(e,t,n,r){var i=fj(e,t,n),a;switch(r=lh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=zye(i,o))&&(r.precision=a),fB(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Tye(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Oye(i))&&(r.precision=a-(r.type==="%")*2);break}}return Gk(r)}function Oo(e){var t=e.domain;return e.ticks=function(n){var r=t();return uj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return hB(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=dj(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 pB(){var e=Hk();return e.copy=function(){return Th(e,pB())},Di.apply(e,arguments),Oo(e)}function mB(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,py),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return mB(e).unknown(t)},e=arguments.length?Array.from(e,py):[0,1],Oo(n)}function gB(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 LD(e){return Math.log(e)}function $D(e){return Math.exp(e)}function Pye(e){return-Math.log(-e)}function Rye(e){return-Math.exp(-e)}function Dye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Mye(e){return e===10?Dye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Iye(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 BD(e){return(t,n)=>-e(-t,n)}function Vk(e){const t=e(LD,$D),n=t.domain;let r=10,i,a;function o(){return i=Iye(r),a=Mye(r),n()[0]<0?(i=BD(i),a=BD(a),e(Pye,Rye)):e(LD,$D),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),S,w;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(S=1;S<r;++S)if(w=y<0?S/a(-y):S*a(y),!(w<f)){if(w>p)break;k.push(w)}}else for(;y<=v;++y)for(S=r-1;S>=1;--S)if(w=y>0?S/a(-y):S*a(y),!(w<f)){if(w>p)break;k.push(w)}k.length*2<j&&(k=uj(f,p,j))}else k=uj(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=lh(d)).precision==null&&(d.trim=!0),d=Gk(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(gB(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function yB(){const e=Vk(Vv()).domain([1,10]);return e.copy=()=>Th(e,yB()).base(e.base()),Di.apply(e,arguments),e}function UD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qk(e){var t=1,n=e(UD(t),qD(t));return n.constant=function(r){return arguments.length?e(UD(t=+r),qD(t)):t},Oo(n)}function vB(){var e=Qk(Vv());return e.copy=function(){return Th(e,vB()).constant(e.constant())},Di.apply(e,arguments)}function FD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Lye(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $ye(e){return e<0?-e*e:e*e}function Zk(e){var t=e(vr,vr),n=1;function r(){return n===1?e(vr,vr):n===.5?e(Lye,$ye):e(FD(n),FD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Oo(t)}function Yk(){var e=Zk(Vv());return e.copy=function(){return Th(e,Yk()).exponent(e.exponent())},Di.apply(e,arguments),e}function Bye(){return Yk.apply(null,arguments).exponent(.5)}function HD(e){return Math.sign(e)*e*e}function Uye(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xB(){var e=Hk(),t=[0,1],n=!1,r;function i(a){var o=Uye(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(HD(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,py)).map(HD)),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 xB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Di.apply(i,arguments),Oo(i)}function bB(){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[Oh(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(go),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 bB().domain(e).range(t).unknown(r)},Di.apply(a,arguments)}function wB(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[Oh(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 wB().domain([e,t]).range(i).unknown(a)},Di.apply(Oo(o),arguments)}function SB(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Oh(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 SB().domain(e).range(t).unknown(n)},Di.apply(i,arguments)}const wS=new Date,SS=new Date;function Bn(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=>Bn(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)=>(wS.setTime(+a),SS.setTime(+o),e(wS),e(SS),Math.floor(n(wS,SS))),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 yy=Bn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);yy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Bn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):yy);yy.range;const as=1e3,Ci=as*60,ss=Ci*60,us=ss*24,Wk=us*7,KD=us*30,jS=us*365,vl=Bn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*as)},(e,t)=>(t-e)/as,e=>e.getUTCSeconds());vl.range;const Xk=Bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*as)},(e,t)=>{e.setTime(+e+t*Ci)},(e,t)=>(t-e)/Ci,e=>e.getMinutes());Xk.range;const Jk=Bn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ci)},(e,t)=>(t-e)/Ci,e=>e.getUTCMinutes());Jk.range;const eC=Bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*as-e.getMinutes()*Ci)},(e,t)=>{e.setTime(+e+t*ss)},(e,t)=>(t-e)/ss,e=>e.getHours());eC.range;const tC=Bn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ss)},(e,t)=>(t-e)/ss,e=>e.getUTCHours());tC.range;const Ph=Bn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ci)/us,e=>e.getDate()-1);Ph.range;const Qv=Bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/us,e=>e.getUTCDate()-1);Qv.range;const jB=Bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/us,e=>Math.floor(e/us));jB.range;function Xl(e){return Bn(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)/Wk)}const Zv=Xl(0),vy=Xl(1),qye=Xl(2),Fye=Xl(3),Tu=Xl(4),Hye=Xl(5),Kye=Xl(6);Zv.range;vy.range;qye.range;Fye.range;Tu.range;Hye.range;Kye.range;function Jl(e){return Bn(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)/Wk)}const Yv=Jl(0),xy=Jl(1),Gye=Jl(2),Vye=Jl(3),Pu=Jl(4),Qye=Jl(5),Zye=Jl(6);Yv.range;xy.range;Gye.range;Vye.range;Pu.range;Qye.range;Zye.range;const nC=Bn(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());nC.range;const rC=Bn(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());rC.range;const ds=Bn(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());ds.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Bn(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)});ds.range;const fs=Bn(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());fs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Bn(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)});fs.range;function NB(e,t,n,r,i,a){const o=[[vl,1,as],[vl,5,5*as],[vl,15,15*as],[vl,30,30*as],[a,1,Ci],[a,5,5*Ci],[a,15,15*Ci],[a,30,30*Ci],[i,1,ss],[i,3,3*ss],[i,6,6*ss],[i,12,12*ss],[r,1,us],[r,2,2*us],[n,1,Wk],[t,1,KD],[t,3,3*KD],[e,1,jS]];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),S=v?v.range(f,+p+1):[];return y?S.reverse():S}function d(f,p,m){const y=Math.abs(p-f)/m,v=Lk(([,,j])=>j).right(o,y);if(v===o.length)return e.every(fj(f/jS,p/jS,m));if(v===0)return yy.every(Math.max(fj(f,p,m),1));const[S,w]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return S.every(w)}return[u,d]}const[Yye,Wye]=NB(fs,rC,Yv,jB,tC,Jk),[Xye,Jye]=NB(ds,nC,Zv,Ph,eC,Xk);function NS(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 kS(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 mf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function eve(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=gf(i),p=yf(i),m=gf(a),y=yf(a),v=gf(o),S=yf(o),w=gf(u),j=yf(u),k=gf(d),O=yf(d),_={a:ee,A:le,b:je,B:L,c:null,d:WD,e:WD,f:jve,g:Pve,G:Dve,H:bve,I:wve,j:Sve,L:kB,m:Nve,M:kve,p:I,q:U,Q:eM,s:tM,S:Cve,u:_ve,U:Ave,V:Eve,w:Ove,W:zve,x:null,X:null,y:Tve,Y:Rve,Z:Mve,"%":JD},A={a:D,A:G,b:ae,B:ne,c:null,d:XD,e:XD,f:Bve,g:Yve,G:Xve,H:Ive,I:Lve,j:$ve,L:_B,m:Uve,M:qve,p:Ce,q:Se,Q:eM,s:tM,S:Fve,u:Hve,U:Kve,V:Gve,w:Vve,W:Qve,x:null,X:null,y:Zve,Y:Wve,Z:Jve,"%":JD},T={a:F,A:q,b:$,B:V,c:te,d:ZD,e:ZD,f:gve,g:QD,G:VD,H:YD,I:YD,j:fve,L:mve,m:dve,M:hve,p:B,q:uve,Q:vve,s:xve,S:pve,u:ave,U:sve,V:ove,w:ive,W:lve,x:W,X:H,y:QD,Y:VD,Z:cve,"%":yve};_.x=C(n,_),_.X=C(r,_),_.c=C(t,_),A.x=C(n,A),A.X=C(r,A),A.c=C(t,A);function C(X,me){return function(Ee){var Y=[],Fe=-1,Te=0,it=X.length,Ge,$t,Dt;for(Ee instanceof Date||(Ee=new Date(+Ee));++Fe<it;)X.charCodeAt(Fe)===37&&(Y.push(X.slice(Te,Fe)),($t=GD[Ge=X.charAt(++Fe)])!=null?Ge=X.charAt(++Fe):$t=Ge==="e"?" ":"0",(Dt=me[Ge])&&(Ge=Dt(Ee,$t)),Y.push(Ge),Te=Fe+1);return Y.push(X.slice(Te,Fe)),Y.join("")}}function z(X,me){return function(Ee){var Y=mf(1900,void 0,1),Fe=R(Y,X,Ee+="",0),Te,it;if(Fe!=Ee.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(me&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Te=kS(mf(Y.y,0,1)),it=Te.getUTCDay(),Te=it>4||it===0?xy.ceil(Te):xy(Te),Te=Qv.offset(Te,(Y.V-1)*7),Y.y=Te.getUTCFullYear(),Y.m=Te.getUTCMonth(),Y.d=Te.getUTCDate()+(Y.w+6)%7):(Te=NS(mf(Y.y,0,1)),it=Te.getDay(),Te=it>4||it===0?vy.ceil(Te):vy(Te),Te=Ph.offset(Te,(Y.V-1)*7),Y.y=Te.getFullYear(),Y.m=Te.getMonth(),Y.d=Te.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),it="Z"in Y?kS(mf(Y.y,0,1)).getUTCDay():NS(mf(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(it+5)%7:Y.w+Y.U*7-(it+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,kS(Y)):NS(Y)}}function R(X,me,Ee,Y){for(var Fe=0,Te=me.length,it=Ee.length,Ge,$t;Fe<Te;){if(Y>=it)return-1;if(Ge=me.charCodeAt(Fe++),Ge===37){if(Ge=me.charAt(Fe++),$t=T[Ge in GD?me.charAt(Fe++):Ge],!$t||(Y=$t(X,Ee,Y))<0)return-1}else if(Ge!=Ee.charCodeAt(Y++))return-1}return Y}function B(X,me,Ee){var Y=f.exec(me.slice(Ee));return Y?(X.p=p.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function F(X,me,Ee){var Y=v.exec(me.slice(Ee));return Y?(X.w=S.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function q(X,me,Ee){var Y=m.exec(me.slice(Ee));return Y?(X.w=y.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function $(X,me,Ee){var Y=k.exec(me.slice(Ee));return Y?(X.m=O.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function V(X,me,Ee){var Y=w.exec(me.slice(Ee));return Y?(X.m=j.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function te(X,me,Ee){return R(X,t,me,Ee)}function W(X,me,Ee){return R(X,n,me,Ee)}function H(X,me,Ee){return R(X,r,me,Ee)}function ee(X){return o[X.getDay()]}function le(X){return a[X.getDay()]}function je(X){return d[X.getMonth()]}function L(X){return u[X.getMonth()]}function I(X){return i[+(X.getHours()>=12)]}function U(X){return 1+~~(X.getMonth()/3)}function D(X){return o[X.getUTCDay()]}function G(X){return a[X.getUTCDay()]}function ae(X){return d[X.getUTCMonth()]}function ne(X){return u[X.getUTCMonth()]}function Ce(X){return i[+(X.getUTCHours()>=12)]}function Se(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var me=C(X+="",_);return me.toString=function(){return X},me},parse:function(X){var me=z(X+="",!1);return me.toString=function(){return X},me},utcFormat:function(X){var me=C(X+="",A);return me.toString=function(){return X},me},utcParse:function(X){var me=z(X+="",!0);return me.toString=function(){return X},me}}}var GD={"-":"",_:" ",0:"0"},Vn=/^\s*\d+/,tve=/^%/,nve=/[\\^$*+?|[\]().{}]/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 rve(e){return e.replace(nve,"\\$&")}function gf(e){return new RegExp("^(?:"+e.map(rve).join("|")+")","i")}function yf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function ive(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ave(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sve(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ove(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lve(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function VD(e,t,n){var r=Vn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function QD(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function cve(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 uve(e,t,n){var r=Vn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dve(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ZD(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function fve(e,t,n){var r=Vn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function YD(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hve(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function pve(e,t,n){var r=Vn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function mve(e,t,n){var r=Vn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gve(e,t,n){var r=Vn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yve(e,t,n){var r=tve.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function vve(e,t,n){var r=Vn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xve(e,t,n){var r=Vn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function WD(e,t){return _t(e.getDate(),t,2)}function bve(e,t){return _t(e.getHours(),t,2)}function wve(e,t){return _t(e.getHours()%12||12,t,2)}function Sve(e,t){return _t(1+Ph.count(ds(e),e),t,3)}function kB(e,t){return _t(e.getMilliseconds(),t,3)}function jve(e,t){return kB(e,t)+"000"}function Nve(e,t){return _t(e.getMonth()+1,t,2)}function kve(e,t){return _t(e.getMinutes(),t,2)}function Cve(e,t){return _t(e.getSeconds(),t,2)}function _ve(e){var t=e.getDay();return t===0?7:t}function Ave(e,t){return _t(Zv.count(ds(e)-1,e),t,2)}function CB(e){var t=e.getDay();return t>=4||t===0?Tu(e):Tu.ceil(e)}function Eve(e,t){return e=CB(e),_t(Tu.count(ds(e),e)+(ds(e).getDay()===4),t,2)}function Ove(e){return e.getDay()}function zve(e,t){return _t(vy.count(ds(e)-1,e),t,2)}function Tve(e,t){return _t(e.getFullYear()%100,t,2)}function Pve(e,t){return e=CB(e),_t(e.getFullYear()%100,t,2)}function Rve(e,t){return _t(e.getFullYear()%1e4,t,4)}function Dve(e,t){var n=e.getDay();return e=n>=4||n===0?Tu(e):Tu.ceil(e),_t(e.getFullYear()%1e4,t,4)}function Mve(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+_t(t/60|0,"0",2)+_t(t%60,"0",2)}function XD(e,t){return _t(e.getUTCDate(),t,2)}function Ive(e,t){return _t(e.getUTCHours(),t,2)}function Lve(e,t){return _t(e.getUTCHours()%12||12,t,2)}function $ve(e,t){return _t(1+Qv.count(fs(e),e),t,3)}function _B(e,t){return _t(e.getUTCMilliseconds(),t,3)}function Bve(e,t){return _B(e,t)+"000"}function Uve(e,t){return _t(e.getUTCMonth()+1,t,2)}function qve(e,t){return _t(e.getUTCMinutes(),t,2)}function Fve(e,t){return _t(e.getUTCSeconds(),t,2)}function Hve(e){var t=e.getUTCDay();return t===0?7:t}function Kve(e,t){return _t(Yv.count(fs(e)-1,e),t,2)}function AB(e){var t=e.getUTCDay();return t>=4||t===0?Pu(e):Pu.ceil(e)}function Gve(e,t){return e=AB(e),_t(Pu.count(fs(e),e)+(fs(e).getUTCDay()===4),t,2)}function Vve(e){return e.getUTCDay()}function Qve(e,t){return _t(xy.count(fs(e)-1,e),t,2)}function Zve(e,t){return _t(e.getUTCFullYear()%100,t,2)}function Yve(e,t){return e=AB(e),_t(e.getUTCFullYear()%100,t,2)}function Wve(e,t){return _t(e.getUTCFullYear()%1e4,t,4)}function Xve(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Pu(e):Pu.ceil(e),_t(e.getUTCFullYear()%1e4,t,4)}function Jve(){return"+0000"}function JD(){return"%"}function eM(e){return+e}function tM(e){return Math.floor(+e/1e3)}var Kc,EB,OB;e0e({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 e0e(e){return Kc=eve(e),EB=Kc.format,Kc.parse,OB=Kc.utcFormat,Kc.utcParse,Kc}function t0e(e){return new Date(e)}function n0e(e){return e instanceof Date?+e:+new Date(+e)}function iC(e,t,n,r,i,a,o,u,d,f){var p=Hk(),m=p.invert,y=p.domain,v=f(".%L"),S=f(":%S"),w=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),O=f("%b %d"),_=f("%B"),A=f("%Y");function T(C){return(d(C)<C?v:u(C)<C?S:o(C)<C?w:a(C)<C?j:r(C)<C?i(C)<C?k:O:n(C)<C?_:A)(C)}return p.invert=function(C){return new Date(m(C))},p.domain=function(C){return arguments.length?y(Array.from(C,n0e)):y().map(t0e)},p.ticks=function(C){var z=y();return e(z[0],z[z.length-1],C??10)},p.tickFormat=function(C,z){return z==null?T:f(z)},p.nice=function(C){var z=y();return(!C||typeof C.range!="function")&&(C=t(z[0],z[z.length-1],C??10)),C?y(gB(z,C)):p},p.copy=function(){return Th(p,iC(e,t,n,r,i,a,o,u,d,f))},p}function r0e(){return Di.apply(iC(Xye,Jye,ds,nC,Zv,Ph,eC,Xk,vl,EB).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function i0e(){return Di.apply(iC(Yye,Wye,fs,rC,Yv,Qv,tC,Jk,vl,OB).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wv(){var e=0,t=1,n,r,i,a,o=vr,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,S;return arguments.length?([v,S]=y,o=m(v,S),f):[o(0),o(1)]}}return f.range=p(Xu),f.rangeRound=p(Fk),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 zo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function zB(){var e=Oo(Wv()(vr));return e.copy=function(){return zo(e,zB())},ys.apply(e,arguments)}function TB(){var e=Vk(Wv()).domain([1,10]);return e.copy=function(){return zo(e,TB()).base(e.base())},ys.apply(e,arguments)}function PB(){var e=Qk(Wv());return e.copy=function(){return zo(e,PB()).constant(e.constant())},ys.apply(e,arguments)}function aC(){var e=Zk(Wv());return e.copy=function(){return zo(e,aC()).exponent(e.exponent())},ys.apply(e,arguments)}function a0e(){return aC.apply(null,arguments).exponent(.5)}function RB(){var e=[],t=vr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Oh(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(go),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)=>Hge(e,a/r))},n.copy=function(){return RB(t).domain(e)},ys.apply(n,arguments)}function Xv(){var e=0,t=.5,n=1,r=1,i,a,o,u,d,f=vr,p,m=!1,y;function v(w){return isNaN(w=+w)?y:(w=.5+((w=+p(w))-a)*(r*w<r*a?u:d),f(m?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=p(e=+e),a=p(t=+t),o=p(n=+n),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(w){return arguments.length?(m=!!w,v):m},v.interpolator=function(w){return arguments.length?(f=w,v):f};function S(w){return function(j){var k,O,_;return arguments.length?([k,O,_]=j,f=yye(w,[k,O,_]),v):[f(0),f(.5),f(1)]}}return v.range=S(Xu),v.rangeRound=S(Fk),v.unknown=function(w){return arguments.length?(y=w,v):y},function(w){return p=w,i=w(e),a=w(t),o=w(n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function DB(){var e=Oo(Xv()(vr));return e.copy=function(){return zo(e,DB())},ys.apply(e,arguments)}function MB(){var e=Vk(Xv()).domain([.1,1,10]);return e.copy=function(){return zo(e,MB()).base(e.base())},ys.apply(e,arguments)}function IB(){var e=Qk(Xv());return e.copy=function(){return zo(e,IB()).constant(e.constant())},ys.apply(e,arguments)}function sC(){var e=Zk(Xv());return e.copy=function(){return zo(e,sC()).exponent(e.exponent())},ys.apply(e,arguments)}function s0e(){return sC.apply(null,arguments).exponent(.5)}const LB=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Bk,scaleDiverging:DB,scaleDivergingLog:MB,scaleDivergingPow:sC,scaleDivergingSqrt:s0e,scaleDivergingSymlog:IB,scaleIdentity:mB,scaleImplicit:hj,scaleLinear:pB,scaleLog:yB,scaleOrdinal:$k,scalePoint:Vge,scalePow:Yk,scaleQuantile:bB,scaleQuantize:wB,scaleRadial:xB,scaleSequential:zB,scaleSequentialLog:TB,scaleSequentialPow:aC,scaleSequentialQuantile:RB,scaleSequentialSqrt:a0e,scaleSequentialSymlog:PB,scaleSqrt:Bye,scaleSymlog:vB,scaleThreshold:SB,scaleTime:r0e,scaleUtc:i0e,tickFormat:hB},Symbol.toStringTag,{value:"Module"}));function o0e(e){var t=LB;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Sh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function nM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=o0e(e);if(r!=null)return r.domain(t).range(n),r}}function oC(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?nM(e.scale,n,r):nM(t,n,r)}function l0e(e){return"scale".concat(Sh(e))}function c0e(e){return l0e(e)in LB}var $B=(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 c0e(r)?r:"point"}};function u0e(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 BB(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=u0e(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 d0e(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):BB(e,void 0)}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 by(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){f0e(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 f0e(e,t,n){return(t=h0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h0e(e){var t=p0e(e,"string");return typeof t=="symbol"?t:t+""}function p0e(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 yj=[0,"auto"],In={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"},UB=(e,t)=>e.cartesianAxis.xAxis[t],vs=(e,t)=>{var n=UB(e,t);return n??In},Ln={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yj,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:kh},qB=(e,t)=>e.cartesianAxis.yAxis[t],xs=(e,t)=>{var n=qB(e,t);return n??Ln},m0e={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:""},lC=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??m0e},Sr=(e,t,n)=>{switch(t){case"xAxis":return vs(e,n);case"yAxis":return xs(e,n);case"zAxis":return lC(e,n);case"angleAxis":return Tk(e,n);case"radiusAxis":return Pk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},g0e=(e,t,n)=>{switch(t){case"xAxis":return vs(e,n);case"yAxis":return xs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Rh=(e,t,n)=>{switch(t){case"xAxis":return vs(e,n);case"yAxis":return xs(e,n);case"angleAxis":return Tk(e,n);case"radiusAxis":return Pk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},FB=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function HB(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 KB=e=>e.graphicalItems.cartesianItems,y0e=oe([Kn,Hv],HB),GB=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Ju=oe([KB,Sr,y0e],GB,{memoizeOptions:{resultEqualityCheck:Gv}}),VB=oe([Ju],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Mk)),QB=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),v0e=oe([Ju],QB),ZB=e=>e.map(t=>t.data).filter(Boolean).flat(1),x0e=oe([Ju],e=>e.some(t=>!t.data)),YB=oe([Ju],ZB,{memoizeOptions:{resultEqualityCheck:Gv}}),WB=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},cC=oe([YB,$v],WB),b0e=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Hn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Hn(i,r)}))):e.map(r=>({value:r})),XB=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:u,dataEndIndex:d}=r,f=b0e(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(u,d+1),m=p.map(y=>({value:Hn(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},Dh=oe([cC,Sr,Ju,$v,x0e,YB],XB);function xu(e){if(Aa(e)||e instanceof Date){var t=Number(e);if(Ct(t))return t}}function iM(e){if(Array.isArray(e)){var t=[xu(e[0]),xu(e[1])];return wa(t)?t:void 0}var n=xu(e);if(n!=null)return[n,n]}function Oa(e){return e.map(xu).filter(va)}function w0e(e,t){var n=xu(e),r=xu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var S0e=oe([Dh],e=>e?.map(t=>t.value).sort(w0e));function JB(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function j0e(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!_a(t))r=t;else if(Array.isArray(t)){var i=Oa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Oa(n.flatMap(a=>{var o=Hn(e,a.dataKey),u,d;if(Array.isArray(o)?[u,d]=o:u=d=o,!(!Ct(u)||!Ct(d)))return[r-u,r+d]}))}var Un=e=>{var t=Gn(e),n=Wu(e);return Rh(e,t,n)},Ru=oe([Un],e=>e?.dataKey),N0e=oe([VB,$v,Un],iB),eU=(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(Dk);return[u,{stackedData:nhe(e,p,n),graphicalItems:f}]}))},tU=oe([N0e,VB,Bv,W6],eU),nU=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=she(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},k0e=oe([Sr],e=>e.allowDataOverflow),uC=e=>{var t;if(e==null||!("domain"in e))return yj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Oa(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:yj},rU=oe([Sr],uC),iU=oe([rU,k0e],B6),C0e=oe([tU,ta,Kn,iU],nU,{memoizeOptions:{resultEqualityCheck:Kv}}),dC=e=>e.errorBars,_0e=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>JB(n,r)),wy=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]}},aU=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=>JB(a,v));m.forEach(v=>{var S,w=Hn(v,(S=n.dataKey)!==null&&S!==void 0?S:f.dataKey),j=j0e(v,w,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 _=iM(w);_!=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=iM(Hn(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]))}),Ct(u)&&Ct(d))return[u,d]},A0e=oe([cC,Sr,v0e,dC,Kn,gge],aU,{memoizeOptions:{resultEqualityCheck:Kv}});function E0e(e){var{value:t}=e;if(Aa(t)||t instanceof Date)return t}var O0e=(e,t,n)=>{var r=e.map(E0e).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&m$(r))?$6(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},sU=e=>e.referenceElements.dots,ed=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),z0e=oe([sU,Kn,Hv],ed),oU=e=>e.referenceElements.areas,T0e=oe([oU,Kn,Hv],ed),lU=e=>e.referenceElements.lines,P0e=oe([lU,Kn,Hv],ed),cU=(e,t)=>{if(e!=null){var n=Oa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},R0e=oe(z0e,Kn,cU),uU=(e,t)=>{if(e!=null){var n=Oa(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)]}},D0e=oe([T0e,Kn],uU);function M0e(e){var t;if(e.x!=null)return Oa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Oa(n)}function I0e(e){var t;if(e.y!=null)return Oa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Oa(n)}var dU=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?M0e(r):I0e(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},L0e=oe([P0e,Kn],dU),$0e=oe(R0e,L0e,D0e,(e,t,n)=>wy(e,n,t)),fU=(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?wy(r,a,i):wy(a,i);return vge(t,f,e.allowDataOverflow)},B0e=oe([Sr,rU,iU,C0e,A0e,$0e,on,Kn],fU,{memoizeOptions:{resultEqualityCheck:Kv}}),U0e=[0,1],hU=(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 $6(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?O0e(r,e,f):i==="expand"&&!f?U0e:o}},fC=oe([Sr,on,cC,Dh,Bv,Kn,B0e],hU),td=oe([Sr,FB,Ek],$B),pU=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=uC(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&wa(e)){if(a)return pD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return mD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&wa(e))return pD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&wa(e))return mD(e,t.tickCount,t.allowDecimals,"adaptive")}}},hC=oe([fC,Rh,td],pU),mU=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&wa(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},q0e=oe([Sr,fC,hC,Kn],mU),F0e=oe(Dh,Sr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Oa(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}}),gU=oe(F0e,on,jge,ar,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ct(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=So(n,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),H0e=(e,t,n)=>{var r=vs(e,t);return r==null||typeof r.padding!="string"?0:gU(e,"xAxis",t,n,r.padding)},K0e=(e,t,n)=>{var r=xs(e,t);return r==null||typeof r.padding!="string"?0:gU(e,"yAxis",t,n,r.padding)},G0e=oe(vs,H0e,(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}}),V0e=oe(xs,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}}),Q0e=oe([ar,G0e,Rv,Pv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Z0e=oe([ar,on,V0e,Rv,Pv,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Mh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Q0e(e,n,r);case"yAxis":return Z0e(e,n,r);case"zAxis":return(i=lC(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return tB(e);case"radiusAxis":return nB(e,n);default:return}},yU=oe([Sr,Mh],Uv),Y0e=oe([td,q0e],Tge),pC=oe([Sr,td,Y0e,yU],oC),vU=(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)}},mC=oe([on,Dh,Rh,Kn],vU),Jv=oe([pC],Ik);oe([pC],d0e);oe([pC,S0e],BB);oe([Ju,dC,Kn],_0e);function xU(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var e0=(e,t)=>t,t0=(e,t,n)=>n,W0e=oe(zv,e0,t0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xU)),X0e=oe(Tv,e0,t0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xU)),bU=(e,t)=>({width:e.width,height:t.height}),J0e=(e,t)=>{var n=typeof t.width=="number"?t.width:kh;return{width:n,height:e.height}},exe=oe(ar,vs,bU),txe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},nxe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},rxe=oe(gs,ar,W0e,e0,t0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=bU(t,u);o==null&&(o=txe(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}),ixe=oe(ms,ar,X0e,e0,t0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=J0e(t,u);o==null&&(o=nxe(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}),axe=(e,t)=>{var n=vs(e,t);if(n!=null)return rxe(e,n.orientation,n.mirror)},sxe=oe([ar,vs,axe,(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}}}),oxe=(e,t)=>{var n=xs(e,t);if(n!=null)return ixe(e,n.orientation,n.mirror)},lxe=oe([ar,xs,oxe,(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}}}),cxe=oe(ar,xs,(e,t)=>{var n=typeof t.width=="number"?t.width:kh;return{width:n,height:e.height}}),wU=(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&&m$(f))return d}},gC=oe([on,Dh,Sr,Kn],wU);oe([on,g0e,td,Jv,gC,mC,Mh,hC,Kn],(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}}});var uxe=(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,S=p==="category"&&r.bandwidth?r.bandwidth()/v:0;S=d==="angleAxis"&&a!=null&&a.length>=2?Zi(a[0]-a[1])*2*S:S;var w=m||i;return w?w.map((j,k)=>{var O=o?o.indexOf(j):j,_=r.map(O);return Ct(_)?{index:k,coordinate:_+S,value:j,offset:S}:null}).filter(va):f&&u?u.map((j,k)=>{var O=r.map(j);return Ct(O)?{coordinate:O+S,value:j,index:k,offset:S}:null}).filter(va):r.ticks?r.ticks(y).map((j,k)=>{var O=r.map(j);return Ct(O)?{coordinate:O+S,value:j,index:k,offset:S}:null}).filter(va):r.domain().map((j,k)=>{var O=r.map(j);return Ct(O)?{coordinate:O+S,value:o?o[j]:j,index:k,offset:S}:null}).filter(va)}},SU=oe([on,Rh,td,Jv,hC,Mh,gC,mC,Kn],uxe),dxe=(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?Zi(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var y=n.map(p);return Ct(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(va):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return Ct(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(va):n.domain().map((p,m)=>{var y=n.map(p);return Ct(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(va)}},jU=oe([on,Rh,Jv,Mh,gC,mC,Kn],dxe),NU=oe(Sr,Jv,(e,t)=>{if(!(e==null||t==null))return by(by({},e),{},{scale:t})}),fxe=oe([Sr,td,fC,yU],oC),hxe=oe([fxe],Ik);oe((e,t,n)=>lC(e,n),hxe,(e,t)=>{if(!(e==null||t==null))return by(by({},e),{},{scale:t})});var pxe=oe([on,zv,Tv],(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}}),mxe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};oe([mxe],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 kU=e=>e.options.defaultTooltipEventType,CU=e=>e.options.validateTooltipEventTypes;function _U(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Ih(e,t){var n=kU(e),r=CU(e);return _U(t,n,r)}function gxe(e){return Qe(t=>Ih(t,e))}var AU=(e,t)=>{var n,r=Number(t);if(!(_a(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},yxe=e=>e.tooltip.settings,ao={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},vxe={itemInteraction:{click:ao,hover:ao},axisInteraction:{click:ao,hover:ao},keyboardInteraction:ao,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}},EU=hr({name:"tooltip",initialState:vxe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Jt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Jt()},removeTooltipEntrySettings:{reducer(e,t){var n=ki(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Jt()},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:xxe,replaceTooltipEntrySettings:bxe,removeTooltipEntrySettings:wxe,setTooltipSettingsState:Sxe,setActiveMouseOverItemIndex:jxe,mouseLeaveItem:WCe,mouseLeaveChart:OU,setActiveClickItemIndex:XCe,setMouseOverAxisIndex:zU,setMouseClickAxisIndex:Nxe,setSyncInteraction:Nf,setKeyboardInteraction:Sy}=EU.actions,kxe=EU.reducer;function aM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){Cxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cxe(e,t,n){return(t=_xe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _xe(e){var t=Axe(e,"string");return typeof t=="symbol"?t:t+""}function Axe(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 Exe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Oxe(e){return e.index!=null}var TU=(e,t,n,r)=>{if(t==null)return ao;var i=Exe(e,t,n);if(i==null)return ao;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(Oxe(i)){if(a)return $m($m({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return $m($m({},ao),{},{coordinate:i.coordinate})};function zxe(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 Txe(e,t){var n=zxe(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 Pxe(e,t,n){if(n==null||t==null)return!0;var r=Hn(e,t);return r==null||!wa(n)?!0:Txe(r,n)}var Rf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Ct(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||Pxe(f,n,r)?String(d):null},PU=(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}}},RU=(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})},DU=e=>e.options.tooltipPayloadSearcher,nd=e=>e.tooltip;function sM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sM(Object(n),!0).forEach(function(r){Rxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rxe(e,t,n){return(t=Dxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dxe(e){var t=Mxe(e,"string");return typeof t=="symbol"?t:t+""}function Mxe(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 Ixe(e){if(typeof e=="string"||typeof e=="number")return e}function Lxe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function $xe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function lM(e){if(typeof e=="string")return e}function Bxe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Ixe(e.name):void 0,n="unit"in e?Lxe(e.unit):void 0,r="dataKey"in e?$xe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?lM(e.color):void 0,o="fill"in e?lM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function Uxe(e,t){return e??t}var MU=(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 S,{dataDefinedOnItem:w,settings:j}=v,k=Uxe(w,u),O=Array.isArray(k)?f6(k,f,p):k,_=(S=j?.dataKey)!==null&&S!==void 0?S:r,A=j?.nameKey,T;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&o==="axis"?T=g$(O,r,i):T=a(O,t,d,A),Array.isArray(T))T.forEach(z=>{var R,B,F=Bxe(z),q=F?.name,$=F?.dataKey,V=F?.payload,te=oM(oM({},j),{},{name:q,unit:F?.unit,color:(R=F?.color)!==null&&R!==void 0?R:j?.color,fill:(B=F?.fill)!==null&&B!==void 0?B:j?.fill});y.push(tR({tooltipEntrySettings:te,dataKey:$,payload:V,value:Hn(V,$),name:q==null?void 0:String(q)}))});else{var C;y.push(tR({tooltipEntrySettings:j,dataKey:_,payload:T,value:Hn(T,_),name:(C=Hn(T,A))!==null&&C!==void 0?C:j?.name}))}return y},m)}},yC=oe([Un,FB,Ek],$B),qxe=oe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Fxe=oe([Gn,Wu],HB),ec=oe([qxe,Un,Fxe],GB,{memoizeOptions:{resultEqualityCheck:Gv}}),Hxe=oe([ec],e=>e.filter(Mk)),IU=oe([ec],ZB,{memoizeOptions:{resultEqualityCheck:Gv}}),Kxe=oe([ec],e=>e.some(t=>!t.data)),ql=oe([IU,ta],WB),Gxe=oe([Hxe,ta,Un],iB),vC=oe([ql,Un,ec,ta,Kxe,IU],XB),LU=oe([Un],uC),Vxe=oe([Un],e=>e.allowDataOverflow),$U=oe([LU,Vxe],B6),Qxe=oe([ec],e=>e.filter(Mk)),Zxe=oe([Gxe,Qxe,Bv,W6],eU),Yxe=oe([Zxe,ta,Gn,$U],nU),Wxe=oe([ec],QB),Xxe=oe([ql,Un,Wxe,dC,Gn,yge],aU,{memoizeOptions:{resultEqualityCheck:Kv}}),Jxe=oe([sU,Gn,Wu],ed),ebe=oe([Jxe,Gn],cU),tbe=oe([oU,Gn,Wu],ed),nbe=oe([tbe,Gn],uU),rbe=oe([lU,Gn,Wu],ed),ibe=oe([rbe,Gn],dU),abe=oe([ebe,ibe,nbe],wy),sbe=oe([Un,LU,$U,Yxe,Xxe,abe,on,Gn],fU),Du=oe([Un,on,ql,vC,Bv,Gn,sbe],hU),obe=oe([Du,Un,yC],pU),lbe=oe([Un,Du,obe,Gn],mU),BU=e=>{var t=Gn(e),n=Wu(e),r=!1;return Mh(e,t,n,r)},UU=oe([Un,BU],Uv),cbe=oe([Un,yC,lbe,UU],oC),qU=oe([cbe],Ik),ube=oe([on,vC,Un,Gn],wU),dbe=oe([on,vC,Un,Gn],vU),fbe=(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?Zi(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var S=r.map(y);return Ct(S)?{coordinate:S+m,value:y,index:v,offset:m}:null}).filter(va):r.domain().map((y,v)=>{var S=r.map(y);return Ct(S)?{coordinate:S+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(va)}}},bs=oe([on,Un,yC,qU,BU,ube,dbe,Gn],fbe),xC=oe([kU,CU,yxe],(e,t,n)=>_U(n.shared,e,t)),FU=e=>e.tooltip.settings.trigger,bC=e=>e.tooltip.settings.defaultIndex,Lh=oe([nd,xC,FU,bC],TU),ch=oe([Lh,ql,Ru,Du],Rf),HU=oe([bs,ch],AU),hbe=oe([Lh],e=>{if(e)return e.dataKey}),pbe=oe([Lh],e=>{if(e)return e.graphicalItemId}),KU=oe([nd,xC,FU,bC],RU),mbe=oe([ms,gs,on,ar,bs,bC,KU],PU),gbe=oe([Lh,mbe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ybe=oe([Lh],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),vbe=oe([KU,ch,ta,Ru,HU,DU,xC],MU),xbe=oe([vbe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(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 uM(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){bbe(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 bbe(e,t,n){return(t=wbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wbe(e){var t=Sbe(e,"string");return typeof t=="symbol"?t:t+""}function Sbe(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 jbe=()=>Qe(Un),Nbe=()=>{var e=jbe(),t=Qe(bs),n=Qe(qU);return Jg(!e||!n?void 0:uM(uM({},e),{},{scale:n}),t)};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 Gc(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){kbe(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 kbe(e,t,n){return(t=Cbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cbe(e){var t=_be(e,"string");return typeof t=="symbol"?t:t+""}function _be(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 Abe=(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}},Ebe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Gc(Gc(Gc({},r),rr(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:d}=r;return Gc(Gc(Gc({},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 Obe(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 GU=(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,S=(p=n[u])===null||p===void 0?void 0:p.coordinate,w=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||S==null||w==null))if(Zi(S-v)!==Zi(w-S)){var k=[];if(Zi(w-S)===Zi(i[1]-i[0])){j=w;var O=S+i[1]-i[0];k[0]=Math.min(O,(O+v)/2),k[1]=Math.max(O,(O+v)/2)}else{j=v;var _=w+i[1]-i[0];k[0]=Math.min(S,(_+S)/2),k[1]=Math.max(S,(_+S)/2)}var A=[Math.min(S,(j+S)/2),Math.max(S,(j+S)/2)];if(e>A[0]&&e<=A[1]||e>=k[0]&&e<=k[1]){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}else{var C=Math.min(v,w),z=Math.max(v,w);if(e>(C+S)/2&&e<=(z+S)/2){var R;return(R=n[u])===null||R===void 0?void 0:R.index}}}else if(t)for(var B=0;B<o;B++){var F=t[B];if(F!=null){var q=t[B+1],$=t[B-1];if(B===0&&q!=null&&e<=(F.coordinate+q.coordinate)/2||B===o-1&&$!=null&&e>(F.coordinate+$.coordinate)/2||B>0&&B<o-1&&$!=null&&q!=null&&e>(F.coordinate+$.coordinate)/2&&e<=(F.coordinate+q.coordinate)/2)return F.index}}return-1},VU=()=>Qe(Ek),wC=(e,t)=>t,QU=(e,t,n)=>n,SC=(e,t,n,r)=>r,zbe=oe(bs,e=>wv(e,t=>t.coordinate)),jC=oe([nd,wC,QU,SC],TU),NC=oe([jC,ql,Ru,Du],Rf),Tbe=(e,t,n)=>{if(t!=null){var r=nd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},ZU=oe([nd,wC,QU,SC],RU),jy=oe([ms,gs,on,ar,bs,SC,ZU],PU),Pbe=oe([jC,jy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),YU=oe([bs,NC],AU),Rbe=oe([ZU,NC,ta,Ru,YU,DU,wC],MU),Dbe=oe([jC,NC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Mbe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&Obe(e,o)){var u=ohe(e,t),d=GU(u,a,i,n,r),f=Abe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Ibe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var u=ige(e,n);if(u){var d=lhe(u,t),f=GU(d,o,a,r,i),p=Ebe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},Lbe=(e,t,n,r,i,a,o,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Mbe(e,t,r,i,a,o,u):Ibe(e,t,n,r,i,a,o)},$be=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(Pr)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:zge}});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 hM(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){Ube(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 Ube(e,t,n){return(t=qbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qbe(e){var t=Fbe(e,"string");return typeof t=="symbol"?t:t+""}function Fbe(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 Hbe={},Kbe={zIndexMap:Object.values(Pr).reduce((e,t)=>hM(hM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Hbe)},Gbe=new Set(Object.values(Pr));function Vbe(e){return Gbe.has(e)}var WU=hr({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:Jt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Vbe(n)&&delete e.zIndexMap[n])},prepare:Jt()},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:Jt()},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:Jt()}}}),{registerZIndexPortal:Qbe,unregisterZIndexPortal:CS,registerZIndexPortalElement:Zbe,unregisterZIndexPortalElement:Ybe}=WU.actions,Wbe=WU.reducer;function To(e){var{zIndex:t,children:n}=e,r=qhe(),i=r&&t!==void 0&&t!==0,a=ii(),o=b.useRef(void 0),u=b.useRef(new Set),d=vn(),f=Qe(m=>$be(m,t,a));if(b.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(CS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(u.current.has(t)||(d(Qbe({zIndex:t})),u.current.add(t)),f){o.current=f;var y=u.current;y.forEach(v=>{v!==t&&(d(CS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),b.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(y=>{d(CS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?Kl.createPortal(n,p):null}function vj(){return vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vj.apply(null,arguments)}function pM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){Xbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xbe(e,t,n){return(t=Jbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jbe(e){var t=ewe(e,"string");return typeof t=="symbol"?t:t+""}function ewe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function twe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function nwe(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 S,w,j;if(p==="ScatterChart")S=m,w=gme,j=Pr.cursorLine;else if(p==="BarChart")S=yme(u,m,a,o),w=Qme,j=Pr.cursorRectangle;else if(u==="radial"&&x$(m)){var{cx:k,cy:O,radius:_,startAngle:A,endAngle:T}=I6(m);S={cx:k,cy:O,startAngle:A,endAngle:T,innerRadius:_,outerRadius:_},w=lge,j=Pr.cursorLine}else S={points:cge(u,m,a)},w=og,j=Pr.cursorLine;var C=typeof d=="object"&&"className"in d?d.className:void 0,z=Bm(Bm(Bm(Bm({stroke:"#ccc",pointerEvents:"none"},a),S),gv(d)),{},{payload:y,payloadIndex:v,className:Rt("recharts-tooltip-cursor",C)});return b.createElement(To,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(twe,{cursor:d,cursorComp:w,cursorProps:z}))}function rwe(e){var t=Nbe(),n=Bhe(),r=Qu(),i=VU();return t==null||n==null||r==null||i==null?null:b.createElement(nwe,vj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var XU=b.createContext(null),iwe=()=>b.useContext(XU),_S={exports:{}},mM;function awe(){return mM||(mM=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),S=n?n+f:f;return d._events[S]?d._events[S].fn?d._events[S]=[d._events[S],v]:d._events[S].push(v):(d._events[S]=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,S=new Array(v);y<v;y++)S[y]=m[y].fn;return S},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,S){var w=n?n+f:f;if(!this._events[w])return!1;var j=this._events[w],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,S),!0}for(_=1,O=new Array(k-1);_<k;_++)O[_-1]=arguments[_];j.fn.apply(j.context,O)}else{var A=j.length,T;for(_=0;_<A;_++)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 S=this._events[v];if(S.fn)S.fn===p&&(!y||S.once)&&(!m||S.context===m)&&o(this,v);else{for(var w=0,j=[],k=S.length;w<k;w++)(S[w].fn!==p||y&&!S[w].once||m&&S[w].context!==m)&&j.push(S[w]);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})(_S)),_S.exports}var swe=awe();const owe=za(swe);var uh=new owe,xj="recharts.syncEvent.tooltip",gM="recharts.syncEvent.brush",lwe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!_a(n))return e[n]}},cwe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},JU=hr({name:"options",initialState:cwe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),uwe=JU.reducer,{createEventEmitter:dwe}=JU.actions;function fwe(e){return e.tooltip.syncInteraction}var hwe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},eq=hr({name:"chartData",initialState:hwe,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:yM,setDataStartEndIndexes:pwe,setComputedData:JCe}=eq.actions,mwe=eq.reducer,gwe=["x","y"];function vM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){ywe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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)}function bwe(e,t){if(e==null)return{};var n,r,i=wwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Swe(){var e=Qe(Ok),t=Qe(zk),n=vn(),r=Qe(X6),i=Qe(bs),a=Qu(),o=Dv(),u=Qe(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return Vu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(Nf({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:S,y:w}=v,j=bwe(v,gwe),{x:k,y:O,width:_,height:A}=p.payload.sourceViewBox,T=Vc(Vc({},j),{},{x:o.x+(_?(S-k)/_:0)*o.width,y:o.y+(A?(w-O)/A:0)*o.height});n(Vc(Vc({},p),{},{payload:Vc(Vc({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var C;if(typeof r=="function"){var z={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},R=r(i,z);C=i[R]}else r==="value"&&(C=i.find(H=>String(H.value)===p.payload.label));var{coordinate:B}=p.payload;if(B==null||o==null){n(Nf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(C==null){n(Nf({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:q}=B,$=Math.min(F,o.x+o.width),V=Math.min(q,o.y+o.height),te={x:a==="horizontal"?C.coordinate:$,y:a==="horizontal"?V:C.coordinate},W=Nf({active:p.payload.active,coordinate:te,dataKey:p.payload.dataKey,index:String(C.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(W)}}};return uh.on(xj,d),()=>{uh.off(xj,d)}},[u,n,t,e,r,i,a,o])}function jwe(){var e=Qe(Ok),t=Qe(zk),n=vn();b.useEffect(()=>{if(e==null)return Vu;var r=(i,a,o)=>{t!==o&&e===i&&n(pwe(a))};return uh.on(gM,r),()=>{uh.off(gM,r)}},[n,t,e])}function Nwe(){var e=vn();b.useEffect(()=>{e(dwe())},[e]),Swe(),jwe()}function kwe(e,t,n,r,i,a){var o=Qe(S=>Tbe(S,e,t)),u=Qe(pbe),d=Qe(zk),f=Qe(Ok),p=Qe(X6),m=Qe(fwe),y=m?.sourceViewBox!=null,v=Dv();b.useEffect(()=>{if(!y&&f!=null&&d!=null){var S=Nf({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});uh.emit(xj,f,S,d)}},[y,n,o,u,i,r,d,f,p,a,v])}function xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){Cwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cwe(e,t,n){return(t=_we(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _we(e){var t=Awe(e,"string");return typeof t=="symbol"?t:t+""}function Awe(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){return e.dataKey}function Owe(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(Kpe,t)}var wM=[],zwe={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 bj(e){var t,n,r=ri(e,zwe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:S,useTranslate3d:w,wrapperStyle:j,cursor:k,shared:O,trigger:_,defaultIndex:A,portal:T,axisId:C}=r,z=vn(),R=typeof A=="number"?String(A):A;b.useEffect(()=>{z(Sxe({shared:O,trigger:_,axisId:C,active:i,defaultIndex:R}))},[z,O,_,C,i,R]);var B=Dv(),F=z6(),q=gxe(O),{activeIndex:$,isActive:V}=(t=Qe(Se=>Dbe(Se,q,_,R)))!==null&&t!==void 0?t:{},te=Qe(Se=>Rbe(Se,q,_,R)),W=Qe(Se=>YU(Se,q,_,R)),H=Qe(Se=>Pbe(Se,q,_,R)),ee=te,le=iwe(),je=(n=i??V)!==null&&n!==void 0?n:!1,[L,I]=M$([ee,je]),U=q==="axis"?W:void 0;kwe(q,_,H,U,$,je);var D=T??le;if(D==null||B==null||q==null)return null;var G=ee??wM;je||(G=wM),f&&G.length&&(G=z$(G.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),y,Ewe));var ae=G.length>0,ne=bM(bM({},r),{},{payload:G,label:U,active:je,activeIndex:$,coordinate:H,accessibilityLayer:F}),Ce=b.createElement(nme,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:p,active:je,coordinate:H,hasPayload:ae,offset:m,position:v,reverseDirection:S,useTranslate3d:w,viewBox:B,wrapperStyle:j,lastBoundingBox:L,innerRef:I,hasPortalFromProps:!!T},Owe(d,ne));return b.createElement(b.Fragment,null,Kl.createPortal(Ce,D),je&&b.createElement(rwe,{cursor:k,tooltipEventType:q,coordinate:H,payload:G,index:$}))}function Twe(e,t,n){return(t=Pwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pwe(e){var t=Rwe(e,"string");return typeof t=="symbol"?t:t+""}function Rwe(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 Dwe{constructor(t){Twe(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 SM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){Iwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iwe(e,t,n){return(t=Lwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lwe(e){var t=$we(e,"string");return typeof t=="symbol"?t:t+""}function $we(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},tq=Mwe({},Bwe),jM=new Dwe(tq.cacheSize),Uwe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},NM="recharts_measurement_span";function qwe(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 kM=(e,t)=>{try{var n=document.getElementById(NM);n||(n=document.createElement("span"),n.setAttribute("id",NM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Uwe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Df=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Eh.isSsr)return{width:0,height:0};if(!tq.enableCache)return kM(t,n);var r=qwe(t,n),i=jM.get(r);if(i)return i;var a=kM(t,n);return jM.set(r,a),a},nq;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=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 CM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_M=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Gwe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Vwe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Qwe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Zwe=["cm","mm","pt","pc","in","Q","px"];function Ywe(e){return Zwe.includes(e)}var su="NaN";function Wwe(e,t){return e*Qwe[t]}class er{static parse(t){var n,[,r,i]=(n=Vwe.exec(t))!==null&&n!==void 0?n:[];return r==null?er.NaN:new er(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,_a(t)&&(this.unit=""),n!==""&&!Gwe.test(n)&&(this.num=NaN,this.unit=""),Ywe(n)&&(this.num=Wwe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new er(NaN,""):new er(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new er(NaN,""):new er(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new er(NaN,""):new er(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new er(NaN,""):new er(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return _a(this.num)}}nq=er;Fwe(er,"NaN",new nq(NaN,""));function rq(e){if(e==null||e.includes(su))return su;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=CM.exec(t))!==null&&n!==void 0?n:[],o=er.parse(r??""),u=er.parse(a??""),d=i==="*"?o.multiply(u):o.divide(u);if(d.isNaN())return su;t=t.replace(CM,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=_M.exec(t))!==null&&f!==void 0?f:[],v=er.parse(p??""),S=er.parse(y??""),w=m==="+"?v.add(S):v.subtract(S);if(w.isNaN())return su;t=t.replace(_M,w.toString())}return t}var AM=/\(([^()]*)\)/;function Xwe(e){for(var t=e,n;(n=AM.exec(t))!=null;){var[,r]=n;t=t.replace(AM,rq(r))}return t}function Jwe(e){var t=e.replace(/\s+/g,"");return t=Xwe(t),t=rq(t),t}function eSe(e){try{return Jwe(e)}catch{return su}}function AS(e){var t=eSe(e.slice(5,-1));return t===su?"":t}var tSe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],nSe=["dx","dy","angle","className","breakAll"];function wj(){return wj=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},wj.apply(null,arguments)}function EM(e,t){if(e==null)return{};var n,r,i=rSe(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 rSe(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 iq=/[ \f\n\r\t\v\u2028\u2029]+/,aq=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];ir(t)||(n?i=t.toString().split(""):i=t.toString().split(iq));var a=i.map(u=>({word:u,width:Df(u,r).width})),o=n?0:Df(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function sq(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function iSe(e){return ir(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var oq=(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},[]),lq=e=>e.reduce((t,n)=>t.width>n.width?t:n),aSe="…",OM=(e,t,n,r,i,a,o,u)=>{var d=e.slice(0,t),f=aq({breakAll:n,style:r,children:d+aSe});if(!f)return[!1,[]];var p=oq(f.wordsWithComputedWidth,a,o,u),m=p.length>i||lq(p).width>Number(a);return[m,p]},sSe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:u,breakAll:d}=e,f=Ue(a),p=String(o),m=oq(t,r,n,i);if(!f||i)return m;var y=m.length>a||lq(m).width>Number(r);if(!y)return m;for(var v=0,S=p.length-1,w=0,j;v<=S&&w<=p.length-1;){var k=Math.floor((v+S)/2),O=k-1,[_,A]=OM(p,O,d,u,a,r,n,i),[T]=OM(p,k,d,u,a,r,n,i);if(!_&&!T&&(v=k+1),_&&T&&(S=k-1),!_&&T){j=A;break}w++}return j||m},zM=e=>{var t=ir(e)?[]:e.toString().split(iq);return[{words:t,width:void 0}]},oSe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Eh.isSsr){var u,d,f=aq({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return zM(r);return sSe({breakAll:a,children:r,maxLines:o,style:i},u,d,t,!!n)}return zM(r)},cq="#808080",lSe={angle:0,breakAll:!1,capHeight:"0.71em",fill:cq,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},kC=b.forwardRef((e,t)=>{var n=ri(e,lSe),{x:r,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=EM(n,tSe),y=b.useMemo(()=>oSe({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:S,angle:w,className:j,breakAll:k}=m,O=EM(m,nSe);if(!Aa(r)||!Aa(i)||y.length===0)return null;var _=Number(r)+(Ue(v)?v:0),A=Number(i)+(Ue(S)?S:0);if(!Ct(_)||!Ct(A))return null;var T;switch(p){case"start":T=AS("calc(".concat(o,")"));break;case"middle":T=AS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:T=AS("calc(".concat(y.length-1," * -").concat(a,")"));break}var C=[],z=y[0];if(d&&z!=null){var R=z.width,{width:B}=m;C.push("scale(".concat(Ue(B)&&Ue(R)?B/R:1,")"))}return w&&C.push("rotate(".concat(w,", ").concat(_,", ").concat(A,")")),C.length&&(O.transform=C.join(" ")),b.createElement("text",wj({},Jr(O),{ref:t,x:_,y:A,className:Rt("recharts-text",j),textAnchor:f,fill:u.includes("url")?cq:u}),y.map((F,q)=>{var $=F.words.join(k?"":" ");return b.createElement("tspan",{x:_,dy:q===0?T:a,key:"".concat($,"-").concat(q)},$)}))});kC.displayName="Text";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 da(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){cSe(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 cSe(e,t,n){return(t=uSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uSe(e){var t=dSe(e,"string");return typeof t=="symbol"?t:t+""}function dSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fSe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:u,upperWidth:d,lowerWidth:f}=wk(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,S=p+d/2,w=u>=0?1:-1,j=w*r,k=w>0?"end":"start",O=w>0?"start":"end",_=d>=0?1:-1,A=_*r,T=_>0?"end":"start",C=_>0?"start":"end",z=i;if(n==="top"){var R={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return z&&(R.height=Math.max(o-z.y,0),R.width=d),R}if(n==="bottom"){var B={x:m+f/2,y:o+u+j,horizontalAnchor:"middle",verticalAnchor:O};return z&&(B.height=Math.max(z.y+z.height-(o+u),0),B.width=f),B}if(n==="left"){var F={x:y-A,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return z&&(F.width=Math.max(F.x-z.x,0),F.height=u),F}if(n==="right"){var q={x:y+v+A,y:o+u/2,horizontalAnchor:C,verticalAnchor:"middle"};return z&&(q.width=Math.max(z.x+z.width-q.x,0),q.height=u),q}var $=z?{width:v,height:u}:{};return n==="insideLeft"?da({x:y+A,y:o+u/2,horizontalAnchor:C,verticalAnchor:"middle"},$):n==="insideRight"?da({x:y+v-A,y:o+u/2,horizontalAnchor:T,verticalAnchor:"middle"},$):n==="insideTop"?da({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:O},$):n==="insideBottom"?da({x:m+f/2,y:o+u-j,horizontalAnchor:"middle",verticalAnchor:k},$):n==="insideTopLeft"?da({x:p+A,y:o+j,horizontalAnchor:C,verticalAnchor:O},$):n==="insideTopRight"?da({x:p+d-A,y:o+j,horizontalAnchor:T,verticalAnchor:O},$):n==="insideBottomLeft"?da({x:m+A,y:o+u-j,horizontalAnchor:C,verticalAnchor:k},$):n==="insideBottomRight"?da({x:m+f-A,y:o+u-j,horizontalAnchor:T,verticalAnchor:k},$):n&&typeof n=="object"&&(Ue(n.x)||Il(n.x))&&(Ue(n.y)||Il(n.y))?da({x:a+So(n.x,v),y:o+So(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},$):da({x:S,y:o+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},hSe=["labelRef"],pSe=["content"];function PM(e,t){if(e==null)return{};var n,r,i=mSe(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 mSe(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 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 kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){gSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gSe(e,t,n){return(t=ySe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ySe(e){var t=vSe(e,"string");return typeof t=="symbol"?t:t+""}function vSe(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 rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rs.apply(null,arguments)}var uq=b.createContext(null),xSe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return b.createElement(uq.Provider,{value:d},u)},dq=()=>{var e=b.useContext(uq),t=Dv();return e||(t?wk(t):void 0)},bSe=b.createContext(null),wSe=()=>{var e=b.useContext(bSe),t=Qe(rB);return e||t},SSe=e=>{var{value:t,formatter:n}=e,r=ir(e.children)?t:e.children;return typeof n=="function"?n(r):r},CC=e=>e!=null&&typeof e=="function",jSe=(e,t)=>{var n=Zi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},NSe=(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,S=(f+p)/2,w=jSe(m,y),j=w>=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=w<=0?O:!O;var _=rr(u,d,S,k),A=rr(u,d,S,k+(O?1:-1)*359),T="M".concat(_.x,",").concat(_.y,`
288
+ A`).concat(S,",").concat(S,",0,1,").concat(O?0:1,`,
289
+ `).concat(A.x,",").concat(A.y),C=ir(e.id)?Yf("recharts-radial-line-"):e.id;return b.createElement("text",rs({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",o)}),b.createElement("defs",null,b.createElement("path",{id:C,d:T})),b.createElement("textPath",{xlinkHref:"#".concat(C)},n))},kSe=(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:S}=rr(r,i,y,f);return{x:v,y:S,textAnchor:"middle",verticalAnchor:"middle"}},lg=e=>e!=null&&"cx"in e&&Ue(e.cx),CSe={angle:0,offset:5,zIndex:Pr.label,position:"middle",textBreakAll:!1};function _Se(e){if(!lg(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function ro(e){var t=ri(e,CSe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=wSe(),y=dq(),v=i==="center"?y:m??y,S,w,j;n==null?S=v:lg(n)?S=n:S=wk(n);var k=_Se(S);if(!S||ir(a)&&ir(o)&&!b.isValidElement(u)&&typeof u!="function")return null;var O=kf(kf({},t),{},{viewBox:S});if(b.isValidElement(u)){var{labelRef:_}=O,A=PM(O,hSe);return b.cloneElement(u,A)}if(typeof u=="function"){var{content:T}=O,C=PM(O,pSe);if(w=b.createElement(u,C),b.isValidElement(w))return w}else w=SSe(t);var z=Jr(t);if(lg(S)){if(i==="insideStart"||i==="insideEnd"||i==="end")return NSe(t,i,w,z,S);j=kSe(S,t.offset,t.position)}else{if(!k)return null;var R=fSe({viewBox:k,position:i,offset:t.offset,parentViewBox:lg(r)?void 0:r});j=kf(kf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return b.createElement(To,{zIndex:t.zIndex},b.createElement(kC,rs({ref:p,className:Rt("recharts-label",d)},z,j,{textAnchor:sq(z.textAnchor)?z.textAnchor:j.textAnchor,breakAll:f}),w))}ro.displayName="Label";var ASe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(ro,rs({key:"label-implicit"},r)):Aa(e)?b.createElement(ro,rs({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===ro?b.cloneElement(e,kf({key:"label-implicit"},r)):b.createElement(ro,rs({key:"label-implicit",content:e},r)):CC(e)?b.createElement(ro,rs({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(ro,rs({},e,{key:"label-implicit"},r)):null};function ESe(e){var{label:t,labelRef:n}=e,r=dq();return ASe(t,r,n)||null}var OSe=["valueAccessor"],zSe=["dataKey","clockWise","id","textBreakAll","zIndex"];function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ny.apply(null,arguments)}function DM(e,t){if(e==null)return{};var n,r,i=TSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var PSe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(iSe(t))return t},fq=b.createContext(void 0),RSe=fq.Provider,hq=b.createContext(void 0);hq.Provider;function DSe(){return b.useContext(fq)}function MSe(){return b.useContext(hq)}function cg(e){var{valueAccessor:t=PSe}=e,n=DM(e,OSe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:u}=n,d=DM(n,zSe),f=DSe(),p=MSe(),m=f||p;return!m||!m.length?null:b.createElement(To,{zIndex:u??Pr.label},b.createElement(Ca,{className:"recharts-label-list"},m.map((y,v)=>{var S,w=ir(r)?t(y,v):Hn(y.payload,r),j=ir(a)?{}:{id:"".concat(a,"-").concat(v)};return b.createElement(ro,Ny({key:"label-".concat(v)},Jr(y),d,j,{fill:(S=n.fill)!==null&&S!==void 0?S:y.fill,parentViewBox:y.parentViewBox,value:w,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}cg.displayName="LabelList";function ISe(e){var{label:t}=e;return t?t===!0?b.createElement(cg,{key:"labelList-implicit"}):b.isValidElement(t)||CC(t)?b.createElement(cg,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(cg,Ny({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Sj(){return Sj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sj.apply(null,arguments)}var pq=e=>{var{cx:t,cy:n,r,className:i}=e,a=Rt("recharts-dot",i);return Ue(t)&&Ue(n)&&Ue(r)?b.createElement("circle",Sj({},ka(e),dk(e),{className:a,cx:t,cy:n,r})):null},LSe={radiusAxis:{},angleAxis:{}},mq=hr({name:"polarAxis",initialState:LSe,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:e_e,removeRadiusAxis:t_e,addAngleAxis:n_e,removeAngleAxis:r_e}=mq.actions,$Se=mq.reducer;function BSe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var gq=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function USe(e){var{tooltipEntrySettings:t}=e,n=vn(),r=ii(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(xxe(t)):i.current!==t&&n(bxe({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(wxe(i.current)),i.current=null)},[n]),null}function qSe(e){var{legendPayload:t}=e,n=vn(),r=ii(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(npe(t)):i.current!==t&&n(rpe({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(ipe(i.current)),i.current=null)},[n]),null}var ES,FSe=()=>{var[e]=b.useState(()=>Yf("uid-"));return e},HSe=(ES=Py.useId)!==null&&ES!==void 0?ES:FSe;function KSe(e,t){var n=HSe();return t||(e?"".concat(e,"-").concat(n):n)}var GSe=b.createContext(void 0),VSe=e=>{var{id:t,type:n,children:r}=e,i=KSe("recharts-".concat(n),t);return b.createElement(GSe.Provider,{value:i},r(i))},QSe={cartesianItems:[],polarItems:[]},yq=hr({name:"graphicalItems",initialState:QSe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Jt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Jt()},removeCartesianGraphicalItem:{reducer(e,t){var n=ki(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Jt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Jt()},removePolarGraphicalItem:{reducer(e,t){var n=ki(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Jt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ki(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Jt()}}}),{addCartesianGraphicalItem:ZSe,replaceCartesianGraphicalItem:YSe,removeCartesianGraphicalItem:WSe,addPolarGraphicalItem:i_e,removePolarGraphicalItem:a_e,replacePolarGraphicalItem:s_e}=yq.actions,XSe=yq.reducer,JSe=e=>{var t=vn(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(ZSe(e)):n.current!==e&&t(YSe({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(WSe(n.current)),n.current=null)},[t]),null},e1e=b.memo(JSe),t1e=["points"];function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){n1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n1e(e,t,n){return(t=r1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r1e(e){var t=i1e(e,"string");return typeof t=="symbol"?t:t+""}function i1e(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 ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ky.apply(null,arguments)}function a1e(e,t){if(e==null)return{};var n,r,i=s1e(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 s1e(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 o1e(e){var{option:t,dotProps:n,className:r}=e;if(b.isValidElement(t))return b.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Rt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,u=a1e(a,t1e);return b.createElement(pq,ky({},u,{className:i}))}function l1e(e,t){return e==null?!1:t?!0:e.length===1}function c1e(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:d,zIndex:f=Pr.scatter}=e;if(!l1e(t,n))return null;var p=gq(n),m=Fce(n),y=t.map((S,w)=>{var j,k,O=OS(OS(OS({r:3},o),m),{},{index:w,cx:(j=S.x)!==null&&j!==void 0?j:void 0,cy:(k=S.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:S.value,payload:S.payload,points:t});return b.createElement(o1e,{key:"dot-".concat(w),option:n,dotProps:O,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),b.createElement(To,{zIndex:f},b.createElement(Ca,ky({className:r},v),y))}function IM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(r){u1e(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 u1e(e,t,n){return(t=d1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d1e(e){var t=f1e(e,"string");return typeof t=="symbol"?t:t+""}function f1e(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 vq=0,h1e={xAxis:{},yAxis:{},zAxis:{}},xq=hr({name:"cartesianAxis",initialState:h1e,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Jt()},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:Jt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Jt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Jt()},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:Jt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Jt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Jt()},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:Jt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Jt()},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]=LM(LM({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:p1e,replaceXAxis:m1e,removeXAxis:g1e,addYAxis:y1e,replaceYAxis:v1e,removeYAxis:x1e,addZAxis:o_e,replaceZAxis:l_e,removeZAxis:c_e,updateYAxisWidth:b1e}=xq.actions,w1e=xq.reducer,S1e=oe([ar],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),j1e=oe([S1e,ms,gs],(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)}}),_C=()=>Qe(j1e),N1e=()=>Qe(xbe);function $M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){k1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k1e(e,t,n){return(t=C1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C1e(e){var t=_1e(e,"string");return typeof t=="symbol"?t:t+""}function _1e(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 A1e=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=zS(zS(zS({},u),gv(i)),dk(i)),f;return b.isValidElement(i)?f=b.cloneElement(i,d):typeof i=="function"?f=i(d):f=b.createElement(pq,d),b.createElement(Ca,{className:"recharts-active-dot",clipPath:o},f)};function BM(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Pr.activeDot}=e,u=Qe(ch),d=N1e();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return ir(f)?null:b.createElement(To,{zIndex:o},b.createElement(A1e,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var E1e=e=>{var{chartData:t}=e,n=vn(),r=ii();return b.useEffect(()=>r?()=>{}:(n(yM(t)),()=>{n(yM(void 0))}),[t,n,r]),null},UM={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},bq=hr({name:"brush",initialState:UM,reducers:{setBrushSettings(e,t){return t.payload==null?UM:t.payload}}}),{setBrushSettings:u_e}=bq.actions,O1e=bq.reducer;function z1e(e){return(e%180+180)%180}var T1e=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=z1e(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)},P1e={dots:[],areas:[],lines:[]},wq=hr({name:"referenceElements",initialState:P1e,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:d_e,removeDot:f_e,addArea:h_e,removeArea:p_e,addLine:m_e,removeLine:g_e}=wq.actions,R1e=wq.reducer,D1e=b.createContext(void 0),M1e=e=>{var{children:t}=e,[n]=b.useState("".concat(Yf("recharts"),"-clip")),r=_C();if(r==null)return null;var{x:i,y:a,width:o,height:u}=r;return b.createElement(D1e.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:o}))),t)};function Sq(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 I1e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return T1e(r,n)}function L1e(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 dh(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 $1e(e,t){return Sq(e,t+1)}function B1e(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:u}=t,d=0,f=1,p=o,m=function(){var S=r?.[d];if(S===void 0)return{v:Sq(r,f)};var w=d,j,k=()=>(j===void 0&&(j=n(S,w)),j),O=S.coordinate,_=d===0||dh(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 U1e(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 A=r[w];if(A==null)return 0;var T=w,C,z=()=>(C===void 0&&(C=n(A,T)),C),R=A.coordinate,B=w===p||dh(e,R,z,m,d);if(!B)return y=!1,1;B&&(m=R+e*(z()/2+i))},S,w=p;w<o&&(S=v(),!(S!==0&&S===1));w+=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){q1e(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 q1e(e,t,n){return(t=F1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F1e(e){var t=H1e(e,"string");return typeof t=="symbol"?t:t+""}function H1e(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 K1e(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 S=v,w,j=()=>(w===void 0&&(w=n(v,y)),w);if(y===o-1){var k=e*(S.coordinate+e*j()/2-d);a[y]=S=lr(lr({},S),{},{tickCoord:k>0?S.coordinate-k*e:S.coordinate})}else a[y]=S=lr(lr({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var O=dh(e,S.tickCoord,j,u,d);O&&(d=S.tickCoord-e*(j()/2+i),a[y]=lr(lr({},S),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function G1e(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=dh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[u-1]=lr(lr({},p),{},{isShow:!0}))}}}for(var S=a?u-1:u,w=function(O){var _=o[O];if(_==null)return 1;var A=_,T,C=()=>(T===void 0&&(T=n(_,O)),T);if(O===0){var z=e*(A.coordinate-e*C()/2-d);o[O]=A=lr(lr({},A),{},{tickCoord:z<0?A.coordinate-z*e:A.coordinate})}else o[O]=A=lr(lr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var R=dh(e,A.tickCoord,C,d,f);R&&(d=A.tickCoord+e*(C()/2+i),o[O]=lr(lr({},A),{},{isShow:!0}))}},j=0;j<S;j++)w(j);return o}function V1e(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(Ue(d)||Eh.isSsr){var y;return(y=$1e(i,Ue(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],S=u==="top"||u==="bottom"?"width":"height",w=p&&S==="width"?Df(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(T,C)=>{var z=typeof f=="function"?f(T.value,C):T.value;return S==="width"?I1e(Df(z,{fontSize:t,letterSpacing:n}),w,m):Df(z,{fontSize:t,letterSpacing:n})[S]},k=i[0],O=i[1],_=i.length>=2&&k!=null&&O!=null?Zi(O.coordinate-k.coordinate):1,A=L1e(a,_,S);return d==="equidistantPreserveStart"?B1e(_,A,j,i,o):d==="equidistantPreserveEnd"?U1e(_,A,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=G1e(_,A,j,i,o,d==="preserveStartEnd"):v=K1e(_,A,j,i,o),v.filter(T=>T.isShow))}var Q1e=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},Z1e={xAxis:{},yAxis:{}},jq=hr({name:"renderedTicks",initialState:Z1e,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:Y1e,removeRenderedTicks:W1e}=jq.actions,X1e=jq.reducer,J1e=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function eje(e,t){if(e==null)return{};var n,r,i=tje(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 tje(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 Fl(){return Fl=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},Fl.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){nje(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 nje(e,t,n){return(t=rje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rje(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)}var Cl={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:Pr.axis};function aje(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),ka(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 b.createElement("line",Fl({},f,{className:Rt("recharts-cartesian-axis-line",bv(u,"className"))}))}function sje(e,t,n,r,i,a,o,u,d){var f,p,m,y,v,S,w=u?-1:1,j=e.tickSize||o,k=Ue(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!u*i,m=y-w*j,S=m-w*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!u*r,f=p-w*j,v=f-w*d,S=k;break;case"right":m=y=e.coordinate,p=t+ +u*r,f=p+w*j,v=f+w*d,S=k;break;default:f=p=e.coordinate,y=n+ +u*i,m=y+w*j,S=m+w*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:S}}}function oje(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function lje(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function cje(e){var{option:t,tickProps:n,value:r}=e,i,a=Rt(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.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=Rt(o,BSe(t))),i=b.createElement(kC,Fl({},n,{className:o}),r)}return i}function uje(e){var{ticks:t,axisType:n,axisId:r}=e,i=vn();return b.useEffect(()=>{if(r==null||n==null)return Vu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(Y1e({ticks:a,axisId:r,axisType:n})),()=>{i(W1e({axisId:r,axisType:n}))}},[i,t,r,n]),null}var dje=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:S,height:w,tickSize:j,tickMargin:k,fontSize:O,letterSpacing:_,getTicksConfig:A,events:T,axisType:C,axisId:z}=e,R=V1e(gn(gn({},A),{},{ticks:n}),O,_),B=ka(A),F=gv(r),q=sq(B.textAnchor)?B.textAnchor:oje(p,m),$=lje(p,m),V={};typeof i=="object"&&(V=i);var te=gn(gn({},B),{},{fill:"none"},V),W=R.map(le=>gn({entry:le},sje(le,y,v,S,w,p,j,m,k))),H=W.map(le=>{var{entry:je,line:L}=le;return b.createElement(Ca,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(je.value,"-").concat(je.coordinate,"-").concat(je.tickCoord)},i&&b.createElement("line",Fl({},te,L,{className:Rt("recharts-cartesian-axis-tick-line",bv(i,"className"))})))}),ee=W.map((le,je)=>{var L,I,{entry:U,tick:D}=le,G=gn(gn(gn(gn({verticalAnchor:$},B),{},{textAnchor:q,stroke:"none",fill:a},D),{},{index:je,payload:U,visibleTicksCount:R.length,tickFormatter:o,padding:d},f),{},{angle:(L=(I=f?.angle)!==null&&I!==void 0?I:B.angle)!==null&&L!==void 0?L:0}),ae=gn(gn({},G),F);return b.createElement(Ca,Fl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},b$(T,U,je)),r&&b.createElement(cje,{option:r,tickProps:ae,value:"".concat(typeof o=="function"?o(U.value,je):U.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(C,"-ticks")},b.createElement(uje,{ticks:R,axisId:z,axisType:C}),ee.length>0&&b.createElement(To,{zIndex:Pr.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(C,"-tick-labels"),ref:t},ee)),H.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(C,"-tick-lines")},H))}),fje=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:u,axisType:d,axisId:f}=e,p=eje(e,J1e),[m,y]=b.useState(""),[v,S]=b.useState(""),w=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return Q1e({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=b.useCallback(k=>{if(k){var O=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=O;var _=O[0];if(_){var A=window.getComputedStyle(_),T=A.fontSize,C=A.letterSpacing;(T!==m||C!==v)&&(y(T),S(C))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(To,{zIndex:e.zIndex},b.createElement(Ca,{className:Rt("recharts-cartesian-axis",a)},b.createElement(aje,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ka(e)}),b.createElement(dje,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),b.createElement(xSe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(ESe,{label:e.label,labelRef:e.labelRef}),e.children)))}),AC=b.forwardRef((e,t)=>{var n=ri(e,Cl);return b.createElement(fje,Fl({},n,{ref:t}))});AC.displayName="CartesianAxis";var hje={},Nq=hr({name:"errorBars",initialState:hje,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:y_e,replaceErrorBar:v_e,removeErrorBar:x_e}=Nq.actions,pje=Nq.reducer;function kq(e,t){var n,r,i=Qe(f=>vs(f,e)),a=Qe(f=>xs(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:In.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Ln.allowDataOverflow,d=o||u;return{needClip:d,needClipX:o,needClipY:u}}function mje(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=_C(),{needClipX:a,needClipY:o,needClip:u}=kq(t,n);if(!u||!i)return null;var{x:d,y:f,width:p,height:m}=i;return b.createElement("clipPath",{id:"clipPath-".concat(r)},b.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function gje(e){var t=gv(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 EC(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:vq}function OC(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:vq}var Cq=(e,t,n)=>NU(e,"xAxis",EC(e,t),n),_q=(e,t,n)=>jU(e,"xAxis",EC(e,t),n),Aq=(e,t,n)=>NU(e,"yAxis",OC(e,t),n),Eq=(e,t,n)=>jU(e,"yAxis",OC(e,t),n),yje=oe([on,Cq,Aq,_q,Eq],(e,t,n,r,i)=>Pa(e,"xAxis")?Jg(t,r,!1):Jg(n,i,!1)),vje=(e,t)=>t,Oq=oe([KB,vje],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),zq=e=>{var t=on(e),n=Pa(t,"xAxis");return n?"yAxis":"xAxis"},xje=(e,t)=>{var n=zq(e);return n==="yAxis"?OC(e,t):EC(e,t)},bje=(e,t,n)=>tU(e,zq(e),xje(e,t),n),wje=oe([Oq,bje],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Dk(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]])}}}),Sje=oe([on,Cq,Aq,_q,Eq,wje,mge,yje,Oq,Nge],(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,S;if(v&&v.length>0?S=v:S=p?.slice(m,y+1),S!=null)return qje({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:S,chartBaseValue:f,bandSize:u})}}),jje=["id"],Nje=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function _l(){return _l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_l.apply(null,arguments)}function Tq(e,t){if(e==null)return{};var n,r,i=kje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function 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 ou(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){Cje(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 Cje(e,t,n){return(t=_je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _je(e){var t=Aje(e,"string");return typeof t=="symbol"?t:t+""}function Aje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cy(e,t){return e&&e!=="none"?e:t}var Eje=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Cy(r,i),value:h6(n,t),payload:e}]},Oje=b.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Vu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:h6(o,t),hide:u,type:f,color:Cy(r,a),unit:d,graphicalItemId:p}};return b.createElement(USe,{tooltipEntrySettings:m})});function zje(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,u=ka(r);return b.createElement(c1e,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function Tje(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,u,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ou(ou({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return b.createElement(RSe,{value:t?i:void 0},n)}function KM(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=Tq(a,jje),v=ka(y),S=Jr(y);return b.createElement(b.Fragment,null,t?.length>1&&b.createElement(Ca,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},b.createElement(og,_l({},S,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&b.createElement(og,_l({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&b.createElement(og,_l({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:n}))),b.createElement(zje,{points:t,props:y,clipPathId:i}))}function Pje(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!Ct(u)||!Ct(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Ue(p)?b.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function Rje(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(!Ct(u)||!Ct(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Ue(p)?b.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function Dje(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?b.createElement(Pje,{alpha:t,points:r,baseLine:i,strokeWidth:a}):b.createElement(Rje,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Mje(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,S=b.useMemo(()=>({points:o,baseLine:u}),[o,u]),w=M6(S,"recharts-area-"),j=Sk(),[k,O]=b.useState(!1),_=!k,A=b.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),T=b.useCallback(()=>{typeof y=="function"&&y(),O(!0)},[y]);if(j==null)return null;var C=i.current,z=a.current;return b.createElement(Tje,{showLabels:_,points:o},r.children,b.createElement(D6,{animationId:w,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:A,onAnimationStart:T,key:w},R=>{if(C){var B=C.length/o.length,F=R===1?o:o.map(($,V)=>{var te=Math.floor(V*B);if(C[te]){var W=C[te];return ou(ou({},$),{},{x:ma(W.x,$.x,R),y:ma(W.y,$.y,R)})}return $}),q;return Ue(u)?q=ma(z,u,R):ir(u)||_a(u)?q=ma(z,0,R):q=u.map(($,V)=>{var te=Math.floor(V*B);if(Array.isArray(z)&&z[te]){var W=z[te];return ou(ou({},$),{},{x:ma(W.x,$.x,R),y:ma(W.y,$.y,R)})}return $}),R>0&&(i.current=F,a.current=q),b.createElement(KM,{points:F,baseLine:q,needClip:t,clipPathId:n,props:r})}return R>0&&(i.current=o,a.current=u),b.createElement(Ca,null,d&&b.createElement("defs",null,b.createElement("clipPath",{id:"animationClipPath-".concat(n)},b.createElement(Dje,{alpha:R,points:o,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),b.createElement(Ca,{clipPath:"url(#animationClipPath-".concat(n,")")},b.createElement(KM,{points:o,baseLine:u,needClip:t,clipPathId:n,props:r})))}),b.createElement(ISe,{label:r.label}))}function Ije(e){var{needClip:t,clipPathId:n,props:r}=e,i=b.useRef(null),a=b.useRef();return b.createElement(Mje,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Lje extends b.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:S}=this.props;if(t)return null;var w=Rt("recharts-area",i),j=y,{r:k,strokeWidth:O}=gje(n),_=gq(n),A=k*2+O,T=u?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return b.createElement(To,{zIndex:S},b.createElement(Ca,{className:w},u&&b.createElement("defs",null,b.createElement(mje,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&b.createElement("clipPath",{id:"clipPath-dots-".concat(j)},b.createElement("rect",{x:o-A/2,y:a-A/2,width:p+A,height:m+A}))),b.createElement(Ije,{needClip:u,clipPathId:j,props:this.props})),b.createElement(BM,{points:r,mainColor:Cy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&b.createElement(BM,{points:v,mainColor:Cy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var $je={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:Pr.area};function Bje(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:S,yAxisId:w}=e,j=Tq(e,Nje),k=Qu(),O=VU(),{needClip:_}=kq(S,w),A=ii(),{points:T,isRange:C,baseLine:z}=(t=Qe(V=>Sje(V,e.id,A)))!==null&&t!==void 0?t:{},R=_C();if(k!=="horizontal"&&k!=="vertical"||R==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:B,width:F,x:q,y:$}=R;return!T||!T.length?null:b.createElement(Lje,_l({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:z,connectNulls:o,dot:u,fill:d,fillOpacity:f,height:B,hide:p,layout:k,isAnimationActive:m,isRange:C,legendType:y,needClip:_,points:T,stroke:v,width:F,left:q,top:$,xAxisId:S,yAxisId:w}))}var Uje=(e,t,n,r,i)=>{var a=n??t;if(Ue(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,S=i&&i.length,w=Uje(a,o,n,u,d),j=a==="horizontal",k=!1,O=f.map((A,T)=>{var C,z,R,B;if(S)B=i[p+T];else{var F=Hn(A,r);Array.isArray(F)?(B=F,k=!0):B=[w,F]}var q=(C=(z=B)===null||z===void 0?void 0:z[1])!==null&&C!==void 0?C:null,$=q==null||S&&!t&&Hn(A,r)==null;if(j){var V;return{x:XP({axis:u,ticks:m,bandSize:v,entry:A,index:T}),y:$?null:(V=d.scale.map(q))!==null&&V!==void 0?V:null,value:B,payload:A}}return{x:$?null:(R=u.scale.map(q))!==null&&R!==void 0?R:null,y:XP({axis:d,ticks:y,bandSize:v,entry:A,index:T}),value:B,payload:A}}),_;return S||k?_=O.map(A=>{var T,C=Array.isArray(A.value)?A.value[0]:null;if(j){var z;return{x:A.x,y:C!=null&&A.y!=null&&(z=d.scale.map(C))!==null&&z!==void 0?z:null,payload:A.payload}}return{x:C!=null&&(T=u.scale.map(C))!==null&&T!==void 0?T:null,y:A.y,payload:A.payload}}):_=j?d.scale.map(w):u.scale.map(w),{points:O,baseLine:_??0,isRange:k}}function Fje(e){var t=ri(e,$je),n=ii();return b.createElement(VSe,{id:t.id,type:"area"},r=>b.createElement(b.Fragment,null,b.createElement(qSe,{legendPayload:Eje(t)}),b.createElement(Oje,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),b.createElement(e1e,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:rhe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),b.createElement(Bje,_l({},t,{id:r}))))}var lu=b.memo(Fje,Ah);lu.displayName="Area";var Hje=["domain","range"],Kje=["domain","range"];function GM(e,t){if(e==null)return{};var n,r,i=Gje(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 Gje(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 VM(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 Pq(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=GM(e,Hje),{domain:a,range:o}=t,u=GM(t,Kje);return!VM(n,a)||!VM(r,o)?!1:Ah(i,u)}var Vje=["type"],Qje=["dangerouslySetInnerHTML","ticks","scale"],Zje=["id","scale"];function jj(){return jj=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},jj.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 ZM(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){Yje(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 Yje(e,t,n){return(t=Wje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wje(e){var t=Xje(e,"string");return typeof t=="symbol"?t:t+""}function Xje(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 Nj(e,t){if(e==null)return{};var n,r,i=Jje(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 Jje(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 eNe(e){var t=vn(),n=b.useRef(null),r=Sk(),{type:i}=e,a=Nj(e,Vje),o=qv(r,"xAxis",i),u=b.useMemo(()=>{if(o!=null)return ZM(ZM({},a),{},{type:o})},[a,o]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(p1e(u)):n.current!==u&&t(m1e({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(g1e(n.current)),n.current=null)},[t]),null}var tNe=e=>{var{xAxisId:t,className:n}=e,r=Qe(m6),i=ii(),a="xAxis",o=Qe(k=>SU(k,a,t,i)),u=Qe(k=>exe(k,t)),d=Qe(k=>sxe(k,t)),f=Qe(k=>UB(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=Nj(e,Qje),{id:S,scale:w}=f,j=Nj(f,Zje);return b.createElement(AC,jj({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:Rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},nNe={allowDataOverflow:In.allowDataOverflow,allowDecimals:In.allowDecimals,allowDuplicatedCategory:In.allowDuplicatedCategory,angle:In.angle,axisLine:Cl.axisLine,height:In.height,hide:!1,includeHidden:In.includeHidden,interval:In.interval,label:!1,minTickGap:In.minTickGap,mirror:In.mirror,orientation:In.orientation,padding:In.padding,reversed:In.reversed,scale:In.scale,tick:In.tick,tickCount:In.tickCount,tickLine:Cl.tickLine,tickSize:Cl.tickSize,type:In.type,niceTicks:In.niceTicks,xAxisId:0},rNe=e=>{var t=ri(e,nNe);return b.createElement(b.Fragment,null,b.createElement(eNe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),b.createElement(tNe,t))},_y=b.memo(rNe,Pq);_y.displayName="XAxis";var iNe=["type"],aNe=["dangerouslySetInnerHTML","ticks","scale"],sNe=["id","scale"];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 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){oNe(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 oNe(e,t,n){return(t=lNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lNe(e){var t=cNe(e,"string");return typeof t=="symbol"?t:t+""}function cNe(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 Cj(e,t){if(e==null)return{};var n,r,i=uNe(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 uNe(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 dNe(e){var t=vn(),n=b.useRef(null),r=Sk(),{type:i}=e,a=Cj(e,iNe),o=qv(r,"yAxis",i),u=b.useMemo(()=>{if(o!=null)return WM(WM({},a),{},{type:o})},[o,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(y1e(u)):n.current!==u&&t(v1e({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(x1e(n.current)),n.current=null)},[t]),null}function fNe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),o=b.useRef(null),u=Qe(m6),d=ii(),f=vn(),p="yAxis",m=Qe(C=>cxe(C,t)),y=Qe(C=>lxe(C,t)),v=Qe(C=>SU(C,p,t,d)),S=Qe(C=>qB(C,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||CC(i)||b.isValidElement(i)||S==null)){var C=a.current;if(C){var z=C.getCalculatedWidth();Math.round(m.width)!==Math.round(z)&&f(b1e({id:t,width:z}))}}},[v,m,f,i,t,r,S]),m==null||y==null||S==null)return null;var{dangerouslySetInnerHTML:w,ticks:j,scale:k}=e,O=Cj(e,aNe),{id:_,scale:A}=S,T=Cj(S,sNe);return b.createElement(AC,kj({},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:Rt("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var hNe={allowDataOverflow:Ln.allowDataOverflow,allowDecimals:Ln.allowDecimals,allowDuplicatedCategory:Ln.allowDuplicatedCategory,angle:Ln.angle,axisLine:Cl.axisLine,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:Cl.tickLine,tickSize:Cl.tickSize,type:Ln.type,niceTicks:Ln.niceTicks,width:Ln.width,yAxisId:0},pNe=e=>{var t=ri(e,hNe);return b.createElement(b.Fragment,null,b.createElement(dNe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),b.createElement(fNe,t))},Ay=b.memo(pNe,Pq);Ay.displayName="YAxis";var mNe=(e,t)=>t,zC=oe([mNe,on,rB,Gn,UU,bs,zbe,ar],Lbe);function gNe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function TC(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(gNe(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 Rq=ei("mouseClick"),Dq=Nh();Dq.startListening({actionCreator:Rq,effect:(e,t)=>{var n=e.payload,r=zC(t.getState(),TC(n));r?.activeIndex!=null&&t.dispatch(Nxe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var _j=ei("mouseMove"),Mq=Nh(),Qc=null,nl=null,TS=null;Mq.startListening({actionCreator:_j,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Qc!==null&&(cancelAnimationFrame(Qc),Qc=null),nl!==null&&(typeof i!="number"||!o)&&(clearTimeout(nl),nl=null),TS=TC(n);var u=()=>{var d=t.getState(),f=Ih(d,d.tooltip.settings.shared);if(!TS){Qc=null,nl=null;return}if(f==="axis"){var p=zC(d,TS);p?.activeIndex!=null?t.dispatch(zU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(OU())}Qc=null,nl=null};if(!o){u();return}i==="raf"?Qc=requestAnimationFrame(u):typeof i=="number"&&nl===null&&(nl=setTimeout(u,i))}});function yNe(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 XM={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},Iq=hr({name:"rootProps",initialState:XM,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:XM.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}}}),vNe=Iq.reducer,{updateOptions:xNe}=Iq.actions,bNe=null,wNe={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)},Lq=hr({name:"polarOptions",initialState:bNe,reducers:wNe}),{updatePolarOptions:b_e}=Lq.actions,SNe=Lq.reducer,$q=ei("keyDown"),Bq=ei("focus"),Uq=ei("blur"),n0=Nh(),Zc=null,rl=null,Um=null;n0.startListening({actionCreator:$q,effect:(e,t)=>{Um=e.payload,Zc!==null&&(cancelAnimationFrame(Zc),Zc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");rl!==null&&(typeof r!="number"||!a)&&(clearTimeout(rl),rl=null);var o=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=Um;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=Rf(f,ql(u),Ru(u),Du(u)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,S=bs(u),w=ql(u),j=Ih(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=jy(u,j,"hover",String(f.index));t.dispatch(Sy({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var O=pxe(u),_=O==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,T;if(v){var C=Ru(u),z=Du(u),R=A*_,B=te=>({active:!1,index:String(te),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,R>0){for(var F=0;F<w.length;F++)if(Rf(B(F),w,C,z)!=null){T=F;break}}else for(var q=w.length-1;q>=0;q--)if(Rf(B(q),w,C,z)!=null){T=q;break}if(T<0)return}else{T=y+A*_;var $=S?.length||w.length;if($===0||T>=$||T<0)return}var V=jy(u,j,"hover",String(T));t.dispatch(Sy({active:!0,activeIndex:T.toString(),activeCoordinate:V}))}finally{Zc=null,rl=null}};if(!a){o();return}r==="raf"?Zc=requestAnimationFrame(o):typeof r=="number"&&rl===null&&(o(),Um=null,rl=setTimeout(()=>{Um?o():(rl=null,Zc=null)},r))}});n0.startListening({actionCreator:Bq,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=Ih(n,n.tooltip.settings.shared),u=jy(n,o,"hover",String(a));t.dispatch(Sy({active:!0,activeIndex:a,activeCoordinate:u}))}}}});n0.startListening({actionCreator:Uq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Sy({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function qq(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=ei("externalEvent"),Fq=Nh(),qm=new Map,vf=new Map,PS=new Map;Fq.startListening({actionCreator:xi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=qq(r);PS.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=vf.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),vf.delete(i));var v=()=>{var j=PS.get(i);try{if(!j)return;var{handler:k,reactEvent:O}=j,_=t.getState(),A={activeCoordinate:gbe(_),activeDataKey:hbe(_),activeIndex:ch(_),activeLabel:HU(_),activeTooltipIndex:ch(_),isTooltipActive:ybe(_)};k&&k(A,O)}finally{qm.delete(i),vf.delete(i),PS.delete(i)}};if(!m){v();return}if(d==="raf"){var S=requestAnimationFrame(v);qm.set(i,S)}else if(typeof d=="number"){if(!vf.has(i)){v();var w=setTimeout(v,d);vf.set(i,w)}}else v()}}});var jNe=oe([nd],e=>e.tooltipItemPayloads),NNe=oe([jNe,(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)}}}),Hq=ei("touchMove"),Kq=Nh(),il=null,Xs=null,JM=null,xf=null;Kq.startListening({actionCreator:Hq,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){xf=qq(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");il!==null&&(cancelAnimationFrame(il),il=null),Xs!==null&&(typeof i!="number"||!o)&&(clearTimeout(Xs),Xs=null),JM=Array.from(n.touches).map(d=>TC({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(xf!=null){var d=t.getState(),f=Ih(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=JM)===null||p===void 0?void 0:p[0];if(m==null){il=null,Xs=null;return}var y=zC(d,m);y?.activeIndex!=null&&t.dispatch(zU({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,S=xf.touches[0];if(document.elementFromPoint==null||S==null)return;var w=document.elementFromPoint(S.clientX,S.clientY);if(!w||!w.getAttribute)return;var j=w.getAttribute(uhe),k=(v=w.getAttribute(dhe))!==null&&v!==void 0?v:void 0,O=ec(d).find(T=>T.id===k);if(j==null||O==null||k==null)return;var{dataKey:_}=O,A=NNe(d,j,k);t.dispatch(jxe({activeDataKey:_,activeIndex:j,activeCoordinate:A,activeGraphicalItemId:k}))}il=null,Xs=null}};if(!o){u();return}i==="raf"?il=requestAnimationFrame(u):typeof i=="number"&&Xs===null&&(u(),xf=null,Xs=setTimeout(()=>{xf?u():(Xs=null,il=null)},i))}}});var Gq={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Vq=hr({name:"eventSettings",initialState:Gq,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:kNe}=Vq.actions,CNe=Vq.reducer,_Ne=L$({brush:O1e,cartesianAxis:w1e,chartData:mwe,errorBars:pje,eventSettings:CNe,graphicalItems:XSe,layout:Qfe,legend:ape,options:uwe,polarAxis:$Se,polarOptions:SNe,referenceElements:R1e,renderedTicks:X1e,rootProps:vNe,tooltip:kxe,zIndex:Wbe}),ANe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return xfe({reducer:_Ne,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([Dq.middleware,Mq.middleware,n0.middleware,Fq.middleware,Kq.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(J$({type:"raf"}))},devTools:{serialize:{replacer:yNe},name:"recharts-".concat(n)}})};function ENe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=ii(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=ANe(t,r));var o=hk;return b.createElement(jpe,{context:o,store:a.current},n)}function ONe(e){var{layout:t,margin:n}=e,r=vn(),i=ii();return b.useEffect(()=>{i||(r(Kfe(t)),r(Hfe(n)))},[r,i,t,n]),null}var zNe=b.memo(ONe,Ah);function TNe(e){var t=vn();return b.useEffect(()=>{t(xNe(e))},[t,e]),null}var PNe=e=>{var t=vn();return b.useEffect(()=>{t(kNe(e))},[t,e]),null},RNe=b.memo(PNe,Ah);function eI(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=vn();return b.useLayoutEffect(()=>(r.current&&i(Zbe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Ybe({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function tI(e){var{children:t,isPanorama:n}=e,r=Qe(Bbe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return b.createElement(b.Fragment,null,i.map(o=>b.createElement(eI,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>b.createElement(eI,{key:o,zIndex:o,isPanorama:n})))}var DNe=["children"];function MNe(e,t){if(e==null)return{};var n,r,i=INe(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 INe(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 Ey(){return Ey=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},Ey.apply(null,arguments)}var LNe={width:"100%",height:"100%",display:"block"},$Ne=b.forwardRef((e,t)=>{var n=x6(),r=b6(),i=z6();if(!jo(n)||!jo(r))return null;var{children:a,otherAttributes:o,title:u,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),b.createElement(ik,Ey({},o,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:LNe,ref:t}),a)}),BNe=e=>{var{children:t}=e,n=Qe(Rv);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return b.createElement(ik,{width:r,height:i,x:o,y:a},t)},nI=b.forwardRef((e,t)=>{var{children:n}=e,r=MNe(e,DNe),i=ii();return i?b.createElement(BNe,null,b.createElement(tI,{isPanorama:!0},n)):b.createElement($Ne,Ey({ref:t},r),b.createElement(tI,{isPanorama:!1},n))});function UNe(){var e=vn(),[t,n]=b.useState(null),r=Qe(che);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Ct(a)&&a!==r&&e(Vfe(a))}},[t,e,r]),n}function rI(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?rI(Object(n),!0).forEach(function(r){FNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FNe(e,t,n){return(t=HNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HNe(e){var t=KNe(e,"string");return typeof t=="symbol"?t:t+""}function KNe(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 yo(){return yo=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},yo.apply(null,arguments)}var GNe=()=>(Nwe(),null);function Oy(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var VNe=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,o]=b.useState({containerWidth:Oy((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Oy((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=b.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();u(p,m);var y=S=>{var w=S[0];if(w!=null){var{width:j,height:k}=w.contentRect;u(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,u]);return b.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(Ch,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",yo({ref:d},e)))}),QNe=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:Oy(n),containerHeight:Oy(r)}),o=b.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return b.createElement(b.Fragment,null,b.createElement(Ch,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",yo({ref:u},e)))}),ZNe=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(Ch,{width:n,height:r}),b.createElement("div",yo({ref:t},e)))}),YNe=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(QNe,yo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(ZNe,yo({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(Ch,{width:n,height:r}),b.createElement("div",yo({ref:t},e)))});function WNe(e){return e?VNe:YNe}var XNe=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:S,onTouchStart:w,style:j,width:k,responsive:O,dispatchTouchEvents:_=!0}=e,A=b.useRef(null),T=vn(),[C,z]=b.useState(null),[R,B]=b.useState(null),F=UNe(),q=bk(),$=q?.width>0?q.width:k,V=q?.height>0?q.height:i,te=b.useCallback(me=>{F(me),typeof t=="function"&&t(me),z(me),B(me),me!=null&&(A.current=me)},[F,t,z,B]),W=b.useCallback(me=>{T(Rq(me)),T(xi({handler:a,reactEvent:me}))},[T,a]),H=b.useCallback(me=>{T(_j(me)),T(xi({handler:f,reactEvent:me}))},[T,f]),ee=b.useCallback(me=>{T(OU()),T(xi({handler:p,reactEvent:me}))},[T,p]),le=b.useCallback(me=>{T(_j(me)),T(xi({handler:m,reactEvent:me}))},[T,m]),je=b.useCallback(()=>{T(Bq())},[T]),L=b.useCallback(()=>{T(Uq())},[T]),I=b.useCallback(me=>{T($q(me.key))},[T]),U=b.useCallback(me=>{T(xi({handler:o,reactEvent:me}))},[T,o]),D=b.useCallback(me=>{T(xi({handler:u,reactEvent:me}))},[T,u]),G=b.useCallback(me=>{T(xi({handler:d,reactEvent:me}))},[T,d]),ae=b.useCallback(me=>{T(xi({handler:y,reactEvent:me}))},[T,y]),ne=b.useCallback(me=>{T(xi({handler:w,reactEvent:me}))},[T,w]),Ce=b.useCallback(me=>{_&&T(Hq(me)),T(xi({handler:S,reactEvent:me}))},[T,_,S]),Se=b.useCallback(me=>{T(xi({handler:v,reactEvent:me}))},[T,v]),X=WNe(O);return b.createElement(XU.Provider,{value:C},b.createElement(W3.Provider,{value:R},b.createElement(X,{width:$??j?.width,height:V??j?.height,className:Rt("recharts-wrapper",r),style:qNe({position:"relative",cursor:"default",width:$,height:V},j),onClick:W,onContextMenu:U,onDoubleClick:D,onFocus:je,onBlur:L,onKeyDown:I,onMouseDown:G,onMouseEnter:H,onMouseLeave:ee,onMouseMove:le,onMouseUp:ae,onTouchEnd:Se,onTouchMove:Ce,onTouchStart:ne,ref:te},b.createElement(GNe,null),n)))}),JNe=["width","height","responsive","children","className","style","compact","title","desc"];function eke(e,t){if(e==null)return{};var n,r,i=tke(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 tke(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 nke=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:u,compact:d,title:f,desc:p}=e,m=eke(e,JNe),y=ka(m);return d?b.createElement(b.Fragment,null,b.createElement(Ch,{width:n,height:r}),b.createElement(nI,{otherAttributes:y,title:f,desc:p},a)):b.createElement(XNe,{className:o,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(nI,{otherAttributes:y,title:f,desc:p,ref:t},b.createElement(M1e,null,a)))});function Aj(){return Aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aj.apply(null,arguments)}function 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 rke(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){ike(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 ike(e,t,n){return(t=ake(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ake(e){var t=ske(e,"string");return typeof t=="symbol"?t:t+""}function ske(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 oke={top:5,right:5,bottom:5,left:5},lke=rke({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:oke,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Gq),cke=b.forwardRef(function(t,n){var r,i=ri(t.categoricalChartProps,lke),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(ENe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},b.createElement(E1e,{chartData:f.data}),b.createElement(zNe,{layout:i.layout,margin:i.margin}),b.createElement(RNe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),b.createElement(TNe,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),b.createElement(nke,Aj({},i,{ref:n})))}),uke=["axis"],Ej=b.forwardRef((e,t)=>b.createElement(cke,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:uke,tooltipPayloadSearcher:lwe,categoricalChartProps:e,ref:t}));const Mf={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},cu={fill:"#71717a",fontSize:11},zy="#27272a",ug=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function Qq(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function Oj(e){return Qq(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function zj(e){const t=Qq(e);return`${t.getMonth()+1}/${t.getDate()}`}const dke=6,Mu="__other__",bu="_socialTotal";function fke(e,t=dke){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,[bu]:0},u.set(p.date,m));const y=a.has(p.source)?p.source:Mu;m[y]=(m[y]??0)+p.sessions,m[bu]=(m[bu]??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(Mu),{data:d,sources:f,otherCount:o}}function wu(e){return e.replace(/\+/g," ")}function Zq(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const hke=["7d","30d","90d","all"],io=ug,Tj="#71717a",Yq="#52525b",bf=25;function Fm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function pke(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 mke({projectName:e}){const t=ni(),[n,r]=b.useState(null),[i,a]=b.useState(null),[o,u]=b.useState(!0),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[y,v]=b.useState(null),[S,w]=b.useState(null),[j,k]=b.useState("sessions"),[O,_]=b.useState("desc"),[A,T]=b.useState("sessions"),[C,z]=b.useState("desc"),[R,B]=b.useState("sessions"),[F,q]=b.useState("desc"),[$,V]=b.useState("sessions"),[te,W]=b.useState("desc"),[H,ee]=b.useState([]),[le,je]=b.useState([]),[L,I]=b.useState([]),[U,D]=b.useState(!1),[G,ae]=b.useState("30d");async function ne(fe){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:Be.traffic.status(e),queryFn:()=>WK(e),staleTime:tf});if(fe.current)return;if(r(ze),!ze.connected){a(null),ee([]),je([]),I([]),u(!1);return}const[he,Ve,Rn,ai]=await Promise.all([t.fetchQuery({queryKey:Be.traffic.summary(e,G),queryFn:()=>XK(e,void 0,G),staleTime:tf}),t.fetchQuery({queryKey:Be.traffic.aiHistory(e,G),queryFn:()=>eG(e,G).catch(()=>[]),staleTime:tf}),t.fetchQuery({queryKey:Be.traffic.sessionHistory(e,G),queryFn:()=>nG(e,G).catch(()=>[]),staleTime:tf}),t.fetchQuery({queryKey:Be.traffic.socialHistory(e,G),queryFn:()=>tG(e,G).catch(()=>[]),staleTime:tf})]);if(fe.current)return;a(he),ee(Ve),je(Rn),I(ai),u(!1)}catch(ze){if(fe.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}b.useEffect(()=>{const fe={current:!1};return ne(fe),()=>{fe.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),w(null);try{const fe=await aL(e);w(`Synced ${fe.rowCount.toLocaleString()} page rows, ${fe.aiReferralCount.toLocaleString()} AI and ${fe.socialReferralCount.toLocaleString()} social referral rows (${fe.days} days)`),await t.invalidateQueries({queryKey:Be.traffic.project(e)}),await ne({current:!1})}catch(fe){v(fe instanceof Error?fe.message:"Sync failed")}finally{f(!1)}}async function Se(){m(!0),v(null),w(null);try{await rG(e),await t.invalidateQueries({queryKey:Be.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),w("GA4 disconnected")}catch(fe){v(fe instanceof Error?fe.message:"Disconnect failed")}finally{m(!1)}}function X(fe){j===fe?_(ze=>ze==="desc"?"asc":"desc"):(k(fe),_("desc"))}function me(fe){A===fe?z(ze=>ze==="desc"?"asc":"desc"):(T(fe),z("desc"))}function Ee(fe){R===fe?q(ze=>ze==="desc"?"asc":"desc"):(B(fe),q("desc"))}function Y(fe){$===fe?W(ze=>ze==="desc"?"asc":"desc"):(V(fe),W("desc"))}const Fe=b.useMemo(()=>i?.topPages?[...i.topPages].sort((fe,ze)=>{const he=fe[j],Ve=ze[j];return typeof he=="string"&&typeof Ve=="string"?O==="asc"?he.localeCompare(Ve):Ve.localeCompare(he):O==="asc"?he-Ve:Ve-he}):[],[i?.topPages,j,O]),Te=b.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((fe,ze)=>{const he=fe[A],Ve=ze[A];return typeof he=="string"&&typeof Ve=="string"?C==="asc"?he.localeCompare(Ve):Ve.localeCompare(he):C==="asc"?he-Ve:Ve-he}):[],[i?.aiReferrals,A,C]),it=b.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((fe,ze)=>{const he=fe[$],Ve=ze[$];return typeof he=="string"&&typeof Ve=="string"?te==="asc"?he.localeCompare(Ve):Ve.localeCompare(he):te==="asc"?he-Ve:Ve-he}):[],[i?.aiReferralLandingPages,$,te]),Ge=b.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((fe,ze)=>{const he=fe[R],Ve=ze[R];return typeof he=="string"&&typeof Ve=="string"?F==="asc"?he.localeCompare(Ve):Ve.localeCompare(he):F==="asc"?he-Ve:Ve-he}):[],[i?.socialReferrals,R,F]),{socialChartData:$t,socialChartSources:Dt,socialOtherCount:tn}=b.useMemo(()=>{const fe=fke(L);return{socialChartData:fe.data,socialChartSources:fe.sources,socialOtherCount:fe.otherCount}},[L]),{chartData:Zt,chartSources:we,dateRange:Xe}=b.useMemo(()=>{const fe=[...new Set(H.map(Yt=>Yt.source))],ze=new Map;for(const Yt of le)ze.set(Yt.date,{_totalSessions:Yt.sessions,_organicSessions:Yt.organicSessions});const he=new Map;for(const Yt of H){const bn=`${Yt.date}::${Yt.source}`,jr=he.get(bn)??0;he.set(bn,Math.max(jr,Yt.sessions))}for(const[Yt,bn]of he){const[jr,Mi]=Yt.split("::");let na=ze.get(jr);na||(na={_totalSessions:0,_organicSessions:0},ze.set(jr,na)),na[Mi]=(na[Mi]??0)+bn}const Ve=[...ze.entries()].sort(([Yt],[bn])=>Yt.localeCompare(bn)).map(([Yt,bn])=>({date:Yt,...bn})),Rn=Ve.map(Yt=>Yt.date),ai=Rn.length>0?{start:Rn[0],end:Rn[Rn.length-1]}:null;return{chartData:Ve,chartSources:fe,dateRange:ai}},[H,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(gke,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:Be.traffic.project(e)}),await ne({current:!1})))()}});const Ot=i?.organicSharePctDisplay??"0%",ft=i?.totalOrganicSessions??0,Je=i?.aiSessionsDeduped??0,ue=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",De=i?new Set(i.aiReferrals.map(fe=>fe.source.toLowerCase())).size:0,Ke=Te[0]??null,dt=i?.totalDirectSessions??0,ln=i?.directSharePctDisplay??"0%",xn=i?.socialSessions??0,cn=i?.socialSharePctDisplay??"0%",Ze=i?new Set(i.socialReferrals.map(fe=>fe.source.toLowerCase())).size:0,Bt=Ge[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}),S&&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:S}),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(Cz,{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(nr,{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:hke.map(fe=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===fe?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>ae(fe),children:fe==="all"?"All":fe},fe))})]}),i?l.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[l.jsx(RS,{value:Fm(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),l.jsx(RS,{value:Fm(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Ot} of total`,tone:"positive"}),l.jsx(RS,{value:Fm(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(Cz,{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(nr,{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)."})]})]}),Xe&&l.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Xe.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Xe.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),Zt.length>0&&l.jsxs(Le,{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:we.length>0?"AI vs. total sessions":"All sessions (baseline)"}),we.length===0&&l.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),we.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(W1,{width:"100%",height:"100%",children:l.jsxs(Ej,{data:Zt,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(_y,{dataKey:"date",tick:cu,tickLine:!1,axisLine:{stroke:zy},tickFormatter:zj}),l.jsx(Ay,{tick:cu,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(bj,{...Mf,labelFormatter:Oj,formatter:(fe,ze)=>{const he=typeof fe=="number"?fe.toLocaleString():String(fe??0),Ve=String(ze??"");return Ve==="_totalSessions"?[he,"Total Sessions"]:Ve==="_organicSessions"?[he,"Organic Sessions"]:[he,Ve]}}),l.jsx(E6,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:fe=>fe==="_totalSessions"?"Total Sessions":fe==="_organicSessions"?"Organic Sessions":fe}),l.jsx(lu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),we.map((fe,ze)=>l.jsx(lu,{type:"monotone",dataKey:fe,stackId:"ai",stroke:io[ze%io.length],fill:io[ze%io.length],fillOpacity:.4,strokeWidth:1.5},fe))]})})})]}),l.jsxs(Le,{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(fa,{label:"Organic",value:Ot,hint:`${ft.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),l.jsx(fa,{label:"Social",value:cn,hint:`${xn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),l.jsx(fa,{label:"Direct",value:ln,hint:`${dt.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(fa,{label:"Known AI referrers (lower bound)",value:Ne,hint:`${ue.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."})]}),Ke&&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:Ke.source})," via ",Ke.medium,", accounting for ",Ke.sessions.toLocaleString()," sessions."]})]}),l.jsxs(Le,{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:A,dir:C,onSort:me,align:"left"}),l.jsx(or,{label:"Medium",sortKey:"medium",current:A,dir:C,onSort:me,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:A,dir:C,onSort:me,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(or,{label:"Users",sortKey:"users",current:A,dir:C,onSort:me,align:"right"})]})}),l.jsx("tbody",{children:Te.map(fe=>l.jsx(vke,{referral:fe,totalSessions:Je},`${fe.source}:${fe.medium}:${fe.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(Le,{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:$,dir:te,onSort:Y,align:"left"}),l.jsx(or,{label:"Source",sortKey:"source",current:$,dir:te,onSort:Y,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:$,dir:te,onSort:Y,align:"right"}),l.jsx(or,{label:"Users",sortKey:"users",current:$,dir:te,onSort:Y,align:"right"})]})}),l.jsx("tbody",{children:it.map(fe=>l.jsx(xke,{row:fe},`${fe.landingPage}:${fe.source}:${fe.medium}:${fe.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(nr,{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."})]})]}),$t.length>0&&l.jsxs(Le,{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"})]}),tn>0&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Dt.length-1," sources · ",tn," more grouped as Other"]})]}),l.jsx("div",{className:"h-64",children:l.jsx(W1,{width:"100%",height:"100%",children:l.jsxs(Ej,{data:$t,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(_y,{dataKey:"date",tick:cu,tickLine:!1,axisLine:{stroke:zy},tickFormatter:zj}),l.jsx(Ay,{tick:cu,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(bj,{...Mf,labelFormatter:Oj,formatter:(fe,ze)=>{const he=typeof fe=="number"?fe.toLocaleString():String(fe??0),Ve=String(ze??"");if(Ve===bu)return[he,"Total Social"];if(Ve===Mu){const Rn=`Other (${tn} source${tn===1?"":"s"})`;return[he,Rn]}return[he,wu(Ve)]}}),l.jsx(lu,{type:"monotone",dataKey:bu,stroke:Yq,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Dt.map((fe,ze)=>{const Ve=fe===Mu?Tj:io[ze%io.length];return l.jsx(lu,{type:"monotone",dataKey:fe,stackId:"social",stroke:Ve,fill:Ve,fillOpacity:.4,strokeWidth:1.5},fe)})]})})}),l.jsx(wke,{sources:Dt,otherCount:tn})]}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[l.jsxs(Le,{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(fa,{label:"Social Sessions",value:Fm(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(fa,{label:"Share of Traffic",value:cn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),l.jsx(fa,{label:"Platforms",value:String(Ze),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."})]}),Bt&&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:`${Bt.source} via ${Bt.medium}`,children:Zq(wu(Bt.source),64)}),l.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Bt.medium,children:["via ",wu(Bt.medium)," · ",Bt.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(fa,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),l.jsx(fa,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),l.jsx(fa,{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(Le,{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?Ge.length>bf&&!U?`Top ${bf} of ${Ge.length}`:`${Ge.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm table-fixed",children:[l.jsxs("colgroup",{children:[l.jsx("col",{className:"w-[32%]"}),l.jsx("col",{className:"w-[22%]"}),l.jsx("col",{className:"w-[12%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[12%]"})]}),l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(or,{label:"Source",sortKey:"source",current:R,dir:F,onSort:Ee,align:"left"}),l.jsx(or,{label:"Medium",sortKey:"medium",current:R,dir:F,onSort:Ee,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:R,dir:F,onSort:Ee,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(or,{label:"Users",sortKey:"users",current:R,dir:F,onSort:Ee,align:"right"})]})}),l.jsx("tbody",{children:(U?Ge:Ge.slice(0,bf)).map(fe=>l.jsx(bke,{referral:fe,totalSessions:xn},`${fe.source}:${fe.medium}:${fe.channelGroup}`))})]})}),Ge.length>bf&&l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("button",{type:"button",onClick:()=>D(fe=>!fe),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:U?`Show top ${bf}`:`Show all ${Ge.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(nr,{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:X,align:"left"}),l.jsx(or,{label:"Sessions",sortKey:"sessions",current:j,dir:O,onSort:X,align:"right"}),l.jsx(or,{label:"Organic",sortKey:"organicSessions",current:j,dir:O,onSort:X,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:X,align:"right"})]})}),l.jsx("tbody",{children:Fe.map(fe=>l.jsx(yke,{page:fe},fe.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 ${pke(i.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function gke({projectName:e,onConnected:t}){const[n,r]=b.useState(""),[i,a]=b.useState(null),[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(null),y=b.useRef(null),v=b.useCallback(w=>{const j=w.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 S(){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 JK(e,{propertyId:n.trim(),keyJson:o});try{await aL(e)}catch{}t()}catch(w){m(w instanceof Error?w.message:"Failed to connect GA4")}finally{f(!1)}}return l.jsxs(Le,{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:w=>r(w.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),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:S,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 Wq={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function RS({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 ${Wq[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function fa({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(nr,{text:i})]}),l.jsx("p",{className:`text-xl font-semibold tabular-nums ${Wq[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function yke({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 Xq={session:"Session",first_user:"First Visit",manual_utm:"UTM"},Jq={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 vke({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=Xq[e.sourceDimension]??e.sourceDimension,i=Jq[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 xke({row:e}){const t=Xq[e.sourceDimension]??e.sourceDimension,n=Jq[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 bke({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=wu(e.source),a=wu(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 wke({sources:e,otherCount:t}){const n=[{key:bu,color:Yq,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===Mu)n.push({key:Mu,color:Tj,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=wu(i);n.push({key:i,color:io[r%io.length]??Tj,label:Zq(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 e8(e){e.invalidateQueries({queryKey:Be.runs.all}),e.invalidateQueries({queryKey:Be.projects.all})}function Ske(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function jke(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 r0(e,t){b5({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),gt({title:Ske(e.kind),detail:jke(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function Nke(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)b5({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=JJ({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 i0(e,t){if(e instanceof Ir&&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 t8(){const e=ni();return fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>lK(t,n),onSuccess:(t,n)=>{e8(e),r0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{i0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function kke(){const e=ni();return fh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>_K(t),onSuccess:t=>{e8(e),Nke(t)},onError:t=>{gt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Cke(){const e=ni();return fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>tL(t,n),onSuccess:(t,n)=>{av(e,St["gsc-sync"],n.projectName),r0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{i0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function _ke(){const e=ni();return fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>BK(t),onSuccess:(t,n)=>{av(e,t.run.kind,n.projectName),r0(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{i0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Ake(){const e=ni();return fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>LK(t,n),onSuccess:(t,n)=>{av(e,St["inspect-sitemap"],n.projectName),r0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{i0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const Eke=["7d","30d","90d","all"];function Oke({projectName:e}){const t=ni(),[n,r]=b.useState(!1),[i,a]=b.useState([]),[o,u]=b.useState([]),[d,f]=b.useState([]),[p,m]=b.useState([]),[y,v]=b.useState([]),[S,w]=b.useState(null),[j,k]=b.useState(""),[O,_]=b.useState(""),[A,T]=b.useState("30"),[C,z]=b.useState(!1),[R,B]=b.useState("30d"),[F,q]=b.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[$,V]=b.useState(""),[te,W]=b.useState(!0),[H,ee]=b.useState(!1),[le,je]=b.useState(!1),[L,I]=b.useState(!1),[U,D]=b.useState(!1),[G,ae]=b.useState(!1),[ne,Ce]=b.useState(!1),[Se,X]=b.useState(null),[me,Ee]=b.useState(!1),[Y,Fe]=b.useState(!1),[Te,it]=b.useState(null),[Ge,$t]=b.useState(""),[Dt,tn]=b.useState(!1),[Zt,we]=b.useState(!1),[Xe,Ot]=b.useState("indexed"),[ft,Je]=b.useState(null),ue=b.useMemo(()=>{if(!ft)return d;const{key:Q,dir:ke}=ft;return[...d].sort((tt,wt)=>{const wn=Q===lo.CTR?Number.isFinite(tt.ctr)?tt.ctr:0:tt[Q],ra=Q===lo.CTR?Number.isFinite(wt.ctr)?wt.ctr:0:wt[Q];return ke==="asc"?wn-ra:ra-wn})},[d,ft]),[Ne,De]=b.useState([]),[Ke,dt]=b.useState(null),[ln,xn]=b.useState(!1),[cn,Ze]=b.useState(null),[Bt,fe]=b.useState(null),ze=i.find(Q=>Q.connectionType==="gsc"),he=d.length>0||p.length>0||y.length>0,Ve=Cke(),Rn=_ke(),ai=Ake();async function Yt(Q){if(!Q){u([]),k("");return}je(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:Be.gsc.properties(e),queryFn:()=>OK(e),staleTime:dr});u(ke),k(Q.propertyId??ke[0]?.siteUrl??"")}catch(ke){u([]),Ze(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{je(!1)}}async function bn(){D(!0);try{const Q={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:R},ke=await t.fetchQuery({queryKey:Be.gsc.performance(e,Q),queryFn:()=>PK(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:R}),staleTime:dr});f(ke)}catch(Q){f([]),Ze(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function jr(){ae(!0);try{const Q=$.trim()||void 0,[ke,tt]=await Promise.all([t.fetchQuery({queryKey:Be.gsc.inspections(e,Q),queryFn:()=>DK(e,{url:Q,limit:20}),staleTime:dr}),t.fetchQuery({queryKey:Be.gsc.deindexed(e),queryFn:()=>MK(e),staleTime:dr})]);m(ke),v(tt)}catch(Q){m([]),v([]),Ze(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{ae(!1)}}async function Mi(){Ee(!0);try{const[Q,ke]=await Promise.all([t.fetchQuery({queryKey:Be.gsc.coverage(e),queryFn:()=>tN(e),staleTime:dr}),t.fetchQuery({queryKey:Be.gsc.coverageHistory(e),queryFn:()=>IK(e).catch(()=>[]),staleTime:dr})]);X(Q),De(ke)}catch(Q){X(null),De([]),Ze(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{Ee(!1)}}async function na(Q){xn(!0),Ze(null);try{const ke=await bz(e,{urls:Q}),{succeeded:tt,failed:wt,total:wn}=ke.summary;gt({title:"Indexing requested",detail:wt===0?`${tt} URL${tt!==1?"s":""} submitted for indexing.`:`${tt}/${wn} submitted successfully, ${wt} failed.`,tone:wt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){Ze(ke instanceof Error?ke.message:"Failed to request indexing")}finally{xn(!1)}}async function Bh(){xn(!0),Ze(null);try{const Q=await bz(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:tt,total:wt}=Q.summary;gt({title:"Indexing requested",detail:tt===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${wt} submitted successfully, ${tt} failed.`,tone:tt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to request indexing")}finally{xn(!1)}}async function ws(){if(Ge.trim()){tn(!0),Ze(null);try{await TK(e,"gsc",Ge.trim()),await t.invalidateQueries({queryKey:Be.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ge.trim()}:ke)),gt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),$t("")}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{tn(!1)}}}async function Ss(){Ze(null);try{const Q=await Rn.mutateAsync({projectName:e,projectLabel:e});it(Q.sitemaps),a(ke=>ke.map(tt=>tt.connectionType==="gsc"?{...tt,sitemapUrl:Q.primarySitemapUrl}:tt))}catch{}}async function a0(){Fe(!0),Ze(null);try{const Q=await $K(e);t.setQueryData(Be.gsc.sitemaps(e),Q),it(Q.sitemaps),Q.sitemaps.length===0&&fe("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{Fe(!1)}}async function id(){W(!0),Ze(null);try{const[Q,ke]=await Promise.all([eN().catch(()=>null),t.fetchQuery({queryKey:Be.gsc.connections(e),queryFn:()=>eL(e).catch(()=>[]),staleTime:dr})]);r(!!Q?.google?.configured),a(ke);const tt=ke.find(wt=>wt.connectionType==="gsc");await Promise.all([Yt(tt),bn(),jr(),Mi()])}finally{W(!1)}}b.useEffect(()=>{id()},[e]),b.useEffect(()=>{bn()},[R]);async function Uh(){if(!n){Ze("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ee(!0),Ze(null),fe(null);try{const{authUrl:Q}=await AK(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){Ze("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Q,"_blank","width=600,height=700");if(!ke){window.location.assign(Q);return}fe("Finish the Google consent flow in the popup, then close it to refresh this project.");const tt=window.setInterval(()=>{ke.closed&&(window.clearInterval(tt),fe(null),t.invalidateQueries({queryKey:Be.gsc.project(e)}),id())},1e3)}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{ee(!1)}}async function qh(){Ze(null),fe(null);try{await EK(e,"gsc"),await t.invalidateQueries({queryKey:Be.gsc.project(e)}),a(Q=>Q.filter(ke=>ke.connectionType!=="gsc")),u([]),k("")}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to disconnect")}}async function ad(){if(j){I(!0),Ze(null);try{await zK(e,"gsc",j),await t.invalidateQueries({queryKey:Be.gsc.project(e)}),a(Q=>Q.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(Q){Ze(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{I(!1)}}}async function sd(){Ze(null),fe(null);try{await Ve.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:C||void 0}}),await t.invalidateQueries({queryKey:Be.gsc.project(e)})}catch{}}async function od(){if(O.trim()){Ce(!0),Ze(null),fe(null);try{const Q=await RK(e,O.trim());await t.invalidateQueries({queryKey:Be.gsc.project(e)}),w(Q),_(""),await jr()}catch(Q){Ze(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ce(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:Eke.map(Q=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${R===Q?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>B(Q),children:Q==="all"?"All":Q},Q))}),ze&&l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:U,onClick:()=>{bn()},children:U?"Refreshing…":"Refresh data"})]})]}),cn&&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:[cn,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ze(null),children:"×"})]}),Bt&&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:[Bt,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>fe(null),children:"×"})]}),te?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Le,{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(mt,{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:Ki(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:H,onClick:Uh,children:H?"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:Rn.isPending||!ze.propertyId,onClick:Ss,children:Rn.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:Ge,onChange:Q=>$t(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void ws()}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:Dt||!Ge.trim(),onClick:ws,children:Dt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ze||he)&&l.jsxs(l.Fragment,{children:[l.jsxs(Le,{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:ln,onClick:()=>{Bh()},children:ln?"Requesting…":`Request indexing (${Se.notIndexed.length})`}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:me,onClick:()=>{Mi()},children:me?"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 Q=Se.summary.indexed+Se.summary.notIndexed,ke=Q>0?Se.summary.indexed/Q:0,tt=Q>0?Se.summary.notIndexed/Q:0,wt=54,wn=2*Math.PI*wt,ra=wn*(1-ke),Ra=wn*tt,js=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:wt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:wt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:wn,strokeDashoffset:ra,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:wt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ra} ${wn-Ra}`,strokeDashoffset:-js,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(Q=>{const ke=Q==="indexed"?Se.indexed.length:Q==="notIndexed"?Se.notIndexed.length:Se.deindexed.length,tt=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Xe===Q?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Ot(Q),dt(null)},children:[tt," (",ke,")"]},Q)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Xe==="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(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Xe==="notIndexed"&&!Ke&&(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(Q=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>dt(Q.reason),children:[l.jsx("td",{className:"text-zinc-200",children:Q.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Xe==="notIndexed"&&!Ke&&(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(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Xe==="notIndexed"&&Ke&&(()=>{const Q=(Se.reasonGroups??[]).find(ke=>ke.reason===Ke);return Q?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>dt(null),children:["←"," Back to reasons"]})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:ln,onClick:()=>{na(Q.urls.map(ke=>ke.url))},children:ln?"Requesting…":`Request indexing (${Q.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:Q.urls.map(ke=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ke.url}),l.jsx("td",{className:"text-zinc-400",children:ke.crawlTime?ke.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:ln,onClick:()=>{na([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),Xe==="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((Q,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState}),l.jsx("td",{className:"text-zinc-400",children:Q.currentState}),l.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${ke}`))})]}),(Xe==="indexed"&&Se.indexed.length===0||Xe==="notIndexed"&&!Ke&&Se.notIndexed.length===0||Xe==="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:me?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(Le,{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:U,onClick:()=>{bn()},children:U?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const ct of d){const Ut=Q.get(ct.date);Ut?(Ut.clicks+=ct.clicks,Ut.impressions+=ct.impressions):Q.set(ct.date,{clicks:ct.clicks,impressions:ct.impressions})}const ke=[...Q.entries()].sort(([ct],[Ut])=>ct.localeCompare(Ut));if(ke.length===0)return null;const tt=Math.max(...ke.map(([,ct])=>ct.impressions),1),wt=ke.reduce((ct,[,Ut])=>ct+Ut.clicks,0),wn=ke.reduce((ct,[,Ut])=>ct+Ut.impressions,0),ra=wn>0?(wt/wn*100).toFixed(1):"0.0",Ra=700,js=220,pr={top:12,bottom:36,left:48,right:12},Po=Ra-pr.left-pr.right,ia=js-pr.top-pr.bottom,si=Po/ke.length,Ii=Math.max(Math.min(si*.35,24),4),Ns=Math.max(Ii*.15,1),ks=ct=>{if(ct<=0)return 1;const Ut=Math.pow(10,Math.floor(Math.log10(ct))),Nr=ct/Ut,Li=Nr<=1.5?1.5:Nr<=3?3:Nr<=5?5:10;return Math.ceil(Li*Ut)},un=4,Ro=Math.ceil(ks(tt)/un)*un,Fh=Array.from({length:un+1},(ct,Ut)=>Ro/un*Ut),Da=ct=>ct>=1e3?`${(ct/1e3).toFixed(ct>=1e4?0:1)}k`:String(ct);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:wt.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:[ra,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ra} / ${js}`},children:l.jsxs("svg",{viewBox:`0 0 ${Ra} ${js}`,className:"h-full w-full",children:[Fh.map((ct,Ut)=>{const Nr=pr.top+ia-ct/Ro*ia;return l.jsxs("g",{children:[l.jsx("line",{x1:pr.left,y1:Nr,x2:Ra-pr.right,y2:Nr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:pr.left-6,y:Nr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Da(ct)})]},`t-${Ut}`)}),ke.map(([ct,Ut],Nr)=>{const Li=pr.left+si*Nr+si/2,tc=Ut.impressions/Ro*ia,Do=Ut.clicks/Ro*ia;return l.jsxs("g",{children:[l.jsx("title",{children:`${ct}
290
+ Clicks: ${Ut.clicks}
291
+ Impressions: ${Ut.impressions}
292
+ CTR: ${Ut.impressions>0?(Ut.clicks/Ut.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:Li-Ii-Ns/2,y:pr.top+ia-tc,width:Ii,height:Math.max(tc,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:Li+Ns/2,y:pr.top+ia-Do,width:Ii,height:Math.max(Do,1),rx:2,fill:"#10b981",opacity:.85})]},ct)}),(()=>{const ct=Math.min(ke.length,7);return Array.from({length:ct},(Ut,Nr)=>{const Li=ke.length===1?0:Math.round(Nr/(ct-1)*(ke.length-1)),tc=pr.left+si*Li+si/2;return l.jsx("text",{x:tc,y:js-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[Li][0].slice(5)},`xl-${Li}`)})})()]})})]})})(),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:Q=>q(ke=>({...ke,startDate:Q.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:F.endDate,onChange:Q=>q(ke=>({...ke,endDate:Q.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:F.query,onChange:Q=>q(ke=>({...ke,query:Q.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:F.page,onChange:Q=>q(ke=>({...ke,page:Q.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:F.limit,onChange:Q=>q(ke=>({...ke,limit:Q.target.value}))})]}),d.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),Object.values(lo).map(Q=>l.jsx("th",{className:"text-right","aria-sort":ft?.key===Q?ft.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:()=>Je(ke=>ke?.key===Q?ke.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[IJ[Q],ft?.key===Q?ft.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),l.jsx("tbody",{children:ue.map((Q,ke)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:Q.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${ke}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(Le,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:O,onChange:Q=>_(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void od()}),l.jsx(xe,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!O.trim(),onClick:od,children:ne?"Inspecting…":"Inspect URL"})]}),S&&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:S.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:S.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:Jz(S.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:Ki(S.crawlTime)})]})]})]}),l.jsxs(Le,{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:()=>{jr()},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:$,onChange:Q=>V(Q.target.value)}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{jr()},children:"Apply filter"})]}),p.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:p.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Jz(Q.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:Ki(Q.inspectedAt)})]},Q.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(Le,{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(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Ki(Q.transitionDate)})]},`${Q.url}:${Q.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:()=>we(Q=>!Q),children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Zt?"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"})]})}),Zt&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(Le,{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:Q=>k(Q.target.value),children:o.length===0?l.jsx("option",{value:"",children:le?"Loading properties…":"No properties available"}):o.map(Q=>l.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(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:ad,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(Le,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:A,onChange:Q=>T(Q.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:C,onChange:Q=>z(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(xe,{type:"button",size:"sm",disabled:Ve.isPending||!ze.propertyId,onClick:sd,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(Le,{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:Y||!ze.propertyId,onClick:()=>{a0()},children:Y?"Loading…":"Browse sitemaps from GSC"}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:Rn.isPending||!ze.propertyId,onClick:Ss,children:Rn.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(Q=>{const ke=Q.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ke&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[ke.indexed," / ",ke.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>$t(Q.path),children:"Use"})]})]},Q.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ze.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ge,onChange:Q=>$t(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ge.trim()&&void ws()}),l.jsx(xe,{type:"button",size:"sm",disabled:Dt||!Ge.trim(),onClick:ws,children:Dt?"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;Ze(null),fe(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 DS({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.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(fL,{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 al=50;function Yc(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Hm(e){return e.toLocaleString()}function zke(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function Tke(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 Pke(e){const t=e.filter(n=>n.kind===St["backlink-extract"]&&!yN(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function Rke(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 Dke({projectName:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,o]=b.useState([]),[u,d]=b.useState(null),[f,p]=b.useState(null),[m,y]=b.useState(null),[v,S]=b.useState(Date.now()),[w,j]=b.useState(0),[k,O]=b.useState(!0),[_,A]=b.useState(!1),[T,C]=b.useState(null),z=b.useRef(null),R=b.useCallback(async()=>{O(!0),C(null);try{const[le,je,L,I,U]=await Promise.all([sL().catch(()=>null),pG(e,{excludeCrawlers:!0}).catch(()=>null),mG(e,{limit:al,offset:w,excludeCrawlers:!0}).catch(G=>{if(G instanceof Ir&&G.code==="NOT_FOUND")return null;throw G}),gG(e).catch(()=>[]),nK(e).catch(()=>[])]);d(le),n(je),i(L),o(I);const D=Pke(U);p(D),z.current=D?.id??null}catch(le){C(le instanceof Error?le.message:"Failed to load backlinks")}finally{O(!1)}},[e,w]);b.useEffect(()=>{R()},[R]),b.useEffect(()=>{if(!f)return;const le=f.id;let je=!1;const L=async()=>{try{const U=await Ol(le);if(je)return;yN(U.status)?(p(null),y(U),await R()):p(D=>D?.id===U.id?{...D,...U}:D)}catch{}},I=window.setInterval(()=>{L()},3e3);return()=>{je=!0,window.clearInterval(I)}},[f,R]),b.useEffect(()=>{if(!f)return;const le=window.setInterval(()=>S(Date.now()),1e3);return()=>window.clearInterval(le)},[f]),b.useEffect(()=>{if(!m||m.status==="failed")return;const le=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(le)},[m]);async function B(){A(!0),C(null);try{const le=await yG(e);p(le),z.current=le.id}catch(le){le instanceof Ir&&le.code==="MISSING_DEPENDENCY"?C("DuckDB is not installed. Visit the Backlinks admin page to install it."):C(le instanceof Error?le.message:"Failed to trigger extract")}finally{A(!1)}}const F=b.useMemo(()=>a.slice().sort((le,je)=>le.queriedAt.localeCompare(je.queriedAt)).map(le=>({date:le.queriedAt,linkingDomains:le.totalLinkingDomains})),[a]),q=r?.rows??[],$=r?.total??0,V=t?.excludedLinkingDomains??0,te=$>al,W=Math.floor(w/al)+1,H=Math.max(1,Math.ceil($/al));return b.useEffect(()=>{w>0&&w>=$&&j(0)},[w,$]),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(Le,{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(Le,{className:"surface-card p-4 mb-4 border-sky-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(pL,{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(mt,{tone:"neutral",children:f.status}),l.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[Rke(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(Le,{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(dL,{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:LJ(m.error)}):m.status!=="failed"?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),ee()]});function ee(){if(k)return l.jsx(Le,{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",U=u?.status==="failed",D=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:Hm(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:Hm(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 ",Tke(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(Le,{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(W1,{width:"100%",height:"100%",children:l.jsxs(Ej,{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:ug[0],stopOpacity:.4}),l.jsx("stop",{offset:"100%",stopColor:ug[0],stopOpacity:0})]})}),l.jsx(_y,{dataKey:"date",tick:cu,stroke:zy,tickFormatter:zj}),l.jsx(Ay,{tick:cu,stroke:zy,allowDecimals:!1}),l.jsx(bj,{contentStyle:Mf.contentStyle,labelStyle:Mf.labelStyle,itemStyle:Mf.itemStyle,labelFormatter:Oj}),l.jsx(lu,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:ug[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"}),te&&l.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",W," of ",H," · ",Hm($)," total"]})]}),l.jsx(Le,{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:[q.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:Hm(G.numHosts)})]},G.linkingDomain)),q.length===0&&l.jsx("tr",{children:l.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:V>0&&$===0?`Every referring domain in this release was a crawler/proxy host (${V} hidden).`:"No referring domains in this release."})})]})]})}),te&&l.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:w===0,onClick:()=>j(G=>Math.max(0,G-al)),children:"Previous"}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:w+al>=$,onClick:()=>j(G=>G+al),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:B,children:[l.jsx(Uy,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),l.jsxs(DS,{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:Yc("/backlinks"),children:"Open admin"})})]})]}):l.jsx(Le,{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(hL,{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:Yc("/backlinks"),children:"Set up backlinks"})})})]}),D&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",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:Yc("/backlinks"),children:"View sync status"})})})]}),U&&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:Yc("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&!D&&!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:B,children:[l.jsx(wg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Run extract"]}),l.jsxs(DS,{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:Yc("/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:Yc("/backlinks"),children:"Go to Backlinks admin"})}),l.jsxs(xe,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:B,children:[l.jsx(wg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),l.jsxs(DS,{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 Mke({projectName:e}){const t=Yi({queryKey:Be.citationVisibility(e),queryFn:()=>aG(e),staleTime:lL}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-rose-400",children:r instanceof Error?r.message:String(r)})]});if(!n)return null;if(n.status==="no-data")return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:o}=n.summary;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",o," engines",l.jsx(nr,{text:"An engine is ‘citing’ when our domain appears in its grounding source list (the structured citation/search-result attribution it returns alongside the answer). Counts each configured engine that cites the project on at least one tracked query in the latest snapshot per (query × provider)."})]}),l.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",o," engine answers",l.jsx(nr,{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(Ike,{data:n}),l.jsx(Lke,{data:n}),n.competitorGaps.length>0&&l.jsx(qke,{data:n})]})}function Ike({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[l.jsx(Km,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),l.jsx(Km,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),l.jsx(Km,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),l.jsx(Km,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Km({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 Lke({data:e}){const t=b.useMemo(()=>{const n=new Set;for(const r of e.byQuery)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byQuery]);return e.byQuery.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):l.jsxs("div",{children:[l.jsx($ke,{}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),t.map(n=>l.jsx("th",{className:"text-center",children:l.jsx(Pl,{provider:n})},n)),l.jsx("th",{className:"text-right",children:"Cite"}),l.jsx("th",{className:"text-right",children:"Ment"})]})}),l.jsx("tbody",{children:e.byQuery.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return l.jsx("td",{className:"text-center",children:i==null?l.jsx(dV,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):l.jsx(Bke,{provider:i})},r)}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.citedCount===n.totalProviders?"text-emerald-300":n.citedCount>0?"text-emerald-400/70":"text-zinc-500",children:[n.citedCount,"/",n.totalProviders]})}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.mentionedCount===n.totalProviders?"text-sky-300":n.mentionedCount>0?"text-sky-400/70":"text-zinc-500",children:[n.mentionedCount,"/",n.totalProviders]})})]},n.queryId))})]})})]})}function $ke(){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(uu,{active:!0,tone:"cited"}),l.jsx("span",{children:"cited (in sources)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(uu,{active:!0,tone:"mentioned"}),l.jsx("span",{children:"mentioned (in answer)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(uu,{active:!1,tone:"cited"}),l.jsx(uu,{active:!1,tone:"mentioned"}),l.jsx("span",{children:"neither"})]})]})}function Bke({provider:e}){const t=Uke(e);return l.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[l.jsx(uu,{active:e.cited,tone:"cited"}),l.jsx(uu,{active:e.mentioned,tone:"mentioned"})]})}function Uke(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 uu({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 qke({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(nr,{text:"Queries where the project is not cited but a configured competitor is. Each row maps to one (query, engine) pair — the same query may surface for multiple engines."}),l.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Engine"}),l.jsx("th",{children:"Competitors cited"})]})}),l.jsx("tbody",{children:e.competitorGaps.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),l.jsx("td",{children:l.jsx(Pl,{provider:t.provider})}),l.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const Fke={critical:"negative",high:"negative",medium:"caution",low:"neutral"};function Hi(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function Hke(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Kke(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function Gke({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(null),a=Yi({queryKey:Be.report(e),queryFn:()=>QK(e)});async function o(){n(!0),i(null);try{await YK(e,"client")}catch(d){const f=d instanceof Ir||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(a.error){const d=a.error instanceof Error?a.error.message:"Failed to load report";return l.jsx("div",{className:"py-8 text-center",children:l.jsx("p",{className:"text-sm text-rose-400",children:d})})}const u=a.data;return u?l.jsxs("div",{children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("p",{className:"eyebrow",children:"AI Visibility Report"}),l.jsx("h1",{className:"page-title",children:u.meta.project.displayName}),l.jsxs("p",{className:"page-subtitle",children:[u.meta.project.canonicalDomain," · ",u.meta.project.country," / ",u.meta.project.language.toUpperCase(),u.meta.location?` · Location: ${Kke(u.meta.location)}`:" · No location set"," · ","Generated ",Hke(u.meta.generatedAt)]}),r&&l.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(xe,{variant:"secondary",size:"sm",onClick:o,disabled:t,children:[l.jsx(Uy,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),l.jsx(Yke,{report:u}),l.jsx(rCe,{report:u,audience:"client"}),l.jsx(Jke,{report:u,audience:"client"}),l.jsx(eCe,{report:u})]}):null}function Vke(e,t){return e.audience==="both"||e.audience===t}const Qke={gemini:"Gemini",openai:"ChatGPT",claude:"Claude",perplexity:"Perplexity",local:"Local model","cdp:chatgpt":"ChatGPT (browser)"};function Ty(e){return Qke[e]??e.charAt(0).toUpperCase()+e.slice(1)}function Zke(e){return e?e.direction==="up"?{text:`Up ${e.deltaAbs.toFixed(1)} points since last check (was ${e.prior}%)`,tone:"positive",arrow:"↑"}:e.direction==="down"?{text:`Down ${Math.abs(e.deltaAbs).toFixed(1)} points since last check (was ${e.prior}%)`,tone:"negative",arrow:"↓"}:{text:`Holding steady since last check (was ${e.prior}%)`,tone:"neutral",arrow:"→"}:null}function Yke({report:e}){const t=e.executiveSummary,n=e.citationScorecard,r=t.totalQueryCount,i=r>0?`${t.citationRate}%`:"—",a=r>0?`When customers asked AI ${r} ${r===1?"question":"questions"} about your industry, AI linked to your website in ${t.citedQueryCount} of ${r===1?"them":"those answers"}.`:"No AI check has been run yet. Run a check to see how AI tools answer customer questions about your business.",o=Zke(e.whatsChanged.citationRate),u=n.providers.length>0?n.providers.map(Ty).join(", "):`${Hi(t.queryCount)} ${t.queryCount===1?"question":"questions"} tested`;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"rounded-2xl border border-zinc-800/60 bg-zinc-900/40 p-6 sm:p-8",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:"Overview"}),l.jsx("p",{className:"mt-3 text-6xl font-bold tracking-tight text-zinc-50 sm:text-7xl",children:i}),l.jsx("p",{className:"mt-3 max-w-2xl text-base text-zinc-300 sm:text-lg",children:a}),o&&l.jsxs("p",{className:`mt-3 text-sm font-medium ${o.tone==="positive"?"text-emerald-400":o.tone==="negative"?"text-rose-400":"text-zinc-400"}`,children:[l.jsx("span",{className:"mr-1",children:o.arrow}),o.text]})]}),l.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[l.jsx(MS,{label:"AI mentions your name",value:`${t.mentionRate}%`,subtitle:r>0?`Says your name in ${t.mentionedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(MS,{label:"AI links to your website",value:`${t.citationRate}%`,subtitle:r>0?`Cites your site as a source in ${t.citedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(MS,{label:"AI tools tested",value:Hi(t.providerCount),subtitle:u})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-semibold text-zinc-200",children:"Mentions and links are different."})," ","A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"mention"})," is when AI says your name out loud in its answer. A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"link"})," is when AI lists your website as a source it used. AI can do either, both, or neither — that's why we track both."]}),n.queries.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Customer questions we tested"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["These are the ",n.queries.length," ",n.queries.length===1?"question we asked":"questions we asked"," every AI tool. The numbers above measure how often you came up."]}),l.jsx("ol",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:n.queries.map((d,f)=>l.jsxs("li",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2 text-sm text-zinc-200",children:[l.jsx("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-zinc-500",children:String(f+1).padStart(2,"0")}),l.jsxs("span",{children:['"',d,'"']})]},f))})]}),n.providerRates.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"How often each AI tool links to your website"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Higher is better. Each bar shows the share of customer questions where the AI cited your site."}),l.jsx("div",{className:"mt-4 space-y-3",children:n.providerRates.map(d=>l.jsxs("div",{className:"grid grid-cols-[120px_1fr_120px] items-center gap-3",children:[l.jsx("span",{className:"text-sm text-zinc-300",children:Ty(d.provider)}),l.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:"h-full rounded-full bg-emerald-500/70",style:{width:`${Math.max(d.citationRate,1.5)}%`}})}),l.jsxs("span",{className:"text-right text-sm font-semibold text-zinc-100",children:[d.citationRate,"% ",l.jsxs("span",{className:"font-normal text-zinc-500",children:["(",d.citedCount,"/",d.totalCount,")"]})]})]},d.provider))})]}),e.clientSummary.confidenceNotes.length>0&&l.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((d,f)=>l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:d},f))})]})}function MS({label:e,value:t,subtitle:n}){return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:e}),l.jsx("p",{className:"mt-3 text-4xl font-bold tracking-tight text-zinc-50 sm:text-5xl",children:t}),l.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:n})]})}function Wke(e){switch(e){case"immediate":return"Do now";case"short-term":return"This month";case"medium-term":return"Next quarter"}}function Xke(e){switch(e){case"high":return"Strong evidence";case"medium":return"Some evidence";case"low":return"Worth trying"}}function Jke({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(a=>Vke(a,t)),r=CJ(e,n),i=t==="client";return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(DC,{eyebrow:i?"Action plan":"Agency actions",title:i?"What to do next":"Agency Action Plan",subtitle:i?"Approve these in order. They are sorted by what will move the needle fastest.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?l.jsx(MC,{message:"No recommendations yet — run an AI check to populate this."}):l.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((a,o)=>{const u=a.evidence.length>0?a.evidence:a.why,d=a.why.length>0||a.evidence.length>0;return l.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-zinc-800/80 text-sm font-semibold text-zinc-100",title:"Priority — 1 will move the needle fastest",children:o+1}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[l.jsx(mt,{tone:xJ(a),children:i?Wke(a.horizon):wJ(a.horizon)}),!i&&l.jsx(mt,{tone:"neutral",children:SJ(a.category)}),l.jsx(mt,{tone:"neutral",children:i?Xke(a.confidence):`${jJ(a.confidence)} confidence`})]}),l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:a.title})]})]}),l.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:a.action}),l.jsx(iCe,{items:u,limit:3,className:"mt-3"}),d&&l.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:i?"See the data behind this":"Evidence details"}),a.why.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"Why this matters":"Why"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.why.map((f,p)=>l.jsx("li",{children:f},p))})]}),a.evidence.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"What we saw":"Evidence"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.evidence.map((f,p)=>l.jsx("li",{children:f},p))})]})]}),l.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[l.jsx("span",{className:"font-medium",children:i?"What success looks like:":"Win condition:"})," ",a.successMetric]})]},`${a.priority}-${a.title}`)})})]})}function aI({label:e,value:t,displayValue:n,max:r,barClass:i}){const a=r>0?Math.max(t/r*100,1.5):0;return l.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-3 text-sm",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-zinc-300",title:e,children:e}),l.jsx("div",{className:"mt-1 h-2 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${i}`,style:{width:`${a}%`}})})]}),l.jsx("span",{className:"whitespace-nowrap text-sm font-semibold text-zinc-100",children:n})]})}function eCe({report:e}){const t=e.aiSourceOrigin.topDomains.slice(0,5),n=e.gsc,r=e.indexingHealth,i=_J(e).slice(0,5),a=t.length>0?Math.max(...t.map(d=>d.count)):0,o=n?Math.max(...n.topQueries.slice(0,5).map(d=>d.impressions),1):0,u=t.length>0||n!==null||r!==null||i.length>0;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(DC,{eyebrow:"What we based this on",title:"The signals behind this plan",subtitle:"The data behind the recommendations above. Switch to Agency for the full breakdowns."}),u?l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Where AI gets its answers"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"The websites AI tools cited most often when answering customer questions about your industry."}),l.jsx("div",{className:"mt-4 space-y-3",children:t.map(d=>l.jsx(aI,{label:d.domain+(d.isCompetitor?" (competitor)":""),value:d.count,displayValue:`${Hi(d.count)}×`,max:a,barClass:"bg-zinc-400/70"},d.domain))})]}),r&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Pages Google can find on your site"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Google indexing your site increases the chances of it appearing in AI search (especially Gemini)."}),l.jsxs("p",{className:`mt-4 text-5xl font-bold tracking-tight ${r.indexedPct>=90?"text-emerald-400":r.indexedPct>=70?"text-amber-400":"text-rose-400"}`,children:[r.indexedPct,"%"]}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Hi(r.indexed)," of ",Hi(r.total)," pages indexed"]}),l.jsx("div",{className:"mt-3 h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${r.indexedPct>=90?"bg-emerald-500/70":r.indexedPct>=70?"bg-amber-500/70":"bg-rose-500/70"}`,style:{width:`${Math.max(r.indexedPct,1.5)}%`}})}),l.jsxs("p",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-medium text-zinc-200",children:Hi(r.notIndexed)})," ",r.notIndexed===1?"page is":"pages are"," not indexed yet."]})]}),n&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"What people search Google for"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["You appeared in ",l.jsx("span",{className:"font-semibold text-zinc-200",children:Hi(n.totalImpressions)})," Google searches and got ",l.jsx("span",{className:"font-semibold text-zinc-200",children:Hi(n.totalClicks)})," ",n.totalClicks===1?"click":"clicks"," this period."]}),n.topQueries.length>0&&l.jsx("div",{className:"mt-4 space-y-3",children:n.topQueries.slice(0,5).map(d=>l.jsx(aI,{label:d.query,value:d.impressions,displayValue:`${Hi(d.impressions)} ${d.impressions===1?"search":"searches"}`,max:o,barClass:"bg-sky-500/70"},d.query))})]}),i.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Topics where you could improve"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Customer questions where better content on your site would help AI cite you."}),l.jsx("ul",{className:"mt-4 space-y-2 text-sm text-zinc-300",children:i.map((d,f)=>l.jsxs("li",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2",children:[l.jsx("p",{className:"font-medium text-zinc-100",children:d.query}),l.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:iJ(d.action)})]},f))})]})]}):l.jsx(MC,{message:"No supporting evidence yet — this fills in after the first AI check."})]})}const tCe=14;function PC(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function RC(e){return e==="up"?"↑":e==="down"?"↓":"→"}function IS({label:e,delta:t,unit:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=PC(t.direction),o=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${o}`,children:[t.current,r," ",l.jsx("span",{className:"text-sm font-medium",children:RC(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[i,n==="%"?t.deltaAbs.toFixed(1):t.deltaAbs,r," vs ",t.prior,r]})]})}function sI({label:e,delta:t,countLabel:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=PC(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[Hi(t.current)," ",l.jsx("span",{className:"text-sm font-medium",children:RC(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,Hi(t.deltaAbs)," ",n," vs prior ",tCe," days"]})]})}function nCe({movements:e,audience:t}){const n=e.filter(i=>i.direction!=="flat");if(n.length===0)return null;const r=t==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:r?"How each AI tool changed":"AI engine movements"}),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:r?"AI tool":"Engine"}),l.jsx("th",{children:r?"Was":"Prior"}),l.jsx("th",{children:r?"Now":"Current"}),l.jsx("th",{children:"Change"})]})}),l.jsx("tbody",{children:n.map(i=>{const a=i.deltaAbs>0?"+":"",o=PC(i.direction),u=o==="positive"?"text-emerald-400":o==="negative"?"text-rose-400":"text-zinc-300";return l.jsxs("tr",{children:[l.jsx("td",{children:r?Ty(i.provider):i.provider}),l.jsxs("td",{children:[i.prior,"%"]}),l.jsxs("td",{children:[i.current,"%"]}),l.jsxs("td",{className:u,children:[a,i.deltaAbs.toFixed(1),"% ",RC(i.direction)]})]},i.provider)})})]})})]})}function oI({insights:e,heading:t,emptyMessage:n,audience:r}){if(e.length===0)return l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsx("p",{className:"eyebrow mb-1",children:t}),l.jsx("p",{className:"text-xs text-zinc-500",children:n})]});const i=r==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:t}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[!i&&l.jsx("th",{children:"Severity"}),l.jsx("th",{children:i?"What changed":"Title"}),l.jsx("th",{children:i?"Customer question":"Query"}),l.jsx("th",{children:i?"AI tool":"Provider"})]})}),l.jsx("tbody",{children:e.map(a=>l.jsxs("tr",{children:[!i&&l.jsxs("td",{children:[l.jsx(mt,{tone:Fke[a.severity],children:bJ(a.severity)}),a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsxs("td",{className:"evidence-query-cell",children:[a.title,i&&a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsx("td",{className:"text-xs text-zinc-400",children:a.query}),l.jsx("td",{className:"text-xs text-zinc-400",children:i?Ty(a.provider):a.provider})]},a.id))})]})})]})}function rCe({report:e,audience:t}){const n=e.whatsChanged,r=t==="client",i=!n.enoughHistory&&!n.gscClicksDelta&&!n.aiReferralsDelta&&n.wins.length===0&&n.regressions.length===0,a=l.jsx(DC,{eyebrow:r?"Since last check":"Section 2",title:r?"What's different since last check":"What's Changed",subtitle:r?void 0:n.headline});return i?l.jsxs("section",{className:"page-section-divider",children:[a,l.jsx(MC,{message:r?"No comparison yet — trends will appear after a few more checks.":"Trends will appear after a few more checks."})]}):l.jsxs("section",{className:"page-section-divider",children:[a,l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(IS,{label:r?"AI links to your website":"Citation rate",delta:n.citationRate,unit:"%"}),l.jsx(IS,{label:r?"AI mentions your name":"Mention rate",delta:n.mentionRate,unit:"%"}),l.jsx(IS,{label:r?"Questions AI answered with you":"Cited queries",delta:n.citedQueryCount,unit:"count"}),l.jsx(sI,{label:r?"Visitors from Google":"GSC clicks",delta:n.gscClicksDelta,countLabel:r?"visits":"clicks"}),l.jsx(sI,{label:r?"Visitors from AI tools":"AI referral sessions",delta:n.aiReferralsDelta,countLabel:r?"visits":"sessions"})]}),l.jsx(nCe,{movements:n.providerMovements,audience:t}),l.jsx(oI,{insights:n.wins,heading:r?"What got better":"Wins",emptyMessage:r?"No new wins this period.":"No new gains in the latest check.",audience:t}),l.jsx(oI,{insights:n.regressions,heading:r?"What got worse":"Regressions",emptyMessage:r?"Nothing got worse this period.":"No new regressions in the latest check.",audience:t})]})}function DC({eyebrow:e,title:t,subtitle:n}){return l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("h2",{className:"page-title",children:t}),n&&l.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function iCe({items:e,limit:t=3,className:n}){if(e.length===0)return null;const r=e.slice(0,t),i=e.length-r.length;return l.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,o)=>l.jsx("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-300",children:a},o)),i>0&&l.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-400",children:["+",i," more"]})]})}function MC({message:e}){return l.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function aCe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=b.useState(!1),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(e.displayName),[m,y]=b.useState(e.canonicalDomain),[v,S]=b.useState(e.country),[w,j]=b.useState(e.language),[k,O]=b.useState(e.ownedDomains??[]),[_,A]=b.useState(""),[T,C]=b.useState(null),[z,R]=b.useState(!1),[B,F]=b.useState(!1),[q,$]=b.useState(""),[V,te]=b.useState(""),[W,H]=b.useState(""),[ee,le]=b.useState(""),[je,L]=b.useState("");b.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),S(e.country),j(e.language),O(e.ownedDomains??[]))},[e,r]);function I(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),S(e.country),j(e.language),O(e.ownedDomains??[]),A("")}function U(){const Y=_.trim();Y&&(k.includes(Y)||O([...k,Y]),A(""))}function D(Y){O(k.filter(Fe=>Fe!==Y))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!w.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:w.trim()}),i(!1),gt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Y){d(Y instanceof Error?Y.message:"Failed to save")}finally{o(!1)}}}async function ae(){const Y=q.trim(),Fe=V.trim(),Te=W.trim(),it=ee.trim();if(!(!Y||!Fe||!Te||!it)){R(!0),C(null);try{const Ge={label:Y,city:Fe,region:Te,country:it};je.trim()&&(Ge.timezone=je.trim()),await cK(e.name,Ge),n(),$(""),te(""),H(""),le(""),L(""),F(!1),gt({title:"Location added",detail:`${Y} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Ge){C(Ge instanceof Error?Ge.message:"Failed to add location")}finally{R(!1)}}}async function ne(Y){R(!0),C(null);try{await uK(e.name,Y),n(),gt({title:"Location removed",detail:`${Y} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Fe){C(Fe instanceof Error?Fe.message:"Failed to remove location")}finally{R(!1)}}async function Ce(Y){R(!0),C(null);try{await dK(e.name,Y),n(),gt({title:"Default location updated",detail:`${Y} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Fe){C(Fe instanceof Error?Fe.message:"Failed to set default location")}finally{R(!1)}}const Se=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||w!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),X="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",me="block text-xs font-medium text-zinc-400 mb-1",Ee=q.trim()&&V.trim()&&W.trim()&&ee.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:me,children:"Display name"}),l.jsx("input",{className:X,type:"text",value:f,onChange:Y=>p(Y.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Canonical domain"}),l.jsx("input",{className:X,type:"text",value:m,onChange:Y=>y(Y.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Country"}),l.jsx("input",{className:X,type:"text",value:v,onChange:Y=>S(Y.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Language"}),l.jsx("input",{className:X,type:"text",value:w,onChange:Y=>j(Y.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:me,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Y=>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:[Y,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(Y),"aria-label":`Remove ${Y}`,children:"×"})]},Y))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${X} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:Y=>A(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&(Y.preventDefault(),U())}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:U,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(Y=>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:Y},Y))}):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:()=>C(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(Y=>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 ${Y.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[Y.label,Y.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Y.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[Y.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:z,onClick:()=>Ce(Y.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Y.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:z,onClick:()=>ne(Y.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Y.label}`,children:"Remove"})]})})]},Y.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),B?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:X,type:"text",value:q,onChange:Y=>$(Y.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:X,type:"text",value:V,onChange:Y=>te(Y.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:X,type:"text",value:W,onChange:Y=>H(Y.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:X,type:"text",value:ee,onChange:Y=>le(Y.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:X,type:"text",value:je,onChange:Y=>L(Y.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:z||!Ee,onClick:ae,children:z?"Adding...":"Add location"}),l.jsx(xe,{type:"button",size:"sm",variant:"outline",disabled:z,onClick:()=>{F(!1),C(null)},children:"Cancel"})]})]}):l.jsx(xe,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const sCe=[{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"}],lI=["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 oCe({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState("daily"),[u,d]=b.useState(6),[f,p]=b.useState(""),[m,y]=b.useState("UTC"),[v,S]=b.useState(!1),[w,j]=b.useState(""),[k,O]=b.useState(!1),[_,A]=b.useState(!1),[T,C]=b.useState(null);b.useEffect(()=>{xK(e).then(n).catch(()=>n(null))},[e]);const z=()=>{if(t&&t!=="loading"){const q=UJ(t.preset??null,t.cronExpr);o(q.freq),d(q.hour),p(q.customCron);const $=lI.includes(t.timezone);y($?t.timezone:"Other"),S(!$),j($?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),S(!1),j("");C(null),i(!0)},R=async()=>{O(!0),C(null);try{const $={timezone:v?w.trim()||"UTC":m};a==="custom"?$.cron=f.trim():$.preset=BJ(a,u);const V=await vz(e,$);n(V),i(!1),gt({title:"Schedule saved",detail:Pb(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(q){C(q instanceof Error?q.message:"Failed to save schedule")}finally{O(!1)}},B=async()=>{if(!(!t||t==="loading")){O(!0),C(null);try{const q={timezone:t.timezone,enabled:!t.enabled};t.preset?q.preset=t.preset:q.cron=t.cronExpr;const $=await vz(e,q);n($),gt({title:$.enabled?"Schedule resumed":"Schedule paused",detail:Pb($.preset??null,$.cronExpr,$.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(q){C(q instanceof Error?q.message:"Failed to update schedule")}finally{O(!1)}}},F=async()=>{A(!0),C(null);try{await bK(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(q){C(q instanceof Error?q.message:"Failed to remove schedule")}finally{A(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:z,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&l.jsx(Le,{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(Le,{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:Pb(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(mt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:B,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:q=>o(q.target.value),children:sCe.map(q=>l.jsx("option",{value:q.value,children:q.label},q.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:q=>d(parseInt(q.target.value)),children:Array.from({length:24},(q,$)=>l.jsx("option",{value:$,children:l1($)},$))})]})]}),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:q=>p(q.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:q=>{q.target.value==="Other"?(S(!0),y("Other")):(S(!1),y(q.target.value))},children:[lI.map(q=>l.jsx("option",{value:q,children:q},q)),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:w,onChange:q=>j(q.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),C(null)},children:"Cancel"}),l.jsx(xe,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:R,children:k?"Saving...":"Save schedule"})]})]})]})}const lCe=[{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 cCe({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState(""),[u,d]=b.useState(["citation.lost","citation.gained"]),[f,p]=b.useState(!1),[m,y]=b.useState(null),[v,S]=b.useState({}),[w,j]=b.useState(new Set);b.useEffect(()=>{wK(e).then(n).catch(()=>n([]))},[e]);const k=T=>{d(C=>C.includes(T)?C.filter(z=>z!==T):[...C,T])},O=async()=>{if(!(!a.trim()||u.length===0)){p(!0),y(null);try{const T=await SK(e,{channel:"webhook",url:a.trim(),events:u});n(C=>C==="loading"?[T]:[...C,T]),o(""),d(["citation.lost","citation.gained"]),i(!1),gt({title:"Webhook added",detail:`Notifications will be sent to ${T.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(T){y(T instanceof Error?T.message:"Failed to add webhook")}finally{p(!1)}}},_=async T=>{if(!w.has(T)){j(C=>new Set(C).add(T));try{await jK(e,T),n(C=>C==="loading"?C:C.filter(z=>z.id!==T)),gt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${T}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}finally{j(C=>{const z=new Set(C);return z.delete(T),z})}}},A=async T=>{S(C=>({...C,[T]:{state:"testing"}}));try{const C=await NK(e,T);S(z=>({...z,[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}:${T}`,dedupeMode:"replace"})}catch{S(C=>({...C,[T]:{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:T=>o(T.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:lCe.map(T=>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(T.value),onChange:()=>k(T.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:T.label})]},T.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:O,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&l.jsx(Le,{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(T=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:T.urlHost,children:T.urlDisplay??T.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:T.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(mt,{tone:T.enabled?"positive":"neutral",children:T.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[T.id]&&(()=>{const C=v[T.id],z=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return l.jsx(mt,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:z})})(),l.jsx(xe,{variant:"ghost",size:"sm",type:"button",disabled:v[T.id]?.state==="testing",onClick:()=>A(T.id),children:"Test"}),l.jsx(xe,{variant:"ghost",size:"sm",type:"button",disabled:w.has(T.id),onClick:()=>_(T.id),children:w.has(T.id)?"Removing…":"Remove"})]})})]},T.id))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function uCe({projectName:e,refreshNonce:t}){const n=ni(),[r,i]=b.useState(null),[a,o]=b.useState([]),[u,d]=b.useState(null),[f,p]=b.useState([]),[m,y]=b.useState([]),[v,S]=b.useState(null),[w,j]=b.useState(""),[k,O]=b.useState(""),[_,A]=b.useState(""),[T,C]=b.useState(!0),[z,R]=b.useState(!1),[B,F]=b.useState(null),[q,$]=b.useState("coverage");b.useEffect(()=>{V()},[e,t]);async function V(){C(!0),F(null);try{const I=await n.fetchQuery({queryKey:Be.bing.status(e),queryFn:()=>nL(e),staleTime:dr});if(i(I),I.connected){const[U,D,G,ae]=await Promise.all([n.fetchQuery({queryKey:Be.bing.coverage(e),queryFn:()=>nN(e).catch(()=>null),staleTime:dr}),n.fetchQuery({queryKey:Be.bing.inspections(e),queryFn:()=>rL(e).catch(()=>[]),staleTime:dr}),n.fetchQuery({queryKey:Be.bing.performance(e),queryFn:()=>GK(e).catch(()=>[]),staleTime:dr}),I.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:Be.bing.sites(e),queryFn:()=>HK(e).then(ne=>ne.sites).catch(()=>[]),staleTime:dr})]);d(U),p(D),y(G),o(ae)}else d(null),p([]),y([]),o([])}catch(I){F(I instanceof Error?I.message:"Failed to load Bing data")}finally{C(!1)}}async function te(){if(k.trim()){F(null);try{const I=await qK(e,k.trim());await n.invalidateQueries({queryKey:Be.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 W(){try{await FK(e),await n.invalidateQueries({queryKey:Be.bing.project(e)}),i(null),o([]),d(null),p([]),y([]),S(null),A(""),F(null)}catch(I){F(I instanceof Error?I.message:"Failed to disconnect")}}async function H(){if(_)try{await KK(e,_),await n.invalidateQueries({queryKey:Be.bing.project(e)}),await V()}catch(I){F(I instanceof Error?I.message:"Failed to set site")}}async function ee(){if(w.trim())try{const I=await iL(e,w.trim());await n.invalidateQueries({queryKey:Be.bing.project(e)}),S(I),p(U=>[I,...U])}catch(I){F(I instanceof Error?I.message:"Inspection failed")}}async function le(I){R(!0),F(null);try{const U=await wz(e,{urls:[I]}),{succeeded:D,failed:G,total:ae}=U.summary;gt({title:"Bing submission requested",detail:G===0?`${D} URL submitted to Bing.`:`${D}/${ae} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}catch(U){const D=U instanceof Error?U.message:"Submission failed";F(D),gt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}finally{R(!1)}}async function je(){R(!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 wz(e,{allUnindexed:!0}),{succeeded:U,failed:D,total:G}=I.summary;gt({title:"Bing submissions requested",detail:D===0?`${U}/${G} URL${G!==1?"s":""} submitted to Bing.`:`${U}/${G} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){const U=I instanceof Error?I.message:"Batch submission failed";F(U),gt({title:"Bing submissions failed",detail:U,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{R(!1)}}if(T)return l.jsx(Le,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return l.jsxs(Le,{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(mt,{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"&&te()}),l.jsx(xe,{size:"sm",disabled:!k.trim(),onClick:te,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"})]})]}),B&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:B})]});if(!r.siteUrl)return l.jsxs(Le,{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(mt,{tone:"positive",children:"Connected"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:W,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?Ki(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=>A(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:H,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."})]})]}),B&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:B})]});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(Le,{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(mt,{tone:"positive",children:"Connected"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:W,children:"Disconnect"})]})]}),B&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:B}),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?Ki(r.updatedAt):"—"})]})]})]})]}),l.jsxs(Le,{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 ${Ki(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 ${q===I.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>$(I.key),children:I.label},I.key))}),q==="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(Cm,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),l.jsx(Cm,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),l.jsx(Cm,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),l.jsx(Cm,{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:z,onClick:je,children:z?"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:z,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:z,onClick:je,children:z?"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?Ki(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:z,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?Ki(I.lastCrawledDate):"—"})]},I.id))})]})})]})]}),q==="coverage"&&!u&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="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:w,onChange:I=>j(I.target.value),onKeyDown:I=>I.key==="Enter"&&ee()}),l.jsx(xe,{size:"sm",disabled:!w.trim(),onClick:ee,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(mt,{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:Ki(I.inspectedAt)})]},I.id))})]})})]}),q==="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:lm[lo.Clicks]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:lm[lo.Impressions]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:lm[lo.CTR]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:lm[lo.Position]})]})}),l.jsx("tbody",{children:m.map((I,U)=>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)})]},U))})]})})})]})]})}function dCe({projectName:e}){const t=ni(),[n,r]=b.useState("google"),[i,a]=b.useState(!0),[o,u]=b.useState("idle"),[d,f]=b.useState(null),p=b.useRef(null),[m,y]=b.useState(!1),[v,S]=b.useState(null),[w,j]=b.useState(null),[k,O]=b.useState(!1),[_,A]=b.useState(null),[T,C]=b.useState(null),[z,R]=b.useState(0);async function B(U=!1){U||a(!0),f(null);try{const[D,G,ae]=await Promise.all([eN().catch(()=>null),t.fetchQuery({queryKey:Be.gsc.connections(e),queryFn:()=>eL(e).catch(()=>[]),staleTime:dr}),t.fetchQuery({queryKey:Be.bing.status(e),queryFn:()=>nL(e).catch(()=>null),staleTime:dr})]),ne=G.find(X=>X.connectionType==="gsc")??null;y(!!D?.google?.configured),O(!!D?.bing?.configured),S(ne),A(ae);const[Ce,Se]=await Promise.all([ne?t.fetchQuery({queryKey:Be.gsc.coverage(e),queryFn:()=>tN(e).catch(()=>null),staleTime:dr}):Promise.resolve(null),ae?.connected?t.fetchQuery({queryKey:Be.bing.coverage(e),queryFn:()=>nN(e).catch(()=>null),staleTime:dr}):Promise.resolve(null)]);j(Ce),C(Se)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(o!=="idle")return;p.current?.abort();const U=new AbortController;p.current=U;const D=U.signal;u("syncing"),f(null);const G=[];try{async function ae(){if(!v)return;const X=await tL(e);if(!X?.id)return;const me=2e3,Y=Date.now()+12e4;for(;Date.now()<Y;){if(D.aborted||(await new Promise(Te=>setTimeout(Te,me)),D.aborted))return;const Fe=await Ol(X.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 X=await rL(e).catch(()=>[]),me=[...new Set(X.map(Ee=>Ee.url))];if(me.length!==0)for(let Ee=0;Ee<me.length;Ee+=ne){if(D.aborted)return;const Y=me.slice(Ee,Ee+ne),Te=(await Promise.allSettled(Y.map(it=>iL(e,it)))).filter(it=>it.status==="rejected").length;Te>0&&G.push(`${Te} Bing inspection(s) failed`)}}const Se=await Promise.allSettled([ae(),Ce()]);for(const X of Se)X.status==="rejected"&&G.push(X.reason instanceof Error?X.reason.message:"Sync failed");if(D.aborted)return;u("reloading"),await Promise.all([t.invalidateQueries({queryKey:Be.gsc.project(e)}),t.invalidateQueries({queryKey:Be.bing.project(e)})]),await B(!0),R(X=>X+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(ae){D.aborted||f(ae instanceof Error?ae.message:"Refresh failed")}finally{D.aborted||u("idle")}}b.useEffect(()=>(B(),()=>{p.current?.abort()}),[e]);const q=v?"positive":m?"caution":"negative",$=v?"Connected":m?"Ready to connect":"Needs setup",V=w?`${w.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",te=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",W=w?.lastSyncedAt??w?.lastInspectedAt??v?.updatedAt??null,H=_?.connected?"positive":k?"caution":"negative",ee=_?.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(Le,{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(RT,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":$,tone:i?"neutral":q,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":V,note:i?"Loading overview…":te,updatedAt:W,active:n==="google",onClick:()=>r("google")}),l.jsx(RT,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":ee,tone:i?"neutral":H,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(([U,D])=>l.jsx("button",{type:"button",role:"tab","aria-selected":n===U,className:`project-subnav-link ${n===U?"project-subnav-link-active":""}`,onClick:()=>r(U),children:D},U))}),n==="google"&&l.jsx(Oke,{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(uCe,{projectName:e,refreshNonce:z})]})]})}function fCe({insights:e}){const{openEvidence:t}=Bu(),[n,r]=b.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(hh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),l.jsx(mt,{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(T1,{state:u.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.query}),l.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&l.jsx(Pl,{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 $h({tab:e}){const{projectId:t}=Ly({from:"/projects/$projectId"}),n=ko(),{dashboard:r,isLoading:i,refetch:a}=Zl();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=Yne(r,t),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(!1),[v,S]=b.useState(""),[w,j]=b.useState(!1),[k,O]=b.useState(!1),[_,A]=b.useState(""),[T,C]=b.useState(!1),[z,R]=b.useState(!1),[B,F]=b.useState(""),[q,$]=b.useState(!1),[V,te]=b.useState(void 0),[W,H]=b.useState(!1),[ee,le]=b.useState(null),[je,L]=b.useState(!1),I=o?.visibilityEvidence??[],U=o?.project.name??"",D=o?.project.displayName||o?.project.name||U,G=t8(),ae=(o?.recentRuns??[]).some(we=>we.kind===St["answer-visibility"]&&(we.status===tr.running||we.status===tr.queued)),ne=b.useMemo(()=>new Set(I.map(we=>we.location??"")),[I]),Ce=ne.has(""),Se=b.useMemo(()=>[...ne].filter(Boolean),[ne]);b.useEffect(()=>{if(V===void 0||V===""||!U){le(null),L(!1);return}L(!0),XI(U,V).then(we=>{le(we),L(!1)}).catch(()=>{le(null),L(!1)})},[V,U]);const X=b.useMemo(()=>{if(!ee)return null;const we=new Map;for(const Xe of ee){for(const[Ot,ft]of Object.entries(Xe.providerRuns??{}))we.set(`${Xe.query}::${Ot}`,ft.map(Je=>({runId:Je.runId,citationState:Je.citationState,createdAt:Je.createdAt,answerMentioned:Je.answerMentioned,visibilityState:Je.visibilityState,visibilityTransition:Je.visibilityTransition})));(!Xe.providerRuns||Object.keys(Xe.providerRuns).length===0)&&we.set(`${Xe.query}::`,Xe.runs.map(Ot=>({runId:Ot.runId,citationState:Ot.citationState,createdAt:Ot.createdAt,answerMentioned:Ot.answerMentioned,visibilityState:Ot.visibilityState,visibilityTransition:Ot.visibilityTransition})))}return we},[ee]),me=b.useMemo(()=>{const we=V!==void 0?I.filter(Xe=>V===""?!Xe.location:Xe.location===V):I;return X?we.map(Xe=>{const Ot=X.get(`${Xe.query}::${Xe.provider}`)??X.get(`${Xe.query}::`);return Ot?{...Xe,runHistory:Ot}:Xe}):we},[I,V,X]);if(!o)return l.jsx("div",{className:"page-container",children:l.jsxs(Le,{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 Ee(){try{await G.mutateAsync({projectName:U,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Y(){p(!0);try{await fK(U),gt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${U}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(we){console.error("Failed to delete project:",we)}finally{p(!1)}}async function Fe(){try{const we=await hK(U),Xe=typeof we=="string"?we:JSON.stringify(we,null,2),Ot=new Blob([Xe],{type:"text/yaml"}),ft=URL.createObjectURL(Ot),Je=document.createElement("a");Je.href=ft,Je.download=`${U}.yaml`,Je.click()}catch(we){gt({title:"Export failed",detail:we instanceof Error?we.message:"Could not export project YAML.",tone:"negative"})}}async function Te(){const we=v.split(`
293
+ `).map(Xe=>Xe.trim()).filter(Boolean);if(we.length!==0){j(!0);try{await sK(U,we),a(),S(""),y(!1)}finally{j(!1)}}}async function it(){const we=_.trim();if(we){C(!0);try{const Ot=(await WI(U)).map(Je=>Je.domain),ft=[...new Set([...Ot,we])];await JI(U,ft),a(),A(""),O(!1)}finally{C(!1)}}}async function Ge(){const we=B.trim();if(we){$(!0);try{const Xe=o?.project.ownedDomains??[];await yz(U,[...Xe,we]),a(),F(""),R(!1)}finally{$(!1)}}}async function $t(we){$(!0);try{const Xe=o?.project.ownedDomains??[];await yz(U,Xe.filter(Ot=>Ot!==we)),a()}finally{$(!1)}}async function Dt(we,Xe){await oK(we,Xe),a()}const tn=we=>!Number.isNaN(Number.parseInt(we,10)),Zt=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"report",label:"Report",href:`/projects/${o.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return l.jsxs("div",{className:"page-container",children:[u?l.jsxs(Le,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xe,{type:"button",variant:"destructive",disabled:f,onClick:Y,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&&!z&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>R(!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||z)&&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:q,onClick:()=>$t(we),"aria-label":`Remove ${we}`,children:"×"})]},we)),z?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:B,onChange:we=>F(we.target.value),onKeyDown:we=>we.key==="Enter"&&Ge(),autoFocus:!0}),l.jsx(xe,{type:"button",size:"sm",disabled:!B.trim()||q,onClick:Ge,children:q?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{R(!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:()=>R(!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:Fe,"aria-label":"Export project as YAML",children:l.jsx(Uy,{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(gL,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(xe,{type:"button",disabled:G.isPending||ae,onClick:Ee,children:G.isPending?"Starting…":ae?"Sweep running…":"Run now"})]})]})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Zt.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(Dce,{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:tn(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",l.jsx(nr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.gapQueries.value}),l.jsxs("span",{className:"text-zinc-600",children:[" / ",o.queryCounts.total]})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapQueries.tone}`,style:{width:o.gapQueries.progress!==void 0?`${Math.min(Math.max(o.gapQueries.progress,0),100)}%`:"0%"}})}),l.jsx("p",{className:"metric-card-detail",children:o.gapQueries.delta}),l.jsx("p",{className:"metric-card-sub",children:o.gapQueries.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",l.jsx(nr,{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(nr,{text:"Query-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?l.jsxs("div",{className:"metric-card-movement",children:[l.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),l.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),l.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):l.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),l.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),l.jsx(Mke,{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(nr,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked queries. Switching models can significantly affect citation rates."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited queries"})]})}),l.jsx("tbody",{children:o.providerScores.map(we=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Pl,{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(fCe,{insights:o.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Query citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(we=>we.query)).size," queries tracked"]}),l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter queries, one per line",value:v,onChange:we=>S(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," queries"]}),l.jsx(xe,{type:"button",size:"sm",disabled:!v.trim()||w,onClick:Te,children:w?"Adding...":"Add queries"})]})]}),o.project.locations&&o.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{te(void 0)},children:"All locations"}),o.project.locations.map(we=>ne.has(we.label)&&l.jsx("button",{className:`filter-chip ${V===we.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===we.label,onClick:()=>{te(we.label),H(!1)},children:we.label},we.label)),Ce&&l.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{te(""),H(!1)},children:"No location"}),Se.length>1&&V===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${W?"filter-chip-active":""}`,type:"button","aria-pressed":W,onClick:()=>H(we=>!we),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(Lce,{evidence:me})]}),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=>A(we.target.value),onKeyDown:we=>we.key==="Enter"&&it()}),l.jsx(xe,{type:"button",size:"sm",disabled:!_.trim()||T,onClick:it,children:T?"Adding...":"Add"})]}),l.jsx($ce,{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(Q3,{run:we},we.id))})]}),l.jsx(aCe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Dt,onRefresh:()=>{a()}}),l.jsx(oCe,{projectName:o.project.name}),l.jsx(cCe,{projectName:o.project.name})]}):e==="report"?l.jsx(Gke,{projectName:o.project.name}):e==="traffic"?l.jsx(mke,{projectName:o.project.name}):e==="inbound"?l.jsx(Dke,{projectName:o.project.name}):l.jsx(dCe,{projectName:o.project.name})]})}function hCe(){const{dashboard:e,isLoading:t}=Zl(),n=kke();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]=b.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":Gy(d)},d))}),l.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>l.jsx(Q3,{run:d},d.id)):l.jsxs(Le,{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 pCe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=b.useState(""),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,S]=b.useState(""),[w,j]=b.useState(""),[k,O]=b.useState(!1),[_,A]=b.useState(null),[T,C]=b.useState(!1),z=i?u.trim().length>0:a.trim().length>0;async function R(){if(z){O(!0),A(null),C(!1);try{const F=W=>{const H=parseInt(W.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},q={},$=F(m);$!==void 0&&(q.maxConcurrency=$);const V=F(v);V!==void 0&&(q.maxRequestsPerMinute=V);const te=F(w);te!==void 0&&(q.maxRequestsPerDay=te),await yK(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(q).length>0?{quota:q}:{}}),o(""),d(""),p(""),y(""),S(""),j(""),C(!0),gt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){A(F instanceof Error?F.message:"Failed to update provider")}finally{O(!1)}}}const B=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:B,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=>S(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:w,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:!z||k,onClick:R,children:k?"Saving...":"Save"})]})}function mCe({onSaved:e}){const[t,n]=b.useState(""),[r,i]=b.useState(""),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await vK({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 gCe(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[o,u]=b.useState("localhost"),[d,f]=b.useState("9222"),[p,m]=b.useState(!1);return b.useEffect(()=>{xz().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),l.jsxs(Le,{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(mt,{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 UK(o,parseInt(d,10)||9222);const v=await xz().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 yCe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function vCe(){const e=mh(),{dashboard:t}=Zl(),n=t?.settings??e?.dashboard?.settings,a=ev(!e,e?.health).data??e?.health??yCe,[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[y,v]=b.useState(""),[S,w]=b.useState(!1),[j,k]=b.useState(null),[O,_]=b.useState(!1);return n?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(A=>l.jsxs(Le,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:A.displayName??A.name})]}),l.jsx(mt,{tone:A.state==="ready"?"positive":"caution",children:A.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:A.model})]}),A.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:A.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[A.quota.maxRequestsPerMinute,"/min · ",A.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:A.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o===A.name?null:A.name),children:o===A.name?"Cancel":A.state==="ready"?A.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===A.name&&l.jsx(pCe,{providerName:A.name,keyUrl:A.keyUrl,modelHint:A.modelHint,onSaved:()=>{u(null)}})]},A.name)),l.jsxs(Le,{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(mt,{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(mCe,{onSaved:()=>{f(!1)}})]}),l.jsxs(Le,{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(mt,{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:A=>v(A.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&l.jsx("p",{className:"text-xs text-rose-400",children:j}),O&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(xe,{type:"button",size:"sm",disabled:!y.trim()||S,onClick:async()=>{if(y.trim()){w(!0),k(null),_(!1);try{await VK(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(A){k(A instanceof Error?A.message:"Failed to update Bing API key")}finally{w(!1)}}},children:S?"Saving...":"Save Bing API key"})]})]}),l.jsx(gCe,{}),l.jsxs(Le,{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(mt,{tone:Eg(a.apiStatus),title:wo(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(mt,{tone:Eg(a.workerStatus),title:wo(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(Le,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(A=>l.jsx("li",{children:A},A))}),l.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const xCe=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function bCe({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 wCe(){const e=mh(),{dashboard:t,isLoading:n,refetch:r}=Zl(),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(he=>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"})]},he))})]})]});const a=i.settings,d=ev(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},f=VJ(i.setup,d,a),p=ko(),[m,y]=b.useState(0),[v,S]=b.useState(""),[w,j]=b.useState(""),[k,O]=b.useState(""),[_,A]=b.useState("US"),[T,C]=b.useState("en"),[z,R]=b.useState(!1),[B,F]=b.useState(null),[q,$]=b.useState(null),[V,te]=b.useState(null),[W,H]=b.useState(!1),[ee,le]=b.useState(""),[je,L]=b.useState(!1),[I,U]=b.useState(null),[D,G]=b.useState(!1),ae=a.providerStatuses.filter(he=>he.state==="ready"),[ne,Ce]=b.useState(ae[0]?.name??""),[Se,X]=b.useState(5),[me,Ee]=b.useState(!1),[Y,Fe]=b.useState(null),[Te,it]=b.useState(""),[Ge,$t]=b.useState(!1),[Dt,tn]=b.useState(null),[Zt,we]=b.useState(!1),[Xe,Ot]=b.useState(!1),[ft,Je]=b.useState(!1),ue=t8(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),De=ee.split(`
295
+ `).map(he=>he.trim()).filter(Boolean),Ke=Te.split(`
296
+ `).map(he=>he.trim()).filter(Boolean),dt=f.healthChecks.some(he=>he.id==="api"&&he.state==="ready"),ln=async()=>{if(!(!Ne||!k)){H(!0),te(null);try{const he=await By(Ne,{displayName:w||v,canonicalDomain:k,country:_,language:T,autoExtractBacklinks:z});F(Ne),$(he.id),gt({title:"Project created",detail:`${he.displayName||he.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${he.name}`,dedupeMode:"drop"}),r(),y(2)}catch(he){te(he instanceof Error?he.message:"Failed to create project")}finally{H(!1)}}},xn=async()=>{if(!B)return;const he=De;if(he.length!==0){G(!0),U(null);try{await aK(B,he),L(!0),r(),y(3)}catch(Ve){U(Ve instanceof Error?Ve.message:"Failed to save queries")}finally{G(!1)}}},cn=async()=>{if(!(!B||!ne)){Ee(!0),Fe(null);try{const he=await kK(B,ne,Se);if(he.queries.length>0){const Ve=ee?ee.trimEnd()+`
297
+ `+he.queries.join(`
298
+ `):he.queries.join(`
299
+ `);le(Ve)}}catch(he){Fe(he instanceof Error?he.message:"Failed to generate queries")}finally{Ee(!1)}}},Ze=async()=>{if(!B)return;const he=Ke;if(he.length!==0){we(!0),tn(null);try{await JI(B,he),$t(!0),r(),y(4)}catch(Ve){tn(Ve instanceof Error?Ve.message:"Failed to save competitors")}finally{we(!1)}}},Bt=async()=>{if(B){Je(!0);try{await ue.mutateAsync({projectName:B,projectLabel:w||v||B,sourceAction:"setup-launch"}),Ot(!0),r()}catch{}finally{Je(!1)}}},fe=()=>y(he=>Math.max(0,he-1)),ze=(()=>{switch(m){case 0:return l.jsxs(Le,{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(he=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:he.label}),l.jsx("p",{className:"supporting-copy",children:he.detail}),he.id==="provider"&&he.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(mt,{tone:he.state==="ready"?"positive":"caution",title:he.id==="api"?wo(d.apiStatus):he.id==="worker"?wo(d.workerStatus):he.detail,children:he.state==="ready"?"Ready":"Attention"})]},he.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(xe,{type:"button",disabled:!dt,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(Le,{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"})]}),B?l.jsx(mt,{tone:"positive",children:"Created"}):null]}),B?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:B})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:fe,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:he=>S(he.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:w,onChange:he=>j(he.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:he=>O(he.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:he=>A(he.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:he=>C(he.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:z,onChange:he=>R(he.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:fe,children:"Back"}),l.jsx(xe,{type:"button",disabled:!Ne||!k||W,onClick:ln,children:W?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(Le,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add queries"})]}),je?l.jsxs(mt,{tone:"positive",children:[De.length," saved"]}):l.jsxs(mt,{tone:"neutral",children:[De.length," quer",De.length!==1?"ies":"y"]})]}),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(he=>l.jsx("li",{children:he},he))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:fe,children:"Back"}),l.jsx(xe,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[ae.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:he=>Ce(he.target.value),children:ae.map(he=>l.jsxs("option",{value:he.name,children:[he.displayName??he.name,he.model?` (${he.model})`:""]},he.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:he=>X(Number(he.target.value)),children:[3,5,10,15,20].map(he=>l.jsx("option",{value:he,children:he},he))})]}),l.jsx(xe,{type:"button",variant:"outline",disabled:me||!ne,onClick:cn,children:me?"Analyzing site...":"Generate"})]}),Y?l.jsx("p",{className:"text-rose-400 text-sm",children:Y}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),l.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
300
+ best invisalign downtown brooklyn
301
+ pediatric dentist brooklyn heights`,value:ee,onChange:he=>le(he.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:fe,children:"Back"}),l.jsx(xe,{type:"button",disabled:De.length===0||D,onClick:xn,children:D?"Saving...":`Save ${De.length} quer${De.length!==1?"ies":"y"}`})]})]})]});case 3:return l.jsxs(Le,{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"})]}),Ge?l.jsx(mt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ge?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Ke.map(he=>l.jsx("li",{children:he},he))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:fe,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:he=>it(he.target.value)})]}),Dt?l.jsx("p",{className:"text-rose-400 text-sm",children:Dt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:fe,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:Ke.length===0||Zt,onClick:Ze,children:Zt?"Saving...":`Save ${Ke.length} competitor${Ke.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(Le,{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"})]}),Xe?l.jsx(mt,{tone:"positive",children:"Queued"}):null]}),Xe?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:q?`/projects/${q}`:"/"}),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:B}),"."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:fe,children:"Back"}),l.jsx(xe,{type:"button",disabled:ft,onClick:Bt,children:ft?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),l.jsx(bCe,{current:m,labels:xCe}),l.jsx("section",{className:"setup-wizard",children:ze})]})}function Wc({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.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(fL,{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 SCe="https://commoncrawl.org/web-graphs";function LS(e){return e==null?"—":e>=1e12?`${(e/1e12).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function Gm(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function $S(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function jCe(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState([]),[o,u]=b.useState([]),[d,f]=b.useState(null),[p,m]=b.useState(!0),[y,v]=b.useState(!1),[S,w]=b.useState(!1),[j,k]=b.useState(""),[O,_]=b.useState(!1),[A,T]=b.useState(null),[C,z]=b.useState(null),R=b.useCallback(async()=>{m(!0),T(null);try{const[V,te,W,H,ee]=await Promise.all([oG(),sL().catch(()=>null),cG().catch(()=>[]),dG().catch(()=>[]),fG().catch(()=>null)]);t(V),r(te),a(W),u(H),f(ee)}catch(V){T(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);b.useEffect(()=>{R()},[R]);async function B(){v(!0),T(null),z(null);try{const V=await lG();z(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await R()}catch(V){T(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=j.trim()||void 0;w(!0),T(null),z(null);try{const te=await uG(V);z(V?`Queued sync for ${te.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${te.release}. Download + query runs in the background.`),k(""),_(!1),await R()}catch(te){te instanceof Ir&&te.code==="MISSING_DEPENDENCY"?T("DuckDB is not installed. Install it first."):T(te instanceof Error?te.message:"Failed to trigger sync")}finally{w(!1)}}async function q(V){T(null),z(null);try{await hG(V),z(`Pruned cached release ${V}.`),await R()}catch(te){T(te instanceof Error?te.message:"Failed to prune release")}}const $=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(Le,{className:"surface-card p-4 mb-6 border-amber-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Sg,{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(Le,{className:"surface-card p-5",children:[l.jsxs("p",{className:"text-sm text-zinc-400 leading-relaxed max-w-3xl mb-4",children:["Common Crawl publishes a quarterly snapshot of the public web’s hyperlink graph. Canonry downloads one"," ",l.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),l.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"1"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"2"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Query (~5 min)"})," — one DuckDB pass scans the cached files and extracts referring domains for every project’s canonical domain. DuckDB is only used to ",l.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"3"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Persist"})," — results land in the same SQLite database the rest of canonry uses. After the first sync, per-project reads (and re-run extracts against the cached release) are instant."]})]})]})]})]}),A&&l.jsx(Le,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:A})}),C&&l.jsx(Le,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:l.jsx("p",{className:"text-sm text-emerald-300",children:C})}),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(Wc,{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(mt,{tone:"positive",children:"Installed"}):l.jsx(mt,{tone:"caution",children:"Not installed"})]}),l.jsx(Le,{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(dL,{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:B,children:[l.jsx(Uy,{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(Wc,{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(mt,{tone:$S(n.status),children:n.status})]}),l.jsxs(Le,{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(Wc,{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:Gm(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:Gm(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."}),$&&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(Sg,{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 ",LS(d.vertexBytes),", edges ",LS(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:SCe,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:S||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[l.jsx(wg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),S?"Queuing…":"Run sync"]}),l.jsxs(Wc,{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:S,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:S,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:S,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(Wc,{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(Le,{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(mt,{tone:$S(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:LS(V.bytes)}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Gm(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:()=>q(V.release),children:[l.jsx(gL,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),l.jsx(Wc,{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(Le,{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(mt,{tone:$S(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:Gm(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function NCe(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(Le,{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 kCe(){return l.jsx(xle,{children:l.jsx(vle,{})})}const Ai=I7()({component:kCe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),CCe=Lr({getParentRoute:()=>Ai,path:"/",component:Sle,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Be.projects.all);if(t&&t.length===0)throw Fj({to:"/setup"})}}),_Ce=Lr({getParentRoute:()=>Ai,path:"/projects",component:Rce}),rd=Lr({getParentRoute:()=>Ai,path:"/projects/$projectId",component:()=>l.jsx(Xj,{})}),ACe=Lr({getParentRoute:()=>rd,path:"/",component:()=>l.jsx($h,{tab:"overview"})}),ECe=Lr({getParentRoute:()=>rd,path:"/search-console",component:()=>l.jsx($h,{tab:"search-console"})}),OCe=Lr({getParentRoute:()=>rd,path:"/report",component:()=>l.jsx($h,{tab:"report"})}),zCe=Lr({getParentRoute:()=>rd,path:"/traffic",component:()=>l.jsx($h,{tab:"traffic"})}),TCe=Lr({getParentRoute:()=>rd,path:"/inbound",component:()=>l.jsx($h,{tab:"inbound"})}),PCe=Lr({getParentRoute:()=>Ai,path:"/runs",component:hCe}),RCe=Lr({getParentRoute:()=>Ai,path:"/settings",component:vCe,beforeLoad:({context:e})=>{}}),DCe=Lr({getParentRoute:()=>Ai,path:"/setup",component:wCe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Be.projects.all);if(t&&t.length>0)throw Fj({to:"/"})}}),MCe=Lr({getParentRoute:()=>Ai,path:"/backlinks",component:jCe}),ICe=Lr({getParentRoute:()=>Ai,path:"*",component:NCe}),LCe=Ai.addChildren([CCe,_Ce,rd.addChildren([ACe,ECe,OCe,zCe,TCe]),PCe,RCe,DCe,MCe,ICe]);function $Ce(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const cI=$Ce(),BCe=cI==="/"?"":cI.replace(/\/$/,"");function UCe(e,t){return V7({routeTree:LCe,basepath:BCe||"/",context:{queryClient:e},...t?.initialEntries})}const n8=kG(),qCe=UCe(n8),r8=document.getElementById("root");if(!r8)throw new Error("Expected #root element for web app bootstrap.");function FCe(){const[e,t]=b.useState(gz()?"ready":"checking"),[n,r]=b.useState(""),[i,a]=b.useState(""),[o,u]=b.useState(null),[d,f]=b.useState(!1);b.useEffect(()=>{if(gz())return;let y=!1;return pK().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 mK(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof Ir||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 gK(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof Ir||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?l.jsx(K9,{client:n8,children:l.jsx(Y7,{router:qCe})}):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(Le,{className:"surface-card w-full",children:e==="checking"?l.jsx(eg,{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(j1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),l.jsx(N1,{children:"Create a dashboard password"}),l.jsx(k1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),l.jsx(eg,{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(j1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),l.jsx(N1,{children:"Sign in to Canonry"}),l.jsx(k1,{children:"Enter your dashboard password to continue."})]}),l.jsx(eg,{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"})]})})]})})})})}b9.createRoot(r8).render(l.jsx(b.StrictMode,{children:l.jsx(FCe,{})}));